@@ -12114,22 +12114,18 @@ fi
12114
12114
12115
12115
fi
12116
12116
12117
- # Note: We can test for libldap_r only after we know PTHREAD_LIBS
12117
+ # Note: We can test for libldap_r only after we know PTHREAD_LIBS;
12118
+ # also, on AIX, we may need to have openssl in LIBS for this step.
12118
12119
if test "$with_ldap" = yes ; then
12119
12120
_LIBS="$LIBS"
12120
12121
if test "$PORTNAME" != "win32"; then
12121
- if test "$enable_thread_safety" = yes; then
12122
- # Use ldap_r for FE if available, else assume ldap is thread-safe.
12123
- # If ldap_r does exist, assume without checking that ldap does too.
12124
- # On some platforms ldap_r fails to link without PTHREAD_LIBS;
12125
- # also, on AIX we must probe ldap_simple_bind not ldap_bind.
12126
- LIBS=""
12127
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing ldap_simple_bind" >&5
12128
- $as_echo_n "checking for library containing ldap_simple_bind... " >&6; }
12129
- if ${ac_cv_search_ldap_simple_bind+:} false; then :
12122
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ldap_bind in -lldap" >&5
12123
+ $as_echo_n "checking for ldap_bind in -lldap... " >&6; }
12124
+ if ${ac_cv_lib_ldap_ldap_bind+:} false; then :
12130
12125
$as_echo_n "(cached) " >&6
12131
12126
else
12132
- ac_func_search_save_LIBS=$LIBS
12127
+ ac_check_lib_save_LIBS=$LIBS
12128
+ LIBS="-lldap $EXTRA_LDAP_LIBS $LIBS"
12133
12129
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12134
12130
/* end confdefs.h. */
12135
12131
@@ -12139,59 +12135,49 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12139
12135
#ifdef __cplusplus
12140
12136
extern "C"
12141
12137
#endif
12142
- charldap_simple_bind ();
12138
+ charldap_bind ();
12143
12139
int
12144
12140
main ()
12145
12141
{
12146
- returnldap_simple_bind ();
12142
+ returnldap_bind ();
12147
12143
;
12148
12144
return 0;
12149
12145
}
12150
12146
_ACEOF
12151
- for ac_lib in '' ldap_r ldap; do
12152
- if test -z "$ac_lib"; then
12153
- ac_res="none required"
12154
- else
12155
- ac_res=-l$ac_lib
12156
- LIBS="-l$ac_lib $PTHREAD_CFLAGS $PTHREAD_LIBS $EXTRA_LDAP_LIBS $ac_func_search_save_LIBS"
12157
- fi
12158
- if ac_fn_c_try_link "$LINENO"; then :
12159
- ac_cv_search_ldap_simple_bind=$ac_res
12147
+ if ac_fn_c_try_link "$LINENO"; then :
12148
+ ac_cv_lib_ldap_ldap_bind=yes
12149
+ else
12150
+ ac_cv_lib_ldap_ldap_bind=no
12160
12151
fi
12161
12152
rm -f core conftest.err conftest.$ac_objext \
12162
- conftest$ac_exeext
12163
- if ${ac_cv_search_ldap_simple_bind+:} false; then :
12164
- break
12153
+ conftest$ac_exeext conftest.$ac_ext
12154
+ LIBS=$ac_check_lib_save_LIBS
12165
12155
fi
12166
- done
12167
- if ${ac_cv_search_ldap_simple_bind+:} false; then :
12156
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ldap_ldap_bind" >&5
12157
+ $as_echo "$ac_cv_lib_ldap_ldap_bind" >&6; }
12158
+ if test "x$ac_cv_lib_ldap_ldap_bind" = xyes; then :
12159
+ cat >>confdefs.h <<_ACEOF
12160
+ #define HAVE_LIBLDAP 1
12161
+ _ACEOF
12168
12162
12169
- else
12170
- ac_cv_search_ldap_simple_bind=no
12171
- fi
12172
- rm conftest.$ac_ext
12173
- LIBS=$ac_func_search_save_LIBS
12174
- fi
12175
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_ldap_simple_bind" >&5
12176
- $as_echo "$ac_cv_search_ldap_simple_bind" >&6; }
12177
- ac_res=$ac_cv_search_ldap_simple_bind
12178
- if test "$ac_res" != no; then :
12179
- test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
12163
+ LIBS="-lldap $LIBS"
12180
12164
12181
12165
else
12182
12166
as_fn_error $? "library 'ldap' is required for LDAP" "$LINENO" 5
12183
12167
fi
12184
12168
12185
- LDAP_LIBS_FE="$LIBS $EXTRA_LDAP_LIBS"
12186
- LDAP_LIBS_BE="-lldap $EXTRA_LDAP_LIBS"
12187
- else
12188
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ldap_bind in -lldap" >&5
12189
- $as_echo_n "checking for ldap_bind in -lldap... " >&6; }
12190
- if ${ac_cv_lib_ldap_ldap_bind+:} false; then :
12169
+ LDAP_LIBS_BE="-lldap $EXTRA_LDAP_LIBS"
12170
+ if test "$enable_thread_safety" = yes; then
12171
+ # Use ldap_r for FE if available, else assume ldap is thread-safe.
12172
+ # On some platforms ldap_r fails to link without PTHREAD_LIBS.
12173
+ LIBS="$_LIBS"
12174
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ldap_bind in -lldap_r" >&5
12175
+ $as_echo_n "checking for ldap_bind in -lldap_r... " >&6; }
12176
+ if ${ac_cv_lib_ldap_r_ldap_bind+:} false; then :
12191
12177
$as_echo_n "(cached) " >&6
12192
12178
else
12193
12179
ac_check_lib_save_LIBS=$LIBS
12194
- LIBS="-lldap $EXTRA_LDAP_LIBS $LIBS"
12180
+ LIBS="-lldap_r $PTHREAD_CFLAGS $PTHREAD_LIBS $EXTRA_LDAP_LIBS $LIBS"
12195
12181
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12196
12182
/* end confdefs.h. */
12197
12183
@@ -12211,29 +12197,24 @@ return ldap_bind ();
12211
12197
}
12212
12198
_ACEOF
12213
12199
if ac_fn_c_try_link "$LINENO"; then :
12214
- ac_cv_lib_ldap_ldap_bind =yes
12200
+ ac_cv_lib_ldap_r_ldap_bind =yes
12215
12201
else
12216
- ac_cv_lib_ldap_ldap_bind =no
12202
+ ac_cv_lib_ldap_r_ldap_bind =no
12217
12203
fi
12218
12204
rm -f core conftest.err conftest.$ac_objext \
12219
12205
conftest$ac_exeext conftest.$ac_ext
12220
12206
LIBS=$ac_check_lib_save_LIBS
12221
12207
fi
12222
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ldap_ldap_bind" >&5
12223
- $as_echo "$ac_cv_lib_ldap_ldap_bind" >&6; }
12224
- if test "x$ac_cv_lib_ldap_ldap_bind" = xyes; then :
12225
- cat >>confdefs.h <<_ACEOF
12226
- #define HAVE_LIBLDAP 1
12227
- _ACEOF
12228
-
12229
- LIBS="-lldap $LIBS"
12230
-
12208
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ldap_r_ldap_bind" >&5
12209
+ $as_echo "$ac_cv_lib_ldap_r_ldap_bind" >&6; }
12210
+ if test "x$ac_cv_lib_ldap_r_ldap_bind" = xyes; then :
12211
+ LDAP_LIBS_FE="-lldap_r $EXTRA_LDAP_LIBS"
12231
12212
else
12232
- as_fn_error $? "library 'ldap' is required for LDAP" "$LINENO" 5
12213
+ LDAP_LIBS_FE="-lldap $EXTRA_LDAP_LIBS"
12233
12214
fi
12234
12215
12216
+ else
12235
12217
LDAP_LIBS_FE="-lldap $EXTRA_LDAP_LIBS"
12236
- LDAP_LIBS_BE="-lldap $EXTRA_LDAP_LIBS"
12237
12218
fi
12238
12219
for ac_func in ldap_initialize
12239
12220
do :