miller/configure

27 lines
673 B
Bash
Executable file

#!/bin/bash
usage() {
echo "Usage: $0 [--prefix {prefix directory}], e.g. /usr/local" 2>&1
exit 1
}
prefix="/usr/local"
if [ $# -eq 0 ]; then
echo "Using $prefix"
elif [ $# -ne 2 ]; then
usage
else
if [ "$1" != "--prefix" ]; then
usage
fi
# Test for read access, not write access, since people can ./configure, make,
# and make check outside of sudo and then make install inside sudo.
prefix="$2"
if [ ! -d "$prefix" ]; then
echo "$0: could not find prefix directory \"$prefix\""
exit 1
fi
fi
sed "s@PREFIX_TEMPLATE_IS_HERE@$prefix@" go/Makefile.in > go/Makefile
sed "s@PREFIX_TEMPLATE_IS_HERE@$prefix@" man/Makefile.in > man/Makefile