summaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
authorLucas Gabriel Vuotto <lvuotto92@gmail.com>2017-06-24 11:14:43 -0300
committerOri Bernstein <ori@eigenstate.org>2017-06-24 10:42:47 -0700
commitc57f6ab5442e2be1500b5e8e280de537eced19d7 (patch)
tree33f4ee392c42f2b2645801640320265bb1dacc05 /configure
parent6df66e51fcfa4982eaba21965b8e5a5be5d52575 (diff)
downloadmc-c57f6ab5442e2be1500b5e8e280de537eced19d7.tar.gz
Fix configure script
* properly iterate over all args, respecting quoted ones * fix --prefix | -p handling * exit on --help Signed-off-by: Lucas Gabriel Vuotto <lvuotto92@gmail.com>
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure12
1 files changed, 7 insertions, 5 deletions
diff --git a/configure b/configure
index 39372fd..534ba9a 100755
--- a/configure
+++ b/configure
@@ -2,16 +2,18 @@
prefix="/usr/local"
-for arg in $*; do
- shift 1
- case $arg in
+while [ $# -gt 0 ]; do
+ arg=$1
+ shift
+ case "$arg" in
"--redo" | "-r")
if [ -f ./configvar_cache ]; then
. ./configvar_cache
fi
;;
"--prefix" | "-p")
- prefix=shift $*
+ prefix=$1
+ shift
;;
--prefix=*)
prefix=`echo $arg | sed 's/^--prefix=//g'`
@@ -19,7 +21,7 @@ for arg in $*; do
"--help" | "-h")
echo "Usage:"
echo " --prefix | -p: The prefix to install to"
- break;
+ exit
;;
*) echo "Unrecognized argument $arg";;
esac