mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-12-20 22:59:34 -05:00
Add check to see if errno is always thread specific.
If it is not, then everything must use threading libraries.
This commit is contained in:
parent
e4a210b017
commit
d0942df6c9
2 changed files with 224 additions and 169 deletions
27
configure.in
27
configure.in
|
|
@ -667,16 +667,33 @@ if test $ol_with_threads = manual ; then
|
|||
AC_CHECK_HEADERS(thread.h synch.h)
|
||||
fi
|
||||
|
||||
if test $ol_with_threads != no ; then
|
||||
if test $ol_with_threads != no ; then
|
||||
dnl needed to get reentrant/threadsafe versions
|
||||
dnl
|
||||
dnl hopefully this will not cause problems with
|
||||
dnl non-threaded apps
|
||||
dnl
|
||||
AC_DEFINE(_REENTRANT,1)
|
||||
AC_DEFINE(_THREAD_SAFE,1)
|
||||
AC_DEFINE(_THREADSAFE,1)
|
||||
fi
|
||||
|
||||
dnl this might cause the errno symbol to be
|
||||
dnl replaced with a function to get a thread specific errno.
|
||||
dnl check to see if everything needs to be compiled
|
||||
dnl with the thread libraries
|
||||
AC_CACHE_CHECK([for thread specific errno],
|
||||
[ol_cv_errno_thread_specific], [
|
||||
AC_TRY_LINK([
|
||||
#include <errno.h>
|
||||
], [
|
||||
int x = errno;
|
||||
],
|
||||
[ol_cv_errno_thread_specific=yes],
|
||||
[ol_cv_errno_thread_specific=no])
|
||||
])
|
||||
|
||||
if test $ol_cv_errno_thread_specific != yes ; then
|
||||
LIBS="$LTHREAD_LIBS $LIBS"
|
||||
LTHREAD_LIBS=""
|
||||
fi
|
||||
fi
|
||||
|
||||
dnl ----------------------------------------------------------------
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue