]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
conf: use better clang detection 829/head
authorNoah Watkins <noahwatkins@gmail.com>
Wed, 6 Nov 2013 22:32:35 +0000 (14:32 -0800)
committerNoah Watkins <noahwatkins@gmail.com>
Wed, 6 Nov 2013 22:33:52 +0000 (14:33 -0800)
Handle case where compiler isn't called 'clang'. This is slightly
modified from the version here:
http://src.chromium.org/svn/branches/1312/src/third_party/mesa/MesaLib/configure.ac

Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
configure.ac

index 2ecd0928bb48ff08648b6cc88c796cea6aab470d..066215a986cdc8b2966fde83d4a1e4a7d701feec 100644 (file)
@@ -61,7 +61,16 @@ if test "$CXX" = no || test "$CXX:$GXX" = "g++:"; then
   AC_MSG_ERROR([no C++ compiler found])
 fi
 
-AM_CONDITIONAL(CLANG, test x"$CXX" = x"clang++")
+AC_MSG_CHECKING([if compiler is clang])
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [[
+#ifndef __clang__
+#error "Not Clang"
+#endif
+return 0;
+]])],
+[CLANG=yes], [CLANG=no])
+AC_MSG_RESULT([$CLANG])
+AM_CONDITIONAL(CLANG, test "$CLANG" = "yes")
 
 #AC_PROG_CC
 AC_PROG_MAKE_SET