mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-12-20 22:59:34 -05:00
Detect pthread_detach using #include <pthread.h> (using AC_TRY_LINK)
instead of AC_CHECK_FUNCS() as symbol may be mangled.
This commit is contained in:
parent
162f373c61
commit
859b1ae451
3 changed files with 315 additions and 267 deletions
18
configure.in
18
configure.in
|
|
@ -792,12 +792,26 @@ if test $ol_with_threads = auto -o $ol_with_threads = yes \
|
|||
fi
|
||||
|
||||
dnl Check functions for compatibility
|
||||
AC_CHECK_FUNCS(pthread_kill pthread_detach)
|
||||
AC_CHECK_FUNCS(pthread_kill)
|
||||
|
||||
if test $ac_cv_func_pthread_detach = no ; then
|
||||
dnl Check for pthread_detach with <pthread.h> inclusion
|
||||
dnl as it's symbol may have been mangled.
|
||||
AC_CACHE_CHECK([for pthread_detach with <pthread.h>],
|
||||
[ol_cv_func_pthread_detach], [
|
||||
dnl save the flags
|
||||
AC_TRY_LINK([#include <pthread.h>],
|
||||
[pthread_detach(NULL);],
|
||||
[ol_cv_func_pthread_detach=yes],
|
||||
[ol_cv_func_pthread_detach=no])
|
||||
])
|
||||
|
||||
if test $ol_cv_func_pthread_detach = no ; then
|
||||
AC_MSG_ERROR([could not locate pthread_detach()])
|
||||
fi
|
||||
|
||||
AC_DEFINE(HAVE_PTHREAD_DETACH,1,
|
||||
[define if you have pthread_detach function])
|
||||
|
||||
dnl Check for setconcurreny functions
|
||||
AC_CHECK_FUNCS( \
|
||||
pthread_setconcurrency \
|
||||
|
|
|
|||
|
|
@ -267,9 +267,6 @@
|
|||
/* Define if you have the mkstemp function. */
|
||||
#undef HAVE_MKSTEMP
|
||||
|
||||
/* Define if you have the pthread_detach function. */
|
||||
#undef HAVE_PTHREAD_DETACH
|
||||
|
||||
/* Define if you have the pthread_getconcurrency function. */
|
||||
#undef HAVE_PTHREAD_GETCONCURRENCY
|
||||
|
||||
|
|
@ -591,6 +588,9 @@
|
|||
/* define if you have POSIX Threads */
|
||||
#undef HAVE_PTHREADS
|
||||
|
||||
/* define if you have pthread_detach function */
|
||||
#undef HAVE_PTHREAD_DETACH
|
||||
|
||||
/* define if you have Mach Cthreads */
|
||||
#undef HAVE_MACH_CTHREADS
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue