From: Sascha Kuehndel (InuSasha) Date: Fri, 22 Aug 2014 15:59:36 +0000 (+0200) Subject: [build] fix configure with komplex enviroments X-Git-Tag: v4.1~1474 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ae56b48e0435292aa275241a7215ee296bbcd03d;p=thirdparty%2Ftvheadend.git [build] fix configure with komplex enviroments - add ldflags - fix multivalued options like --cflags="-m64 -I/include/extra" --- diff --git a/configure b/configure index 96839f6e7..18f0c8a89 100755 --- a/configure +++ b/configure @@ -47,7 +47,36 @@ OPTIONS=( # . "$ROOTDIR/support/configure.inc" -parse_args $* + +# ########################################################################### +# Parse arguments +# ########################################################################### +opt= +val= +for opt do + val=${opt#*=} + opt=${opt%=*} + opt=${opt#*--} + case "$opt" in + help) + show_help + ;; + *dir|prefix) + eval "$opt=$val" + ;; + cc|cflags|ldflags|arch|cpu|platform|python) + eval "$(toupper $opt)=\"$val\"" + ;; + enable-*) + opt=${opt#*-} + enable $opt 1 + ;; + disable-*) + opt=${opt#*-} + disable $opt 1 + ;; + esac +done # ########################################################################### # Checks diff --git a/support/configure.inc b/support/configure.inc index ab4dc52fd..97b1a8ad1 100755 --- a/support/configure.inc +++ b/support/configure.inc @@ -165,6 +165,7 @@ show_help () echo "Compiler/Arch" printf " $fmt Build using compiler [$CC]\n" "--cc=CC" printf " $fmt Build using C flags\n" "--cflags=CFLAGS" + printf " $fmt Build using LD flags\n" "--ldflags=LDFLAGS" printf " $fmt Build and optimize for specific CPU\n" "--cpu=CPU" printf " $fmt Build for architecture [$ARCH]\n" "--arch=ARCH" printf " $fmt Build for platform [$PLATFORM]\n" "--platform=PLATFORM" @@ -186,37 +187,6 @@ show_help () exit 0 } -# Process command line -parse_args () -{ - local opt= val= - for opt do - val=${opt#*=} - opt=${opt%=*} - opt=${opt#*--} - case "$opt" in - help) - show_help - ;; - *dir|prefix) - eval "$opt=$val" - ;; - cc|cflags|arch|cpu|platform|python) - eval "$(toupper $opt)=$val" - ;; - enable-*) - opt=${opt#*-} - enable $opt 1 - ;; - disable-*) - opt=${opt#*-} - disable $opt 1 - ;; - esac - done -} - - # ########################################################################### # Package tests # ###########################################################################