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
|
||||||
dnl --------------------------------------------------------------------
|
dnl ====================================================================
|
||||||
dnl Check LinuxThread
|
dnl Check LinuxThread Header
|
||||||
dnl
|
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 'no' implies pthreads.h is not LinuxThreads or pthreads.h
|
||||||
dnl doesn't exists. Existance of pthread.h should separately
|
dnl doesn't exists. Existance of pthread.h should separately
|
||||||
dnl checked.
|
dnl checked.
|
||||||
dnl
|
dnl
|
||||||
AC_DEFUN([OL_LINUX_THREADS],
|
AC_DEFUN([OL_HEADER_LINUX_THREADS], [
|
||||||
[
|
AC_CACHE_CHECK([for LinuxThreads pthread.h],
|
||||||
AC_CACHE_CHECK([for LinuxThreads], [ol_cv_linux_threads], [
|
[ol_cv_header_linux_threads],
|
||||||
res=`grep Linuxthreads /usr/include/pthread.h 2>/dev/null | wc -l`
|
[
|
||||||
if test "$res" -gt 0 ; then
|
AC_EGREP_CPP(pthread_kill_other_threads_np,
|
||||||
ol_cv_linux_threads=yes
|
[#include <pthread.h>],
|
||||||
else
|
[ol_cv_header_linux_threads=yes],
|
||||||
ol_cv_linux_threads=no
|
[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
|
fi
|
||||||
])
|
|
||||||
])dnl
|
])dnl
|
||||||
dnl
|
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
|
# consider threads found
|
||||||
ol_with_threads=found
|
ol_with_threads=found
|
||||||
|
|
||||||
OL_LINUX_THREADS
|
OL_HEADER_LINUX_THREADS
|
||||||
|
|
||||||
if test $ol_cv_linux_threads = yes ; then
|
|
||||||
AC_DEFINE(HAVE_LINUX_THREADS,1,
|
|
||||||
[define if you have LinuxThreads])
|
|
||||||
fi
|
|
||||||
|
|
||||||
dnl Now the hard part, how to link?
|
dnl Now the hard part, how to link?
|
||||||
dnl
|
dnl
|
||||||
@ -1001,6 +996,13 @@ dnl fi
|
|||||||
thr_getconcurrency \
|
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_MSG_CHECKING([if pthread_create() works])
|
||||||
AC_CACHE_VAL(ol_cv_pthread_create_works,[
|
AC_CACHE_VAL(ol_cv_pthread_create_works,[
|
||||||
AC_TRY_RUN([
|
AC_TRY_RUN([
|
||||||
|
@ -309,9 +309,6 @@
|
|||||||
/* Define if you have the snprintf function. */
|
/* Define if you have the snprintf function. */
|
||||||
#undef HAVE_SNPRINTF
|
#undef HAVE_SNPRINTF
|
||||||
|
|
||||||
/* Define if you have the socket function. */
|
|
||||||
#undef HAVE_SOCKET
|
|
||||||
|
|
||||||
/* Define if you have the strdup function. */
|
/* Define if you have the strdup function. */
|
||||||
#undef HAVE_STRDUP
|
#undef HAVE_STRDUP
|
||||||
|
|
||||||
@ -630,15 +627,15 @@
|
|||||||
/* define if pthreads API compatible with draft4 spec */
|
/* define if pthreads API compatible with draft4 spec */
|
||||||
#undef HAVE_PTHREADS_D4
|
#undef HAVE_PTHREADS_D4
|
||||||
|
|
||||||
/* define if you have LinuxThreads */
|
|
||||||
#undef HAVE_LINUX_THREADS
|
|
||||||
|
|
||||||
/* define if you have POSIX Threads */
|
/* define if you have POSIX Threads */
|
||||||
#undef HAVE_PTHREADS
|
#undef HAVE_PTHREADS
|
||||||
|
|
||||||
/* define if you have pthread_detach function */
|
/* define if you have pthread_detach function */
|
||||||
#undef HAVE_PTHREAD_DETACH
|
#undef HAVE_PTHREAD_DETACH
|
||||||
|
|
||||||
|
/* define if you have LinuxThreads */
|
||||||
|
#undef HAVE_LINUX_THREADS
|
||||||
|
|
||||||
/* define if you have Mach Cthreads */
|
/* define if you have Mach Cthreads */
|
||||||
#undef HAVE_MACH_CTHREADS
|
#undef HAVE_MACH_CTHREADS
|
||||||
|
|
||||||
@ -651,6 +648,9 @@
|
|||||||
/* define if select implicitly yields */
|
/* define if select implicitly yields */
|
||||||
#undef HAVE_YIELDING_SELECT
|
#undef HAVE_YIELDING_SELECT
|
||||||
|
|
||||||
|
/* define if you have LinuxThreads */
|
||||||
|
#undef HAVE_LINUX_THREADS
|
||||||
|
|
||||||
/* define if you have (or want) no threads */
|
/* define if you have (or want) no threads */
|
||||||
#undef NO_THREADS
|
#undef NO_THREADS
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user