Skip to content

Commit cbcf5ff

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 9807b9a commit cbcf5ff

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
@@ -12498,11 +12498,12 @@ if test "$with_ldap" = yes ; then
1249812498
if test "$enable_thread_safety" = yes; then
1249912499
# Use ldap_r for FE if available, else assume ldap is thread-safe.
1250012500
# If ldap_r does exist, assume without checking that ldap does too.
12501-
# on some platforms ldap_r fails to link without PTHREAD_LIBS
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.
1250212503
LIBS=""
12503-
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing ldap_bind" >&5
12504-
$as_echo_n "checking for library containing ldap_bind... " >&6; }
12505-
if ${ac_cv_search_ldap_bind+:} false; then :
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 :
1250612507
$as_echo_n "(cached) " >&6
1250712508
else
1250812509
ac_func_search_save_LIBS=$LIBS
@@ -12515,11 +12516,11 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
1251512516
#ifdef __cplusplus
1251612517
extern "C"
1251712518
#endif
12518-
char ldap_bind ();
12519+
char ldap_simple_bind ();
1251912520
int
1252012521
main ()
1252112522
{
12522-
return ldap_bind ();
12523+
return ldap_simple_bind ();
1252312524
;
1252412525
return 0;
1252512526
}
@@ -12532,25 +12533,25 @@ for ac_lib in '' ldap_r ldap; do
1253212533
LIBS="-l$ac_lib $PTHREAD_CFLAGS $PTHREAD_LIBS $EXTRA_LDAP_LIBS $ac_func_search_save_LIBS"
1253312534
fi
1253412535
if ac_fn_c_try_link "$LINENO"; then :
12535-
ac_cv_search_ldap_bind=$ac_res
12536+
ac_cv_search_ldap_simple_bind=$ac_res
1253612537
fi
1253712538
rm -f core conftest.err conftest.$ac_objext \
1253812539
conftest$ac_exeext
12539-
if ${ac_cv_search_ldap_bind+:} false; then :
12540+
if ${ac_cv_search_ldap_simple_bind+:} false; then :
1254012541
break
1254112542
fi
1254212543
done
12543-
if ${ac_cv_search_ldap_bind+:} false; then :
12544+
if ${ac_cv_search_ldap_simple_bind+:} false; then :
1254412545

1254512546
else
12546-
ac_cv_search_ldap_bind=no
12547+
ac_cv_search_ldap_simple_bind=no
1254712548
fi
1254812549
rm conftest.$ac_ext
1254912550
LIBS=$ac_func_search_save_LIBS
1255012551
fi
12551-
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_ldap_bind" >&5
12552-
$as_echo "$ac_cv_search_ldap_bind" >&6; }
12553-
ac_res=$ac_cv_search_ldap_bind
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
1255412555
if test "$ac_res" != no; then :
1255512556
test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
1255612557

configure.in

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1244,9 +1244,10 @@ if test "$with_ldap" = yes ; then
12441244
if test "$enable_thread_safety" = yes; then
12451245
# Use ldap_r for FE if available, else assume ldap is thread-safe.
12461246
# If ldap_r does exist, assume without checking that ldap does too.
1247-
# on some platforms ldap_r fails to link without PTHREAD_LIBS
1247+
# On some platforms ldap_r fails to link without PTHREAD_LIBS;
1248+
# also, on AIX we must probe ldap_simple_bind not ldap_bind.
12481249
LIBS=""
1249-
AC_SEARCH_LIBS(ldap_bind, [ldap_r ldap], [],
1250+
AC_SEARCH_LIBS(ldap_simple_bind, [ldap_r ldap], [],
12501251
[AC_MSG_ERROR([library 'ldap' is required for LDAP])],
12511252
[$PTHREAD_CFLAGS $PTHREAD_LIBS $EXTRA_LDAP_LIBS])
12521253
LDAP_LIBS_FE="$LIBS $EXTRA_LDAP_LIBS"

0 commit comments

Comments
 (0)