Bug 882766 - Recognize clang even when it doesn't #define __GNUC__; r=ted
authorEhsan Akhgari <ehsan@mozilla.com>
Thu, 13 Jun 2013 13:03:13 -0400
changeset 135691 da94b18e9f27b6d0f68fa425781a63a5fe5d2a11
parent 135690 29e698ae2b5c5b552cfe572fd72db0c69cebe354
child 135692 069b2adf589e0895953bb60303f282bc53f5c07c
push id1767
push useremorley@mozilla.com
push dateThu, 20 Jun 2013 08:22:43 +0000
treeherderfx-team@c6a841a3e36f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersted
bugs882766
milestone24.0a1
Bug 882766 - Recognize clang even when it doesn't #define __GNUC__; r=ted Clang on Windows #defines _MSC_VER but not __GNUC__, so we need to make sure that the build system can recognize it even when __GNUC__ is not defined.
build/autoconf/toolchain.m4
js/src/build/autoconf/toolchain.m4
--- a/build/autoconf/toolchain.m4
+++ b/build/autoconf/toolchain.m4
@@ -50,21 +50,17 @@ fi
 if test "$GXX" = yes; then
    if test "`$CXX -help 2>&1 | grep -c 'Intel(R) C++ Compiler'`" != "0"; then
      INTEL_CXX=1
    fi
 fi
 
 CLANG_CC=
 CLANG_CXX=
-if test "$GCC" = yes; then
-   if test "`$CC -v 2>&1 | egrep -c '(clang version|Apple.*clang)'`" != "0"; then
-     CLANG_CC=1
-   fi
+if test "`$CC -v 2>&1 | egrep -c '(clang version|Apple.*clang)'`" != "0"; then
+   CLANG_CC=1
 fi
 
-if test "$GXX" = yes; then
-   if test "`$CXX -v 2>&1 | egrep -c '(clang version|Apple.*clang)'`" != "0"; then
-     CLANG_CXX=1
-   fi
+if test "`$CXX -v 2>&1 | egrep -c '(clang version|Apple.*clang)'`" != "0"; then
+   CLANG_CXX=1
 fi
 AC_SUBST(CLANG_CXX)
 ])
--- a/js/src/build/autoconf/toolchain.m4
+++ b/js/src/build/autoconf/toolchain.m4
@@ -50,21 +50,17 @@ fi
 if test "$GXX" = yes; then
    if test "`$CXX -help 2>&1 | grep -c 'Intel(R) C++ Compiler'`" != "0"; then
      INTEL_CXX=1
    fi
 fi
 
 CLANG_CC=
 CLANG_CXX=
-if test "$GCC" = yes; then
-   if test "`$CC -v 2>&1 | egrep -c '(clang version|Apple.*clang)'`" != "0"; then
-     CLANG_CC=1
-   fi
+if test "`$CC -v 2>&1 | egrep -c '(clang version|Apple.*clang)'`" != "0"; then
+   CLANG_CC=1
 fi
 
-if test "$GXX" = yes; then
-   if test "`$CXX -v 2>&1 | egrep -c '(clang version|Apple.*clang)'`" != "0"; then
-     CLANG_CXX=1
-   fi
+if test "`$CXX -v 2>&1 | egrep -c '(clang version|Apple.*clang)'`" != "0"; then
+   CLANG_CXX=1
 fi
 AC_SUBST(CLANG_CXX)
 ])