]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
If we can't use cc then try and find a working compiler.
authorRoy Marples <roy@marples.name>
Thu, 13 Mar 2014 00:42:16 +0000 (00:42 +0000)
committerRoy Marples <roy@marples.name>
Thu, 13 Mar 2014 00:42:16 +0000 (00:42 +0000)
configure

index 161f477d1e50e9397ab20583ffd1cb4d3e691101..82fae317767a8fb2aaf82e88c5905917d2381b9b 100755 (executable)
--- a/configure
+++ b/configure
@@ -246,7 +246,23 @@ echo "LIBDIR=              $LIBDIR" >>$CONFIG_MK
 echo "MANDIR=          $MANDIR" >>$CONFIG_MK
 
 : ${CC:=cc}
-echo "Using compiler .. $(which $CC)"
+if ! type "$CC" >/dev/null 2>&1; then
+       for _CC in clang gcc pcc icc; do
+               _CC=$(_which "$_CC")
+               if [ -x "$_CC" ]; then
+                       CC=$_CC
+                       break
+               fi
+       done
+       
+fi
+
+echo "Using compiler .. $CC"
+if ! type "$CC" >/dev/null 2>&1; then
+       echo "$CC is not an executable"
+       exit 1
+fi
+[ "$CC" != cc ] && echo "CC=   $CC" >>$CONFIG_MK
 $CC --version | $SED -e '1!d'
 
 # Set to blank, then append user config