diff options
author | Diego 'Flameeyes' Pettenò <flameeyes@gmail.com> | 2008-05-24 02:08:29 +0200 |
---|---|---|
committer | Diego 'Flameeyes' Pettenò <flameeyes@gmail.com> | 2008-05-24 02:08:29 +0200 |
commit | c9ad18a7e3b147c95c8b9132831259722aa95c18 (patch) | |
tree | 0efc06e090c8b0f105855db911f7858927478453 /m4 | |
parent | 0cb95cb5ae7e494f0ba776eeeceec3225ff15a28 (diff) | |
download | xine-lib-c9ad18a7e3b147c95c8b9132831259722aa95c18.tar.gz xine-lib-c9ad18a7e3b147c95c8b9132831259722aa95c18.tar.bz2 |
Rewrite CC_PTHREAD_RECURSIVE_MUTEX to use M4sh and AC_CACHE_CHECK.
Diffstat (limited to 'm4')
-rw-r--r-- | m4/pthreads.m4 | 34 |
1 files changed, 18 insertions, 16 deletions
diff --git a/m4/pthreads.m4 b/m4/pthreads.m4 index facac076f..653a496da 100644 --- a/m4/pthreads.m4 +++ b/m4/pthreads.m4 @@ -75,26 +75,28 @@ AC_DEFUN([CC_PTHREAD_FLAGS], [ ]) AC_DEFUN([CC_PTHREAD_RECURSIVE_MUTEX], [ - AC_REQUIRE([CC_PTHREAD_FLAGS]) - AC_MSG_CHECKING([for recursive mutex support in pthread]) - - ac_save_LIBS="$LIBS" - LIBS="$LIBS $PTHREAD_LIBS" - AC_COMPILE_IFELSE(AC_LANG_SOURCE([#include <pthread.h> - + AC_REQUIRE([CC_PTHREAD_FLAGS]) + AC_CACHE_CHECK( + [for recursive mutex support in pthread], + [cc_cv_pthread_recursive_mutex], + [ac_save_LIBS="$LIBS" + LIBS="$LIBS $PTHREAD_LIBS" + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([ +#include <pthread.h> + ], [ int main() { pthread_mutexattr_t attr; pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE); return 0; } - ]), [have_recursive_mutex=yes], [have_recursive_mutex=no]) - LIBS="$ac_save_LIBS" - - AC_MSG_RESULT([$have_recursive_mutex]) + ]) + ], + [cc_cv_pthread_recursive_mutex=yes], + [cc_cv_pthread_recursive_mutex=no]) + LIBS="$ac_save_LIBS" + ]) - if test x"$have_recursive_mutex" = x"yes"; then - ifelse([$1], , [:], [$1]) - else - ifelse([$2], , [:], [$2]) - fi + AS_IF([test x"$cc_cv_pthread_recursive_mutex" = x"yes"], + [$1], [$2]) ]) |