@@ -12876,22 +12876,18 @@ fi
1287612876
1287712877fi
1287812878
12879- # Note: We can test for libldap_r only after we know PTHREAD_LIBS
12879+ # Note: We can test for libldap_r only after we know PTHREAD_LIBS;
12880+ # also, on AIX, we may need to have openssl in LIBS for this step.
1288012881if test "$with_ldap" = yes ; then
1288112882 _LIBS="$LIBS"
1288212883 if test "$PORTNAME" != "win32"; then
12883- if test "$enable_thread_safety" = yes; then
12884- # Use ldap_r for FE if available, else assume ldap is thread-safe.
12885- # If ldap_r does exist, assume without checking that ldap does too.
12886- # On some platforms ldap_r fails to link without PTHREAD_LIBS;
12887- # also, on AIX we must probe ldap_simple_bind not ldap_bind.
12888- LIBS=""
12889- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing ldap_simple_bind" >&5
12890- $as_echo_n "checking for library containing ldap_simple_bind... " >&6; }
12891- if ${ac_cv_search_ldap_simple_bind+:} false; then :
12884+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ldap_bind in -lldap" >&5
12885+ $as_echo_n "checking for ldap_bind in -lldap... " >&6; }
12886+ if ${ac_cv_lib_ldap_ldap_bind+:} false; then :
1289212887 $as_echo_n "(cached) " >&6
1289312888else
12894- ac_func_search_save_LIBS=$LIBS
12889+ ac_check_lib_save_LIBS=$LIBS
12890+ LIBS="-lldap $EXTRA_LDAP_LIBS $LIBS"
1289512891cat confdefs.h - <<_ACEOF >conftest.$ac_ext
1289612892/* end confdefs.h. */
1289712893
@@ -12901,59 +12897,49 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
1290112897#ifdef __cplusplus
1290212898extern "C"
1290312899#endif
12904- charldap_simple_bind ();
12900+ charldap_bind ();
1290512901int
1290612902main ()
1290712903{
12908- returnldap_simple_bind ();
12904+ returnldap_bind ();
1290912905 ;
1291012906 return 0;
1291112907}
1291212908_ACEOF
12913- for ac_lib in '' ldap_r ldap; do
12914- if test -z "$ac_lib"; then
12915- ac_res="none required"
12916- else
12917- ac_res=-l$ac_lib
12918- LIBS="-l$ac_lib $PTHREAD_CFLAGS $PTHREAD_LIBS $EXTRA_LDAP_LIBS $ac_func_search_save_LIBS"
12919- fi
12920- if ac_fn_c_try_link "$LINENO"; then :
12921- ac_cv_search_ldap_simple_bind=$ac_res
12909+ if ac_fn_c_try_link "$LINENO"; then :
12910+ ac_cv_lib_ldap_ldap_bind=yes
12911+ else
12912+ ac_cv_lib_ldap_ldap_bind=no
1292212913fi
1292312914rm -f core conftest.err conftest.$ac_objext \
12924- conftest$ac_exeext
12925- if ${ac_cv_search_ldap_simple_bind+:} false; then :
12926- break
12915+ conftest$ac_exeext conftest.$ac_ext
12916+ LIBS=$ac_check_lib_save_LIBS
1292712917fi
12928- done
12929- if ${ac_cv_search_ldap_simple_bind+:} false; then :
12918+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ldap_ldap_bind" >&5
12919+ $as_echo "$ac_cv_lib_ldap_ldap_bind" >&6; }
12920+ if test "x$ac_cv_lib_ldap_ldap_bind" = xyes; then :
12921+ cat >>confdefs.h <<_ACEOF
12922+ #define HAVE_LIBLDAP 1
12923+ _ACEOF
1293012924
12931- else
12932- ac_cv_search_ldap_simple_bind=no
12933- fi
12934- rm conftest.$ac_ext
12935- LIBS=$ac_func_search_save_LIBS
12936- fi
12937- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_ldap_simple_bind" >&5
12938- $as_echo "$ac_cv_search_ldap_simple_bind" >&6; }
12939- ac_res=$ac_cv_search_ldap_simple_bind
12940- if test "$ac_res" != no; then :
12941- test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
12925+ LIBS="-lldap $LIBS"
1294212926
1294312927else
1294412928 as_fn_error $? "library 'ldap' is required for LDAP" "$LINENO" 5
1294512929fi
1294612930
12947- LDAP_LIBS_FE="$LIBS $EXTRA_LDAP_LIBS"
12948- LDAP_LIBS_BE="-lldap $EXTRA_LDAP_LIBS"
12949- else
12950- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ldap_bind in -lldap" >&5
12951- $as_echo_n "checking for ldap_bind in -lldap... " >&6; }
12952- if ${ac_cv_lib_ldap_ldap_bind+:} false; then :
12931+ LDAP_LIBS_BE="-lldap $EXTRA_LDAP_LIBS"
12932+ if test "$enable_thread_safety" = yes; then
12933+ # Use ldap_r for FE if available, else assume ldap is thread-safe.
12934+ # On some platforms ldap_r fails to link without PTHREAD_LIBS.
12935+ LIBS="$_LIBS"
12936+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ldap_bind in -lldap_r" >&5
12937+ $as_echo_n "checking for ldap_bind in -lldap_r... " >&6; }
12938+ if ${ac_cv_lib_ldap_r_ldap_bind+:} false; then :
1295312939 $as_echo_n "(cached) " >&6
1295412940else
1295512941 ac_check_lib_save_LIBS=$LIBS
12956- LIBS="-lldap $EXTRA_LDAP_LIBS $LIBS"
12942+ LIBS="-lldap_r $PTHREAD_CFLAGS $PTHREAD_LIBS $EXTRA_LDAP_LIBS $LIBS"
1295712943cat confdefs.h - <<_ACEOF >conftest.$ac_ext
1295812944/* end confdefs.h. */
1295912945
@@ -12973,29 +12959,24 @@ return ldap_bind ();
1297312959}
1297412960_ACEOF
1297512961if ac_fn_c_try_link "$LINENO"; then :
12976- ac_cv_lib_ldap_ldap_bind =yes
12962+ ac_cv_lib_ldap_r_ldap_bind =yes
1297712963else
12978- ac_cv_lib_ldap_ldap_bind =no
12964+ ac_cv_lib_ldap_r_ldap_bind =no
1297912965fi
1298012966rm -f core conftest.err conftest.$ac_objext \
1298112967 conftest$ac_exeext conftest.$ac_ext
1298212968LIBS=$ac_check_lib_save_LIBS
1298312969fi
12984- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ldap_ldap_bind" >&5
12985- $as_echo "$ac_cv_lib_ldap_ldap_bind" >&6; }
12986- if test "x$ac_cv_lib_ldap_ldap_bind" = xyes; then :
12987- cat >>confdefs.h <<_ACEOF
12988- #define HAVE_LIBLDAP 1
12989- _ACEOF
12990-
12991- LIBS="-lldap $LIBS"
12992-
12970+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ldap_r_ldap_bind" >&5
12971+ $as_echo "$ac_cv_lib_ldap_r_ldap_bind" >&6; }
12972+ if test "x$ac_cv_lib_ldap_r_ldap_bind" = xyes; then :
12973+ LDAP_LIBS_FE="-lldap_r $EXTRA_LDAP_LIBS"
1299312974else
12994- as_fn_error $? "library 'ldap' is required for LDAP" "$LINENO" 5
12975+ LDAP_LIBS_FE="-lldap $EXTRA_LDAP_LIBS"
1299512976fi
1299612977
12978+ else
1299712979 LDAP_LIBS_FE="-lldap $EXTRA_LDAP_LIBS"
12998- LDAP_LIBS_BE="-lldap $EXTRA_LDAP_LIBS"
1299912980 fi
1300012981 for ac_func in ldap_initialize
1300112982do :