diff options
-rw-r--r-- | configure.ac | 23 | ||||
-rw-r--r-- | m4/pthreads.m4 | 6 |
2 files changed, 5 insertions, 24 deletions
diff --git a/configure.ac b/configure.ac index d8a4f3676..fa141a22a 100644 --- a/configure.ac +++ b/configure.ac @@ -227,28 +227,7 @@ dnl threads and OS specific stuff dnl --------------------------------------------- CC_PTHREAD_FLAGS(, [AC_MSG_ERROR([Pthread support is needed])]) - -dnl -AC_MSG_CHECKING(for recursive mutex support in pthread) -ac_save_LIBS="$LIBS" -LIBS="$LIBS $PTHREAD_LIBS" - -have_recursive_mutex=no -AC_COMPILE_IFELSE(AC_LANG_SOURCE([#include <pthread.h> - -int main() { - pthread_mutexattr_t attr; - pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE); - return 0; -} - ]),[ - have_recursive_mutex=yes - ],[ - AC_MSG_ERROR(recursive mutex support is needed - please report) - ]) -LIBS="$ac_save_LIBS" - -AC_MSG_RESULT($have_recursive_mutex) +CC_PTHREAD_RECURSIVE_MUTEX(, [AC_MSG_ERROR([recursive mutex support is needed - please report])]) AC_CHECK_DECL(sysi86,[ AC_DEFINE(HAVE_SYSI86,1,[Define this if the 'sysi86' function is declared in sys/sysi86.h]) diff --git a/m4/pthreads.m4 b/m4/pthreads.m4 index 653a496da..8438cde0b 100644 --- a/m4/pthreads.m4 +++ b/m4/pthreads.m4 @@ -48,7 +48,6 @@ AC_DEFUN([CC_PTHREAD_FLAGS], [ [ac_save_CFLAGS="$CFLAGS" ac_save_LIBS="$LIBS" CFLAGS="$CFLAGS $cc_cv_werror $PTHREAD_CFLAGS" - LIBS="$LIBS $PTHREAD_LIBS" AC_LINK_IFELSE( [AC_LANG_PROGRAM( @@ -79,7 +78,9 @@ AC_DEFUN([CC_PTHREAD_RECURSIVE_MUTEX], [ AC_CACHE_CHECK( [for recursive mutex support in pthread], [cc_cv_pthread_recursive_mutex], - [ac_save_LIBS="$LIBS" + [ac_save_CFLAGS="$CFLAGS" + ac_save_LIBS="$LIBS" + CFLAGS="$CFLAGS $cc_cv_werror $PTHREAD_CFLAGS" LIBS="$LIBS $PTHREAD_LIBS" AC_COMPILE_IFELSE( [AC_LANG_PROGRAM([ @@ -94,6 +95,7 @@ int main() { ], [cc_cv_pthread_recursive_mutex=yes], [cc_cv_pthread_recursive_mutex=no]) + CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" ]) |