[PATCH] autofs-5.1.8 - define LDAP_DEPRECATED during LDAP configure check

From: Arjun Shankar <arjun@redhat.com>

This commit defines LDAP_DEPRECATED as 1 during a configure check for
ldap_parse_page_control.  This is in line with how lookup_ldap.c is
compiled at build time.

The configure script is regenerated with autoconf 2.69.

The regeneration of the configure script also includes changes due to
commit 69fda4f090e3.  That commit intended to run checks with implicit
function declaration warnings enabled in order to recognize missing
libldap functions.  However, the in-tree copy of the configure script
was not regenerated at that time.

Signed-off-by: Arjun Shankar <arjun@redhat.com>
Signed-off-by: Ian Kent <raven@themaw.net>
---
 CHANGELOG  |    1 +
 aclocal.m4 |    3 ++-
 configure  |    9 ++++++++-
 3 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/CHANGELOG b/CHANGELOG
index 772a7645..251f8480 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -55,6 +55,7 @@
 - fail on empty replicated host name.
 - improve handling of ENOENT in sss setautomntent().
 - don't immediately call function when waiting.
+- define LDAP_DEPRECATED during LDAP configure check.
 
 19/10/2021 autofs-5.1.8
 - add xdr_exports().
diff --git a/aclocal.m4 b/aclocal.m4
index 9fc20bf1..3b495994 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -419,7 +419,8 @@ af_check_ldap_parse_page_control_save_cflags="$CFLAGS"
 CFLAGS="$CFLAGS -Werror=implicit-function-declaration"
 
 AC_TRY_LINK(
-  [ #include <ldap.h> ],
+  [ #define LDAP_DEPRECATED 1
+    #include <ldap.h> ],
   [ LDAP *ld;
     ber_int_t ct;
     struct berval *c;
diff --git a/configure b/configure
index 91be1e14..bbd2586a 100755
--- a/configure
+++ b/configure
@@ -5471,6 +5471,8 @@ $as_echo_n "checking for ldap_create_page_control in -lldap... " >&6; }
 # save current libs
 af_check_ldap_create_page_control_save_libs="$LIBS"
 LIBS="$LIBS -lldap"
+af_check_ldap_create_page_control_save_cflags="$CFLAGS"
+CFLAGS="$CFLAGS -Werror=implicit-function-declaration"
 
 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
@@ -5507,6 +5509,7 @@ fi
 
 # restore libs
 LIBS="$af_check_ldap_create_page_control_save_libs"
+CFLAGS="$af_check_ldap_create_page_control_save_cflags"
 
 	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ldap_parse_page_control in -lldap" >&5
 $as_echo_n "checking for ldap_parse_page_control in -lldap... " >&6; }
@@ -5514,10 +5517,13 @@ $as_echo_n "checking for ldap_parse_page_control in -lldap... " >&6; }
 # save current libs
 af_check_ldap_parse_page_control_save_libs="$LIBS"
 LIBS="$LIBS -lldap"
+af_check_ldap_parse_page_control_save_cflags="$CFLAGS"
+CFLAGS="$CFLAGS -Werror=implicit-function-declaration"
 
 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
- #include <ldap.h>
+ #define LDAP_DEPRECATED 1
+    #include <ldap.h>
 int
 main ()
 {
@@ -5550,6 +5556,7 @@ fi
 
 # restore libs
 LIBS="$af_check_ldap_parse_page_control_save_libs"
+CFLAGS="$af_check_ldap_parse_page_control_save_cflags"
 
     fi
 fi