diff options
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 14 |
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) |