summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Kara <jack@suse.cz>2016-01-19 11:40:15 +0100
committerJan Kara <jack@suse.cz>2016-01-19 11:44:18 +0100
commit1d9542df5d2ae5c21a1e96d100f899b3d7b2f27c (patch)
tree81a6785755e1fed5922cd9d3b96befddfc654333
parentab2bf5b51a1ca14cef63e8a7a88b039f173a210a (diff)
Don't link all binaries with ldap library
The default action-if-found of AC_CHECK_LIB() is to append checked library to LIBS. Thus check for ldap library resulted in unwanted addition of -lldap to LIBS as [] is an empty string in M4 and the default action is used. Fix the problem by providing proper action-if-found which was currently just hidden behind the check. Also do similar cleanup for AC_CHECK_HEADER check although there it didn't have any undesired side-effect. Reported-by: Petr Písař <petrp@users.sf.net> Signed-off-by: Jan Kara <jack@suse.cz>
-rw-r--r--configure.ac26
1 files changed, 12 insertions, 14 deletions
diff --git a/configure.ac b/configure.ac
index 68d5924..d17b18c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -72,18 +72,17 @@ AC_ARG_ENABLE([ldapmail],
[enable_ldapmail=auto]
)
AS_IF([test "x$enable_ldapmail" != "xno"], [
- build_ldap="yes"
- AC_CHECK_LIB([ldap], [ldap_initialize], [], [
+ AC_CHECK_LIB([ldap], [ldap_initialize], [
+ build_ldap="yes"
+ LDAP_LIBS="-lldap -llber"
+ AC_DEFINE([USE_LDAP_MAIL_LOOKUP], 1, [Lookup email address using LDAP])
+ COMPILE_OPTS="$COMPILE_OPTS USE_LDAP_MAIL_LOOKUP"
+ ], [
build_ldap="no"
AS_IF([test "x$enable_ldapmail" = "xyes"], [
AC_MSG_ERROR([LDAP support required but library not found.]);
])
])
- AS_IF([test "x$build_ldap" = "xyes"], [
- LDAP_LIBS="-lldap -llber"
- AC_DEFINE([USE_LDAP_MAIL_LOOKUP], 1, [Lookup email address using LDAP])
- COMPILE_OPTS="$COMPILE_OPTS USE_LDAP_MAIL_LOOKUP"
- ])
], [
build_ldap="no"
])
@@ -163,8 +162,12 @@ AC_ARG_ENABLE([libwrap],
[enable_libwrap=auto]
)
AS_IF([test "x$enable_libwrap" != "xno"], [
- build_libwrap="yes"
- AC_CHECK_HEADER([tcpd.h],[], [
+ AC_CHECK_HEADER([tcpd.h], [
+ build_libwrap="yes"
+ WRAP_LIBS="-lwrap"
+ AC_DEFINE([HOSTS_ACCESS], 1, [Use hosts.allow and hosts.deny for access checking of rpc.rquotad])
+ COMPILE_OPTS="$COMPILE_OPTS HOSTS_ACCESS"
+ ], [
build_libwrap="no"
AS_IF([test "x$enable_libwrap" = "xyes"] , [
AC_MSG_ERROR([tcpd.h not found and requested])
@@ -172,11 +175,6 @@ AS_IF([test "x$enable_libwrap" != "xno"], [
AC_MSG_WARN([tcpd.h not found])
])
])
- AS_IF([test "x$build_libwrap" != "xno"], [
- WRAP_LIBS="-lwrap"
- AC_DEFINE([HOSTS_ACCESS], 1, [Use hosts.allow and hosts.deny for access checking of rpc.rquotad])
- COMPILE_OPTS="$COMPILE_OPTS HOSTS_ACCESS"
- ])
], [
build_libwrap="no"
])