changeset 2396:e7797ac185e6 draft

If we can't use cc then try and find a working compiler.
author Roy Marples <roy@marples.name>
date Thu, 13 Mar 2014 00:42:16 +0000
parents 89e56106e0cc
children 56327846c5dd
files configure
diffstat 1 files changed, 17 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/configure	Wed Mar 12 15:59:19 2014 +0000
+++ b/configure	Thu Mar 13 00:42:16 2014 +0000
@@ -246,7 +246,23 @@
 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