]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Test that the CC command works and makes an exectuable rather
authorRoy Marples <roy@marples.name>
Sat, 21 Jun 2014 15:46:31 +0000 (15:46 +0000)
committerRoy Marples <roy@marples.name>
Sat, 21 Jun 2014 15:46:31 +0000 (15:46 +0000)
than using the type command.
Thanks to Thomas De Schampheleire.

configure

index a25e9ca5ef36853ab8f99f96999031478e707f6d..b0b15cb9c0b37b79a206f5edd287fde5f5fcec67 100755 (executable)
--- 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 <<EOF >_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