[Libguestfs] [v2v PATCH 6/7] build: actually require libvirt

Pino Toscano ptoscano at redhat.com
Fri Dec 13 16:01:38 UTC 2019


libvirt was already a required component, so make the build system
enforce that.
---
 m4/guestfs-libraries.m4 | 22 ++--------------------
 tests/Makefile.am       |  2 --
 2 files changed, 2 insertions(+), 22 deletions(-)

diff --git a/m4/guestfs-libraries.m4 b/m4/guestfs-libraries.m4
index 41f3a975..bb5d75f6 100644
--- a/m4/guestfs-libraries.m4
+++ b/m4/guestfs-libraries.m4
@@ -80,26 +80,8 @@ PKG_CHECK_MODULES([PCRE], [libpcre], [], [
     PCRE_LIBS=`$PCRE_CONFIG --libs`
 ])
 
-dnl libvirt (highly recommended)
-AC_ARG_WITH([libvirt],[
-    AS_HELP_STRING([--without-libvirt],
-                   [disable libvirt support @<:@default=check@:>@])],
-    [],
-    [with_libvirt=check])
-AS_IF([test "$with_libvirt" != "no"],[
-    PKG_CHECK_MODULES([LIBVIRT], [libvirt >= 0.10.2],[
-        AC_SUBST([LIBVIRT_CFLAGS])
-        AC_SUBST([LIBVIRT_LIBS])
-        AC_DEFINE([HAVE_LIBVIRT],[1],[libvirt found at compile time.])
-    ],[
-        if test "$DEFAULT_BACKEND" = "libvirt"; then
-            AC_MSG_ERROR([Please install the libvirt devel package])
-        else
-            AC_MSG_WARN([libvirt not found, some core features will be disabled])
-        fi
-    ])
-])
-AM_CONDITIONAL([HAVE_LIBVIRT],[test "x$LIBVIRT_LIBS" != "x"])
+dnl libvirt (required)
+PKG_CHECK_MODULES([LIBVIRT], [libvirt >= 0.10.2])
 
 libvirt_ro_uri='qemu+unix:///system?socket=/var/run/libvirt/libvirt-sock-ro'
 AC_SUBST([libvirt_ro_uri])
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 41fd24bf..0f004d19 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -19,7 +19,6 @@ include $(top_srcdir)/subdir-rules.mk
 
 EXTRA_DIST = test-functions.sh
 
-if HAVE_LIBVIRT
 # Small utility to check for a needed libvirt version;
 # to be used in shell/script-based tests.
 noinst_PROGRAMS = libvirt-is-version
@@ -36,7 +35,6 @@ libvirt_is_version_CPPFLAGS = \
 libvirt_is_version_CFLAGS = \
 	$(WARN_CFLAGS) $(WERROR_CFLAGS) \
 	$(LIBVIRT_CFLAGS)
-endif
 
 # Tests.
 
-- 
2.23.0




More information about the Libguestfs mailing list