]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
[build] fix configure with komplex enviroments
authorSascha Kuehndel (InuSasha) <dev@inusasha.de>
Fri, 22 Aug 2014 15:59:36 +0000 (17:59 +0200)
committerJaroslav Kysela <perex@perex.cz>
Mon, 1 Sep 2014 13:36:21 +0000 (15:36 +0200)
- add ldflags
- fix multivalued options like --cflags="-m64 -I/include/extra"

configure
support/configure.inc

index 96839f6e71997c1febf651657d77992ae44e79ab..18f0c8a89a443a49730ab6bd001208d82b875a6c 100755 (executable)
--- 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
index ab4dc52fd4d927e1b812c2d59004b3984622006e..97b1a8ad17358d3fe5e6ce541b495d6e66ba1d45 100755 (executable)
@@ -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
 # ###########################################################################