miller/configure
2021-11-11 14:15:13 -05:00

27 lines
660 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 -I .prefix-backup 's@^PREFIX.*@PREFIX='$prefix'@' Makefile
sed -I .prefix-backup 's@^PREFIX.*@PREFIX='$prefix'@' man/Makefile