@@ -12876,22 +12876,18 @@ fi
12876
12876
12877
12877
fi
12878
12878
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.
12880
12881
if test "$with_ldap" = yes ; then
12881
12882
_LIBS="$LIBS"
12882
12883
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 :
12892
12887
$as_echo_n "(cached) " >&6
12893
12888
else
12894
- ac_func_search_save_LIBS=$LIBS
12889
+ ac_check_lib_save_LIBS=$LIBS
12890
+ LIBS="-lldap $EXTRA_LDAP_LIBS $LIBS"
12895
12891
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12896
12892
/* end confdefs.h. */
12897
12893
@@ -12901,59 +12897,49 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12901
12897
#ifdef __cplusplus
12902
12898
extern "C"
12903
12899
#endif
12904
- char ldap_simple_bind ();
12900
+ char ldap_bind ();
12905
12901
int
12906
12902
main ()
12907
12903
{
12908
- return ldap_simple_bind ();
12904
+ return ldap_bind ();
12909
12905
;
12910
12906
return 0;
12911
12907
}
12912
12908
_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
12922
12913
fi
12923
12914
rm -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
12927
12917
fi
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
12930
12924
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"
12942
12926
12943
12927
else
12944
12928
as_fn_error $? "library 'ldap' is required for LDAP" "$LINENO" 5
12945
12929
fi
12946
12930
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 :
12953
12939
$as_echo_n "(cached) " >&6
12954
12940
else
12955
12941
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"
12957
12943
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12958
12944
/* end confdefs.h. */
12959
12945
@@ -12973,29 +12959,24 @@ return ldap_bind ();
12973
12959
}
12974
12960
_ACEOF
12975
12961
if ac_fn_c_try_link "$LINENO"; then :
12976
- ac_cv_lib_ldap_ldap_bind =yes
12962
+ ac_cv_lib_ldap_r_ldap_bind =yes
12977
12963
else
12978
- ac_cv_lib_ldap_ldap_bind =no
12964
+ ac_cv_lib_ldap_r_ldap_bind =no
12979
12965
fi
12980
12966
rm -f core conftest.err conftest.$ac_objext \
12981
12967
conftest$ac_exeext conftest.$ac_ext
12982
12968
LIBS=$ac_check_lib_save_LIBS
12983
12969
fi
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"
12993
12974
else
12994
- as_fn_error $? "library 'ldap' is required for LDAP" "$LINENO" 5
12975
+ LDAP_LIBS_FE="-lldap $EXTRA_LDAP_LIBS"
12995
12976
fi
12996
12977
12978
+ else
12997
12979
LDAP_LIBS_FE="-lldap $EXTRA_LDAP_LIBS"
12998
- LDAP_LIBS_BE="-lldap $EXTRA_LDAP_LIBS"
12999
12980
fi
13000
12981
for ac_func in ldap_initialize
13001
12982
do :
0 commit comments