summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Austin Seipp <mad.one@gmail.com>2012-09-23 20:47:20 -0500
committerGravatar Austin Seipp <mad.one@gmail.com>2012-09-23 20:47:20 -0500
commit84213bae242f02da97f42f02d662f2aa3bfd14af (patch)
tree0455cf91a485ad92953199dce72ddcc648d9d356
parent9f704b8c6e17c96c440fb3168a91c0bdb5cb845f (diff)
Fix compilation when using Clang on OS X; it doesn't like -pthread
-rw-r--r--configure.ac20
1 files changed, 20 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 70ec14ed..02b9562a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -94,6 +94,24 @@ if test [$WORKING_VERSION = "1"]; then
VERSION="$VERSION + `hg identify || (cat .hg_archival.txt | grep 'node\:') || echo ?`"
fi
+# Clang does not like being passed -pthread, since it's implicit on OS X.
+# So let's get rid of that! Here's to hoping it doesn't break Clang
+# on other platforms.
+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])
+
+if test [$CLANG = "yes"]; then
+ PTHREAD_CFLAGS=""
+ PTHREAD_LIBS=""
+fi
+
AC_SUBST(CC)
AC_SUBST(BIN)
AC_SUBST(LIB)
@@ -130,6 +148,8 @@ Ur/Web configuration:
MySQL C header: MSHEADER $MSHEADER
SQLite C header: SQHEADER $SQHEADER
OpenSSL: OPENSSL_LIBS $OPENSSL_LIBS
+ pthreads: PTHREAD_CFLAGS $PTHREAD_CFLAGS
+ PTHREAD_LIBS $PTHREAD_LIBS
Version: $VERSION
EOF