mirror of
https://github.com/johnkerl/miller.git
synced 2026-01-23 02:14:13 +00:00
Allow more typical --prefix= syntax (#744)
Co-authored-by: John Kerl <kerl.john.r@gmail.com>
This commit is contained in:
parent
0d51fee11f
commit
39a6ddd782
1 changed files with 19 additions and 6 deletions
25
configure
vendored
25
configure
vendored
|
|
@ -2,21 +2,34 @@
|
|||
|
||||
usage() {
|
||||
echo "Usage: $0 [--prefix {prefix directory}], e.g. /usr/local" 2>&1
|
||||
echo " or $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
|
||||
elif [ $# -gt 2 ]; then
|
||||
usage
|
||||
else
|
||||
if [ "$1" != "--prefix" ]; then
|
||||
usage
|
||||
fi
|
||||
while [ $# -gt 0 ]; do
|
||||
case "$1" in
|
||||
-p=* | --prefix=*)
|
||||
prefix="${1#*=}"
|
||||
;;
|
||||
-p | --prefix)
|
||||
prefix="$2"
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
printf "Error: unknown option: $1\n"
|
||||
usage
|
||||
esac
|
||||
shift
|
||||
done
|
||||
# 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
|
||||
|
|
@ -24,4 +37,4 @@ else
|
|||
fi
|
||||
|
||||
sed -I .prefix-backup 's@^PREFIX.*@PREFIX='$prefix'@' Makefile
|
||||
sed -I .prefix-backup 's@^PREFIX.*@PREFIX='$prefix'@' man/Makefile
|
||||
sed -I .prefix-backup 's@^PREFIX.*@PREFIX='$prefix'@' man/Makefile
|
||||
Loading…
Add table
Add a link
Reference in a new issue