From: Roy Marples Date: Thu, 13 Mar 2014 00:42:16 +0000 (+0000) Subject: If we can't use cc then try and find a working compiler. X-Git-Tag: v6.3.2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=8820c5c9f76fbe0b7eea820d332c7239de73b97b;p=thirdparty%2Fdhcpcd.git If we can't use cc then try and find a working compiler. --- diff --git a/configure b/configure index 161f477d..82fae317 100755 --- 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