aboutsummaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
authortilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2010-04-06 19:28:42 +0000
committertilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2010-04-06 19:28:42 +0000
commitbfb86188c05b186db5cb26b7a812ac55304e2924 (patch)
treefb1fa543ea6b001a0e274ce81c156b1cac66996d /configure.ac
parent086b3ec45a009b33b4a2dfe72f4782ca84ecf85b (diff)
Mac OS X does not support comparing a mutex to its initializer. Create a test for this.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@256370 f38db490-d61c-443f-a65b-d21fe96a405b
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)