ref: c57f6ab5442e2be1500b5e8e280de537eced19d7
parent: 6df66e51fcfa4982eaba21965b8e5a5be5d52575
author: Lucas Gabriel Vuotto <lvuotto92@gmail.com>
date: Sat Jun 24 07:14:43 EDT 2017
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>
--- a/configure
+++ b/configure
@@ -2,9 +2,10 @@
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
@@ -11,7 +12,8 @@
fi
;;
"--prefix" | "-p")
- prefix=shift $*
+ prefix=$1
+ shift
;;
--prefix=*)
prefix=`echo $arg | sed 's/^--prefix=//g'`
@@ -19,7 +21,7 @@
"--help" | "-h")
echo "Usage:"
echo " --prefix | -p: The prefix to install to"
- break;
+ exit
;;
*) echo "Unrecognized argument $arg";;
esac