#!/bin/sh -e

# If the user has -pie in their LDFLAGS, remove it; it breaks the build.
printf "\n\n\nHey, boss. We're gonna be removing -pie from your LDFLAGS if it's there, to make sure the build succeeds.\n\n\n"
sleep 3

LDFLAGS=$(echo $LDFLAGS|sed 's/-pie//')
export FORCE_UNSAFE_CONFIGURE=1
export CFLAGS="$CFLAGS -static"

./configure \
    --prefix=/usr

make
make DESTDIR="$1" install
