summary refs log tree commit diff
diff options
context:
space:
mode:
authorAlexander Barton <alex@barton.de>2013-10-16 21:59:23 +0200
committerAlexander Barton <alex@barton.de>2013-10-16 21:59:31 +0200
commita2479bb9069ea2b61cf606dbefc2cb3ad0eb8e1d (patch)
treeeeb7f0c6774afd64cb9223e62e0a358ba482f5e8
parent17589534d0ccff05463910d1f0ba673d7d1630fd (diff)
downloadngircd-a2479bb9069ea2b61cf606dbefc2cb3ad0eb8e1d.tar.gz
ngircd-a2479bb9069ea2b61cf606dbefc2cb3ad0eb8e1d.zip
platformtest.sh: Detect tcc compiler
-rwxr-xr-xcontrib/platformtest.sh8
1 files changed, 8 insertions, 0 deletions
diff --git a/contrib/platformtest.sh b/contrib/platformtest.sh
index ac545757..6b154bbb 100755
--- a/contrib/platformtest.sh
+++ b/contrib/platformtest.sh
@@ -109,6 +109,7 @@ if [ -r "Makefile" ]; then
 	CC=$(grep "^CC = " Makefile | cut -d' ' -f3)
 	$CC --version 2>&1 | grep -i "GCC" >/dev/null
 	if [ $? -eq 0 ]; then
+		# GCC, or compiler that mimics GCC
 		$CC --version 2>&1 | grep -i "Open64" >/dev/null
 		if [ $? -eq 0 ]; then
 			COMPILER="Open64"
@@ -118,14 +119,21 @@ if [ -r "Makefile" ]; then
 			COMPILER="gcc $COMPILER"
 		fi
 	else
+		# Non-GCC compiler
 		$CC --version 2>&1 | grep -i "LLVM" >/dev/null
 		if [ $? -eq 0 ]; then
 			COMPILER=$($CC --version 2>/dev/null | head -1 \
 			  | cut -d'(' -f1 | sed -e 's/version //g' \
 			  | sed -e 's/Apple /A-/g')
 		fi
+		$CC -version 2>&1 | grep -i "tcc" >/dev/null
+		if [ $? -eq 0 ]; then
+			COMPILER=$($CC -version 2>/dev/null | head -1 \
+			  | cut -d'(' -f1 | sed -e 's/version //g')
+		fi
 		if [ "$COMPILER" = "unknown" ]; then
 			v="`$CC --version 2>/dev/null | head -1`"
+			[ -z "$v" ] && v="`$CC -version 2>/dev/null | head -1`"
 			[ -n "$v" ] && COMPILER="$v"
 		fi
 	fi