mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-01-18 11:05:48 +08:00
New LinuxThreads detection. Correctly detects FreeBSD's LinuxThreads port
(but not sure if it's usable yet). Needs to be tested on various versions of Linux native LinuxThreads.
This commit is contained in:
parent
73b846c011
commit
bbb7964508
@ -472,24 +472,57 @@ AC_DEFUN([OL_POSIX_THREAD_VERSION],
|
||||
])
|
||||
])dnl
|
||||
dnl
|
||||
dnl --------------------------------------------------------------------
|
||||
dnl Check LinuxThread
|
||||
dnl ====================================================================
|
||||
dnl Check LinuxThread Header
|
||||
dnl
|
||||
dnl defines ol_cv_linux_threads to 'yes' or 'no'
|
||||
dnl defines ol_cv_header linux_threads to 'yes' or 'no'
|
||||
dnl 'no' implies pthreads.h is not LinuxThreads or pthreads.h
|
||||
dnl doesn't exists. Existance of pthread.h should separately
|
||||
dnl checked.
|
||||
dnl
|
||||
AC_DEFUN([OL_LINUX_THREADS],
|
||||
[
|
||||
AC_CACHE_CHECK([for LinuxThreads], [ol_cv_linux_threads], [
|
||||
res=`grep Linuxthreads /usr/include/pthread.h 2>/dev/null | wc -l`
|
||||
if test "$res" -gt 0 ; then
|
||||
ol_cv_linux_threads=yes
|
||||
else
|
||||
ol_cv_linux_threads=no
|
||||
AC_DEFUN([OL_HEADER_LINUX_THREADS], [
|
||||
AC_CACHE_CHECK([for LinuxThreads pthread.h],
|
||||
[ol_cv_header_linux_threads],
|
||||
[
|
||||
AC_EGREP_CPP(pthread_kill_other_threads_np,
|
||||
[#include <pthread.h>],
|
||||
[ol_cv_header_linux_threads=yes],
|
||||
[ol_cv_header_linux_threads=no])
|
||||
])])dnl
|
||||
dnl
|
||||
dnl --------------------------------------------------------------------
|
||||
dnl Check LinuxThread Implementation
|
||||
dnl
|
||||
dnl defines ol_cv_sys_linux_threads to 'yes' or 'no'
|
||||
dnl 'no' implies pthreads implementation is not LinuxThreads.
|
||||
dnl
|
||||
AC_DEFUN([OL_SYS_LINUX_THREADS], [
|
||||
AC_CHECK_FUNC(pthread_kill_other_threads_np)
|
||||
AC_CACHE_CHECK([for LinuxThreads implementation],
|
||||
[ol_cv_sys_linux_threads],
|
||||
[ol_cv_sys_linux_threads=$ac_cv_func_pthread_kill_other_threads_np])
|
||||
])dnl
|
||||
dnl
|
||||
dnl --------------------------------------------------------------------
|
||||
dnl
|
||||
AC_DEFUN([OL_LINUX_THREADS], [
|
||||
AC_REQUIRE([OL_HEADER_LINUX_THREADS])
|
||||
AC_REQUIRE([OL_SYS_LINUX_THREADS])
|
||||
AC_CACHE_CHECK([for LinuxThreads consistency], [ol_cv_linux_threads], [
|
||||
if test $ol_cv_header_linux_threads = yes -a \
|
||||
$ol_cv_sys_linux_threads = yes; then
|
||||
ol_cv_linux_threads=yes
|
||||
elif test $ol_cv_header_linux_threads = no -a \
|
||||
$ol_cv_sys_linux_threads = no; then
|
||||
ol_cv_linux_threads=no
|
||||
else
|
||||
ol_cv_linux_threads=error
|
||||
fi
|
||||
])
|
||||
if test $ol_cv_linux_threads = yes; then
|
||||
AC_DEFINE(HAVE_LINUX_THREADS,1,
|
||||
[define if you have LinuxThreads])
|
||||
fi
|
||||
])
|
||||
])dnl
|
||||
dnl
|
||||
dnl ====================================================================
|
||||
|
14
configure.in
14
configure.in
@ -587,12 +587,7 @@ if test $ol_with_threads = auto -o $ol_with_threads = yes \
|
||||
# consider threads found
|
||||
ol_with_threads=found
|
||||
|
||||
OL_LINUX_THREADS
|
||||
|
||||
if test $ol_cv_linux_threads = yes ; then
|
||||
AC_DEFINE(HAVE_LINUX_THREADS,1,
|
||||
[define if you have LinuxThreads])
|
||||
fi
|
||||
OL_HEADER_LINUX_THREADS
|
||||
|
||||
dnl Now the hard part, how to link?
|
||||
dnl
|
||||
@ -1001,6 +996,13 @@ dnl fi
|
||||
thr_getconcurrency \
|
||||
)
|
||||
|
||||
OL_SYS_LINUX_THREADS
|
||||
OL_LINUX_THREADS
|
||||
|
||||
if test $ol_cv_linux_threads = error ; then
|
||||
AC_MSG_ERROR([LinuxThreads header/library mismatch])
|
||||
fi
|
||||
|
||||
AC_MSG_CHECKING([if pthread_create() works])
|
||||
AC_CACHE_VAL(ol_cv_pthread_create_works,[
|
||||
AC_TRY_RUN([
|
||||
|
@ -309,9 +309,6 @@
|
||||
/* Define if you have the snprintf function. */
|
||||
#undef HAVE_SNPRINTF
|
||||
|
||||
/* Define if you have the socket function. */
|
||||
#undef HAVE_SOCKET
|
||||
|
||||
/* Define if you have the strdup function. */
|
||||
#undef HAVE_STRDUP
|
||||
|
||||
@ -630,15 +627,15 @@
|
||||
/* define if pthreads API compatible with draft4 spec */
|
||||
#undef HAVE_PTHREADS_D4
|
||||
|
||||
/* define if you have LinuxThreads */
|
||||
#undef HAVE_LINUX_THREADS
|
||||
|
||||
/* define if you have POSIX Threads */
|
||||
#undef HAVE_PTHREADS
|
||||
|
||||
/* define if you have pthread_detach function */
|
||||
#undef HAVE_PTHREAD_DETACH
|
||||
|
||||
/* define if you have LinuxThreads */
|
||||
#undef HAVE_LINUX_THREADS
|
||||
|
||||
/* define if you have Mach Cthreads */
|
||||
#undef HAVE_MACH_CTHREADS
|
||||
|
||||
@ -651,6 +648,9 @@
|
||||
/* define if select implicitly yields */
|
||||
#undef HAVE_YIELDING_SELECT
|
||||
|
||||
/* define if you have LinuxThreads */
|
||||
#undef HAVE_LINUX_THREADS
|
||||
|
||||
/* define if you have (or want) no threads */
|
||||
#undef NO_THREADS
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user