Commit 73b4170a authored by Kurt Zeilenga's avatar Kurt Zeilenga
Browse files

Rework libldap to not attempt to set LDAP_API_FEATURE_X_OPENLDAP_THREAD_SAFE

parent daf7d0c0
This diff is collapsed.
......@@ -1313,47 +1313,6 @@ if test $ol_enable_lmpasswd != no; then
AC_DEFINE(SLAPD_LMHASH, 1, [define to support LAN Manager passwords])
fi
dnl ----------------------------------------------------------------
dnl Tests for reentrant functions necessary to build a
dnl thread_safe -lldap.
AC_CHECK_FUNCS( \
ctime_r \
gethostbyname_r gethostbyaddr_r \
)
if test "$ac_cv_func_ctime_r" = no ; then
ol_cv_func_ctime_r_nargs=0
else
OL_FUNC_CTIME_R_NARGS
dnl OL_FUNC_CTIME_R_TYPE
fi
if test "$ac_cv_func_gethostbyname_r" = yes ; then
OL_FUNC_GETHOSTBYNAME_R_NARGS
else
ol_cv_func_gethostbyname_r_nargs=0
fi
if test "$ac_cv_func_gethostbyaddr_r" = yes ; then
OL_FUNC_GETHOSTBYADDR_R_NARGS
else
ol_cv_func_gethostbyaddr_r_nargs=0
fi
if test "$ac_cv_func_ctime_r" = yes \
-a "$ol_cv_func_ctime_r_nargs" -ge 2 \
-a "$ol_cv_func_ctime_r_nargs" -le 3 \
-a "$ac_cv_func_gethostbyname_r" = yes \
-a "$ol_cv_func_gethostbyname_r_nargs" -ge 5 \
-a "$ol_cv_func_gethostbyname_r_nargs" -le 6 \
-a "$ac_cv_func_gethostbyaddr_r" = yes \
-a "$ol_cv_func_gethostbyaddr_r_nargs" -ge 5 \
-a "$ol_cv_func_gethostbyaddr_r_nargs" -le 6 \
; then
AC_DEFINE(LDAP_API_FEATURE_X_OPENLDAP_REENTRANT,1)
fi
dnl ----------------------------------------------------------------
dnl Threads?
ol_link_threads=no
......@@ -1854,8 +1813,7 @@ if test $ol_link_threads != no -a $ol_link_threads != nt ; then
fi
dnl When in thread environment, use
dnl #if defined( HAVE_REENTRANT_FUNCTIONS ) \
dnl || defined( HAVE_FUNC_R )
dnl #if defined( HAVE_REENTRANT_FUNCTIONS ) || defined( HAVE_FUNC_R )
dnl func_r(...);
dnl #else
dnl # if defined( HAVE_THREADS )
......@@ -1872,14 +1830,14 @@ dnl _POSIX_REENTRANT_FUNCTIONS
dnl _POSIX_THREAD_SAFE_FUNCTIONS
dnl _POSIX_THREADSAFE_FUNCTIONS
dnl
dnl and is currently defined in lthread.h
dnl and is currently defined in <ldap_pvt_thread.h>
dnl
dnl HAVE_THREADS is defined by lthread.h iff -UNO_THREADS
dnl HAVE_THREADS is defined by <ldap_pvt_thread.h> iff -UNO_THREADS
dnl
dnl libldap/*.c should only include <lthread.h> iff
dnl libldap/*.c should only include <ldap_pvt_thread.h> iff
dnl LDAP_R_COMPILE is defined. ie:
dnl #ifdef LDAP_R_COMPILE
dnl # include LDAP_R_COMPILE
dnl # include <ldap_pvt_thread.h>
dnl #endif
dnl
dnl LDAP_R_COMPILE is defined by libldap_r/Makefile.in
......@@ -1924,6 +1882,32 @@ if test $ol_link_threads != no ; then
AC_DEFINE(LDAP_API_FEATURE_X_OPENLDAP_THREAD_SAFE,1)
fi
dnl ----------------------------------------------------------------
dnl Tests for reentrant functions necessary to build -lldap_r
AC_CHECK_FUNCS( \
ctime_r \
gethostbyname_r gethostbyaddr_r \
)
if test "$ac_cv_func_ctime_r" = no ; then
ol_cv_func_ctime_r_nargs=0
else
OL_FUNC_CTIME_R_NARGS
dnl OL_FUNC_CTIME_R_TYPE
fi
if test "$ac_cv_func_gethostbyname_r" = yes ; then
OL_FUNC_GETHOSTBYNAME_R_NARGS
else
ol_cv_func_gethostbyname_r_nargs=0
fi
if test "$ac_cv_func_gethostbyaddr_r" = yes ; then
OL_FUNC_GETHOSTBYADDR_R_NARGS
else
ol_cv_func_gethostbyaddr_r_nargs=0
fi
dnl ----------------------------------------------------------------
ol_link_ldbm=no
......
......@@ -29,15 +29,11 @@
** OpenLDAP reentrancy/thread-safeness should be dynamically
** checked using ldap_get_option().
**
** The -lldap implementation may or may not be:
** LDAP_API_FEATURE_THREAD_SAFE
** The -lldap implementation is not thread-safe.
**
** The preprocessor flag LDAP_API_FEATURE_X_OPENLDAP_REENTRANT can
** be used to determine if -lldap is LDAP_API_FEATURE_THREAD_SAFE at
** compile time.
**
** The -lldap_r implementation is always THREAD_SAFE but
** may also be:
** The -lldap_r implementation is:
** LDAP_API_FEATURE_THREAD_SAFE (basic thread safety)
** but also be:
** LDAP_API_FEATURE_SESSION_THREAD_SAFE
** LDAP_API_FEATURE_OPERATION_THREAD_SAFE
**
......@@ -52,10 +48,7 @@
**
*/
/* is -lldap reentrant or not */
#undef LDAP_API_FEATURE_X_OPENLDAP_REENTRANT
/* is threadsafe version of -lldap (ie: -lldap_r) *available* or not */
/* is -lldap_r available or not */
#undef LDAP_API_FEATURE_X_OPENLDAP_THREAD_SAFE
/* LDAP v2 Kerberos Bind */
......
......@@ -184,7 +184,6 @@ ldap_pvt_thread_pool_setkey LDAP_P((
void *data,
ldap_pvt_thread_pool_keyfree_t *kfree ));
LDAP_END_DECL
#endif /* _LDAP_THREAD_H */
......@@ -698,15 +698,6 @@
/* define to support LAN Manager passwords */
#undef SLAPD_LMHASH
/* set to the number of arguments ctime_r() expects */
#undef CTIME_R_NARGS
/* set to the number of arguments gethostbyname_r() expects */
#undef GETHOSTBYNAME_R_NARGS
/* set to the number of arguments gethostbyaddr_r() expects */
#undef GETHOSTBYADDR_R_NARGS
/* if you have NT Threads */
#undef HAVE_NT_THREADS
......@@ -749,6 +740,15 @@
/* define if you have (or want) no threads */
#undef NO_THREADS
/* set to the number of arguments ctime_r() expects */
#undef CTIME_R_NARGS
/* set to the number of arguments gethostbyname_r() expects */
#undef GETHOSTBYNAME_R_NARGS
/* set to the number of arguments gethostbyaddr_r() expects */
#undef GETHOSTBYADDR_R_NARGS
/* define if Berkeley DB has DB_THREAD support */
#undef HAVE_BERKELEY_DB_THREAD
......
This diff is collapsed.
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment