1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
|
#!/usr/bin/env bash
PREFIX=/usr
if [ ! -z "$1" ]; then
if [[ "$1" =~ ^--prefix= ]]; then
PREFIX=$(echo $1 | cut -d= -f2)
else
echo "Usage: $0 [--prefix=<path>]"
exit 1
fi
fi
if [ -f config.h ]; then
echo "overwriting old config.h..."
fi
cat > config.h <<EOF
/* created by ./configure */
#define PREFIX $PREFIX
EOF
if [ -f Makefile.config ]; then
echo "overwriting old Makefile.config..."
fi
cat > Makefile.config <<EOF
# created by ./configure
PREFIX = $PREFIX
EOF
|