From: Howard Chu Date: Thu, 11 Jan 2007 00:54:45 +0000 (+0000) Subject: Better check for pthread_rwlock_destroy() X-Git-Tag: OPENLDAP_REL_ENG_2_4_4ALPHA~8^2~208 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=65f05d3ac54e5a36b841b411402d5431766cc195;p=openldap Better check for pthread_rwlock_destroy() --- diff --git a/configure.in b/configure.in index d225ea9944..6d001d23a7 100644 --- a/configure.in +++ b/configure.in @@ -1326,7 +1326,22 @@ dnl [ol_cv_pthread_lpthread_lexc]) fi dnl Check functions for compatibility - AC_CHECK_FUNCS(pthread_kill pthread_rwlock_destroy) + AC_CHECK_FUNCS(pthread_kill) + + dnl Check for pthread_rwlock_destroy with + dnl as pthread_rwlock_t may not be defined. + AC_CACHE_CHECK([for pthread_rwlock_destroy with ], + [ol_cv_func_pthread_rwlock_destroy], [ + dnl save the flags + AC_LINK_IFELSE([AC_LANG_PROGRAM([[ +#include +pthread_rwlock_t rwlock; +]], [[pthread_rwlock_destroy(&rwlock);]])],[ol_cv_func_pthread_rwlock_destroy=yes],[ol_cv_func_pthread_rwlock_destroy=no]) + ]) + if test $ol_cv_func_pthread_rwlock_destroy = yes ; then + AC_DEFINE(HAVE_PTHREAD_RWLOCK_DESTROY,1, + [define if you have pthread_rwlock_destroy function])], + fi dnl Check for pthread_detach with inclusion dnl as it's symbol may have been mangled.