From: Roy Marples Date: Sat, 21 Jun 2014 15:46:31 +0000 (+0000) Subject: Test that the CC command works and makes an exectuable rather X-Git-Tag: v6.4.1~53 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=67dcaaa4ddc4c3be8aa5b1f0b60261af136e71b3;p=thirdparty%2Fdhcpcd.git Test that the CC command works and makes an exectuable rather than using the type command. Thanks to Thomas De Schampheleire. --- diff --git a/configure b/configure index a25e9ca5..b0b15cb9 100755 --- a/configure +++ b/configure @@ -272,8 +272,20 @@ if ! type "$CC" >/dev/null 2>&1; then fi echo "Using compiler .. $CC" -if ! type "$CC" >/dev/null 2>&1; then - echo "$CC is not an executable" +cat <_test.c +int main(void) { + return 0; +} +EOF +_CC=true +if $CC _test.c -o _test >/dev/null 2>&1; then + [ -x _test ] || _CC=false +else + _CC=false +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