meson: tools: build virsh binary

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Neal Gompa <ngompa13@gmail.com>
This commit is contained in:
Pavel Hrdina 2020-06-24 13:33:22 +02:00
parent a39ea937aa
commit 75d211c2e6
2 changed files with 52 additions and 49 deletions

View File

@ -25,7 +25,7 @@ confdir = $(sysconfdir)/libvirt
conf_DATA =
bin_SCRIPTS = virt-xml-validate virt-pki-validate
bin_PROGRAMS = virsh virt-admin
bin_PROGRAMS = virt-admin
libexec_SCRIPTS = libvirt-guests.sh
if WITH_SANLOCK
@ -53,50 +53,6 @@ virt-sanlock-cleanup: virt-sanlock-cleanup.in Makefile
noinst_LTLIBRARIES =
virsh_SOURCES = \
virsh.c virsh.h \
virsh-backup.c virsh-backup.h \
virsh-checkpoint.c virsh-checkpoint.h \
virsh-completer.c virsh-completer.h \
virsh-completer-domain.c virsh-completer-domain.h \
virsh-completer-checkpoint.c virsh-completer-checkpoint.h \
virsh-completer-host.c virsh-completer-host.h \
virsh-completer-interface.c virsh-completer-interface.h \
virsh-completer-network.c virsh-completer-network.h \
virsh-completer-nodedev.c virsh-completer-nodedev.h \
virsh-completer-nwfilter.c virsh-completer-nwfilter.h \
virsh-completer-pool.c virsh-completer-pool.h \
virsh-completer-secret.c virsh-completer-secret.h \
virsh-completer-snapshot.c virsh-completer-snapshot.h \
virsh-completer-volume.c virsh-completer-volume.h \
virsh-console.c virsh-console.h \
virsh-domain.c virsh-domain.h \
virsh-domain-monitor.c virsh-domain-monitor.h \
virsh-host.c virsh-host.h \
virsh-interface.c virsh-interface.h \
virsh-network.c virsh-network.h \
virsh-nodedev.c virsh-nodedev.h \
virsh-nwfilter.c virsh-nwfilter.h \
virsh-pool.c virsh-pool.h \
virsh-secret.c virsh-secret.h \
virsh-snapshot.c virsh-snapshot.h \
virsh-util.c virsh-util.h \
virsh-volume.c virsh-volume.h \
$(NULL)
virsh_LDFLAGS = \
$(AM_LDFLAGS) \
$(COVERAGE_LDFLAGS) \
$(NULL)
virsh_LDADD = \
$(STATIC_BINARIES) \
../src/libvirt-lxc.la \
../src/libvirt-qemu.la \
libvirt_shell.la
virsh_CFLAGS = \
$(AM_CFLAGS) \
$(READLINE_CFLAGS)
virt_admin_SOURCES = \
virt-admin.c virt-admin.h \
virt-admin-completer.c virt-admin-completer.h \
@ -117,10 +73,6 @@ virt_admin_CFLAGS = \
$(READLINE_CFLAGS)
BUILT_SOURCES =
if WITH_WIN_ICON
virsh_LDADD += virsh_win_icon.$(OBJEXT)
endif WITH_WIN_ICON
install-data-local: install-systemd install-nss \
install-bash-completion

View File

@ -146,3 +146,54 @@ if host_machine.system() == 'windows'
else
virsh_icon_res = []
endif
executable(
'virsh',
[
'virsh.c',
'virsh-backup.c',
'virsh-checkpoint.c',
'virsh-completer.c',
'virsh-completer-domain.c',
'virsh-completer-checkpoint.c',
'virsh-completer-host.c',
'virsh-completer-interface.c',
'virsh-completer-network.c',
'virsh-completer-nodedev.c',
'virsh-completer-nwfilter.c',
'virsh-completer-pool.c',
'virsh-completer-secret.c',
'virsh-completer-snapshot.c',
'virsh-completer-volume.c',
'virsh-console.c',
'virsh-domain.c',
'virsh-domain-monitor.c',
'virsh-host.c',
'virsh-interface.c',
'virsh-network.c',
'virsh-nodedev.c',
'virsh-nwfilter.c',
'virsh-pool.c',
'virsh-secret.c',
'virsh-snapshot.c',
'virsh-util.c',
'virsh-volume.c',
virsh_icon_res,
],
dependencies: [
tools_dep,
readline_dep,
thread_dep,
],
link_args: [
coverage_flags,
],
link_with: [
libvirt_lxc_lib,
libvirt_qemu_lib,
libvirt_shell_lib,
],
install: true,
install_dir: bindir,
install_rpath: libdir,
)