483b06
From 03750b1c1ba8ed670691e4e464d110b9329d85be Mon Sep 17 00:00:00 2001
483b06
From: Jan Cholasta <jcholast@redhat.com>
483b06
Date: Wed, 5 Apr 2017 10:24:17 +0000
483b06
Subject: [PATCH] configure: fix AC_CHECK_LIB usage
483b06
483b06
Replace empty string with a single space in the third argument of
483b06
`AC_CHECK_LIB` (`action-if-found`) where applicable.
483b06
483b06
Empty string in the argument causes `AC_CHECK_LIB` to use the default
483b06
action when a library is found which includes adding the library to `LIBS`,
483b06
which specifies libraries to be linked in every binary and library in the
483b06
project.
483b06
483b06
This fixes libkrad, liblber, libldap_r and libsss_nss_idmap being linked to
483b06
every binary and library in IPA, even where unused.
483b06
483b06
https://pagure.io/freeipa/issue/6846
483b06
483b06
Reviewed-By: Stanislav Laznicka <slaznick@redhat.com>
483b06
---
483b06
 configure.ac | 4 ++--
483b06
 server.m4    | 4 ++--
483b06
 2 files changed, 4 insertions(+), 4 deletions(-)
483b06
483b06
diff --git a/configure.ac b/configure.ac
483b06
index ded1d71fd079a5f6947ef0627fb699783c8cc109..e31a9849c4c0556833f5cd47104381d006c96eef 100644
483b06
--- a/configure.ac
483b06
+++ b/configure.ac
483b06
@@ -86,8 +86,8 @@ dnl ---------------------------------------------------------------------------
483b06
 
483b06
 SAVE_CPPFLAGS=$CPPFLAGS
483b06
 CPPFLAGS="$NSPR_CFLAGS $NSS_CFLAGS"
483b06
-AC_CHECK_LIB([ldap_r], [ldap_search], [], AC_MSG_ERROR([libldap_r not found]))
483b06
-AC_CHECK_LIB([lber], [ber_peek_tag], [], AC_MSG_ERROR([liblber not found]))
483b06
+AC_CHECK_LIB([ldap_r], [ldap_search], [ ], AC_MSG_ERROR([libldap_r not found]))
483b06
+AC_CHECK_LIB([lber], [ber_peek_tag], [ ], AC_MSG_ERROR([liblber not found]))
483b06
 LDAP_LIBS="-lldap_r -llber"
483b06
 LDAP_CFLAGS=""
483b06
 AC_SUBST(LDAP_LIBS)
483b06
diff --git a/server.m4 b/server.m4
483b06
index 346d73e906c5d0499e46fcc4da070007b2ff5973..aa784e096299d5a6cc599a0d6a0652168f9bafbc 100644
483b06
--- a/server.m4
483b06
+++ b/server.m4
483b06
@@ -31,7 +31,7 @@ PKG_CHECK_MODULES([SSSIDMAP], [sss_idmap])
483b06
 PKG_CHECK_MODULES([SSSNSSIDMAP], [sss_nss_idmap >= 1.15.2])
483b06
 AC_CHECK_LIB([sss_nss_idmap],
483b06
              [sss_nss_getlistbycert],
483b06
-             [],
483b06
+             [ ],
483b06
              [AC_MSG_ERROR([Required sss_nss_getlistbycert symbol in sss_nss_idmap not found])],
483b06
              [])
483b06
 
483b06
@@ -48,7 +48,7 @@ dnl - Check for KRB5 krad
483b06
 dnl ---------------------------------------------------------------------------
483b06
 
483b06
 AC_CHECK_HEADER(krad.h, [], [AC_MSG_ERROR([krad.h not found])])
483b06
-AC_CHECK_LIB(krad, main, [], [AC_MSG_ERROR([libkrad not found])])
483b06
+AC_CHECK_LIB(krad, main, [ ], [AC_MSG_ERROR([libkrad not found])])
483b06
 KRAD_LIBS="-lkrad"
483b06
 krb5rundir="${localstatedir}/run/krb5kdc"
483b06
 AC_SUBST(KRAD_LIBS)
483b06
-- 
483b06
2.12.2
483b06