summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorTilghman Lesher <tilghman@meg.abyt.es>2010-04-06 19:28:42 +0000
committerTilghman Lesher <tilghman@meg.abyt.es>2010-04-06 19:28:42 +0000
commitbcbafc800eb68b6a2aa0e0582a04e6f205df9ce9 (patch)
treefb1fa543ea6b001a0e274ce81c156b1cac66996d /configure.ac
parentd3f44c979c08ce7e2a28e0016f427f326b9b764f (diff)
Mac OS X does not support comparing a mutex to its initializer. Create a test for this.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@256370 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac14
1 files changed, 14 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 057327a09..7a4cbb8eb 100644
--- a/configure.ac
+++ b/configure.ac
@@ -595,6 +595,20 @@ fi
AST_C_DEFINE_CHECK([PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP], [PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP], [pthread.h])
+# Can we compare a mutex to its initial value?
+# Generally yes on OpenBSD/FreeBSD and no on Mac OS X.
+AC_MSG_CHECKING(whether we can compare a mutex to its initial value)
+AC_LINK_IFELSE(
+ AC_LANG_PROGRAM([#include <pthread.h>], [pthread_mutex_t lock;
+ if ((lock) != ((pthread_mutex_t) PTHREAD_MUTEX_INITIALIZER)) {
+ return 0;
+ }
+ return 0]),
+ AC_MSG_RESULT(yes)
+ AC_DEFINE([CAN_COMPARE_MUTEX_TO_INIT_VALUE], 1, [Define to 1 if your system's implementation of mutexes supports comparison of a mutex to its initializer.]),
+ AC_MSG_RESULT(no)
+)
+
#if test "${cross_compiling}" = "no";
#then
#AC_MSG_CHECKING(for working epoll support)