]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
configure: move toolchain init to a function
authorMike Frysinger <vapier@gentoo.org>
Sun, 16 Dec 2012 22:09:15 +0000 (17:09 -0500)
committerStephen Hemminger <shemminger@vyatta.com>
Mon, 17 Dec 2012 17:13:46 +0000 (09:13 -0800)
The layout of this file uses functions to update Config.  Move the
toolchain logic to the same style to fix setting the vars in Config.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
configure

index 9912114438e908ffd0820876c69968c4db399a59..ea1038df53ffe5eb5454c3d56f97a44288a7eb57 100755 (executable)
--- a/configure
+++ b/configure
@@ -2,14 +2,19 @@
 # This is not an autconf generated configure
 #
 INCLUDE=${1:-"$PWD/include"}
-: ${PKG_CONFIG:=pkg-config}
-: ${CC=gcc}
-echo "PKG_CONFIG:=${PKG_CONFIG}" >>Config
 
 # Make a temp directory in build tree.
 TMPDIR=$(mktemp -d config.XXXXXX)
 trap 'status=$?; rm -rf $TMPDIR; exit $status' EXIT HUP INT QUIT TERM
 
+check_toolchain()
+{
+: ${PKG_CONFIG:=pkg-config}
+: ${CC=gcc}
+echo "CC:=${CC}" >>Config
+echo "PKG_CONFIG:=${PKG_CONFIG}" >>Config
+}
+
 check_atm()
 {
 cat >$TMPDIR/atmtest.c <<EOF
@@ -224,6 +229,7 @@ rm -f $TMPDIR/ipsettest.c $TMPDIR/ipsettest
 }
 
 echo "# Generated config based on" $INCLUDE >Config
+check_toolchain
 
 echo "TC schedulers"