From 3de1f23d74b286d1d108a0e4c4c630b1f7630a7d Mon Sep 17 00:00:00 2001 From: Samy Al Bahra Date: Tue, 5 Feb 2013 20:44:22 -0500 Subject: [PATCH] build: Support all *=* forms. --- configure | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/configure b/configure index dd5d9cf..cae36f9 100755 --- a/configure +++ b/configure @@ -124,11 +124,11 @@ generate_stdout() } for option in $*; do - value=`echo "$option" | sed -e 's/^[^=]*=\(.*\)/\1/'` + value=`expr "$option" : '[^=]*=\(.*\)'` case "$option" in --help) - echo "Usage: ./configure [OPTIONS]" + echo "Usage: $0 [OPTIONS]" echo echo "The following options may be used for cross-building." echo " --profile=N Use custom build profile (use in conjunction with \$CC)" @@ -195,20 +195,14 @@ for option in $*; do --mandir=*) MANDIR=$value ;; - CC=*) - CC=$value - ;; - LDFLAGS=*) - LDFLAGS=$value - ;; - CFLAGS=*) - CFLAGS=$value - ;; - GZIP=*) - GZIP=$value + *=*) + NAME=`expr "$option" : '\([^=]*\)='` + VALUE=`echo "$value" | sed "s/'/'\\\\\\\\''/g"` + eval "$NAME='$VALUE'" + export $NAME ;; *) - echo "./configure [--help]" + echo "$0 [--help]" exit $EXIT_FAILURE ;; esac