Skip to content

Commit 83a8bf2

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 a5377e7 commit 83a8bf2

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
@@ -12463,11 +12463,12 @@ if test "$with_ldap" = yes ; then
1246312463
if test "$enable_thread_safety" = yes; then
1246412464
# Use ldap_r for FE if available, else assume ldap is thread-safe.
1246512465
# If ldap_r does exist, assume without checking that ldap does too.
12466-
# on some platforms ldap_r fails to link without PTHREAD_LIBS
12466+
# On some platforms ldap_r fails to link without PTHREAD_LIBS;
12467+
# also, on AIX we must probe ldap_simple_bind not ldap_bind.
1246712468
LIBS=""
12468-
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing ldap_bind" >&5
12469-
$as_echo_n "checking for library containing ldap_bind... " >&6; }
12470-
if ${ac_cv_search_ldap_bind+:} false; then :
12469+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing ldap_simple_bind" >&5
12470+
$as_echo_n "checking for library containing ldap_simple_bind... " >&6; }
12471+
if ${ac_cv_search_ldap_simple_bind+:} false; then :
1247112472
$as_echo_n "(cached) " >&6
1247212473
else
1247312474
ac_func_search_save_LIBS=$LIBS
@@ -12480,11 +12481,11 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
1248012481
#ifdef __cplusplus
1248112482
extern "C"
1248212483
#endif
12483-
char ldap_bind ();
12484+
char ldap_simple_bind ();
1248412485
int
1248512486
main ()
1248612487
{
12487-
return ldap_bind ();
12488+
return ldap_simple_bind ();
1248812489
;
1248912490
return 0;
1249012491
}
@@ -12497,25 +12498,25 @@ for ac_lib in '' ldap_r ldap; do
1249712498
LIBS="-l$ac_lib $PTHREAD_CFLAGS $PTHREAD_LIBS $EXTRA_LDAP_LIBS $ac_func_search_save_LIBS"
1249812499
fi
1249912500
if ac_fn_c_try_link "$LINENO"; then :
12500-
ac_cv_search_ldap_bind=$ac_res
12501+
ac_cv_search_ldap_simple_bind=$ac_res
1250112502
fi
1250212503
rm -f core conftest.err conftest.$ac_objext \
1250312504
conftest$ac_exeext
12504-
if ${ac_cv_search_ldap_bind+:} false; then :
12505+
if ${ac_cv_search_ldap_simple_bind+:} false; then :
1250512506
break
1250612507
fi
1250712508
done
12508-
if ${ac_cv_search_ldap_bind+:} false; then :
12509+
if ${ac_cv_search_ldap_simple_bind+:} false; then :
1250912510

1251012511
else
12511-
ac_cv_search_ldap_bind=no
12512+
ac_cv_search_ldap_simple_bind=no
1251212513
fi
1251312514
rm conftest.$ac_ext
1251412515
LIBS=$ac_func_search_save_LIBS
1251512516
fi
12516-
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_ldap_bind" >&5
12517-
$as_echo "$ac_cv_search_ldap_bind" >&6; }
12518-
ac_res=$ac_cv_search_ldap_bind
12517+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_ldap_simple_bind" >&5
12518+
$as_echo "$ac_cv_search_ldap_simple_bind" >&6; }
12519+
ac_res=$ac_cv_search_ldap_simple_bind
1251912520
if test "$ac_res" != no; then :
1252012521
test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
1252112522

configure.in

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1273,9 +1273,10 @@ if test "$with_ldap" = yes ; then
12731273
if test "$enable_thread_safety" = yes; then
12741274
# Use ldap_r for FE if available, else assume ldap is thread-safe.
12751275
# If ldap_r does exist, assume without checking that ldap does too.
1276-
# on some platforms ldap_r fails to link without PTHREAD_LIBS
1276+
# On some platforms ldap_r fails to link without PTHREAD_LIBS;
1277+
# also, on AIX we must probe ldap_simple_bind not ldap_bind.
12771278
LIBS=""
1278-
AC_SEARCH_LIBS(ldap_bind, [ldap_r ldap], [],
1279+
AC_SEARCH_LIBS(ldap_simple_bind, [ldap_r ldap], [],
12791280
[AC_MSG_ERROR([library 'ldap' is required for LDAP])],
12801281
[$PTHREAD_CFLAGS $PTHREAD_LIBS $EXTRA_LDAP_LIBS])
12811282
LDAP_LIBS_FE="$LIBS $EXTRA_LDAP_LIBS"

0 commit comments

Comments
 (0)