summaryrefslogtreecommitdiffstats
path: root/configure
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2014-03-13 00:42:16 +0000
committerRoy Marples <roy@marples.name>2014-03-13 00:42:16 +0000
commit8820c5c9f76fbe0b7eea820d332c7239de73b97b (patch)
tree4910cae00168f6d22593ef625d4d4fe8dae9826f /configure
parentcc43133914bde9c93ef92a6a01545992cfd471b7 (diff)
downloaddhcpcd-8820c5c9f76fbe0b7eea820d332c7239de73b97b.tar.xz
If we can't use cc then try and find a working compiler.
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure18
1 files changed, 17 insertions, 1 deletions
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