Skip to content

Commit 29a4fbd

Browse files
committed
Un-break AIX build.
In commit d0a02bd, I'd supposed that uniformly probing for ldap_bind would make the intent clearer. However, that seems not to work on AIX, for obscure reasons (maybe it's a macro there?). Revert to the former behavior of probing ldap_simple_bind for thread-safe cases and ldap_bind otherwise. Per buildfarm member hoverfly. Discussion: https://postgr.es/m/17083-a19190d9591946a7@postgresql.org
1 parent b69e8ad commit 29a4fbd

File tree

2 files changed

+17
-15
lines changed

2 files changed

+17
-15
lines changed

configure

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12121,11 +12121,12 @@ if test "$with_ldap" = yes ; then
1212112121
if test "$enable_thread_safety" = yes; then
1212212122
# Use ldap_r for FE if available, else assume ldap is thread-safe.
1212312123
# If ldap_r does exist, assume without checking that ldap does too.
12124-
# on some platforms ldap_r fails to link without PTHREAD_LIBS
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.
1212512126
LIBS=""
12126-
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing ldap_bind" >&5
12127-
$as_echo_n "checking for library containing ldap_bind... " >&6; }
12128-
if ${ac_cv_search_ldap_bind+:} false; then :
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 :
1212912130
$as_echo_n "(cached) " >&6
1213012131
else
1213112132
ac_func_search_save_LIBS=$LIBS
@@ -12138,11 +12139,11 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
1213812139
#ifdef __cplusplus
1213912140
extern "C"
1214012141
#endif
12141-
char ldap_bind ();
12142+
char ldap_simple_bind ();
1214212143
int
1214312144
main ()
1214412145
{
12145-
return ldap_bind ();
12146+
return ldap_simple_bind ();
1214612147
;
1214712148
return 0;
1214812149
}
@@ -12155,25 +12156,25 @@ for ac_lib in '' ldap_r ldap; do
1215512156
LIBS="-l$ac_lib $PTHREAD_CFLAGS $PTHREAD_LIBS $EXTRA_LDAP_LIBS $ac_func_search_save_LIBS"
1215612157
fi
1215712158
if ac_fn_c_try_link "$LINENO"; then :
12158-
ac_cv_search_ldap_bind=$ac_res
12159+
ac_cv_search_ldap_simple_bind=$ac_res
1215912160
fi
1216012161
rm -f core conftest.err conftest.$ac_objext \
1216112162
conftest$ac_exeext
12162-
if ${ac_cv_search_ldap_bind+:} false; then :
12163+
if ${ac_cv_search_ldap_simple_bind+:} false; then :
1216312164
break
1216412165
fi
1216512166
done
12166-
if ${ac_cv_search_ldap_bind+:} false; then :
12167+
if ${ac_cv_search_ldap_simple_bind+:} false; then :
1216712168

1216812169
else
12169-
ac_cv_search_ldap_bind=no
12170+
ac_cv_search_ldap_simple_bind=no
1217012171
fi
1217112172
rm conftest.$ac_ext
1217212173
LIBS=$ac_func_search_save_LIBS
1217312174
fi
12174-
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_ldap_bind" >&5
12175-
$as_echo "$ac_cv_search_ldap_bind" >&6; }
12176-
ac_res=$ac_cv_search_ldap_bind
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
1217712178
if test "$ac_res" != no; then :
1217812179
test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
1217912180

configure.in

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1268,9 +1268,10 @@ if test "$with_ldap" = yes ; then
12681268
if test "$enable_thread_safety" = yes; then
12691269
# Use ldap_r for FE if available, else assume ldap is thread-safe.
12701270
# If ldap_r does exist, assume without checking that ldap does too.
1271-
# on some platforms ldap_r fails to link without PTHREAD_LIBS
1271+
# On some platforms ldap_r fails to link without PTHREAD_LIBS;
1272+
# also, on AIX we must probe ldap_simple_bind not ldap_bind.
12721273
LIBS=""
1273-
AC_SEARCH_LIBS(ldap_bind, [ldap_r ldap], [],
1274+
AC_SEARCH_LIBS(ldap_simple_bind, [ldap_r ldap], [],
12741275
[AC_MSG_ERROR([library 'ldap' is required for LDAP])],
12751276
[$PTHREAD_CFLAGS $PTHREAD_LIBS $EXTRA_LDAP_LIBS])
12761277
LDAP_LIBS_FE="$LIBS $EXTRA_LDAP_LIBS"

0 commit comments

Comments
 (0)