From 747779df1b5615db6da16bde6a6ed9f39e1f1759 Mon Sep 17 00:00:00 2001 From: Samy Al Bahra Date: Mon, 11 Aug 2014 21:14:52 +0000 Subject: [PATCH] configure: Allow for multi-option parameters. --- configure | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/configure b/configure index b9b6898..1b31294 100755 --- a/configure +++ b/configure @@ -144,8 +144,18 @@ generate_stdout() echo "Documentation will be installed in $MANDIR" } -for option in $*; do - value=`echo "$option" | sed -e 's/^[^=]*=\(.*\)/\1/'` +for option; do + case "$option" in + *=?*) + value=`expr -- "$option" : '[^=]*=\(.*\)'` + ;; + *=) + value= + ;; + *) + value=yes + ;; + esac case "$option" in --help) @@ -244,9 +254,8 @@ for option in $*; do fi ;; *=*) - NAME=`expr "$option" : '\([^=]*\)='` - VALUE=`echo "$value" | sed "s/'/'\\\\\\\\''/g"` - eval "$NAME='$VALUE'" + NAME=`expr -- "$option" : '\([^=]*\)='` + eval "$NAME='$value'" export $NAME ;; *)