#!/bin/sh -e

./configure        \
   --prefix=/usr   \
   --enable-static 

# autotools doesn't detect things properly, so we overwrite its config.h.
mv config.h.mid config.h

for i in $(find . -name Makefile)
do
    sed -i 's/.*fatal-warning.*/LDFLAGS = -static/' $i
done


make DESTDIR="$1" install
ln -s /usr/bin/dash "$1/usr/bin/sh"
