Signed-off-by: Pavel Hrdina <phrdina(a)redhat.com>
---
tools/Makefile.am | 43 -------------------------------------------
tools/meson.build | 42 ++++++++++++++++++++++++++++++++++++++++++
2 files changed, 42 insertions(+), 43 deletions(-)
diff --git a/tools/Makefile.am b/tools/Makefile.am
index 01c24bec02d..d285146622f 100644
--- a/tools/Makefile.am
+++ b/tools/Makefile.am
@@ -45,10 +45,6 @@ bin_PROGRAMS += virt-login-shell
libexec_PROGRAMS = virt-login-shell-helper
endif WITH_LOGIN_SHELL
-if WITH_HOST_VALIDATE
-bin_PROGRAMS += virt-host-validate
-endif WITH_HOST_VALIDATE
-
virt-xml-validate: virt-xml-validate.in Makefile
$(AM_V_GEN)sed -e 's|[@]schemadir@|$(pkgdatadir)/schemas|g' \
-e 's|[@]VERSION@|$(VERSION)|g' \
@@ -66,45 +62,6 @@ virt-sanlock-cleanup: virt-sanlock-cleanup.in Makefile
noinst_LTLIBRARIES =
-virt_host_validate_SOURCES = \
- virt-host-validate.c \
- virt-host-validate-common.c virt-host-validate-common.h
-
-VIRT_HOST_VALIDATE_QEMU = \
- virt-host-validate-qemu.c \
- virt-host-validate-qemu.h
-VIRT_HOST_VALIDATE_LXC = \
- virt-host-validate-lxc.c \
- virt-host-validate-lxc.h
-VIRT_HOST_VALIDATE_BHYVE = \
- virt-host-validate-bhyve.c \
- virt-host-validate-bhyve.h
-if WITH_QEMU
-virt_host_validate_SOURCES += $(VIRT_HOST_VALIDATE_QEMU)
-endif ! WITH_QEMU
-
-if WITH_LXC
-virt_host_validate_SOURCES += $(VIRT_HOST_VALIDATE_LXC)
-endif ! WITH_LXC
-
-if WITH_BHYVE
-virt_host_validate_SOURCES += $(VIRT_HOST_VALIDATE_BHYVE)
-endif ! WITH_BHYVE
-
-virt_host_validate_LDFLAGS = \
- $(AM_LDFLAGS) \
- $(COVERAGE_LDFLAGS) \
- $(NULL)
-
-virt_host_validate_LDADD = \
- ../src/libvirt.la \
- $(GLIB_LIBS) \
- $(NULL)
-
-virt_host_validate_CFLAGS = \
- $(AM_CFLAGS) \
- $(NULL)
-
# virt-login-shell will be setuid, and must not link to anything
# except glibc. It wil scrub the environment and then invoke the
# real virt-login-shell-helper binary.
diff --git a/tools/meson.build b/tools/meson.build
index 3a4bd760688..8c7d3ec64ab 100644
--- a/tools/meson.build
+++ b/tools/meson.build
@@ -32,3 +32,45 @@ libvirt_shell_lib = static_library(
coverage_flags,
],
)
+
+if conf.has('WITH_HOST_VALIDATE')
+ virt_host_validate_sources = [
+ 'virt-host-validate.c',
+ 'virt-host-validate-common.c',
+ ]
+
+ if conf.has('WITH_QEMU')
+ virt_host_validate_sources += [
+ 'virt-host-validate-qemu.c',
+ ]
+ endif
+ if conf.has('WITH_LXC')
+ virt_host_validate_sources += [
+ 'virt-host-validate-lxc.c',
+ ]
+ endif
+ if conf.has('WITH_BHYVE')
+ virt_host_validate_sources += [
+ 'virt-host-validate-bhyve.c',
+ ]
+ endif
+
+ executable(
+ 'virt-host-validate',
+ [
+ virt_host_validate_sources,
+ ],
+ dependencies: [
+ tools_dep,
+ ],
+ link_args: [
+ coverage_flags,
+ ],
+ link_with: [
+ libvirt_lib,
+ ],
+ install: true,
+ install_dir: bindir,
+ install_rpath: libdir,
+ )
+endif
--
2.26.2