@@ -12491,22 +12491,18 @@ fi
12491
12491
12492
12492
fi
12493
12493
12494
- # Note: We can test for libldap_r only after we know PTHREAD_LIBS
12494
+ # Note: We can test for libldap_r only after we know PTHREAD_LIBS;
12495
+ # also, on AIX, we may need to have openssl in LIBS for this step.
12495
12496
if test "$with_ldap" = yes ; then
12496
12497
_LIBS="$LIBS"
12497
12498
if test "$PORTNAME" != "win32"; then
12498
- if test "$enable_thread_safety" = yes; then
12499
- # Use ldap_r for FE if available, else assume ldap is thread-safe.
12500
- # If ldap_r does exist, assume without checking that ldap does too.
12501
- # On some platforms ldap_r fails to link without PTHREAD_LIBS;
12502
- # also, on AIX we must probe ldap_simple_bind not ldap_bind.
12503
- LIBS=""
12504
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing ldap_simple_bind" >&5
12505
- $as_echo_n "checking for library containing ldap_simple_bind... " >&6; }
12506
- if ${ac_cv_search_ldap_simple_bind+:} false; then :
12499
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ldap_bind in -lldap" >&5
12500
+ $as_echo_n "checking for ldap_bind in -lldap... " >&6; }
12501
+ if ${ac_cv_lib_ldap_ldap_bind+:} false; then :
12507
12502
$as_echo_n "(cached) " >&6
12508
12503
else
12509
- ac_func_search_save_LIBS=$LIBS
12504
+ ac_check_lib_save_LIBS=$LIBS
12505
+ LIBS="-lldap $EXTRA_LDAP_LIBS $LIBS"
12510
12506
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12511
12507
/* end confdefs.h. */
12512
12508
@@ -12516,59 +12512,49 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12516
12512
#ifdef __cplusplus
12517
12513
extern "C"
12518
12514
#endif
12519
- char ldap_simple_bind ();
12515
+ char ldap_bind ();
12520
12516
int
12521
12517
main ()
12522
12518
{
12523
- return ldap_simple_bind ();
12519
+ return ldap_bind ();
12524
12520
;
12525
12521
return 0;
12526
12522
}
12527
12523
_ACEOF
12528
- for ac_lib in '' ldap_r ldap; do
12529
- if test -z "$ac_lib"; then
12530
- ac_res="none required"
12531
- else
12532
- ac_res=-l$ac_lib
12533
- LIBS="-l$ac_lib $PTHREAD_CFLAGS $PTHREAD_LIBS $EXTRA_LDAP_LIBS $ac_func_search_save_LIBS"
12534
- fi
12535
- if ac_fn_c_try_link "$LINENO"; then :
12536
- ac_cv_search_ldap_simple_bind=$ac_res
12524
+ if ac_fn_c_try_link "$LINENO"; then :
12525
+ ac_cv_lib_ldap_ldap_bind=yes
12526
+ else
12527
+ ac_cv_lib_ldap_ldap_bind=no
12537
12528
fi
12538
12529
rm -f core conftest.err conftest.$ac_objext \
12539
- conftest$ac_exeext
12540
- if ${ac_cv_search_ldap_simple_bind+:} false; then :
12541
- break
12530
+ conftest$ac_exeext conftest.$ac_ext
12531
+ LIBS=$ac_check_lib_save_LIBS
12542
12532
fi
12543
- done
12544
- if ${ac_cv_search_ldap_simple_bind+:} false; then :
12533
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ldap_ldap_bind" >&5
12534
+ $as_echo "$ac_cv_lib_ldap_ldap_bind" >&6; }
12535
+ if test "x$ac_cv_lib_ldap_ldap_bind" = xyes; then :
12536
+ cat >>confdefs.h <<_ACEOF
12537
+ #define HAVE_LIBLDAP 1
12538
+ _ACEOF
12545
12539
12546
- else
12547
- ac_cv_search_ldap_simple_bind=no
12548
- fi
12549
- rm conftest.$ac_ext
12550
- LIBS=$ac_func_search_save_LIBS
12551
- fi
12552
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_ldap_simple_bind" >&5
12553
- $as_echo "$ac_cv_search_ldap_simple_bind" >&6; }
12554
- ac_res=$ac_cv_search_ldap_simple_bind
12555
- if test "$ac_res" != no; then :
12556
- test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
12540
+ LIBS="-lldap $LIBS"
12557
12541
12558
12542
else
12559
12543
as_fn_error $? "library 'ldap' is required for LDAP" "$LINENO" 5
12560
12544
fi
12561
12545
12562
- LDAP_LIBS_FE="$LIBS $EXTRA_LDAP_LIBS"
12563
- LDAP_LIBS_BE="-lldap $EXTRA_LDAP_LIBS"
12564
- else
12565
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ldap_bind in -lldap" >&5
12566
- $as_echo_n "checking for ldap_bind in -lldap... " >&6; }
12567
- if ${ac_cv_lib_ldap_ldap_bind+:} false; then :
12546
+ LDAP_LIBS_BE="-lldap $EXTRA_LDAP_LIBS"
12547
+ if test "$enable_thread_safety" = yes; then
12548
+ # Use ldap_r for FE if available, else assume ldap is thread-safe.
12549
+ # On some platforms ldap_r fails to link without PTHREAD_LIBS.
12550
+ LIBS="$_LIBS"
12551
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ldap_bind in -lldap_r" >&5
12552
+ $as_echo_n "checking for ldap_bind in -lldap_r... " >&6; }
12553
+ if ${ac_cv_lib_ldap_r_ldap_bind+:} false; then :
12568
12554
$as_echo_n "(cached) " >&6
12569
12555
else
12570
12556
ac_check_lib_save_LIBS=$LIBS
12571
- LIBS="-lldap $EXTRA_LDAP_LIBS $LIBS"
12557
+ LIBS="-lldap_r $PTHREAD_CFLAGS $PTHREAD_LIBS $EXTRA_LDAP_LIBS $LIBS"
12572
12558
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12573
12559
/* end confdefs.h. */
12574
12560
@@ -12588,29 +12574,24 @@ return ldap_bind ();
12588
12574
}
12589
12575
_ACEOF
12590
12576
if ac_fn_c_try_link "$LINENO"; then :
12591
- ac_cv_lib_ldap_ldap_bind =yes
12577
+ ac_cv_lib_ldap_r_ldap_bind =yes
12592
12578
else
12593
- ac_cv_lib_ldap_ldap_bind =no
12579
+ ac_cv_lib_ldap_r_ldap_bind =no
12594
12580
fi
12595
12581
rm -f core conftest.err conftest.$ac_objext \
12596
12582
conftest$ac_exeext conftest.$ac_ext
12597
12583
LIBS=$ac_check_lib_save_LIBS
12598
12584
fi
12599
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ldap_ldap_bind" >&5
12600
- $as_echo "$ac_cv_lib_ldap_ldap_bind" >&6; }
12601
- if test "x$ac_cv_lib_ldap_ldap_bind" = xyes; then :
12602
- cat >>confdefs.h <<_ACEOF
12603
- #define HAVE_LIBLDAP 1
12604
- _ACEOF
12605
-
12606
- LIBS="-lldap $LIBS"
12607
-
12585
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ldap_r_ldap_bind" >&5
12586
+ $as_echo "$ac_cv_lib_ldap_r_ldap_bind" >&6; }
12587
+ if test "x$ac_cv_lib_ldap_r_ldap_bind" = xyes; then :
12588
+ LDAP_LIBS_FE="-lldap_r $EXTRA_LDAP_LIBS"
12608
12589
else
12609
- as_fn_error $? "library 'ldap' is required for LDAP" "$LINENO" 5
12590
+ LDAP_LIBS_FE="-lldap $EXTRA_LDAP_LIBS"
12610
12591
fi
12611
12592
12593
+ else
12612
12594
LDAP_LIBS_FE="-lldap $EXTRA_LDAP_LIBS"
12613
- LDAP_LIBS_BE="-lldap $EXTRA_LDAP_LIBS"
12614
12595
fi
12615
12596
for ac_func in ldap_initialize
12616
12597
do :
0 commit comments