diff options
author | Tom Lane | 2021-07-09 20:59:07 +0000 |
---|---|---|
committer | Tom Lane | 2021-07-09 20:59:07 +0000 |
commit | 53c38a086a8001d63401671755638bc95c7fa1c7 (patch) | |
tree | 38472b5cb34e9a5cb14e5f17e17d09b93f737bc1 /configure.ac | |
parent | ab09679429009bfed4bd894a6187afde0b7bdfcd (diff) |
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
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/configure.ac b/configure.ac index be825a81131..5f217c01e38 100644 --- a/configure.ac +++ b/configure.ac @@ -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])]) 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 _LIBS="$LIBS" 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 # 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; - # also, on AIX we must probe ldap_simple_bind not ldap_bind. - LIBS="" - AC_SEARCH_LIBS(ldap_simple_bind, [ldap_r ldap], [], - [AC_MSG_ERROR([library 'ldap' is required for LDAP])], - [$PTHREAD_CFLAGS $PTHREAD_LIBS $EXTRA_LDAP_LIBS]) - LDAP_LIBS_FE="$LIBS $EXTRA_LDAP_LIBS" - LDAP_LIBS_BE="-lldap $EXTRA_LDAP_LIBS" + # On some platforms ldap_r fails to link without PTHREAD_LIBS. + LIBS="$_LIBS" + AC_CHECK_LIB(ldap_r, ldap_bind, + [LDAP_LIBS_FE="-lldap_r $EXTRA_LDAP_LIBS"], + [LDAP_LIBS_FE="-lldap $EXTRA_LDAP_LIBS"], + [$PTHREAD_CFLAGS $PTHREAD_LIBS $EXTRA_LDAP_LIBS]) 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_BE="-lldap $EXTRA_LDAP_LIBS" fi AC_CHECK_FUNCS([ldap_initialize]) else |