@@ -12880,13 +12880,17 @@ fi
12880
12880
if test "$with_ldap" = yes ; then
12881
12881
_LIBS="$LIBS"
12882
12882
if test "$PORTNAME" != "win32"; then
12883
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ldap_bind in -lldap" >&5
12884
- $as_echo_n "checking for ldap_bind in -lldap... " >&6; }
12885
- if ${ac_cv_lib_ldap_ldap_bind+:} false; 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
+ LIBS=""
12888
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing ldap_bind" >&5
12889
+ $as_echo_n "checking for library containing ldap_bind... " >&6; }
12890
+ if ${ac_cv_search_ldap_bind+:} false; then :
12886
12891
$as_echo_n "(cached) " >&6
12887
12892
else
12888
- ac_check_lib_save_LIBS=$LIBS
12889
- LIBS="-lldap $EXTRA_LDAP_LIBS $LIBS"
12893
+ ac_func_search_save_LIBS=$LIBS
12890
12894
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12891
12895
/* end confdefs.h. */
12892
12896
@@ -12905,38 +12909,50 @@ return ldap_bind ();
12905
12909
return 0;
12906
12910
}
12907
12911
_ACEOF
12908
- if ac_fn_c_try_link "$LINENO"; then :
12909
- ac_cv_lib_ldap_ldap_bind=yes
12910
- else
12911
- ac_cv_lib_ldap_ldap_bind=no
12912
+ for ac_lib in '' ldap_r ldap; do
12913
+ if test -z "$ac_lib"; then
12914
+ ac_res="none required"
12915
+ else
12916
+ ac_res=-l$ac_lib
12917
+ LIBS="-l$ac_lib $PTHREAD_CFLAGS $PTHREAD_LIBS $EXTRA_LDAP_LIBS $ac_func_search_save_LIBS"
12918
+ fi
12919
+ if ac_fn_c_try_link "$LINENO"; then :
12920
+ ac_cv_search_ldap_bind=$ac_res
12912
12921
fi
12913
12922
rm -f core conftest.err conftest.$ac_objext \
12914
- conftest$ac_exeext conftest.$ac_ext
12915
- LIBS=$ac_check_lib_save_LIBS
12923
+ conftest$ac_exeext
12924
+ if ${ac_cv_search_ldap_bind+:} false; then :
12925
+ break
12916
12926
fi
12917
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ldap_ldap_bind" >&5
12918
- $as_echo "$ac_cv_lib_ldap_ldap_bind" >&6; }
12919
- if test "x$ac_cv_lib_ldap_ldap_bind" = xyes; then :
12920
- cat >>confdefs.h <<_ACEOF
12921
- #define HAVE_LIBLDAP 1
12922
- _ACEOF
12927
+ done
12928
+ if ${ac_cv_search_ldap_bind+:} false; then :
12923
12929
12924
- LIBS="-lldap $LIBS"
12930
+ else
12931
+ ac_cv_search_ldap_bind=no
12932
+ fi
12933
+ rm conftest.$ac_ext
12934
+ LIBS=$ac_func_search_save_LIBS
12935
+ fi
12936
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_ldap_bind" >&5
12937
+ $as_echo "$ac_cv_search_ldap_bind" >&6; }
12938
+ ac_res=$ac_cv_search_ldap_bind
12939
+ if test "$ac_res" != no; then :
12940
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
12925
12941
12926
12942
else
12927
12943
as_fn_error $? "library 'ldap' is required for LDAP" "$LINENO" 5
12928
12944
fi
12929
12945
12930
- LDAP_LIBS_BE="-lldap $EXTRA_LDAP_LIBS"
12931
- if test "$enable_thread_safety" = yes; then
12932
- # on some platforms ldap_r fails to link without PTHREAD_LIBS
12933
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ldap_simple_bind in -lldap_r " >&5
12934
- $as_echo_n "checking for ldap_simple_bind in -lldap_r ... " >&6; }
12935
- if ${ac_cv_lib_ldap_r_ldap_simple_bind +:} false; then :
12946
+ LDAP_LIBS_FE="$LIBS $EXTRA_LDAP_LIBS"
12947
+ LDAP_LIBS_BE="-lldap $EXTRA_LDAP_LIBS"
12948
+ else
12949
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ldap_bind in -lldap " >&5
12950
+ $as_echo_n "checking for ldap_bind in -lldap ... " >&6; }
12951
+ if ${ac_cv_lib_ldap_ldap_bind +:} false; then :
12936
12952
$as_echo_n "(cached) " >&6
12937
12953
else
12938
12954
ac_check_lib_save_LIBS=$LIBS
12939
- LIBS="-lldap_r $PTHREAD_CFLAGS $PTHREAD_LIBS $EXTRA_LDAP_LIBS $LIBS"
12955
+ LIBS="-lldap $EXTRA_LDAP_LIBS $LIBS"
12940
12956
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12941
12957
/* end confdefs.h. */
12942
12958
@@ -12946,40 +12962,39 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12946
12962
#ifdef __cplusplus
12947
12963
extern "C"
12948
12964
#endif
12949
- char ldap_simple_bind ();
12965
+ char ldap_bind ();
12950
12966
int
12951
12967
main ()
12952
12968
{
12953
- return ldap_simple_bind ();
12969
+ return ldap_bind ();
12954
12970
;
12955
12971
return 0;
12956
12972
}
12957
12973
_ACEOF
12958
12974
if ac_fn_c_try_link "$LINENO"; then :
12959
- ac_cv_lib_ldap_r_ldap_simple_bind =yes
12975
+ ac_cv_lib_ldap_ldap_bind =yes
12960
12976
else
12961
- ac_cv_lib_ldap_r_ldap_simple_bind =no
12977
+ ac_cv_lib_ldap_ldap_bind =no
12962
12978
fi
12963
12979
rm -f core conftest.err conftest.$ac_objext \
12964
12980
conftest$ac_exeext conftest.$ac_ext
12965
12981
LIBS=$ac_check_lib_save_LIBS
12966
12982
fi
12967
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ldap_r_ldap_simple_bind " >&5
12968
- $as_echo "$ac_cv_lib_ldap_r_ldap_simple_bind " >&6; }
12969
- if test "x$ac_cv_lib_ldap_r_ldap_simple_bind " = xyes; then :
12983
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ldap_ldap_bind " >&5
12984
+ $as_echo "$ac_cv_lib_ldap_ldap_bind " >&6; }
12985
+ if test "x$ac_cv_lib_ldap_ldap_bind " = xyes; then :
12970
12986
cat >>confdefs.h <<_ACEOF
12971
- #define HAVE_LIBLDAP_R 1
12987
+ #define HAVE_LIBLDAP 1
12972
12988
_ACEOF
12973
12989
12974
- LIBS="-lldap_r $LIBS"
12990
+ LIBS="-lldap $LIBS"
12975
12991
12976
12992
else
12977
- as_fn_error $? "library 'ldap_r ' is required for LDAP" "$LINENO" 5
12993
+ as_fn_error $? "library 'ldap ' is required for LDAP" "$LINENO" 5
12978
12994
fi
12979
12995
12980
- LDAP_LIBS_FE="-lldap_r $EXTRA_LDAP_LIBS"
12981
- else
12982
12996
LDAP_LIBS_FE="-lldap $EXTRA_LDAP_LIBS"
12997
+ LDAP_LIBS_BE="-lldap $EXTRA_LDAP_LIBS"
12983
12998
fi
12984
12999
for ac_func in ldap_initialize
12985
13000
do :
0 commit comments