Commit 9ffad7ae authored by Tom Lane's avatar Tom Lane

Un-break AIX build, take 2.

I incorrectly diagnosed the reason why hoverfly is unhappy.
Looking closer, it appears that it fails to link libldap
unless libssl is also present; so the problem was my
idea of clearing LIBS before making the check.  Revert
to essentially the original coding, except that instead
of failing when libldap_r isn't there, use libldap.

Per buildfarm member hoverfly.

Discussion: https://postgr.es/m/17083-a19190d9591946a7@postgresql.org
parent 1beaa654
...@@ -12876,22 +12876,18 @@ fi ...@@ -12876,22 +12876,18 @@ fi
fi fi
# Note: We can test for libldap_r only after we know PTHREAD_LIBS # Note: We can test for libldap_r only after we know PTHREAD_LIBS;
# also, on AIX, we may need to have openssl in LIBS for this step.
if test "$with_ldap" = yes ; then if test "$with_ldap" = yes ; then
_LIBS="$LIBS" _LIBS="$LIBS"
if test "$PORTNAME" != "win32"; then if test "$PORTNAME" != "win32"; then
if test "$enable_thread_safety" = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ldap_bind in -lldap" >&5
# Use ldap_r for FE if available, else assume ldap is thread-safe. $as_echo_n "checking for ldap_bind in -lldap... " >&6; }
# If ldap_r does exist, assume without checking that ldap does too. if ${ac_cv_lib_ldap_ldap_bind+:} false; then :
# On some platforms ldap_r fails to link without PTHREAD_LIBS;
# also, on AIX we must probe ldap_simple_bind not ldap_bind.
LIBS=""
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing ldap_simple_bind" >&5
$as_echo_n "checking for library containing ldap_simple_bind... " >&6; }
if ${ac_cv_search_ldap_simple_bind+:} false; then :
$as_echo_n "(cached) " >&6 $as_echo_n "(cached) " >&6
else else
ac_func_search_save_LIBS=$LIBS ac_check_lib_save_LIBS=$LIBS
LIBS="-lldap $EXTRA_LDAP_LIBS $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */ /* end confdefs.h. */
...@@ -12901,59 +12897,49 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ...@@ -12901,59 +12897,49 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
#ifdef __cplusplus #ifdef __cplusplus
extern "C" extern "C"
#endif #endif
char ldap_simple_bind (); char ldap_bind ();
int int
main () main ()
{ {
return ldap_simple_bind (); return ldap_bind ();
; ;
return 0; return 0;
} }
_ACEOF _ACEOF
for ac_lib in '' ldap_r ldap; do if ac_fn_c_try_link "$LINENO"; then :
if test -z "$ac_lib"; then ac_cv_lib_ldap_ldap_bind=yes
ac_res="none required" else
else ac_cv_lib_ldap_ldap_bind=no
ac_res=-l$ac_lib
LIBS="-l$ac_lib $PTHREAD_CFLAGS $PTHREAD_LIBS $EXTRA_LDAP_LIBS $ac_func_search_save_LIBS"
fi
if ac_fn_c_try_link "$LINENO"; then :
ac_cv_search_ldap_simple_bind=$ac_res
fi fi
rm -f core conftest.err conftest.$ac_objext \ rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest$ac_exeext conftest.$ac_ext
if ${ac_cv_search_ldap_simple_bind+:} false; then : LIBS=$ac_check_lib_save_LIBS
break
fi fi
done { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ldap_ldap_bind" >&5
if ${ac_cv_search_ldap_simple_bind+:} false; then : $as_echo "$ac_cv_lib_ldap_ldap_bind" >&6; }
if test "x$ac_cv_lib_ldap_ldap_bind" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_LIBLDAP 1
_ACEOF
else LIBS="-lldap $LIBS"
ac_cv_search_ldap_simple_bind=no
fi
rm conftest.$ac_ext
LIBS=$ac_func_search_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_ldap_simple_bind" >&5
$as_echo "$ac_cv_search_ldap_simple_bind" >&6; }
ac_res=$ac_cv_search_ldap_simple_bind
if test "$ac_res" != no; then :
test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
else else
as_fn_error $? "library 'ldap' is required for LDAP" "$LINENO" 5 as_fn_error $? "library 'ldap' is required for LDAP" "$LINENO" 5
fi fi
LDAP_LIBS_FE="$LIBS $EXTRA_LDAP_LIBS"
LDAP_LIBS_BE="-lldap $EXTRA_LDAP_LIBS" LDAP_LIBS_BE="-lldap $EXTRA_LDAP_LIBS"
else if test "$enable_thread_safety" = yes; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ldap_bind in -lldap" >&5 # Use ldap_r for FE if available, else assume ldap is thread-safe.
$as_echo_n "checking for ldap_bind in -lldap... " >&6; } # On some platforms ldap_r fails to link without PTHREAD_LIBS.
if ${ac_cv_lib_ldap_ldap_bind+:} false; then : LIBS="$_LIBS"
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ldap_bind in -lldap_r" >&5
$as_echo_n "checking for ldap_bind in -lldap_r... " >&6; }
if ${ac_cv_lib_ldap_r_ldap_bind+:} false; then :
$as_echo_n "(cached) " >&6 $as_echo_n "(cached) " >&6
else else
ac_check_lib_save_LIBS=$LIBS ac_check_lib_save_LIBS=$LIBS
LIBS="-lldap $EXTRA_LDAP_LIBS $LIBS" LIBS="-lldap_r $PTHREAD_CFLAGS $PTHREAD_LIBS $EXTRA_LDAP_LIBS $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */ /* end confdefs.h. */
...@@ -12973,29 +12959,24 @@ return ldap_bind (); ...@@ -12973,29 +12959,24 @@ return ldap_bind ();
} }
_ACEOF _ACEOF
if ac_fn_c_try_link "$LINENO"; then : if ac_fn_c_try_link "$LINENO"; then :
ac_cv_lib_ldap_ldap_bind=yes ac_cv_lib_ldap_r_ldap_bind=yes
else else
ac_cv_lib_ldap_ldap_bind=no ac_cv_lib_ldap_r_ldap_bind=no
fi fi
rm -f core conftest.err conftest.$ac_objext \ rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS LIBS=$ac_check_lib_save_LIBS
fi fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ldap_ldap_bind" >&5 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ldap_r_ldap_bind" >&5
$as_echo "$ac_cv_lib_ldap_ldap_bind" >&6; } $as_echo "$ac_cv_lib_ldap_r_ldap_bind" >&6; }
if test "x$ac_cv_lib_ldap_ldap_bind" = xyes; then : if test "x$ac_cv_lib_ldap_r_ldap_bind" = xyes; then :
cat >>confdefs.h <<_ACEOF LDAP_LIBS_FE="-lldap_r $EXTRA_LDAP_LIBS"
#define HAVE_LIBLDAP 1
_ACEOF
LIBS="-lldap $LIBS"
else else
as_fn_error $? "library 'ldap' is required for LDAP" "$LINENO" 5 LDAP_LIBS_FE="-lldap $EXTRA_LDAP_LIBS"
fi fi
else
LDAP_LIBS_FE="-lldap $EXTRA_LDAP_LIBS" LDAP_LIBS_FE="-lldap $EXTRA_LDAP_LIBS"
LDAP_LIBS_BE="-lldap $EXTRA_LDAP_LIBS"
fi fi
for ac_func in ldap_initialize for ac_func in ldap_initialize
do : do :
......
...@@ -1285,27 +1285,25 @@ if test "$with_lz4" = yes ; then ...@@ -1285,27 +1285,25 @@ if test "$with_lz4" = yes ; then
AC_CHECK_LIB(lz4, LZ4_compress_default, [], [AC_MSG_ERROR([library 'lz4' is required for LZ4 support])]) AC_CHECK_LIB(lz4, LZ4_compress_default, [], [AC_MSG_ERROR([library 'lz4' is required for LZ4 support])])
fi fi
# Note: We can test for libldap_r only after we know PTHREAD_LIBS # Note: We can test for libldap_r only after we know PTHREAD_LIBS;
# also, on AIX, we may need to have openssl in LIBS for this step.
if test "$with_ldap" = yes ; then if test "$with_ldap" = yes ; then
_LIBS="$LIBS" _LIBS="$LIBS"
if test "$PORTNAME" != "win32"; then if test "$PORTNAME" != "win32"; then
AC_CHECK_LIB(ldap, ldap_bind, [],
[AC_MSG_ERROR([library 'ldap' is required for LDAP])],
[$EXTRA_LDAP_LIBS])
LDAP_LIBS_BE="-lldap $EXTRA_LDAP_LIBS"
if test "$enable_thread_safety" = yes; then if test "$enable_thread_safety" = yes; then
# Use ldap_r for FE if available, else assume ldap is thread-safe. # Use ldap_r for FE if available, else assume ldap is thread-safe.
# If ldap_r does exist, assume without checking that ldap does too. # On some platforms ldap_r fails to link without PTHREAD_LIBS.
# On some platforms ldap_r fails to link without PTHREAD_LIBS; LIBS="$_LIBS"
# also, on AIX we must probe ldap_simple_bind not ldap_bind. AC_CHECK_LIB(ldap_r, ldap_bind,
LIBS="" [LDAP_LIBS_FE="-lldap_r $EXTRA_LDAP_LIBS"],
AC_SEARCH_LIBS(ldap_simple_bind, [ldap_r ldap], [], [LDAP_LIBS_FE="-lldap $EXTRA_LDAP_LIBS"],
[AC_MSG_ERROR([library 'ldap' is required for LDAP])],
[$PTHREAD_CFLAGS $PTHREAD_LIBS $EXTRA_LDAP_LIBS]) [$PTHREAD_CFLAGS $PTHREAD_LIBS $EXTRA_LDAP_LIBS])
LDAP_LIBS_FE="$LIBS $EXTRA_LDAP_LIBS"
LDAP_LIBS_BE="-lldap $EXTRA_LDAP_LIBS"
else else
AC_CHECK_LIB(ldap, ldap_bind, [],
[AC_MSG_ERROR([library 'ldap' is required for LDAP])],
[$EXTRA_LDAP_LIBS])
LDAP_LIBS_FE="-lldap $EXTRA_LDAP_LIBS" LDAP_LIBS_FE="-lldap $EXTRA_LDAP_LIBS"
LDAP_LIBS_BE="-lldap $EXTRA_LDAP_LIBS"
fi fi
AC_CHECK_FUNCS([ldap_initialize]) AC_CHECK_FUNCS([ldap_initialize])
else else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment