From 717a22e3e674e778da0d488dd26a01d7fa233ba6 Mon Sep 17 00:00:00 2001
From: Andres Freund <andres@anarazel.de>
Date: Fri, 5 Aug 2022 14:09:42 -0700
Subject: [PATCH v11 2/9] meson: prereq: Don't add HAVE_LDAP_H HAVE_WINLDAP_H
 to pg_config.h.

They're not referenced.
---
 src/include/pg_config.h.in |  6 ------
 configure                  | 16 ++--------------
 configure.ac               | 12 ++++++------
 src/tools/msvc/Solution.pm |  2 --
 4 files changed, 8 insertions(+), 28 deletions(-)

diff --git a/src/include/pg_config.h.in b/src/include/pg_config.h.in
index fc5ad5fd658..dc8b13c0533 100644
--- a/src/include/pg_config.h.in
+++ b/src/include/pg_config.h.in
@@ -259,9 +259,6 @@
 /* Define to 1 if you have the <langinfo.h> header file. */
 #undef HAVE_LANGINFO_H
 
-/* Define to 1 if you have the <ldap.h> header file. */
-#undef HAVE_LDAP_H
-
 /* Define to 1 if you have the `ldap_initialize' function. */
 #undef HAVE_LDAP_INITIALIZE
 
@@ -589,9 +586,6 @@
 /* Define to 1 if you have the `wcstombs_l' function. */
 #undef HAVE_WCSTOMBS_L
 
-/* Define to 1 if you have the <winldap.h> header file. */
-#undef HAVE_WINLDAP_H
-
 /* Define to 1 if you have the `X509_get_signature_nid' function. */
 #undef HAVE_X509_GET_SIGNATURE_NID
 
diff --git a/configure b/configure
index cf2c4b85fe2..e527363a9c6 100755
--- a/configure
+++ b/configure
@@ -14311,19 +14311,13 @@ fi
 
 if test "$with_ldap" = yes ; then
   if test "$PORTNAME" != "win32"; then
-     for ac_header in ldap.h
-do :
-  ac_fn_c_check_header_mongrel "$LINENO" "ldap.h" "ac_cv_header_ldap_h" "$ac_includes_default"
+     ac_fn_c_check_header_mongrel "$LINENO" "ldap.h" "ac_cv_header_ldap_h" "$ac_includes_default"
 if test "x$ac_cv_header_ldap_h" = xyes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_LDAP_H 1
-_ACEOF
 
 else
   as_fn_error $? "header file <ldap.h> is required for LDAP" "$LINENO" 5
 fi
 
-done
 
      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for compatible LDAP implementation" >&5
 $as_echo_n "checking for compatible LDAP implementation... " >&6; }
@@ -14367,22 +14361,16 @@ $as_echo "$as_me: WARNING:
 *** also uses LDAP will crash on exit." >&2;}
 fi
   else
-     for ac_header in winldap.h
-do :
-  ac_fn_c_check_header_compile "$LINENO" "winldap.h" "ac_cv_header_winldap_h" "$ac_includes_default
+     ac_fn_c_check_header_compile "$LINENO" "winldap.h" "ac_cv_header_winldap_h" "$ac_includes_default
 #include <windows.h>
 
 "
 if test "x$ac_cv_header_winldap_h" = xyes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_WINLDAP_H 1
-_ACEOF
 
 else
   as_fn_error $? "header file <winldap.h> is required for LDAP" "$LINENO" 5
 fi
 
-done
 
   fi
 fi
diff --git a/configure.ac b/configure.ac
index b5798bcb0a1..1c392684bb8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1559,15 +1559,15 @@ fi
 
 if test "$with_ldap" = yes ; then
   if test "$PORTNAME" != "win32"; then
-     AC_CHECK_HEADERS(ldap.h, [],
-                      [AC_MSG_ERROR([header file <ldap.h> is required for LDAP])])
+     AC_CHECK_HEADER(ldap.h, [],
+                     [AC_MSG_ERROR([header file <ldap.h> is required for LDAP])])
      PGAC_LDAP_SAFE
   else
-     AC_CHECK_HEADERS(winldap.h, [],
-                      [AC_MSG_ERROR([header file <winldap.h> is required for LDAP])],
-                      [AC_INCLUDES_DEFAULT
+     AC_CHECK_HEADER(winldap.h, [],
+                     [AC_MSG_ERROR([header file <winldap.h> is required for LDAP])],
+                     [AC_INCLUDES_DEFAULT
 #include <windows.h>
-                      ])
+                     ])
   fi
 fi
 
diff --git a/src/tools/msvc/Solution.pm b/src/tools/msvc/Solution.pm
index cc82668457f..e832bf0c814 100644
--- a/src/tools/msvc/Solution.pm
+++ b/src/tools/msvc/Solution.pm
@@ -283,7 +283,6 @@ sub GenerateFiles
 		HAVE_I_CONSTRAINT__BUILTIN_CONSTANT_P       => undef,
 		HAVE_KQUEUE                                 => undef,
 		HAVE_LANGINFO_H                             => undef,
-		HAVE_LDAP_H                                 => undef,
 		HAVE_LDAP_INITIALIZE                        => undef,
 		HAVE_LIBCRYPTO                              => undef,
 		HAVE_LIBLDAP                                => undef,
@@ -390,7 +389,6 @@ sub GenerateFiles
 		HAVE_UUID_OSSP                           => undef,
 		HAVE_UUID_H                              => undef,
 		HAVE_UUID_UUID_H                         => undef,
-		HAVE_WINLDAP_H                           => undef,
 		HAVE_WCSTOMBS_L                          => 1,
 		HAVE_VISIBILITY_ATTRIBUTE                => undef,
 		HAVE_X509_GET_SIGNATURE_NID              => 1,
-- 
2.37.0.3.g30cc8d0f14

