summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichal Schmidt <mschmidt@redhat.com>2015-10-13 20:06:04 +0200
committerMichal Schmidt <mschmidt@redhat.com>2015-10-14 14:49:18 +0200
commite97379dea2a5b99648abd2d76fae108b369f4988 (patch)
tree5063aae006f280a4090de611c2d70bd58befc8bc
parent5fd2e2284323304ad28f8ab80041f3cf6632dc72 (diff)
build: libdl is needed only for libnss_resolve
Not everything needs to link to libdl. dlopen+dlsym are used only by libnss_resolve.
-rw-r--r--Makefile.am4
-rw-r--r--configure.ac7
2 files changed, 6 insertions, 5 deletions
diff --git a/Makefile.am b/Makefile.am
index 8646e55450..c22394f0bf 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -919,7 +919,6 @@ libbasic_la_CFLAGS = \
libbasic_la_LIBADD = \
$(SELINUX_LIBS) \
$(CAP_LIBS) \
- -ldl \
-lrt \
-lm
@@ -5148,7 +5147,8 @@ libnss_resolve_la_LDFLAGS = \
-Wl,--version-script=$(top_srcdir)/src/nss-resolve/nss-resolve.sym
libnss_resolve_la_LIBADD = \
- libshared.la
+ libshared.la \
+ -ldl
lib_LTLIBRARIES += \
libnss_resolve.la
diff --git a/configure.ac b/configure.ac
index 4984c56f67..903eedff14 100644
--- a/configure.ac
+++ b/configure.ac
@@ -281,7 +281,6 @@ AM_CONDITIONAL([HAVE_PYTHON], [test "x$have_python" = "xyes"])
# ------------------------------------------------------------------------------
-AC_SEARCH_LIBS([dlsym], [dl], [], [AC_MSG_ERROR([*** Dynamic linking loader library not found])])
AC_CHECK_HEADERS([sys/capability.h], [], [AC_MSG_ERROR([*** POSIX caps headers not found])])
AC_CHECK_HEADERS([linux/btrfs.h], [], [])
AC_CHECK_HEADERS([linux/memfd.h], [], [])
@@ -1099,10 +1098,12 @@ AM_CONDITIONAL(ENABLE_POLKIT, [test "x$have_polkit" = "xyes"])
# ------------------------------------------------------------------------------
have_resolved=no
AC_ARG_ENABLE(resolved, AS_HELP_STRING([--disable-resolved], [disable resolve daemon]))
-if test "x$enable_resolved" != "xno"; then
+AS_IF([test "x$enable_resolved" != "xno"], [
+ AC_CHECK_LIB([dl], [dlsym], [true], [AC_MSG_ERROR([*** Dynamic linking loader library not found])])
+
have_resolved=yes
M4_DEFINES="$M4_DEFINES -DENABLE_RESOLVED"
-fi
+])
AM_CONDITIONAL(ENABLE_RESOLVED, [test "$have_resolved" = "yes"])
AC_ARG_WITH(dns-servers,