diff options
author | Wookey <wookey@wookware.org> | 2012-11-16 08:06:19 -0800 |
---|---|---|
committer | Stephen Hemminger <shemminger@vyatta.com> | 2012-11-16 08:06:19 -0800 |
commit | 35122a7500cd965f8e99d5fd9faae9b0732b55c1 (patch) | |
tree | 4250917e1c5bdf4032d537f08fab4813053fa2d3 /configure | |
parent | 2c389b0f31ec5218d9ae4fb161232a5cbebb5cb1 (diff) |
configure: respect $CC environment var override
Enables e.g. cross-compiling by setting $CC env var. This patch
extracted from the Ubuntu package (thanks, Wookey and Colin Watson).
BugLink: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=670660
BugLink: https://bugs.launchpad.net/bugs/870197
Signed-off-by: Kamal Mostafa <kamal@debian.org>
Diffstat (limited to 'configure')
-rwxr-xr-x | configure | 13 |
1 files changed, 7 insertions, 6 deletions
@@ -3,6 +3,7 @@ # INCLUDE=${1:-"$PWD/include"} : ${PKG_CONFIG:=pkg-config} +: ${CC=gcc} echo "PKG_CONFIG:=${PKG_CONFIG}" >>Config # Make a temp directory in build tree. @@ -19,7 +20,7 @@ int main(int argc, char **argv) { return 0; } EOF -gcc -I$INCLUDE -o $TMPDIR/atmtest $TMPDIR/atmtest.c -latm >/dev/null 2>&1 +$CC -I$INCLUDE -o $TMPDIR/atmtest $TMPDIR/atmtest.c -latm >/dev/null 2>&1 if [ $? -eq 0 ] then echo "TC_CONFIG_ATM:=y" >>Config @@ -53,7 +54,7 @@ int main(int argc, char **argv) EOF -if gcc -I$INCLUDE $IPTC -o $TMPDIR/ipttest $TMPDIR/ipttest.c $IPTL $(${PKG_CONFIG} xtables --cflags --libs) -ldl >/dev/null 2>&1 +if $CC -I$INCLUDE $IPTC -o $TMPDIR/ipttest $TMPDIR/ipttest.c $IPTL $(${PKG_CONFIG} xtables --cflags --libs) -ldl >/dev/null 2>&1 then echo "TC_CONFIG_XT:=y" >>Config echo "using xtables" @@ -90,7 +91,7 @@ int main(int argc, char **argv) { } EOF -gcc -I$INCLUDE $IPTC -o $TMPDIR/ipttest $TMPDIR/ipttest.c $IPTL -ldl >/dev/null 2>&1 +$CC -I$INCLUDE $IPTC -o $TMPDIR/ipttest $TMPDIR/ipttest.c $IPTL -ldl >/dev/null 2>&1 if [ $? -eq 0 ] then @@ -130,7 +131,7 @@ int main(int argc, char **argv) { } EOF -gcc -I$INCLUDE $IPTC -o $TMPDIR/ipttest $TMPDIR/ipttest.c $IPTL -ldl >/dev/null 2>&1 +$CC -I$INCLUDE $IPTC -o $TMPDIR/ipttest $TMPDIR/ipttest.c $IPTL -ldl >/dev/null 2>&1 if [ $? -eq 0 ] then @@ -180,7 +181,7 @@ int main(int argc, char **argv) return 0; } EOF -gcc -I$INCLUDE -o $TMPDIR/setnstest $TMPDIR/setnstest.c >/dev/null 2>&1 +$CC -I$INCLUDE -o $TMPDIR/setnstest $TMPDIR/setnstest.c >/dev/null 2>&1 if [ $? -eq 0 ] then echo "IP_CONFIG_SETNS:=y" >>Config @@ -212,7 +213,7 @@ int main(void) #endif EOF -if gcc -I$INCLUDE -o $TMPDIR/ipsettest $TMPDIR/ipsettest.c >/dev/null 2>&1 +if $CC -I$INCLUDE -o $TMPDIR/ipsettest $TMPDIR/ipsettest.c >/dev/null 2>&1 then echo "TC_CONFIG_IPSET:=y" >>Config echo "yes" |