]> git.ipfire.org Git - thirdparty/postgresql.git/commitdiff
Fix busted test for ldap_initialize.
authorTom Lane <tgl@sss.pgh.pa.us>
Sat, 10 Jul 2021 17:19:31 +0000 (13:19 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Sat, 10 Jul 2021 17:19:31 +0000 (13:19 -0400)
Sigh ... I was expecting AC_CHECK_LIB to do something it didn't,
namely update LIBS.  This led to not finding ldap_initialize.
Fix by moving the probe for ldap_initialize.  In some sense this
is more correct anyway, since (at least for now) we care about
whether ldap_initialize exists in libldap not libldap_r.

Per buildfarm member elver and local testing.

Discussion: https://postgr.es/m/17083-a19190d9591946a7@postgresql.org

configure
configure.in

index e7ee00f8087fd1d4f0d6a1f0d586759eb2df61f3..de05cbeb158a951992b8ae9cf03e49de4c8df5c5 100755 (executable)
--- a/configure
+++ b/configure
@@ -12167,6 +12167,18 @@ else
 fi
 
     LDAP_LIBS_BE="-lldap $EXTRA_LDAP_LIBS"
+    # This test is carried out against libldap.
+    for ac_func in ldap_initialize
+do :
+  ac_fn_c_check_func "$LINENO" "ldap_initialize" "ac_cv_func_ldap_initialize"
+if test "x$ac_cv_func_ldap_initialize" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LDAP_INITIALIZE 1
+_ACEOF
+
+fi
+done
+
     if test "$enable_thread_safety" = yes; then
       # Use ldap_r for FE if available, else assume ldap is thread-safe.
       # On some platforms ldap_r fails to link without PTHREAD_LIBS.
     else
       LDAP_LIBS_FE="-lldap $EXTRA_LDAP_LIBS"
     fi
-    for ac_func in ldap_initialize
-do :
-  ac_fn_c_check_func "$LINENO" "ldap_initialize" "ac_cv_func_ldap_initialize"
-if test "x$ac_cv_func_ldap_initialize" = xyes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_LDAP_INITIALIZE 1
-_ACEOF
-
-fi
-done
-
   else
     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ldap_bind in -lwldap32" >&5
 $as_echo_n "checking for ldap_bind in -lwldap32... " >&6; }
index 5a40d4c2cb8e542b9b6963fd0823e8f3c5bcba2f..ebc21bf413649544882cdf7d698d7361df261183 100644 (file)
@@ -1270,6 +1270,8 @@ if test "$with_ldap" = yes ; then
                 [AC_MSG_ERROR([library 'ldap' is required for LDAP])],
                 [$EXTRA_LDAP_LIBS])
     LDAP_LIBS_BE="-lldap $EXTRA_LDAP_LIBS"
+    # This test is carried out against libldap.
+    AC_CHECK_FUNCS([ldap_initialize])
     if test "$enable_thread_safety" = yes; then
       # Use ldap_r for FE if available, else assume ldap is thread-safe.
       # On some platforms ldap_r fails to link without PTHREAD_LIBS.
@@ -1281,7 +1283,6 @@ if test "$with_ldap" = yes ; then
     else
       LDAP_LIBS_FE="-lldap $EXTRA_LDAP_LIBS"
     fi
-    AC_CHECK_FUNCS([ldap_initialize])
   else
     AC_CHECK_LIB(wldap32, ldap_bind, [], [AC_MSG_ERROR([library 'wldap32' is required for LDAP])])
     LDAP_LIBS_FE="-lwldap32"