summaryrefslogtreecommitdiff
path: root/configure.in
diff options
context:
space:
mode:
authorTor Lillqvist <tml@iki.fi>2012-03-02 14:07:25 +0200
committerTor Lillqvist <tml@iki.fi>2012-03-02 15:42:25 +0200
commitfa65ff8b1d2f50fa7f14e92fa7bc3c5d6619831a (patch)
treeef3ed977dd512cb2581a7959778c6126c34bf763 /configure.in
parenta871755e673fc83c92bf9731603d22004d0a3f2e (diff)
Check for Clang in configury and store and use result
Diffstat (limited to 'configure.in')
-rw-r--r--configure.in23
1 files changed, 20 insertions, 3 deletions
diff --git a/configure.in b/configure.in
index 3d3d7e982502..6e51f3507c28 100644
--- a/configure.in
+++ b/configure.in
@@ -2442,9 +2442,9 @@ if test "$_os" = "WINNT"; then
fi
dnl ===================================================================
-dnl Test the gcc version, 3 is OK
+dnl Test the gcc version
dnl ===================================================================
-if test \( "$_os" != "WINNT" -o "$WITH_MINGW" = "yes" \) -a "$GCC" = "yes"; then
+if test "$GCC" = "yes"; then
AC_MSG_CHECKING([the GNU C compiler version])
_gcc_version=`$CC -dumpversion`
_gcc_major=`echo $_gcc_version | $AWK -F. '{ print \$1 }'`
@@ -2465,10 +2465,27 @@ if test \( "$_os" != "WINNT" -o "$WITH_MINGW" = "yes" \) -a "$GCC" = "yes"; then
AC_MSG_RESULT([implicitly using CC=$CC])
fi
else
- AC_MSG_RESULT([checked (gcc $_gcc_version)])
+ AC_MSG_RESULT([gcc $_gcc_version])
fi
fi
+dnl ===================================================================
+dnl Is it actually Clang?
+dnl ===================================================================
+
+if test "$GCC" = "yes"; then
+ AC_MSG_CHECKING([whether GCC is actually Clang])
+ AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
+ #ifndef __clang__
+ you lose
+ #endif
+ int foo=42;
+ ]])],
+ [AC_MSG_RESULT([yes])
+ COM_GCC_IS_CLANG=TRUE],
+ [AC_MSG_RESULT([no])])
+fi
+AC_SUBST(COM_GCC_IS_CLANG)
#
# prefix C with ccache if needed