summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2012-12-21 18:03:00 -0800
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-01-23 17:02:25 +0100
commitb862f43e363b9705cbc3ee3a491eb1d9c82fac71 (patch)
tree5bb5bda7cc0dae7ee7d7e0a949788e328e37db1a
parent896bf9ff5c142dd218ccca4f102ab5d267be7557 (diff)
Detect Clang and Apple Clang's version properly
The current code matches *g++*, which matches "clang++" and detects Clang as GCC. That's highly incorrect. Change-Id: Ifd85bbd35aa130be3094fc75d471614d06ca23bd Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
-rwxr-xr-xconfigure15
1 files changed, 15 insertions, 0 deletions
diff --git a/configure b/configure
index 18bbfae7f9..b74a3afcd4 100755
--- a/configure
+++ b/configure
@@ -5734,6 +5734,13 @@ if [ "$CFG_QML_DEBUG" = "no" ]; then
fi
case "$QMAKE_CONF_COMPILER" in
+*clang++*)
+ # Clang
+ COMPILER_VERSION=`${QMAKE_CONF_COMPILER} -v 2>&1 | sed -n '
+/^Apple clang version /{s///; s/^\([0-9]*\)\.\([0-9]*\).*$/QT_APPLE_CLANG_MAJOR_VERSION=\1; QT_APPLE_CLANG_MINOR_VERSION=\2/;p;q;}
+/^clang version /{s///; s/^\([0-9]*\)\.\([0-9]*\).*$/QT_CLANG_MAJOR_VERSION=\1; QT_CLANG_MINOR_VERSION=\2/;p;q;}'`
+ eval "$COMPILER_VERSION"
+ ;;
*g++*)
# GNU C++
COMPILER_VERSION=`${QMAKE_CONF_COMPILER} -dumpversion 2>/dev/null`
@@ -6074,6 +6081,14 @@ if [ -n "$QT_GCC_MAJOR_VERSION" ]; then
echo "QT_GCC_MINOR_VERSION = $QT_GCC_MINOR_VERSION" >> "$QTCONFIG.tmp"
echo "QT_GCC_PATCH_VERSION = $QT_GCC_PATCH_VERSION" >> "$QTCONFIG.tmp"
fi
+if [ -n "$QT_CLANG_MAJOR_VERSION" ]; then
+ echo "QT_CLANG_MAJOR_VERSION = $QT_CLANG_MAJOR_VERSION" >> "$QTCONFIG.tmp"
+ echo "QT_CLANG_MINOR_VERSION = $QT_CLANG_MINOR_VERSION" >> "$QTCONFIG.tmp"
+fi
+if [ -n "$QT_APPLE_CLANG_MAJOR_VERSION" ]; then
+ echo "QT_APPLE_CLANG_MAJOR_VERSION = $QT_APPLE_CLANG_MAJOR_VERSION" >> "$QTCONFIG.tmp"
+ echo "QT_APPLE_CLANG_MINOR_VERSION = $QT_APPLE_CLANG_MINOR_VERSION" >> "$QTCONFIG.tmp"
+fi
if [ -n "$QMAKE_INCDIR_OPENGL_ES2" ]; then
echo "#Qt opengl include path" >> "$QTCONFIG.tmp"