[libvirt] [PATCH 17/17] nss: only link to yajl library and nothing else

Daniel P. Berrangé berrange at redhat.com
Thu Aug 1 15:00:19 UTC 2019


Now that the code does not refer to any libvirt headers,
except internal.h macros, it does not need to link to
any libvirt code, nor gnulib either. The only thing it
needs is yajl.

Signed-off-by: Daniel P. Berrangé <berrange at redhat.com>
---
 config-post.h      | 30 -------------------
 src/Makefile.am    | 73 ----------------------------------------------
 src/util/virfile.c |  3 +-
 tools/Makefile.am  |  8 ++---
 4 files changed, 5 insertions(+), 109 deletions(-)

diff --git a/config-post.h b/config-post.h
index a11f9c83d6..38baeefdff 100644
--- a/config-post.h
+++ b/config-post.h
@@ -16,36 +16,6 @@
  * <http://www.gnu.org/licenses/>.
  */
 
-/*
- * The NSS module can be loaded into any binary and thus we want
- * to minimize what code is liable to be run. Especiall we need
- * to minimize use of any 3rd party libraries which have
- * __attribute__((constructor)) functions.
- *
- * The only way to avoid such deps is to re-compile the
- * functions with the code in question disabled, and for that we
- * must override the main config.h rules. Hence this file :-(
- */
-#ifdef LIBVIRT_NSS
-# undef HAVE_LIBNL
-# undef HAVE_LIBNL3
-# undef HAVE_LIBSASL2
-# undef HAVE_SYS_ACL_H
-# undef WITH_CAPNG
-# undef WITH_CURL
-# undef WITH_DEVMAPPER
-# undef WITH_DTRACE_PROBES
-# undef WITH_GNUTLS
-# undef WITH_LIBSSH
-# undef WITH_MACVTAP
-# undef WITH_NUMACTL
-# undef WITH_SASL
-# undef WITH_SSH2
-# undef WITH_VIRTUALPORT
-# undef WITH_SECDRIVER_SELINUX
-# undef WITH_SECDRIVER_APPARMOR
-#endif /* LIBVIRT_NSS */
-
 #ifndef __GNUC__
 # error "Libvirt requires GCC >= 4.4, or CLang"
 #endif
diff --git a/src/Makefile.am b/src/Makefile.am
index 8ca714dd34..f111b2a1b4 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -767,79 +767,6 @@ libvirt_iohelper_CFLAGS = \
 endif WITH_LIBVIRTD
 
 
-
-if WITH_NSS
-noinst_LTLIBRARIES += libvirt-nss.la
-
-libvirt_nss_la_SOURCES = \
-		util/viralloc.c \
-		util/viralloc.h \
-		util/viratomic.c \
-		util/viratomic.h \
-		util/virautoclean.h \
-		util/virbitmap.c \
-		util/virbitmap.h \
-		util/virbuffer.c \
-		util/virbuffer.h \
-		util/vircommand.c \
-		util/vircommand.h \
-		util/virenum.c \
-		util/virenum.h \
-		util/virerror.c \
-		util/virerror.h \
-		util/virfile.c \
-		util/virfile.h \
-		util/virhash.c \
-		util/virhash.h \
-		util/virhashcode.c \
-		util/virhashcode.h \
-		util/virjson.c \
-		util/virjson.h \
-		util/virkmod.c \
-		util/virkmod.h \
-		util/virlease.c \
-		util/virlease.h \
-		util/virlog.c \
-		util/virlog.h \
-		util/virmacmap.c \
-		util/virmacmap.h \
-		util/virobject.c \
-		util/virobject.h \
-		util/virpidfile.c \
-		util/virpidfile.h \
-		util/virprocess.c \
-		util/virprocess.h \
-		util/virrandom.c \
-		util/virrandom.h \
-		util/virsocketaddr.c \
-		util/virsocketaddr.h \
-		util/virstring.c \
-		util/virstring.h \
-		util/virthread.c \
-		util/virthread.h \
-		util/virthreadjob.c \
-		util/virthreadjob.h \
-		util/virtime.c \
-		util/virtime.h \
-		util/virutil.c \
-		util/virutil.h \
-		$(NULL)
-
-libvirt_nss_la_CFLAGS = \
-		-DLIBVIRT_NSS \
-		$(AM_CFLAGS) \
-		$(YAJL_CFLAGS) \
-		$(NULL)
-libvirt_nss_la_LDFLAGS = \
-		$(AM_LDFLAGS) \
-		$(NULL)
-
-libvirt_nss_la_LIBADD = \
-		$(YAJL_LIBS) \
-		$(NULL)
-endif WITH_NSS
-
-
 install-data-local: $(INSTALL_DATA_LOCAL) \
 		$(INSTALL_DATA_DIRS:%=install-data-%)
 	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/cache/libvirt"
diff --git a/src/util/virfile.c b/src/util/virfile.c
index 7667c16d27..81a3c096eb 100644
--- a/src/util/virfile.c
+++ b/src/util/virfile.c
@@ -631,8 +631,7 @@ int virFileUpdatePerm(const char *path,
 }
 
 
-#if defined(__linux__) && HAVE_DECL_LO_FLAGS_AUTOCLEAR && \
-    !defined(LIBVIRT_NSS)
+#if defined(__linux__) && HAVE_DECL_LO_FLAGS_AUTOCLEAR
 
 # if HAVE_DECL_LOOP_CTL_GET_FREE
 
diff --git a/tools/Makefile.am b/tools/Makefile.am
index 61812a2cb1..09cada949b 100644
--- a/tools/Makefile.am
+++ b/tools/Makefile.am
@@ -493,8 +493,8 @@ nss_libnss_libvirt_impl_la_CFLAGS = \
 	$(NULL)
 
 nss_libnss_libvirt_impl_la_LIBADD = \
-	../gnulib/lib/libgnu.la \
-	../src/libvirt-nss.la
+	$(YAJL_LIBS) \
+	$(NULL)
 
 nss_libnss_libvirt_la_SOURCES =
 nss_libnss_libvirt_la_LDFLAGS = \
@@ -524,8 +524,8 @@ nss_libnss_libvirt_guest_impl_la_CFLAGS = \
 	$(NULL)
 
 nss_libnss_libvirt_guest_impl_la_LIBADD = \
-	../gnulib/lib/libgnu.la \
-	../src/libvirt-nss.la
+	$(YAJL_LIBS) \
+	$(NULL)
 
 nss_libnss_libvirt_guest_la_SOURCES =
 nss_libnss_libvirt_guest_la_LDFLAGS = \
-- 
2.21.0




More information about the libvir-list mailing list