summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornobled <[email protected]>2010-08-29 20:03:37 -0400
committerEric Anholt <[email protected]>2010-08-30 13:59:18 -0700
commit2a50187a923eb8950bc8b63f50eaea4704d6dc36 (patch)
tree7a9d8a4b8089592ac2b9d06cc3e5d63b57375995
parente637f8b40c426d6ae79e0215fa8865d50326812f (diff)
Make configure work with clang
It was mistaking clang for gcc and deciding its version was too low.
-rw-r--r--configure.ac16
1 files changed, 15 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac
index 45188544fb0..cf2e200db3f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -48,9 +48,23 @@ solaris*)
;;
esac
+dnl clang is mostly GCC-compatible, but its version is much lower,
+dnl so we have to check for it.
+AC_MSG_CHECKING([if compiling with clang])
+
+AC_COMPILE_IFELSE(
+[AC_LANG_PROGRAM([], [[
+#ifndef __clang__
+ not clang
+#endif
+]])],
+[CLANG=yes], [CLANG=no])
+
+AC_MSG_RESULT([$CLANG])
+
dnl If we're using GCC, make sure that it is at least version 3.3.0. Older
dnl versions are explictly not supported.
-if test "x$GCC" = xyes; then
+if test "x$GCC" = xyes -a "x$CLANG" = xno; then
AC_MSG_CHECKING([whether gcc version is sufficient])
major=0
minor=0