@@ -12460,13 +12460,17 @@ fi
12460
12460
if test "$with_ldap" = yes ; then
12461
12461
_LIBS="$LIBS"
12462
12462
if test "$PORTNAME" != "win32"; then
12463
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ldap_bind in -lldap" >&5
12464
- $as_echo_n "checking for ldap_bind in -lldap... " >&6; }
12465
- if ${ac_cv_lib_ldap_ldap_bind+:} false; then :
12463
+ if test "$enable_thread_safety" = yes; then
12464
+ # Use ldap_r for FE if available, else assume ldap is thread-safe.
12465
+ # If ldap_r does exist, assume without checking that ldap does too.
12466
+ # on some platforms ldap_r fails to link without PTHREAD_LIBS
12467
+ LIBS=""
12468
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing ldap_bind" >&5
12469
+ $as_echo_n "checking for library containing ldap_bind... " >&6; }
12470
+ if ${ac_cv_search_ldap_bind+:} false; then :
12466
12471
$as_echo_n "(cached) " >&6
12467
12472
else
12468
- ac_check_lib_save_LIBS=$LIBS
12469
- LIBS="-lldap $EXTRA_LDAP_LIBS $LIBS"
12473
+ ac_func_search_save_LIBS=$LIBS
12470
12474
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12471
12475
/* end confdefs.h. */
12472
12476
@@ -12485,38 +12489,50 @@ return ldap_bind ();
12485
12489
return 0;
12486
12490
}
12487
12491
_ACEOF
12488
- if ac_fn_c_try_link "$LINENO"; then :
12489
- ac_cv_lib_ldap_ldap_bind=yes
12490
- else
12491
- ac_cv_lib_ldap_ldap_bind=no
12492
+ for ac_lib in '' ldap_r ldap; do
12493
+ if test -z "$ac_lib"; then
12494
+ ac_res="none required"
12495
+ else
12496
+ ac_res=-l$ac_lib
12497
+ LIBS="-l$ac_lib $PTHREAD_CFLAGS $PTHREAD_LIBS $EXTRA_LDAP_LIBS $ac_func_search_save_LIBS"
12498
+ fi
12499
+ if ac_fn_c_try_link "$LINENO"; then :
12500
+ ac_cv_search_ldap_bind=$ac_res
12492
12501
fi
12493
12502
rm -f core conftest.err conftest.$ac_objext \
12494
- conftest$ac_exeext conftest.$ac_ext
12495
- LIBS=$ac_check_lib_save_LIBS
12503
+ conftest$ac_exeext
12504
+ if ${ac_cv_search_ldap_bind+:} false; then :
12505
+ break
12496
12506
fi
12497
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ldap_ldap_bind" >&5
12498
- $as_echo "$ac_cv_lib_ldap_ldap_bind" >&6; }
12499
- if test "x$ac_cv_lib_ldap_ldap_bind" = xyes; then :
12500
- cat >>confdefs.h <<_ACEOF
12501
- #define HAVE_LIBLDAP 1
12502
- _ACEOF
12507
+ done
12508
+ if ${ac_cv_search_ldap_bind+:} false; then :
12503
12509
12504
- LIBS="-lldap $LIBS"
12510
+ else
12511
+ ac_cv_search_ldap_bind=no
12512
+ fi
12513
+ rm conftest.$ac_ext
12514
+ LIBS=$ac_func_search_save_LIBS
12515
+ fi
12516
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_ldap_bind" >&5
12517
+ $as_echo "$ac_cv_search_ldap_bind" >&6; }
12518
+ ac_res=$ac_cv_search_ldap_bind
12519
+ if test "$ac_res" != no; then :
12520
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
12505
12521
12506
12522
else
12507
12523
as_fn_error $? "library 'ldap' is required for LDAP" "$LINENO" 5
12508
12524
fi
12509
12525
12510
- LDAP_LIBS_BE="-lldap $EXTRA_LDAP_LIBS"
12511
- if test "$enable_thread_safety" = yes; then
12512
- # on some platforms ldap_r fails to link without PTHREAD_LIBS
12513
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ldap_simple_bind in -lldap_r " >&5
12514
- $as_echo_n "checking for ldap_simple_bind in -lldap_r ... " >&6; }
12515
- if ${ac_cv_lib_ldap_r_ldap_simple_bind +:} false; then :
12526
+ LDAP_LIBS_FE="$LIBS $EXTRA_LDAP_LIBS"
12527
+ LDAP_LIBS_BE="-lldap $EXTRA_LDAP_LIBS"
12528
+ else
12529
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ldap_bind in -lldap " >&5
12530
+ $as_echo_n "checking for ldap_bind in -lldap ... " >&6; }
12531
+ if ${ac_cv_lib_ldap_ldap_bind +:} false; then :
12516
12532
$as_echo_n "(cached) " >&6
12517
12533
else
12518
12534
ac_check_lib_save_LIBS=$LIBS
12519
- LIBS="-lldap_r $PTHREAD_CFLAGS $PTHREAD_LIBS $EXTRA_LDAP_LIBS $LIBS"
12535
+ LIBS="-lldap $EXTRA_LDAP_LIBS $LIBS"
12520
12536
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12521
12537
/* end confdefs.h. */
12522
12538
@@ -12526,40 +12542,39 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12526
12542
#ifdef __cplusplus
12527
12543
extern "C"
12528
12544
#endif
12529
- char ldap_simple_bind ();
12545
+ char ldap_bind ();
12530
12546
int
12531
12547
main ()
12532
12548
{
12533
- return ldap_simple_bind ();
12549
+ return ldap_bind ();
12534
12550
;
12535
12551
return 0;
12536
12552
}
12537
12553
_ACEOF
12538
12554
if ac_fn_c_try_link "$LINENO"; then :
12539
- ac_cv_lib_ldap_r_ldap_simple_bind =yes
12555
+ ac_cv_lib_ldap_ldap_bind =yes
12540
12556
else
12541
- ac_cv_lib_ldap_r_ldap_simple_bind =no
12557
+ ac_cv_lib_ldap_ldap_bind =no
12542
12558
fi
12543
12559
rm -f core conftest.err conftest.$ac_objext \
12544
12560
conftest$ac_exeext conftest.$ac_ext
12545
12561
LIBS=$ac_check_lib_save_LIBS
12546
12562
fi
12547
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ldap_r_ldap_simple_bind " >&5
12548
- $as_echo "$ac_cv_lib_ldap_r_ldap_simple_bind " >&6; }
12549
- if test "x$ac_cv_lib_ldap_r_ldap_simple_bind " = xyes; then :
12563
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ldap_ldap_bind " >&5
12564
+ $as_echo "$ac_cv_lib_ldap_ldap_bind " >&6; }
12565
+ if test "x$ac_cv_lib_ldap_ldap_bind " = xyes; then :
12550
12566
cat >>confdefs.h <<_ACEOF
12551
- #define HAVE_LIBLDAP_R 1
12567
+ #define HAVE_LIBLDAP 1
12552
12568
_ACEOF
12553
12569
12554
- LIBS="-lldap_r $LIBS"
12570
+ LIBS="-lldap $LIBS"
12555
12571
12556
12572
else
12557
- as_fn_error $? "library 'ldap_r ' is required for LDAP" "$LINENO" 5
12573
+ as_fn_error $? "library 'ldap ' is required for LDAP" "$LINENO" 5
12558
12574
fi
12559
12575
12560
- LDAP_LIBS_FE="-lldap_r $EXTRA_LDAP_LIBS"
12561
- else
12562
12576
LDAP_LIBS_FE="-lldap $EXTRA_LDAP_LIBS"
12577
+ LDAP_LIBS_BE="-lldap $EXTRA_LDAP_LIBS"
12563
12578
fi
12564
12579
for ac_func in ldap_initialize
12565
12580
do :
0 commit comments