Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDick Porter <dick@acm.org>2001-11-13 12:04:31 +0300
committerDick Porter <dick@acm.org>2001-11-13 12:04:31 +0300
commit9666f63a62b903975f0c71c11dc4126548453cb4 (patch)
tree6375da3bec7358ca41b8a86d0e17568481d93ad9 /configure.in
parenta97b1f0b2afa19d045cf1ae2162ef59b1c5189cd (diff)
2001-11-13 Dick Porter <dick@ximian.com>
* configure.in: Some more tests for pthread features (specifically, glibc 2.1 doesnt define pthread_mutex_timedlock but still needs _GNU_SOURCE for PTHREAD_MUTEX_RECURSIVE) svn path=/trunk/mono/; revision=1339
Diffstat (limited to 'configure.in')
-rw-r--r--configure.in35
1 files changed, 35 insertions, 0 deletions
diff --git a/configure.in b/configure.in
index 2d12e7eb7d6..9e596e77c38 100644
--- a/configure.in
+++ b/configure.in
@@ -161,6 +161,41 @@ if test x$platform_win32 = xno; then
])
CPPFLAGS=$orig_CPPFLAGS
CFLAGS="$CFLAGS $pthread_CFLAGS"
+
+ # Need PTHREAD_MUTEX_RECURSIVE
+ pthread_CFLAGS=""
+ orig_CPPFLAGS=$CPPFLAGS
+ # This is a gcc-specific error, but we already set
+ # gcc-specific options in CFLAGS
+ CPPFLAGS="$CPPFLAGS -Werror-implicit-function-declaration"
+ AC_MSG_CHECKING(for PTHREAD_MUTEX_RECURSIVE)
+ AC_TRY_COMPILE([ #include <pthread.h>], [
+ pthread_mutexattr_t attr;
+ pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
+ ], [
+ # Works!
+ AC_MSG_RESULT(ok)
+ ], [
+ AC_MSG_RESULT(no)
+
+ # glibc requires -D_GNU_SOURCE before it will declare
+ # this macro
+ AC_MSG_CHECKING(whether _GNU_SOURCE is needed for PTHREAD_MUTEX_RECURSIVE)
+ CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
+ AC_TRY_COMPILE([ #include <pthread.h>], [
+ pthread_mutexattr_t attr;
+ pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
+ ], [
+ AC_MSG_RESULT(ok)
+ pthread_CFLAGS="-D_GNU_SOURCE"
+ ], [
+ AC_MSG_RESULT(no)
+ dnl Add other variants here
+ AC_MSG_ERROR([PTHREAD_MUTEX_RECURSIVE not found])
+ ])
+ ])
+ CPPFLAGS=$orig_CPPFLAGS
+ CFLAGS="$CFLAGS $pthread_CFLAGS"
], [
AC_MSG_ERROR([libpthread is required on non-win32 hosts])
])