From ebd0cbde5b2a528e6f237fa09bec586d064fc266 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= Date: Thu, 7 Jan 2016 10:45:03 +0100 Subject: [PATCH] Work around Autoconf bug not to link ldap library to everything --- ...ound-an-AC_CHECK_LIB-bug-in-Autoconf.patch | 37 +++++++++++++++++++ quota.spec | 5 +++ 2 files changed, 42 insertions(+) create mode 100644 quota-4.03-Work-around-an-AC_CHECK_LIB-bug-in-Autoconf.patch diff --git a/quota-4.03-Work-around-an-AC_CHECK_LIB-bug-in-Autoconf.patch b/quota-4.03-Work-around-an-AC_CHECK_LIB-bug-in-Autoconf.patch new file mode 100644 index 0000000..9af9c8f --- /dev/null +++ b/quota-4.03-Work-around-an-AC_CHECK_LIB-bug-in-Autoconf.patch @@ -0,0 +1,37 @@ +From 47601e462c6606f7a711c093fb1b03580b01ee46 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= +Date: Thu, 7 Jan 2016 10:23:24 +0100 +Subject: [PATCH] Work around an AC_CHECK_LIB bug in Autoconf +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +AC_CHECK_LIB([ldap], [ldap_initialize], [], [...]) should not append -lldap to +LIBS variable because third AC_CHECK_LIB arugment is defined and +empty. + +But broken autoconf-2.69-21.fc23 thinks empty is undefined and +defaults to implicit if-found action. That results into linking all +executables to ldap library and that is unnecessary. + +Signed-off-by: Petr Písař +--- + configure.ac | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/configure.ac b/configure.ac +index bb33774..1994945 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -73,7 +73,7 @@ AC_ARG_ENABLE([ldapmail], + ) + AS_IF([test "x$enable_ldapmail" != "xno"], [ + build_ldap="yes" +- AC_CHECK_LIB([ldap], [ldap_initialize], [], [ ++ AC_CHECK_LIB([ldap], [ldap_initialize], [:;], [ + build_ldap=no + AS_IF([test "x$enable_ldapmail" = "xyes"], [ + AC_MSG_ERROR([LDAP support required but library not found.]); +-- +2.5.0 + diff --git a/quota.spec b/quota.spec index 88e1fb7..904726a 100644 --- a/quota.spec +++ b/quota.spec @@ -40,6 +40,8 @@ Patch2: quota-4.03-Validate-upper-bound-of-RPC-port.patch # Fix build script to work with hardended flags, submitted to upstream # Patch3: quota-4.03-Respect-enviroment-CFLAGS.patch +# Work around Autoconf bug not to link ldap library to everything, bug #1296455 +Patch4: quota-4.03-Work-around-an-AC_CHECK_LIB-bug-in-Autoconf.patch BuildRequires: autoconf BuildRequires: automake BuildRequires: bash @@ -149,6 +151,7 @@ Linux/UNIX environment. %endif %patch2 -p1 %patch3 -p1 +%patch4 -p1 # Unpack forgotten LDAP scripts tar -xzkf %{SOURCE5} # Regenerate build scripts, also because of Respect-enviroment-CFLAGS.patch @@ -263,6 +266,8 @@ make check %changelog * Wed Jan 06 2016 Petr Pisar - 1:4.03-1 - 4.03 bump +- Work around Autoconf bug not to link ldap library to everything + (bug #1296455) * Thu Jun 18 2015 Fedora Release Engineering - 1:4.02-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild