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>
This commit is contained in:
Thiago Macieira 2012-12-21 18:03:00 -08:00 committed by The Qt Project
parent 896bf9ff5c
commit b862f43e36

15
configure vendored
View File

@ -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"