From: Roy Marples Date: Sun, 21 Sep 2014 10:28:54 +0000 (+0000) Subject: Check that CC works after applying all our CPPFLAGS and CFLAGS as one X-Git-Tag: v6.4.6~27 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=1304ce8127b82706f389eab70028aba6f830131f;p=thirdparty%2Fdhcpcd.git Check that CC works after applying all our CPPFLAGS and CFLAGS as one of them might stop CC from working. --- diff --git a/configure b/configure index 5a8c8768..2b53cd06 100755 --- a/configure +++ b/configure @@ -271,24 +271,6 @@ if ! type "$CC" >/dev/null 2>&1; then done fi -echo "Using compiler .. $CC" -cat <_test.c -int main(void) { - return 0; -} -EOF -_CC=false -if $CC _test.c -o _test >/dev/null 2>&1; then - [ -x _test ] && _CC=true -fi -rm -f _test.c _test -if ! $_CC; then - echo "$CC does not create executables" - exit 1 -fi -[ "$CC" != cc ] && echo "CC= $CC" >>$CONFIG_MK -$CC --version | $SED -e '1!d' - # Set to blank, then append user config # We do this so our SED call to append to XCC remains portable if [ -n "$CFLAGS" ]; then @@ -417,10 +399,29 @@ if [ -z "$INET6" -o "$INET6" = yes ]; then echo "DHCPCD_SRCS+= ipv6.c ipv6nd.c dhcp6.c" >>$CONFIG_MK fi +echo "Using compiler .. $CC" # Add CPPFLAGS and CFLAGS to CC for testing features XCC="$CC `$SED -n -e 's/CPPFLAGS+=*\(.*\)/\1/p' $CONFIG_MK`" XCC="$XCC `$SED -n -e 's/CFLAGS+=*\(.*\)/\1/p' $CONFIG_MK`" +# Now test we can use the compiler with our CFLAGS +cat <_test.c +int main(void) { + return 0; +} +EOF +_CC=false +if $CC _test.c -o _test >/dev/null 2>&1; then + [ -x _test ] && _CC=true +fi +rm -f _test.c _test +if ! $_CC; then + echo "$CC does not create executables" + exit 1 +fi +[ "$CC" != cc ] && echo "CC= $CC" >>$CONFIG_MK +$CC --version | $SED -e '1!d' + if [ "$OS" = linux ]; then printf "Testing for nl80211 ... " cat <_nl80211.c