From b862f43e363b9705cbc3ee3a491eb1d9c82fac71 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Fri, 21 Dec 2012 18:03:00 -0800 Subject: Detect Clang and Apple Clang's version properly MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The current code matches *g++*, which matches "clang++" and detects Clang as GCC. That's highly incorrect. Change-Id: Ifd85bbd35aa130be3094fc75d471614d06ca23bd Reviewed-by: Oswald Buddenhagen Reviewed-by: Morten Johan Sørvig --- configure | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'configure') 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" -- cgit v1.2.3