[libvirt] [PATCH 00/11] build: work in progress illustration of meson conversion

For the past week or to I've been tackling the problem of converting from autotools to meson. Many of the virt related projects have gone through this already, but libvirt is a bit of a special case because it is so huge. In particular I don't think it is acceptable to do a big bang where the entire of meson support is in one commit and then entire of autotools support is deleted in the next commit. While this was OK for smaller projects, it is impossible to sensibly review for something as large as libvirt. Obviously this series is faaaar from complete as it hasn't tried to convert anything in the src/ dir where most of our cruft is. It is also not tested on anything other than my Fedora 30 system so don't expect perfection here. Daniel P. Berrangé (11): build: mandate use of a build dir != src dir build: drop support for python2, requiring python3 only build: introduce bare minimum use of meson as a build system build: declare deps for libraries built by autotools build: use meson for building the example programs build: use meson for installing example program src / data build: use meson for building NSS modules build: add command line options for enabling each driver build: use meson for building virt-host-validate build: use meson for building virt-login-shell build: use meson for building virsh / virt-admin Makefile.am | 2 +- build-aux/dist.py | 133 ++++++++++++ configure.ac | 13 +- docs/apibuild.py | 4 +- docs/reformat-news.py | 4 +- examples/Makefile.am | 135 ------------ examples/c/admin/meson.build | 59 ++++++ examples/c/domain/meson.build | 43 ++++ examples/c/meson.build | 4 + examples/c/misc/meson.build | 27 +++ examples/meson.build | 6 + examples/polkit/meson.build | 5 + examples/sh/meson.build | 5 + examples/systemtap/meson.build | 8 + examples/xml/meson.build | 3 + examples/xml/storage/meson.build | 14 ++ examples/xml/test/meson.build | 13 ++ libvirt.spec.in | 47 ++--- m4/virt-bash-completion.m4 | 70 ------- m4/virt-host-validate.m4 | 43 ---- m4/virt-login-shell.m4 | 43 ---- meson.build | 54 +++++ meson_options.txt | 27 +++ src/bhyve/meson.build | 5 + src/esx/esx_vi_generator.py | 4 +- src/esx/meson.build | 2 + src/hyperv/hyperv_wmi_generator.py | 4 +- src/hyperv/meson.build | 2 + src/interface/meson.build | 5 + src/libxl/meson.build | 5 + src/lxc/meson.build | 5 + src/meson.build | 61 ++++++ src/network/meson.build | 5 + src/node_device/meson.build | 5 + src/nwfilter/meson.build | 5 + src/openvz/meson.build | 2 + src/phyp/meson.build | 2 + src/qemu/meson.build | 5 + src/remote/meson.build | 6 + src/secret/meson.build | 5 + src/storage/meson.build | 5 + src/test/meson.build | 2 + src/vbox/meson.build | 2 + src/vmware/meson.build | 2 + src/vz/meson.build | 5 + tests/cputestdata/cpu-gather.sh | 9 +- tools/Makefile.am | 318 +---------------------------- tools/bash-completion/meson.build | 19 ++ tools/meson.build | 252 +++++++++++++++++++++++ tools/nss/meson.build | 63 ++++++ 50 files changed, 909 insertions(+), 658 deletions(-) create mode 100755 build-aux/dist.py delete mode 100644 examples/Makefile.am create mode 100644 examples/c/admin/meson.build create mode 100644 examples/c/domain/meson.build create mode 100644 examples/c/meson.build create mode 100644 examples/c/misc/meson.build create mode 100644 examples/meson.build create mode 100644 examples/polkit/meson.build create mode 100644 examples/sh/meson.build create mode 100644 examples/systemtap/meson.build create mode 100644 examples/xml/meson.build create mode 100644 examples/xml/storage/meson.build create mode 100644 examples/xml/test/meson.build delete mode 100644 m4/virt-bash-completion.m4 delete mode 100644 m4/virt-host-validate.m4 delete mode 100644 m4/virt-login-shell.m4 create mode 100644 meson.build create mode 100644 meson_options.txt create mode 100644 src/bhyve/meson.build create mode 100644 src/esx/meson.build create mode 100644 src/hyperv/meson.build create mode 100644 src/interface/meson.build create mode 100644 src/libxl/meson.build create mode 100644 src/lxc/meson.build create mode 100644 src/meson.build create mode 100644 src/network/meson.build create mode 100644 src/node_device/meson.build create mode 100644 src/nwfilter/meson.build create mode 100644 src/openvz/meson.build create mode 100644 src/phyp/meson.build create mode 100644 src/qemu/meson.build create mode 100644 src/remote/meson.build create mode 100644 src/secret/meson.build create mode 100644 src/storage/meson.build create mode 100644 src/test/meson.build create mode 100644 src/vbox/meson.build create mode 100644 src/vmware/meson.build create mode 100644 src/vz/meson.build create mode 100644 tools/bash-completion/meson.build create mode 100644 tools/meson.build create mode 100644 tools/nss/meson.build -- 2.21.0

Historically we've allowed builds in the main src dir, but meson does not support this. Explicitly force separate build dir in autotools to align with meson. We must re-enable dependency tracking which the RPM %configure macro turns off. Without this, the build dir doesn't get the source directory tree mirrored. Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> --- configure.ac | 6 ++++++ libvirt.spec.in | 10 +++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index af8cbcdfd8..2855d8cab0 100644 --- a/configure.ac +++ b/configure.ac @@ -17,6 +17,12 @@ dnl License along with this library. If not, see dnl <http://www.gnu.org/licenses/>. AC_INIT([libvirt], [5.8.0], [libvir-list@redhat.com], [], [https://libvirt.org]) + +if test $srcdir = "." +then + AC_MSG_ERROR([Build directory must be different from source directory]) +fi + AC_CONFIG_SRCDIR([src/libvirt.c]) AC_CONFIG_AUX_DIR([build-aux]) AC_CONFIG_HEADERS([config.h]) diff --git a/libvirt.spec.in b/libvirt.spec.in index 7f5183f341..29839fad77 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -1162,7 +1162,13 @@ export SOURCE_DATE_EPOCH=$(stat --printf='%Y' %{_specdir}/%{name}.spec) %endif rm -f po/stamp-po -%configure --with-runstatedir=%{_rundir} \ + +%define _configure ../configure +mkdir %{_vpath_builddir} +cd %{_vpath_builddir} + +%configure --enable-dependency-tracking \ + --with-runstatedir=%{_rundir} \ %{?arg_qemu} \ %{?arg_openvz} \ %{?arg_lxc} \ @@ -1231,6 +1237,7 @@ rm -fr %{buildroot} export SOURCE_DATE_EPOCH=$(stat --printf='%Y' %{_specdir}/%{name}.spec) +cd %{_vpath_builddir} %make_install %{?_smp_mflags} SYSTEMD_UNIT_DIR=%{_unitdir} V=1 rm -f $RPM_BUILD_ROOT%{_libdir}/*.la @@ -1312,6 +1319,7 @@ mv $RPM_BUILD_ROOT%{_datadir}/systemtap/tapset/libvirt_qemu_probes.stp \ %endif %check +cd %{_vpath_builddir} if ! make %{?_smp_mflags} check VIR_TEST_DEBUG=1 then cat test-suite.log || true -- 2.21.0

Meson requires python 3 and python 2 is end of life at the end of the year. This is the bare minimum cleanup which simply drops any "from __future__" usage and updates the shbang line. Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> --- configure.ac | 4 ++-- docs/apibuild.py | 4 +--- docs/reformat-news.py | 4 +--- libvirt.spec.in | 9 +-------- src/esx/esx_vi_generator.py | 4 +--- src/hyperv/hyperv_wmi_generator.py | 4 +--- tests/cputestdata/cpu-gather.sh | 9 +-------- 7 files changed, 8 insertions(+), 30 deletions(-) diff --git a/configure.ac b/configure.ac index 2855d8cab0..f5c6fabc6d 100644 --- a/configure.ac +++ b/configure.ac @@ -706,9 +706,9 @@ if test "$with_linux" = "yes"; then fi dnl Allow perl/python overrides -AC_PATH_PROGS([PYTHON], [python3 python2 python]) +AC_PATH_PROGS([PYTHON], [python3]) if test -z "$PYTHON"; then - AC_MSG_ERROR(['python3', 'python2' or 'python' binary is required to build libvirt]) + AC_MSG_ERROR(['python3' binary is required to build libvirt]) fi AC_PATH_PROG([FLAKE8], [flake8]) if test -z "$FLAKE8"; then diff --git a/docs/apibuild.py b/docs/apibuild.py index 92886e1276..0242ff81be 100755 --- a/docs/apibuild.py +++ b/docs/apibuild.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # # This is the API builder, it parses the C sources and build the # API formal description in XML. @@ -8,8 +8,6 @@ # daniel@veillard.com # -from __future__ import print_function - import os import sys import glob diff --git a/docs/reformat-news.py b/docs/reformat-news.py index 955ce2d45b..c2dfc138bc 100755 --- a/docs/reformat-news.py +++ b/docs/reformat-news.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # reformat-news.py: Reformat the NEWS file properly # @@ -18,8 +18,6 @@ # License along with this library. If not, see # <http://www.gnu.org/licenses/>. -from __future__ import print_function - import sys COLUMNS = 80 diff --git a/libvirt.spec.in b/libvirt.spec.in index 29839fad77..20d4c0444b 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -175,13 +175,6 @@ %define with_bash_completion 0%{!?_without_bash_completion:1} -# Use Python 3 when possible, Python 2 otherwise -%if 0%{?fedora} || 0%{?rhel} > 7 - %define python python3 -%else - %define python python2 -%endif - %if %{with_qemu} || %{with_lxc} # numad is used to manage the CPU and memory placement dynamically, @@ -268,7 +261,7 @@ BuildRequires: perl-interpreter %else BuildRequires: perl %endif -BuildRequires: %{python} +BuildRequires: python3 BuildRequires: systemd-units %if %{with_libxl} BuildRequires: xen-devel diff --git a/src/esx/esx_vi_generator.py b/src/esx/esx_vi_generator.py index 28d440a6df..1be42210ff 100755 --- a/src/esx/esx_vi_generator.py +++ b/src/esx/esx_vi_generator.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # # esx_vi_generator.py: generates most of the SOAP type mapping code @@ -22,8 +22,6 @@ # <http://www.gnu.org/licenses/>. # -from __future__ import print_function - import sys import os import os.path diff --git a/src/hyperv/hyperv_wmi_generator.py b/src/hyperv/hyperv_wmi_generator.py index a9ece0ff00..d12d15d012 100755 --- a/src/hyperv/hyperv_wmi_generator.py +++ b/src/hyperv/hyperv_wmi_generator.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # # hyperv_wmi_generator.py: generates most of the WMI type mapping code @@ -20,8 +20,6 @@ # <http://www.gnu.org/licenses/>. # -from __future__ import print_function - import sys import os import os.path diff --git a/tests/cputestdata/cpu-gather.sh b/tests/cputestdata/cpu-gather.sh index cefd1b0d0d..79e3fddf22 100755 --- a/tests/cputestdata/cpu-gather.sh +++ b/tests/cputestdata/cpu-gather.sh @@ -9,9 +9,7 @@ grep 'model name' /proc/cpuinfo | head -n1 cpuid -1r echo -for python in python3 python2; do - $python <<EOF -from __future__ import print_function +python3 <<EOF from struct import pack, unpack from fcntl import ioctl import sys, errno @@ -51,11 +49,6 @@ except IOError as e: pass EOF - if [[ $? -eq 0 ]]; then - break - fi -done - qemu=qemu-system-x86_64 for cmd in /usr/bin/$qemu /usr/bin/qemu-kvm /usr/libexec/qemu-kvm; do if [[ -x $cmd ]]; then -- 2.21.0

This patch is the first baby step in an incremental conversion to use meson. Initially all it does is take responsibilty for creating the dist tarball. No attempt is made to integrate into autotools at this stage. Eventually meson will be the primary build system and autotools will be invoked by meson automatically for building gnulib. To start with though, the build process will require invoking both automake and meson. Since meson only supports builddir != srcdir, automake must be invoked this way too: mkdir build cd build ../configure make cd .. meson build ninja -C build Though in reality the meson/ninja step here is a no-op, it is enough to start the integration process. In terms of making a release the steps are the same, but the last command must be followed by "ninja -C build dist" The dist tarball we generate is slightly different from what we previously built. meson's default is to merely bundle the result of 'git archive' with all submodules. We do not want the .gnulib submodule though as that is far too large. We just want the subset of gnulib installed by bootstrap. We can't simply copy the gnulib/ directory though, as we need the autotools integration too and bootstrap runs autoreconf. The upshot is that we purge .gnulib and copy a whitelist of files that were seen to be created by bootstrap in a Fedora 30 host. By the end of the series, when gnulib is the only thing using autotools, we can isolate everything from bootstrap in a private sub-dir and simplify the dist. In addition to the gnulib / autotools pieces, we add the AUTHORS, NEWS and libvirt.spec files. What this looses compared to previous tarballs is any files that were listed as EXTRA_DIST, which were not source controlled in git. This is negligible and any such files are easily built. Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> --- build-aux/dist.py | 133 ++++++++++++++++++++++++++++++++++++++++++++++ libvirt.spec.in | 8 +++ meson.build | 22 ++++++++ 3 files changed, 163 insertions(+) create mode 100755 build-aux/dist.py create mode 100644 meson.build diff --git a/build-aux/dist.py b/build-aux/dist.py new file mode 100755 index 0000000000..306d8d91bc --- /dev/null +++ b/build-aux/dist.py @@ -0,0 +1,133 @@ +#!/usr/bin/env python3 + +from __future__ import print_function + +import os +import os.path +import time +import shutil +import subprocess +import sys + +if len(sys.argv) != 3: + print("syntax: %s SOURCE-ROOT BUILD-ROOT", sys.argv[0]) + sys.exit(1) + +srcroot = sys.argv[1] +buildroot = sys.argv[2] +distdir = os.environ["MESON_DIST_ROOT"] + +# We don't want to bundle the entire of gnulib. +# Bundling only the stuff we need is not as simple +# as just grabbing the gnulib/ subdir though. The +# bootstrap script is intertwined into autoreconf +# with specific ordering needs. Thus we must +# bundle the result from autoreconf + bootstrap +gnulibmod = os.path.join(distdir, ".gnulib") +shutil.rmtree(gnulibmod) + +autotools = { + "/": [ + "GNUmakefile", + "INSTALL", + "Makefile.in", + "aclocal.m4", + "config.h.in", + "configure", + "maint.mk", + ], + "/build-aux": [ + ".gitignore", + "compile", + "config.guess", + "config.rpath", + "config.sub", + "depcomp", + "gitlog-to-changelog", + "install-sh", + "ltmain.sh", + "missing", + "mktempd", + "test-driver", + "useless-if-before-free", + "vc-list-files", + ], + "/docs": [ + "Makefile.in", + ], + "/examples": [ + "Makefile.in", + ], + "/gnulib": None, + "/include/libvirt": [ + "Makefile.in", + ], + "/m4": None, + "/po": [ + "Makefile.in", + ], + "/src": [ + "Makefile.in", + ], + "/tests": [ + "Makefile.in", + ], + "/tools": [ + "Makefile.in", + ], +} + +for dirname in autotools.keys(): + srcdir = os.path.join(srcroot, *dirname[1:].split("/")) + dstdir = os.path.join(distdir, *dirname[1:].split("/")) + + if autotools[dirname] is None: + shutil.rmtree(dstdir) + shutil.copytree(srcdir, dstdir) + else: + os.makedirs(dstdir, exist_ok=True) + for filename in autotools[dirname]: + srcfile = os.path.join(srcdir, filename) + dstfile = os.path.join(dstdir, filename) + + shutil.copyfile(srcfile, dstfile) + shutil.copymode(srcfile, dstfile) + +# Files created by meson using 'git clone' get a +# timestamp from time we run 'ninja dist'. The +# autotools files we're copying, get a time from +# time we copy them. When 'make' runs later it +# will think 'configure' is out of date and try +# to recreate it. We hack around this by setting +# all files to the same timestamp +now = time.time() +for dirname, subdirs, files in os.walk(distdir): + for filename in files: + dstfile = os.path.join(dirname, filename) + os.utime(dstfile, (now, now)) + + +# Some auto-generated files we want to include +extra_dist = [ + "libvirt.spec", + "NEWS" +] +for filename in extra_dist: + filesrc = os.path.join(buildroot, filename) + filedst = os.path.join(distdir, filename) + + shutil.copyfile(filesrc, filedst) + +authors = subprocess.check_output(["git", "log", "--pretty=format:%aN <%aE>"]) +authorlist = sorted(set(authors.decode("utf8").split("\n"))) + +authorssrc = os.path.join(srcroot, "AUTHORS.in") +authorsdst = os.path.join(distdir, "AUTHORS") +with open(authorssrc, "r") as src, open(authorsdst, "w") as dst: + for line in src: + if line.find("#contributorslist#") != -1: + for name in authorlist: + print(name, file=dst) + else: + print(line, end='', file=dst) + diff --git a/libvirt.spec.in b/libvirt.spec.in index 20d4c0444b..9e33504e01 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -254,6 +254,7 @@ BuildRequires: gettext-devel BuildRequires: libtool BuildRequires: /usr/bin/pod2man %endif +BuildRequires: meson BuildRequires: gcc BuildRequires: git %if 0%{?fedora} || 0%{?rhel} > 7 @@ -1224,6 +1225,9 @@ cd %{_vpath_builddir} --with-init-script=systemd \ %{?arg_login_shell} make %{?_smp_mflags} V=1 +cd .. +%meson +%meson_build %install rm -fr %{buildroot} @@ -1232,6 +1236,8 @@ export SOURCE_DATE_EPOCH=$(stat --printf='%Y' %{_specdir}/%{name}.spec) cd %{_vpath_builddir} %make_install %{?_smp_mflags} SYSTEMD_UNIT_DIR=%{_unitdir} V=1 +cd .. +%meson_install rm -f $RPM_BUILD_ROOT%{_libdir}/*.la rm -f $RPM_BUILD_ROOT%{_libdir}/*.a @@ -1318,6 +1324,8 @@ then cat test-suite.log || true exit 1 fi +cd ../.. +%meson_test %post libs %if 0%{?rhel} == 7 diff --git a/meson.build b/meson.build new file mode 100644 index 0000000000..31428dba9b --- /dev/null +++ b/meson.build @@ -0,0 +1,22 @@ +project( + 'libvirt', + 'c', + version: '5.8.0', + license: 'LGPLv2+', + default_options: [ + 'buildtype=debugoptimized', + 'c_std=gnu99', + ], + meson_version: '>= 0.49.0' +) + +prefix = get_option('prefix') +bin_dir = get_option('bindir') +lib_dir = get_option('libdir') +sys_conf_dir = get_option('sysconfdir') +data_dir = get_option('datadir') +local_state_dir = get_option('localstatedir') +pkg_data_dir = data_dir / meson.project_name() +pkg_doc_dir = data_dir / 'doc' / meson.project_name() + '-' + meson.project_version() + +meson.add_dist_script('build-aux' / 'dist.py', meson.source_root(), meson.build_root()) -- 2.21.0

The meson recipes will need to link against libvirt.so, libvirt-admin.so and libgnu.a. We declare these as external pre-built dependencies for now. Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> --- meson.build | 13 +++++++++++++ src/meson.build | 25 +++++++++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 src/meson.build diff --git a/meson.build b/meson.build index 31428dba9b..1febd9c35d 100644 --- a/meson.build +++ b/meson.build @@ -19,4 +19,17 @@ local_state_dir = get_option('localstatedir') pkg_data_dir = data_dir / meson.project_name() pkg_doc_dir = data_dir / 'doc' / meson.project_name() + '-' + meson.project_version() +public_inc_dir = include_directories('include') +gnulib_inc_dir = include_directories('gnulib/lib') + +cc = meson.get_compiler('c') + +gnulib = cc.find_library('libgnu', dirs: [meson.build_root() / 'gnulib' / 'lib' / '.libs']) +gnulib_dep = declare_dependency( + dependencies: [gnulib], + include_directories: [gnulib_inc_dir] +) + meson.add_dist_script('build-aux' / 'dist.py', meson.source_root(), meson.build_root()) + +subdir('src') diff --git a/src/meson.build b/src/meson.build new file mode 100644 index 0000000000..a86d3a6980 --- /dev/null +++ b/src/meson.build @@ -0,0 +1,25 @@ + +libvirt = cc.find_library('libvirt', dirs: [meson.build_root() / 'src' / '.libs']) +libvirt_admin = cc.find_library('libvirt-admin', dirs: [meson.build_root() / 'src' / '.libs']) +libvirt_qemu = cc.find_library('libvirt-qemu', dirs: [meson.build_root() / 'src' / '.libs']) +libvirt_lxc = cc.find_library('libvirt-lxc', dirs: [meson.build_root() / 'src' / '.libs']) + +libvirt_dep = declare_dependency( + dependencies: libvirt, + include_directories: [public_inc_dir] +) + +libvirt_admin_dep = declare_dependency( + dependencies: libvirt_admin, + include_directories: [public_inc_dir] +) + +libvirt_qemu_dep = declare_dependency( + dependencies: libvirt_qemu, + include_directories: [public_inc_dir] +) + +libvirt_lxc_dep = declare_dependency( + dependencies: libvirt_lxc, + include_directories: [public_inc_dir] +) -- 2.21.0

The example programs link against the main libvirt.so, which is not yet built by meson. Thus we declare it as an external dependancy initially. Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> --- examples/Makefile.am | 52 ----------------------------------- examples/c/admin/meson.build | 51 ++++++++++++++++++++++++++++++++++ examples/c/domain/meson.build | 37 +++++++++++++++++++++++++ examples/c/meson.build | 4 +++ examples/c/misc/meson.build | 23 ++++++++++++++++ examples/meson.build | 2 ++ meson.build | 1 + 7 files changed, 118 insertions(+), 52 deletions(-) create mode 100644 examples/c/admin/meson.build create mode 100644 examples/c/domain/meson.build create mode 100644 examples/c/meson.build create mode 100644 examples/c/misc/meson.build create mode 100644 examples/meson.build diff --git a/examples/Makefile.am b/examples/Makefile.am index ad635bdcc0..b12652874f 100644 --- a/examples/Makefile.am +++ b/examples/Makefile.am @@ -56,58 +56,6 @@ EXTRA_DIST = \ $(TEST_XML_EXAMPLES) \ $(NULL) -AM_CPPFLAGS = \ - -I$(top_builddir)/include \ - -I$(top_srcdir)/include \ - $(NULL) - -AM_CFLAGS = \ - $(WARN_CFLAGS) \ - $(NULL) - -AM_LDFLAGS = \ - $(STATIC_BINARIES) \ - $(NULL) - -LDADD = \ - $(top_builddir)/src/libvirt.la \ - $(top_builddir)/src/libvirt-admin.la \ - $(NULL) - -noinst_PROGRAMS = \ - c/admin/client_close \ - c/admin/client_info \ - c/admin/client_limits \ - c/admin/list_clients \ - c/admin/list_servers \ - c/admin/logging \ - c/admin/threadpool_params \ - c/domain/dommigrate \ - c/domain/domtop \ - c/domain/info1 \ - c/domain/rename \ - c/domain/suspend \ - c/misc/event-test \ - c/misc/hellolibvirt \ - c/misc/openauth \ - $(NULL) - -c_admin_client_close_SOURCES = c/admin/client_close.c -c_admin_client_info_SOURCES = c/admin/client_info.c -c_admin_client_limits_SOURCES = c/admin/client_limits.c -c_admin_list_clients_SOURCES = c/admin/list_clients.c -c_admin_list_servers_SOURCES = c/admin/list_servers.c -c_admin_logging_SOURCES = c/admin/logging.c -c_admin_threadpool_params_SOURCES = c/admin/threadpool_params.c -c_domain_dommigrate_SOURCES = c/domain/dommigrate.c -c_domain_domtop_SOURCES = c/domain/domtop.c -c_domain_info1_SOURCES = c/domain/info1.c -c_domain_rename_SOURCES = c/domain/rename.c -c_domain_suspend_SOURCES = c/domain/suspend.c -c_misc_event_test_SOURCES = c/misc/event-test.c -c_misc_hellolibvirt_SOURCES = c/misc/hellolibvirt.c -c_misc_openauth_SOURCES = c/misc/openauth.c - examplesdir = $(docdir)/examples adminexamplesdir = $(examplesdir)/c/admin diff --git a/examples/c/admin/meson.build b/examples/c/admin/meson.build new file mode 100644 index 0000000000..bdec5fd22e --- /dev/null +++ b/examples/c/admin/meson.build @@ -0,0 +1,51 @@ + +examples_admin_deps = [libvirt_dep, libvirt_admin_dep] + +client_close_src = ['client_close.c'] +client_close = executable( + 'client_close', + client_close_src, + dependencies: examples_admin_deps +) + +client_info_src = ['client_info.c'] +client_info = executable( + 'client_info', + client_info_src, + dependencies: examples_admin_deps +) + +client_limits_src = ['client_limits.c'] +client_limits = executable( + 'client_limits', + client_limits_src, + dependencies: examples_admin_deps +) + +list_clients_src = ['list_clients.c'] +list_clients = executable( + 'list_clients', + list_clients_src, + dependencies: examples_admin_deps +) + +list_server_src = ['list_servers.c'] +list_servers = executable( + 'list_servers', + list_server_src, + dependencies: examples_admin_deps +) + +logging_src = ['logging.c'] +logging = executable( + 'logging', + logging_src, + dependencies: examples_admin_deps +) + +threadpool_params_src = ['threadpool_params.c'] +threadpool_params = executable( + 'threadpool_params', + threadpool_params_src, + dependencies: examples_admin_deps +) diff --git a/examples/c/domain/meson.build b/examples/c/domain/meson.build new file mode 100644 index 0000000000..8e9336b150 --- /dev/null +++ b/examples/c/domain/meson.build @@ -0,0 +1,37 @@ + +examples_domain_deps = [libvirt_dep] + +dommigrate_src = ['dommigrate.c'] +dommigrate = executable( + 'dommigrate', + dommigrate_src, + dependencies: examples_domain_deps +) + +domtop_src = ['domtop.c'] +domtop = executable( + 'domtop', + domtop_src, + dependencies: examples_domain_deps +) + +info1_src = ['info1.c'] +info1 = executable( + 'info1', + info1_src, + dependencies: examples_domain_deps +) + +rename_src = ['rename.c'] +rename = executable( + 'rename', + rename_src, + dependencies: examples_domain_deps +) + +suspend_src = ['suspend.c'] +suspend = executable( + 'suspend', + suspend_src, + dependencies: examples_domain_deps +) diff --git a/examples/c/meson.build b/examples/c/meson.build new file mode 100644 index 0000000000..3a93ccd033 --- /dev/null +++ b/examples/c/meson.build @@ -0,0 +1,4 @@ + +subdir('misc') +subdir('domain') +subdir('admin') diff --git a/examples/c/misc/meson.build b/examples/c/misc/meson.build new file mode 100644 index 0000000000..397258170f --- /dev/null +++ b/examples/c/misc/meson.build @@ -0,0 +1,23 @@ + +examples_misc_deps = [libvirt_dep] + +hellolibvirt_src = ['hellolibvirt.c'] +hellolibvirt = executable( + 'hellolibvirt', + hellolibvirt_src, + dependencies: examples_misc_deps +) + +eventtest_src = ['event-test.c'] +eventtest = executable( + 'event-test', + eventtest_src, + dependencies: examples_misc_deps +) + +openauth_src = ['openauth.c'] +openauth = executable( + 'openauth', + openauth_src, + dependencies: examples_misc_deps +) diff --git a/examples/meson.build b/examples/meson.build new file mode 100644 index 0000000000..bb757e92a0 --- /dev/null +++ b/examples/meson.build @@ -0,0 +1,2 @@ + +subdir('c') diff --git a/meson.build b/meson.build index 1febd9c35d..1b9efde467 100644 --- a/meson.build +++ b/meson.build @@ -33,3 +33,4 @@ gnulib_dep = declare_dependency( meson.add_dist_script('build-aux' / 'dist.py', meson.source_root(), meson.build_root()) subdir('src') +subdir('examples') -- 2.21.0

This uses meson to install the example data files and example program source. Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> --- Makefile.am | 2 +- examples/Makefile.am | 83 -------------------------------- examples/c/admin/meson.build | 8 +++ examples/c/domain/meson.build | 6 +++ examples/c/misc/meson.build | 4 ++ examples/meson.build | 4 ++ examples/polkit/meson.build | 5 ++ examples/sh/meson.build | 5 ++ examples/systemtap/meson.build | 8 +++ examples/xml/meson.build | 3 ++ examples/xml/storage/meson.build | 14 ++++++ examples/xml/test/meson.build | 13 +++++ 12 files changed, 71 insertions(+), 84 deletions(-) delete mode 100644 examples/Makefile.am create mode 100644 examples/polkit/meson.build create mode 100644 examples/sh/meson.build create mode 100644 examples/systemtap/meson.build create mode 100644 examples/xml/meson.build create mode 100644 examples/xml/storage/meson.build create mode 100644 examples/xml/test/meson.build diff --git a/Makefile.am b/Makefile.am index 711f365504..bf043c5362 100644 --- a/Makefile.am +++ b/Makefile.am @@ -20,7 +20,7 @@ LCOV = lcov GENHTML = genhtml SUBDIRS = . gnulib/lib include/libvirt src tools docs gnulib/tests \ - tests po examples + tests po XZ_OPT ?= -v -T0 export XZ_OPT diff --git a/examples/Makefile.am b/examples/Makefile.am deleted file mode 100644 index b12652874f..0000000000 --- a/examples/Makefile.am +++ /dev/null @@ -1,83 +0,0 @@ -## Process this file with automake to produce Makefile.in - -## Copyright (C) 2005-2016 Red Hat, Inc. -## -## This library is free software; you can redistribute it and/or -## modify it under the terms of the GNU Lesser General Public -## License as published by the Free Software Foundation; either -## version 2.1 of the License, or (at your option) any later version. -## -## This library is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -## Lesser General Public License for more details. -## -## You should have received a copy of the GNU Lesser General Public -## License along with this library. If not, see -## <http://www.gnu.org/licenses/>. - -ADMIN_EXAMPLES = \ - $(wildcard $(srcdir)/c/admin/*.c) \ - $(NULL) - -DOMAIN_EXAMPLES = \ - $(wildcard $(srcdir)/c/domain/*.c) \ - $(NULL) - -MISC_EXAMPLES = \ - $(wildcard $(srcdir)/c/misc/*.c) \ - $(NULL) - -POLKIT_EXAMPLES = \ - $(wildcard $(srcdir)/polkit/*.rules) \ - $(NULL) - -SH_EXAMPLES = \ - $(wildcard $(srcdir)/sh/*) \ - $(NULL) - -STORAGE_XML_EXAMPLES = \ - $(wildcard $(srcdir)/xml/storage/*.xml) \ - $(NULL) - -SYSTEMTAP_EXAMPLES = \ - $(wildcard $(srcdir)/systemtap/*.stp) \ - $(NULL) - -TEST_XML_EXAMPLES = \ - $(wildcard $(srcdir)/xml/test/*.xml) \ - $(NULL) - -EXTRA_DIST = \ - $(POLKIT_EXAMPLES) \ - $(SH_EXAMPLES) \ - $(STORAGE_XML_EXAMPLES) \ - $(SYSTEMTAP_EXAMPLES) \ - $(TEST_XML_EXAMPLES) \ - $(NULL) - -examplesdir = $(docdir)/examples - -adminexamplesdir = $(examplesdir)/c/admin -adminexamples_DATA = $(ADMIN_EXAMPLES) - -domainexamplesdir = $(examplesdir)/c/domain -domainexamples_DATA = $(DOMAIN_EXAMPLES) - -miscexamplesdir = $(examplesdir)/c/misc -miscexamples_DATA = $(MISC_EXAMPLES) - -polkitexamplesdir = $(examplesdir)/polkit -polkitexamples_DATA = $(POLKIT_EXAMPLES) - -shexamplesdir = $(examplesdir)/sh -shexamples_DATA = $(SH_EXAMPLES) - -storagexmlexamplesdir = $(examplesdir)/xml/storage -storagexmlexamples_DATA = $(STORAGE_XML_EXAMPLES) - -systemtapexamplesdir = $(examplesdir)/systemtap -systemtapexamples_DATA = $(SYSTEMTAP_EXAMPLES) - -testxmlexamplesdir = $(examplesdir)/xml/test -testxmlexamples_DATA = $(TEST_XML_EXAMPLES) diff --git a/examples/c/admin/meson.build b/examples/c/admin/meson.build index bdec5fd22e..3fb6b3f7db 100644 --- a/examples/c/admin/meson.build +++ b/examples/c/admin/meson.build @@ -1,4 +1,5 @@ +examples_admin_dir = examples_dir / 'c' / 'admin' examples_admin_deps = [libvirt_dep, libvirt_admin_dep] client_close_src = ['client_close.c'] @@ -7,6 +8,7 @@ client_close = executable( client_close_src, dependencies: examples_admin_deps ) +install_data(client_close_src, install_dir: examples_admin_dir) client_info_src = ['client_info.c'] client_info = executable( @@ -14,6 +16,7 @@ client_info = executable( client_info_src, dependencies: examples_admin_deps ) +install_data(client_info_src, install_dir: examples_admin_dir) client_limits_src = ['client_limits.c'] client_limits = executable( @@ -21,6 +24,7 @@ client_limits = executable( client_limits_src, dependencies: examples_admin_deps ) +install_data(client_limits_src, install_dir: examples_admin_dir) list_clients_src = ['list_clients.c'] list_clients = executable( @@ -28,6 +32,7 @@ list_clients = executable( list_clients_src, dependencies: examples_admin_deps ) +install_data(list_clients_src, install_dir: examples_admin_dir) list_server_src = ['list_servers.c'] list_servers = executable( @@ -35,6 +40,7 @@ list_servers = executable( list_server_src, dependencies: examples_admin_deps ) +install_data(list_server_src, install_dir: examples_admin_dir) logging_src = ['logging.c'] logging = executable( @@ -42,6 +48,7 @@ logging = executable( logging_src, dependencies: examples_admin_deps ) +install_data(logging_src, install_dir: examples_admin_dir) threadpool_params_src = ['threadpool_params.c'] threadpool_params = executable( @@ -49,3 +56,4 @@ threadpool_params = executable( threadpool_params_src, dependencies: examples_admin_deps ) +install_data(threadpool_params_src, install_dir: examples_admin_dir) diff --git a/examples/c/domain/meson.build b/examples/c/domain/meson.build index 8e9336b150..d3d9a5a029 100644 --- a/examples/c/domain/meson.build +++ b/examples/c/domain/meson.build @@ -1,4 +1,5 @@ +examples_domain_dir = examples_dir / 'c' / 'domain' examples_domain_deps = [libvirt_dep] dommigrate_src = ['dommigrate.c'] @@ -7,6 +8,7 @@ dommigrate = executable( dommigrate_src, dependencies: examples_domain_deps ) +install_data(dommigrate_src, install_dir: examples_domain_dir) domtop_src = ['domtop.c'] domtop = executable( @@ -14,6 +16,7 @@ domtop = executable( domtop_src, dependencies: examples_domain_deps ) +install_data(domtop_src, install_dir: examples_domain_dir) info1_src = ['info1.c'] info1 = executable( @@ -21,6 +24,7 @@ info1 = executable( info1_src, dependencies: examples_domain_deps ) +install_data(info1_src, install_dir: examples_domain_dir) rename_src = ['rename.c'] rename = executable( @@ -28,6 +32,7 @@ rename = executable( rename_src, dependencies: examples_domain_deps ) +install_data(rename_src, install_dir: examples_domain_dir) suspend_src = ['suspend.c'] suspend = executable( @@ -35,3 +40,4 @@ suspend = executable( suspend_src, dependencies: examples_domain_deps ) +install_data(suspend_src, install_dir: examples_domain_dir) diff --git a/examples/c/misc/meson.build b/examples/c/misc/meson.build index 397258170f..2a77c526f7 100644 --- a/examples/c/misc/meson.build +++ b/examples/c/misc/meson.build @@ -1,4 +1,5 @@ +examples_misc_dir = examples_dir / 'c' / 'misc' examples_misc_deps = [libvirt_dep] hellolibvirt_src = ['hellolibvirt.c'] @@ -7,6 +8,7 @@ hellolibvirt = executable( hellolibvirt_src, dependencies: examples_misc_deps ) +install_data(hellolibvirt_src, install_dir: examples_misc_dir) eventtest_src = ['event-test.c'] eventtest = executable( @@ -14,6 +16,7 @@ eventtest = executable( eventtest_src, dependencies: examples_misc_deps ) +install_data(eventtest_src, install_dir: examples_misc_dir) openauth_src = ['openauth.c'] openauth = executable( @@ -21,3 +24,4 @@ openauth = executable( openauth_src, dependencies: examples_misc_deps ) +install_data(openauth_src, install_dir: examples_misc_dir) diff --git a/examples/meson.build b/examples/meson.build index bb757e92a0..36faf5abec 100644 --- a/examples/meson.build +++ b/examples/meson.build @@ -1,2 +1,6 @@ +examples_dir = join_paths(pkg_doc_dir, 'examples') + subdir('c') +subdir('polkit') +subdir('sh') diff --git a/examples/polkit/meson.build b/examples/polkit/meson.build new file mode 100644 index 0000000000..759f565e3a --- /dev/null +++ b/examples/polkit/meson.build @@ -0,0 +1,5 @@ + +examples_polkit_dir = examples_dir / 'polkit' + +polkit_rules = ['libvirt-acl.rules'] +install_data(polkit_rules, install_dir: examples_polkit_dir) diff --git a/examples/sh/meson.build b/examples/sh/meson.build new file mode 100644 index 0000000000..3f43da2e02 --- /dev/null +++ b/examples/sh/meson.build @@ -0,0 +1,5 @@ + +examples_sh_dir = examples_dir / 'sh' + +sh_scripts = ['virt-lxc-convert'] +install_data(sh_scripts, install_dir: examples_sh_dir) diff --git a/examples/systemtap/meson.build b/examples/systemtap/meson.build new file mode 100644 index 0000000000..023e6be7ed --- /dev/null +++ b/examples/systemtap/meson.build @@ -0,0 +1,8 @@ + +examples_systemtap_dir = examples_dir / 'systemtap' + +systemtap_scripts = ['events.stp', + 'lock-debug.stp', + 'qemu-monitor.stp', + 'rpc-monitor.stp'] +install_data(systemtap_scripts, install_dir: examples_systemtap_dir) diff --git a/examples/xml/meson.build b/examples/xml/meson.build new file mode 100644 index 0000000000..d37508121e --- /dev/null +++ b/examples/xml/meson.build @@ -0,0 +1,3 @@ + +subdir('storage') +subdir('test') diff --git a/examples/xml/storage/meson.build b/examples/xml/storage/meson.build new file mode 100644 index 0000000000..3e78086c67 --- /dev/null +++ b/examples/xml/storage/meson.build @@ -0,0 +1,14 @@ + +examples_xml_storage_dir = examples_dir / 'xml' / 'storage' + +storage_xml = ['pool-dir.xml', + 'pool-logical.xml', + 'vol-cow.xml', + 'vol-qcow.xml', + 'vol-sparse.xml', + 'pool-fs.xml', + 'pool-netfs.xml', + 'vol-qcow2.xml', + 'vol-raw.xml', + 'vol-vmdk.xml'] +install_data(storage_xml, install_dir: examples_xml_storage_dir) diff --git a/examples/xml/test/meson.build b/examples/xml/test/meson.build new file mode 100644 index 0000000000..31c5e38bc1 --- /dev/null +++ b/examples/xml/test/meson.build @@ -0,0 +1,13 @@ + +examples_xml_test_dir = examples_dir / 'xml' / 'test' + +test_xml = ['testdomfc4.xml', + 'testnetdef.xml', + 'testnodeinline.xml', + 'testpool.xml', + 'testdev.xml', + 'testdomfv0.xml', + 'testnetpriv.xml', + 'testnode.xml', + 'testvol.xml'] +install_data(test_xml, install_dir: examples_xml_test_dir) -- 2.21.0

Switch over to using meson for building the two NSS modules Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> --- meson.build | 5 ++ tools/Makefile.am | 112 +----------------------------------------- tools/meson.build | 2 + tools/nss/meson.build | 63 ++++++++++++++++++++++++ 4 files changed, 72 insertions(+), 110 deletions(-) create mode 100644 tools/meson.build create mode 100644 tools/nss/meson.build diff --git a/meson.build b/meson.build index 1b9efde467..53ee9e331f 100644 --- a/meson.build +++ b/meson.build @@ -21,6 +21,7 @@ pkg_doc_dir = data_dir / 'doc' / meson.project_name() + '-' + meson.project_vers public_inc_dir = include_directories('include') gnulib_inc_dir = include_directories('gnulib/lib') +top_inc_dir = include_directories('.') cc = meson.get_compiler('c') @@ -32,5 +33,9 @@ gnulib_dep = declare_dependency( meson.add_dist_script('build-aux' / 'dist.py', meson.source_root(), meson.build_root()) +yajl_min_version = '>= 2.0.3' +yajl_dep = dependency('yajl', version: yajl_min_version) + subdir('src') subdir('examples') +subdir('tools') diff --git a/tools/Makefile.am b/tools/Makefile.am index 29fdbfe846..a294224a99 100644 --- a/tools/Makefile.am +++ b/tools/Makefile.am @@ -354,10 +354,10 @@ POD2MAN = pod2man -c "Virtualization Support" -r "$(PACKAGE)-$(VERSION)" < $< > $@-t && \ mv $@-t $@ -install-data-local: install-systemd install-nss \ +install-data-local: install-systemd \ install-bash-completion -uninstall-local: uninstall-systemd uninstall-nss \ +uninstall-local: uninstall-systemd \ uninstall-bash-completion install-sysconfig: @@ -470,114 +470,6 @@ wireshark/src/libvirt/protocol.h: wireshark/util/genxdrstub.pl \ endif WITH_WIRESHARK_DISSECTOR -if WITH_BSD_NSS -LIBVIRT_NSS_SYMBOL_FILE = \ - $(srcdir)/nss/libvirt_nss_bsd.syms -LIBVIRT_GUEST_NSS_SYMBOL_FILE = \ - $(LIBVIRT_NSS_SYMBOL_FILE) -NSS_SO_VER = 1 - -install-nss: - ( cd $(DESTDIR)$(libdir) && \ - rm -f nss_libvirt.so.$(NSS_SO_VER) && \ - $(LN_S) libnss_libvirt.so.$(NSS_SO_VER) nss_libvirt.so.$(NSS_SO_VER) && \ - rm -f nss_libvirt_guest.so.$(NSS_SO_VER) && \ - $(LN_S) libnss_libvirt_guest.so.$(NSS_SO_VER) \ - nss_libvirt_guest.so.$(NSS_SO_VER)) - -uninstall-nss: - -rm -f $(DESTDIR)$(libdir)/nss_libvirt.so.$(NSS_SO_VER) - -rm -f $(DESTDIR)$(libdir)/nss_libvirt_guest.so.$(NSS_SO_VER) -else ! WITH_BSD_NSS -LIBVIRT_NSS_SYMBOL_FILE = \ - $(srcdir)/nss/libvirt_nss.syms -LIBVIRT_GUEST_NSS_SYMBOL_FILE = \ - $(srcdir)/nss/libvirt_guest_nss.syms -NSS_SO_VER = 2 - -install-nss: -uninstall-nss: -endif ! WITH_BSD_NSS - -LIBVIRT_NSS_SOURCES = \ - nss/libvirt_nss.c \ - nss/libvirt_nss.h \ - nss/libvirt_nss_leases.c \ - nss/libvirt_nss_leases.h \ - $(NULL) - -if WITH_NSS -noinst_LTLIBRARIES += nss/libnss_libvirt_impl.la -nss_libnss_libvirt_impl_la_SOURCES = \ - $(LIBVIRT_NSS_SOURCES) - -nss_libnss_libvirt_impl_la_CPPFLAGS = $(STANDALONE_CPPFLAGS) -nss_libnss_libvirt_impl_la_CFLAGS = \ - -DLIBVIRT_NSS \ - $(YAJL_CFLAGS) \ - $(AM_CFLAGS) \ - $(NULL) - -nss_libnss_libvirt_impl_la_LIBADD = \ - $(YAJL_LIBS) \ - $(NULL) - -nss_libnss_libvirt_la_SOURCES = -nss_libnss_libvirt_la_LDFLAGS = \ - $(VERSION_SCRIPT_FLAGS)$(LIBVIRT_NSS_SYMBOL_FILE) \ - $(AM_LDFLAGS) \ - -module \ - -export-dynamic \ - -avoid-version \ - -shared \ - -shrext .so.$(NSS_SO_VER) - -nss_libnss_libvirt_la_LIBADD = \ - nss/libnss_libvirt_impl.la - -noinst_LTLIBRARIES += nss/libnss_libvirt_guest_impl.la -nss_libnss_libvirt_guest_impl_la_SOURCES = \ - $(LIBVIRT_NSS_SOURCES) \ - nss/libvirt_nss_macs.h \ - nss/libvirt_nss_macs.c \ - $(NULL) - -nss_libnss_libvirt_guest_impl_la_CPPFLAGS = $(STANDALONE_CPPFLAGS) -nss_libnss_libvirt_guest_impl_la_CFLAGS = \ - -DLIBVIRT_NSS \ - -DLIBVIRT_NSS_GUEST \ - $(YAJL_CFLAGS) \ - $(AM_CFLAGS) \ - $(NULL) - -nss_libnss_libvirt_guest_impl_la_LIBADD = \ - $(YAJL_LIBS) \ - $(NULL) - -nss_libnss_libvirt_guest_la_SOURCES = -nss_libnss_libvirt_guest_la_LDFLAGS = \ - $(VERSION_SCRIPT_FLAGS)$(LIBVIRT_GUEST_NSS_SYMBOL_FILE) \ - $(AM_LDFLAGS) \ - -module \ - -export-dynamic \ - -avoid-version \ - -shared \ - -shrext .so.$(NSS_SO_VER) - -nss_libnss_libvirt_guest_la_LIBADD = \ - nss/libnss_libvirt_guest_impl.la - -lib_LTLIBRARIES = \ - nss/libnss_libvirt.la \ - nss/libnss_libvirt_guest.la - -endif WITH_NSS - -EXTRA_DIST += $(LIBVIRT_NSS_SOURCES) \ - $(srcdir)/nss/libvirt_nss.syms \ - $(srcdir)/nss/libvirt_nss_bsd.syms \ - $(srcdir)/nss/libvirt_guest_nss.syms - clean-local: -rm -rf wireshark/src/libvirt diff --git a/tools/meson.build b/tools/meson.build new file mode 100644 index 0000000000..dd2da4adc7 --- /dev/null +++ b/tools/meson.build @@ -0,0 +1,2 @@ + +subdir('nss') diff --git a/tools/nss/meson.build b/tools/nss/meson.build new file mode 100644 index 0000000000..c21cfdfa9d --- /dev/null +++ b/tools/nss/meson.build @@ -0,0 +1,63 @@ + +if host_machine.system() == 'freebsd' + with_nss = true + libnss_prefix = '' + libnss_so_version = '1' + libnss_syms = 'libvirt_nss_bsd.syms' + libnss_guest_syms = 'libvirt_nss_bsd.syms' +elif host_machine.system() == 'linux' + with_nss = true + libnss_prefix = 'lib' + libnss_so_version = '2' + libnss_syms = 'libvirt_nss.syms' + libnss_guest_syms = 'libvirt_guest_nss.syms' +else + with_nss = false +endif + +if with_nss + libnss_common_src = [ + 'libvirt_nss.c', + 'libvirt_nss.h', + 'libvirt_nss_leases.c', + 'libvirt_nss_leases.h' + ] + + libnss_src = libnss_common_src + libnss_guest_src = libnss_common_src + [ + 'libvirt_nss_macs.c', + 'libvirt_nss_macs.h', + ] + + libnss_deps = [yajl_dep] + libnss_link_args = [ + '-Wl,--version-script,@0@/@1@'.format(meson.current_source_dir(), libnss_syms) + ] + libnss_guest_link_args = [ + '-Wl,--version-script,@0@/@1@'.format(meson.current_source_dir(), libnss_guest_syms) + ] + libnss_inc_dirs = [top_inc_dir] + + libnss_libvirt_so = shared_library('nss_libvirt', + libnss_src, + name_prefix: libnss_prefix, + version: libnss_so_version, + c_args: ['-DLIBVIRT_NSS'], + link_args: libnss_link_args, + dependencies: libnss_deps, + include_directories: libnss_inc_dirs, + link_depends: libnss_syms) + + libnss_libvirt_guest_so = shared_library('nss_libvirt_guest', + libnss_guest_src, + name_prefix: libnss_prefix, + version: libnss_so_version, + c_args: ['-DLIBVIRT_NSS', + '-DLIBVIRT_NSS_GUEST'], + link_args: libnss_guest_link_args, + dependencies: libnss_deps, + include_directories: libnss_inc_dirs, + link_depends: libnss_guest_syms) + + +endif -- 2.21.0

Placeholder options for enabling each driver, which will be fleshed out in later commits. Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> --- meson_options.txt | 23 +++++++++++++++++++++++ src/bhyve/meson.build | 5 +++++ src/esx/meson.build | 2 ++ src/hyperv/meson.build | 2 ++ src/interface/meson.build | 5 +++++ src/libxl/meson.build | 5 +++++ src/lxc/meson.build | 5 +++++ src/meson.build | 25 +++++++++++++++++++++++++ src/network/meson.build | 5 +++++ src/node_device/meson.build | 5 +++++ src/nwfilter/meson.build | 5 +++++ src/openvz/meson.build | 2 ++ src/phyp/meson.build | 2 ++ src/qemu/meson.build | 5 +++++ src/remote/meson.build | 6 ++++++ src/secret/meson.build | 5 +++++ src/storage/meson.build | 5 +++++ src/test/meson.build | 2 ++ src/vbox/meson.build | 2 ++ src/vmware/meson.build | 2 ++ src/vz/meson.build | 5 +++++ 21 files changed, 123 insertions(+) create mode 100644 meson_options.txt create mode 100644 src/bhyve/meson.build create mode 100644 src/esx/meson.build create mode 100644 src/hyperv/meson.build create mode 100644 src/interface/meson.build create mode 100644 src/libxl/meson.build create mode 100644 src/lxc/meson.build create mode 100644 src/network/meson.build create mode 100644 src/node_device/meson.build create mode 100644 src/nwfilter/meson.build create mode 100644 src/openvz/meson.build create mode 100644 src/phyp/meson.build create mode 100644 src/qemu/meson.build create mode 100644 src/remote/meson.build create mode 100644 src/secret/meson.build create mode 100644 src/storage/meson.build create mode 100644 src/test/meson.build create mode 100644 src/vbox/meson.build create mode 100644 src/vmware/meson.build create mode 100644 src/vz/meson.build diff --git a/meson_options.txt b/meson_options.txt new file mode 100644 index 0000000000..4667fa6580 --- /dev/null +++ b/meson_options.txt @@ -0,0 +1,23 @@ + +option('with-driver-remote', type: 'boolean', value: true, description: 'Enable remote driver') +option('with-remote-daemon', type: 'boolean', value: true, description: 'Enable remote daemon') + +option('with-driver-bhyve', type: 'boolean', value: true, description: 'Enable bhyve driver') +option('with-driver-esx', type: 'boolean', value: true, description: 'Enable esx driver') +option('with-driver-hyperv', type: 'boolean', value: true, description: 'Enable hyperv driver') +option('with-driver-libxl', type: 'boolean', value: true, description: 'Enable libxl driver') +option('with-driver-lxc', type: 'boolean', value: true, description: 'Enable lxc driver') +option('with-driver-openvz', type: 'boolean', value: true, description: 'Enable openvz driver') +option('with-driver-phyp', type: 'boolean', value: true, description: 'Enable phyp driver') +option('with-driver-qemu', type: 'boolean', value: true, description: 'Enable qemu driver') +option('with-driver-test', type: 'boolean', value: true, description: 'Enable test driver') +option('with-driver-vbox', type: 'boolean', value: true, description: 'Enable vbox driver') +option('with-driver-vz', type: 'boolean', value: true, description: 'Enable vz driver') +option('with-driver-vmware', type: 'boolean', value: true, description: 'Enable vmware driver') + +option('with-driver-interface', type: 'boolean', value: true, description: 'Enable interface driver') +option('with-driver-network', type: 'boolean', value: true, description: 'Enable network driver') +option('with-driver-nodedev', type: 'boolean', value: true, description: 'Enable nodedev driver') +option('with-driver-nwfilter', type: 'boolean', value: true, description: 'Enable nwfilter driver') +option('with-driver-secret', type: 'boolean', value: true, description: 'Enable secret driver') +option('with-driver-storage', type: 'boolean', value: true, description: 'Enable storage driver') diff --git a/src/bhyve/meson.build b/src/bhyve/meson.build new file mode 100644 index 0000000000..1c2d41050b --- /dev/null +++ b/src/bhyve/meson.build @@ -0,0 +1,5 @@ + +with_driver_bhyve = get_option('with-driver-bhyve') +if not with_remote_daemon or host_machine.system() != 'freebsd' + with_driver_bhyve = false +endif diff --git a/src/esx/meson.build b/src/esx/meson.build new file mode 100644 index 0000000000..e9b379d1bb --- /dev/null +++ b/src/esx/meson.build @@ -0,0 +1,2 @@ + +with_driver_esx = get_option('with-driver-esx') diff --git a/src/hyperv/meson.build b/src/hyperv/meson.build new file mode 100644 index 0000000000..ebaed11cf3 --- /dev/null +++ b/src/hyperv/meson.build @@ -0,0 +1,2 @@ + +with_driver_hyperv = get_option('with-driver-hyperv') diff --git a/src/interface/meson.build b/src/interface/meson.build new file mode 100644 index 0000000000..ca8bcc83c2 --- /dev/null +++ b/src/interface/meson.build @@ -0,0 +1,5 @@ + +with_driver_interface = get_option('with-driver-interface') +if not with_remote_daemon + with_driver_interface = false +endif diff --git a/src/libxl/meson.build b/src/libxl/meson.build new file mode 100644 index 0000000000..52093656f9 --- /dev/null +++ b/src/libxl/meson.build @@ -0,0 +1,5 @@ + +with_driver_libxl = get_option('with-driver-libxl') +if not with_remote_daemon or host_machine.system() != 'linux' + with_driver_libxl = false +endif diff --git a/src/lxc/meson.build b/src/lxc/meson.build new file mode 100644 index 0000000000..37a2558623 --- /dev/null +++ b/src/lxc/meson.build @@ -0,0 +1,5 @@ + +with_driver_lxc = get_option('with-driver-lxc') +if not with_remote_daemon or host_machine.system() != 'linux' + with_driver_lxc = false +endif diff --git a/src/meson.build b/src/meson.build index a86d3a6980..71b42baf22 100644 --- a/src/meson.build +++ b/src/meson.build @@ -23,3 +23,28 @@ libvirt_lxc_dep = declare_dependency( dependencies: libvirt_lxc, include_directories: [public_inc_dir] ) + +# General +subdir('remote') + +# Primary virt drivers +subdir('bhyve') +subdir('esx') +subdir('hyperv') +subdir('libxl') +subdir('lxc') +subdir('openvz') +subdir('phyp') +subdir('qemu') +subdir('test') +subdir('vbox') +subdir('vz') +subdir('vmware') + +# Secondary drivers +subdir('interface') +subdir('network') +subdir('node_device') +subdir('nwfilter') +subdir('secret') +subdir('storage') diff --git a/src/network/meson.build b/src/network/meson.build new file mode 100644 index 0000000000..aa8d1ebc5e --- /dev/null +++ b/src/network/meson.build @@ -0,0 +1,5 @@ + +with_driver_network = get_option('with-driver-network') +if not with_remote_daemon + with_driver_network = false +endif diff --git a/src/node_device/meson.build b/src/node_device/meson.build new file mode 100644 index 0000000000..ae011ad735 --- /dev/null +++ b/src/node_device/meson.build @@ -0,0 +1,5 @@ + +with_driver_nodedev = get_option('with-driver-nodedev') +if not with_remote_daemon + with_driver_nodedev = false +endif diff --git a/src/nwfilter/meson.build b/src/nwfilter/meson.build new file mode 100644 index 0000000000..b85c58fed4 --- /dev/null +++ b/src/nwfilter/meson.build @@ -0,0 +1,5 @@ + +with_driver_nwfilter = get_option('with-driver-nwfilter') +if not with_remote_daemon + with_driver_nwfilter = false +endif diff --git a/src/openvz/meson.build b/src/openvz/meson.build new file mode 100644 index 0000000000..be116ba074 --- /dev/null +++ b/src/openvz/meson.build @@ -0,0 +1,2 @@ + +with_driver_openvz = get_option('with-driver-openvz') diff --git a/src/phyp/meson.build b/src/phyp/meson.build new file mode 100644 index 0000000000..f16c579426 --- /dev/null +++ b/src/phyp/meson.build @@ -0,0 +1,2 @@ + +with_driver_phyp = get_option('with-driver-phyp') diff --git a/src/qemu/meson.build b/src/qemu/meson.build new file mode 100644 index 0000000000..f4ceb6be4d --- /dev/null +++ b/src/qemu/meson.build @@ -0,0 +1,5 @@ + +with_driver_qemu = get_option('with-driver-qemu') +if not with_remote_daemon + with_driver_qemu = false +endif diff --git a/src/remote/meson.build b/src/remote/meson.build new file mode 100644 index 0000000000..0240ceb17c --- /dev/null +++ b/src/remote/meson.build @@ -0,0 +1,6 @@ + +with_driver_remote = get_option('with-driver-remote') +with_remote_daemon = get_option('with-remote-daemon') +if not with_remote_daemon or host_machine.system() == 'windows' + with_remote_daemon = false +endif diff --git a/src/secret/meson.build b/src/secret/meson.build new file mode 100644 index 0000000000..a13bd66665 --- /dev/null +++ b/src/secret/meson.build @@ -0,0 +1,5 @@ + +with_driver_secret = get_option('with-driver-secret') +if not with_remote_daemon + with_driver_secret = false +endif diff --git a/src/storage/meson.build b/src/storage/meson.build new file mode 100644 index 0000000000..9a18a1f731 --- /dev/null +++ b/src/storage/meson.build @@ -0,0 +1,5 @@ + +with_driver_storage = get_option('with-driver-storage') +if not with_remote_daemon + with_driver_storage = false +endif diff --git a/src/test/meson.build b/src/test/meson.build new file mode 100644 index 0000000000..451de4cc54 --- /dev/null +++ b/src/test/meson.build @@ -0,0 +1,2 @@ + +with_driver_test = get_option('with-driver-test') diff --git a/src/vbox/meson.build b/src/vbox/meson.build new file mode 100644 index 0000000000..71f2136e4c --- /dev/null +++ b/src/vbox/meson.build @@ -0,0 +1,2 @@ + +with_driver_vbox = get_option('with-driver-vbox') diff --git a/src/vmware/meson.build b/src/vmware/meson.build new file mode 100644 index 0000000000..f34fdd746b --- /dev/null +++ b/src/vmware/meson.build @@ -0,0 +1,2 @@ + +with_driver_vmware = get_option('with-driver-vmware') diff --git a/src/vz/meson.build b/src/vz/meson.build new file mode 100644 index 0000000000..c1c5a4cef4 --- /dev/null +++ b/src/vz/meson.build @@ -0,0 +1,5 @@ + +with_driver_vz = get_option('with-driver-vz') +if not with_remote_daemon + with_driver_vz = false +endif -- 2.21.0

Switch over to using meson for building the virt-host-validate tool Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> --- configure.ac | 3 -- m4/virt-host-validate.m4 | 43 ----------------------------- meson.build | 4 +++ meson_options.txt | 2 ++ src/meson.build | 11 ++++++++ tools/Makefile.am | 52 ----------------------------------- tools/meson.build | 59 ++++++++++++++++++++++++++++++++++++++++ 7 files changed, 76 insertions(+), 98 deletions(-) delete mode 100644 m4/virt-host-validate.m4 diff --git a/configure.ac b/configure.ac index f5c6fabc6d..412ac4b94b 100644 --- a/configure.ac +++ b/configure.ac @@ -512,7 +512,6 @@ LIBVIRT_ARG_CHRDEV_LOCK_FILES LIBVIRT_ARG_DEFAULT_EDITOR LIBVIRT_ARG_LOADER_NVRAM LIBVIRT_ARG_LOGIN_SHELL -LIBVIRT_ARG_HOST_VALIDATE LIBVIRT_ARG_TLS_PRIORITY LIBVIRT_ARG_SYSCTL_CONFIG @@ -525,7 +524,6 @@ LIBVIRT_CHECK_CHRDEV_LOCK_FILES LIBVIRT_CHECK_DEFAULT_EDITOR LIBVIRT_CHECK_LOADER_NVRAM LIBVIRT_CHECK_LOGIN_SHELL -LIBVIRT_CHECK_HOST_VALIDATE LIBVIRT_CHECK_TLS_PRIORITY LIBVIRT_CHECK_SYSCTL_CONFIG LIBVIRT_CHECK_NSS @@ -1063,7 +1061,6 @@ LIBVIRT_RESULT_CHRDEV_LOCK_FILES LIBVIRT_RESULT_DEFAULT_EDITOR LIBVIRT_RESULT_LOADER_NVRAM LIBVIRT_RESULT_LOGIN_SHELL -LIBVIRT_RESULT_HOST_VALIDATE LIBVIRT_RESULT_TLS_PRIORITY AC_MSG_NOTICE([]) AC_MSG_NOTICE([Developer Tools]) diff --git a/m4/virt-host-validate.m4 b/m4/virt-host-validate.m4 deleted file mode 100644 index e43cec5366..0000000000 --- a/m4/virt-host-validate.m4 +++ /dev/null @@ -1,43 +0,0 @@ -dnl Copyright (C) 2015 SUSE LINUX Products GmbH, Nuernberg, Germany. -dnl Copyright (C) 2016 Red Hat, Inc. -dnl -dnl This library is free software; you can redistribute it and/or -dnl modify it under the terms of the GNU Lesser General Public -dnl License as published by the Free Software Foundation; either -dnl version 2.1 of the License, or (at your option) any later version. -dnl -dnl This library is distributed in the hope that it will be useful, -dnl but WITHOUT ANY WARRANTY; without even the implied warranty of -dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -dnl Lesser General Public License for more details. -dnl -dnl You should have received a copy of the GNU Lesser General Public -dnl License along with this library. If not, see -dnl <http://www.gnu.org/licenses/>. - -AC_DEFUN([LIBVIRT_ARG_HOST_VALIDATE], [ - LIBVIRT_ARG_WITH([HOST_VALIDATE], [build virt-host-validate], [check]) -]) - -AC_DEFUN([LIBVIRT_CHECK_HOST_VALIDATE], [ - if test "x$with_host_validate" != "xno"; then - if test "x$with_win" = "xyes"; then - if test "x$with_host_validate" = "xyes"; then - AC_MSG_ERROR([virt-host-validate is not supported on Windows]) - else - with_host_validate=no; - fi - else - with_host_validate=yes; - fi - fi - - if test "x$with_host_validate" = "xyes" ; then - AC_DEFINE_UNQUOTED([WITH_HOST_VALIDATE], 1, [whether virt-host-validate is built]) - fi - AM_CONDITIONAL([WITH_HOST_VALIDATE], [test "x$with_host_validate" = "xyes"]) -]) - -AC_DEFUN([LIBVIRT_RESULT_HOST_VALIDATE], [ - LIBVIRT_RESULT([virt-host-validate], [$with_host_validate]) -]) diff --git a/meson.build b/meson.build index 53ee9e331f..4e759d147b 100644 --- a/meson.build +++ b/meson.build @@ -24,6 +24,7 @@ gnulib_inc_dir = include_directories('gnulib/lib') top_inc_dir = include_directories('.') cc = meson.get_compiler('c') +pod2man = find_program('pod2man') gnulib = cc.find_library('libgnu', dirs: [meson.build_root() / 'gnulib' / 'lib' / '.libs']) gnulib_dep = declare_dependency( @@ -34,7 +35,10 @@ gnulib_dep = declare_dependency( meson.add_dist_script('build-aux' / 'dist.py', meson.source_root(), meson.build_root()) yajl_min_version = '>= 2.0.3' +libxml_min_version = '>= 2.9.1' + yajl_dep = dependency('yajl', version: yajl_min_version) +libxml_dep = dependency('libxml-2.0', version: libxml_min_version) subdir('src') subdir('examples') diff --git a/meson_options.txt b/meson_options.txt index 4667fa6580..92062f5d63 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -21,3 +21,5 @@ option('with-driver-nodedev', type: 'boolean', value: true, description: 'Enable option('with-driver-nwfilter', type: 'boolean', value: true, description: 'Enable nwfilter driver') option('with-driver-secret', type: 'boolean', value: true, description: 'Enable secret driver') option('with-driver-storage', type: 'boolean', value: true, description: 'Enable storage driver') + +option('with-tools-host-validate', type: 'boolean', value: true, description: 'Enable virt-host-validate tool') diff --git a/src/meson.build b/src/meson.build index 71b42baf22..7393a86796 100644 --- a/src/meson.build +++ b/src/meson.build @@ -1,4 +1,15 @@ +src_inc_dir = include_directories('.') +util_inc_dir = include_directories('util') +common_inc_dir = [ + gnulib_inc_dir, + public_inc_dir, + top_inc_dir, + src_inc_dir, + util_inc_dir, +] + + libvirt = cc.find_library('libvirt', dirs: [meson.build_root() / 'src' / '.libs']) libvirt_admin = cc.find_library('libvirt-admin', dirs: [meson.build_root() / 'src' / '.libs']) libvirt_qemu = cc.find_library('libvirt-qemu', dirs: [meson.build_root() / 'src' / '.libs']) diff --git a/tools/Makefile.am b/tools/Makefile.am index a294224a99..749eaa12ff 100644 --- a/tools/Makefile.am +++ b/tools/Makefile.am @@ -53,7 +53,6 @@ ICON_FILES = \ PODFILES = \ virt-admin.pod \ - virt-host-validate.pod \ virt-login-shell.pod \ virt-pki-validate.pod \ virt-sanlock-cleanup.pod \ @@ -63,7 +62,6 @@ PODFILES = \ MANINFILES = \ virt-admin.1.in \ - virt-host-validate.1.in \ virt-login-shell.1.in \ virt-pki-validate.1.in \ virt-sanlock-cleanup.8.in \ @@ -116,11 +114,6 @@ libexec_PROGRAMS = virt-login-shell-helper man1_MANS += virt-login-shell.1 endif WITH_LOGIN_SHELL -if WITH_HOST_VALIDATE -bin_PROGRAMS += virt-host-validate -man1_MANS += virt-host-validate.1 -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' \ @@ -156,51 +149,6 @@ libvirt_shell_la_SOURCES = \ vsh.c vsh.h \ vsh-table.c vsh-table.h -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) -else ! WITH_QEMU -EXTRA_DIST += $(VIRT_HOST_VALIDATE_QEMU) -endif ! WITH_QEMU - -if WITH_LXC -virt_host_validate_SOURCES += $(VIRT_HOST_VALIDATE_LXC) -else ! WITH_LXC -EXTRA_DIST += $(VIRT_HOST_VALIDATE_LXC) -endif ! WITH_LXC - -if WITH_BHYVE -virt_host_validate_SOURCES += $(VIRT_HOST_VALIDATE_BHYVE) -else ! WITH_BHYVE -EXTRA_DIST += $(VIRT_HOST_VALIDATE_BHYVE) -endif ! WITH_BHYVE - -virt_host_validate_LDFLAGS = \ - $(AM_LDFLAGS) \ - $(PIE_LDFLAGS) \ - $(COVERAGE_LDFLAGS) \ - $(NULL) - -virt_host_validate_LDADD = \ - ../src/libvirt.la \ - ../gnulib/lib/libgnu.la \ - $(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 diff --git a/tools/meson.build b/tools/meson.build index dd2da4adc7..fdc3549411 100644 --- a/tools/meson.build +++ b/tools/meson.build @@ -1,2 +1,61 @@ subdir('nss') + +with_tools_host_validate = get_option('with-tools-host-validate') +if not (with_driver_qemu or with_driver_lxc or with_driver_bhyve) + with_tools_host_validate = false +endif + +if with_tools_host_validate + virt_host_validate_src = [ + 'virt-host-validate.c', + 'virt-host-validate-common.c', + 'virt-host-validate-common.h', + ] + + if with_driver_qemu + virt_host_validate_src += [ + 'virt-host-validate-qemu.c', + 'virt-host-validate-qemu.h', + ] + endif + + if with_driver_lxc + virt_host_validate_src += [ + 'virt-host-validate-lxc.c', + 'virt-host-validate-lxc.h', + ] + endif + + if with_driver_bhyve + virt_host_validate_src += [ + 'virt-host-validate-bhyve.c', + 'virt-host-validate-bhyve.h', + ] + endif + + virt_host_validate_inc = common_inc_dir + virt_host_validate_libs = [libvirt_dep, libxml_dep, gnulib_dep] + virt_host_validate = executable( + 'virt-host-validate', + install: true, + sources: virt_host_validate_src, + include_directories: virt_host_validate_inc, + dependencies: virt_host_validate_libs + ) + + virt_host_validate_man = custom_target( + 'virt_host_validate_man', + output : 'virt-host-validate.1', + input : 'virt-host-validate.pod', + command : [ + pod2man, + '--section=1', + '--center=Virtualization Support', + '--release=libvirt @0@'.format(meson.project_version()), + '@INPUT@', '@OUTPUT@' + ], + install : true, + install_dir : join_paths(get_option('mandir'), 'man1') + ) +endif -- 2.21.0

Switch over to using meson for building the virt-login-shell tool Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> --- m4/virt-login-shell.m4 | 43 ------------------------------- meson.build | 2 ++ meson_options.txt | 1 + tools/Makefile.am | 35 -------------------------- tools/meson.build | 57 ++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 60 insertions(+), 78 deletions(-) delete mode 100644 m4/virt-login-shell.m4 diff --git a/m4/virt-login-shell.m4 b/m4/virt-login-shell.m4 deleted file mode 100644 index 713c488599..0000000000 --- a/m4/virt-login-shell.m4 +++ /dev/null @@ -1,43 +0,0 @@ -dnl Copyright (c) 2015 SUSE LINUX Products GmbH, Nuernberg, Germany. -dnl Copyright (C) 2016 Red Hat, Inc. -dnl -dnl This library is free software; you can redistribute it and/or -dnl modify it under the terms of the GNU Lesser General Public -dnl License as published by the Free Software Foundation; either -dnl version 2.1 of the License, or (at your option) any later version. -dnl -dnl This library is distributed in the hope that it will be useful, -dnl but WITHOUT ANY WARRANTY; without even the implied warranty of -dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -dnl Lesser General Public License for more details. -dnl -dnl You should have received a copy of the GNU Lesser General Public -dnl License along with this library. If not, see -dnl <http://www.gnu.org/licenses/>. - -AC_DEFUN([LIBVIRT_ARG_LOGIN_SHELL], [ - LIBVIRT_ARG_WITH([LOGIN_SHELL], [build virt-login-shell], [check]) -]) - -AC_DEFUN([LIBVIRT_CHECK_LOGIN_SHELL], [ - if test "x$with_login_shell" != "xno"; then - if test "x$with_linux" != "xyes"; then - if test "x$with_login_shell" = "xyes"; then - AC_MSG_ERROR([virt-login-shell is supported on Linux only]) - else - with_login_shell=no; - fi - else - with_login_shell=yes; - fi - fi - - if test "x$with_login_shell" = "xyes" ; then - AC_DEFINE_UNQUOTED([WITH_LOGIN_SHELL], 1, [whether virt-login-shell is built]) - fi - AM_CONDITIONAL([WITH_LOGIN_SHELL], [test "$with_login_shell" = "yes"]) -]) - -AC_DEFUN([LIBVIRT_RESULT_LOGIN_SHELL], [ - LIBVIRT_RESULT([virt-login-shell], [$with_login_shell]) -]) diff --git a/meson.build b/meson.build index 4e759d147b..bda0ee0373 100644 --- a/meson.build +++ b/meson.build @@ -13,11 +13,13 @@ project( prefix = get_option('prefix') bin_dir = get_option('bindir') lib_dir = get_option('libdir') +libexec_dir = get_option('libexecdir') sys_conf_dir = get_option('sysconfdir') data_dir = get_option('datadir') local_state_dir = get_option('localstatedir') pkg_data_dir = data_dir / meson.project_name() pkg_doc_dir = data_dir / 'doc' / meson.project_name() + '-' + meson.project_version() +pkg_sys_conf_dir = sys_conf_dir / 'libvirt' public_inc_dir = include_directories('include') gnulib_inc_dir = include_directories('gnulib/lib') diff --git a/meson_options.txt b/meson_options.txt index 92062f5d63..d092f30ba7 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -23,3 +23,4 @@ option('with-driver-secret', type: 'boolean', value: true, description: 'Enable option('with-driver-storage', type: 'boolean', value: true, description: 'Enable storage driver') option('with-tools-host-validate', type: 'boolean', value: true, description: 'Enable virt-host-validate tool') +option('with-tools-login-shell', type: 'boolean', value: true, description: 'Enable virt-login-shell tool') diff --git a/tools/Makefile.am b/tools/Makefile.am index 749eaa12ff..94146632cb 100644 --- a/tools/Makefile.am +++ b/tools/Makefile.am @@ -53,7 +53,6 @@ ICON_FILES = \ PODFILES = \ virt-admin.pod \ - virt-login-shell.pod \ virt-pki-validate.pod \ virt-sanlock-cleanup.pod \ virt-xml-validate.pod \ @@ -62,7 +61,6 @@ PODFILES = \ MANINFILES = \ virt-admin.1.in \ - virt-login-shell.1.in \ virt-pki-validate.1.in \ virt-sanlock-cleanup.8.in \ virt-xml-validate.1.in \ @@ -76,7 +74,6 @@ EXTRA_DIST = \ virt-pki-validate.in \ virt-sanlock-cleanup.in \ libvirt-guests.sysconf \ - virt-login-shell.conf \ virsh-edit.c \ bash-completion/vsh \ libvirt_recover_xattrs.sh \ @@ -107,13 +104,6 @@ man8_MANS = virt-sanlock-cleanup.8 DISTCLEANFILES += virt-sanlock-cleanup endif WITH_SANLOCK -if WITH_LOGIN_SHELL -conf_DATA += virt-login-shell.conf -bin_PROGRAMS += virt-login-shell -libexec_PROGRAMS = virt-login-shell-helper -man1_MANS += virt-login-shell.1 -endif WITH_LOGIN_SHELL - virt-xml-validate: virt-xml-validate.in Makefile $(AM_V_GEN)sed -e 's|[@]schemadir@|$(pkgdatadir)/schemas|g' \ -e 's|[@]VERSION@|$(VERSION)|g' \ @@ -150,31 +140,6 @@ libvirt_shell_la_SOURCES = \ vsh-table.c vsh-table.h -# 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. -virt_login_shell_SOURCES = \ - virt-login-shell.c - -virt_login_shell_CPPFLAGS = $(STANDALONE_CPPFLAGS) - -virt_login_shell_helper_SOURCES = \ - virt-login-shell-helper.c - -virt_login_shell_helper_LDFLAGS = \ - $(AM_LDFLAGS) \ - $(PIE_LDFLAGS) \ - $(COVERAGE_LDFLAGS) \ - $(NULL) -virt_login_shell_helper_LDADD = \ - ../src/libvirt.la \ - ../src/libvirt-lxc.la \ - ../gnulib/lib/libgnu.la - -virt_login_shell_helper_CFLAGS = \ - $(AM_CFLAGS) \ - $(NULL) - virsh_SOURCES = \ virsh.c virsh.h \ virsh-checkpoint.c virsh-checkpoint.h \ diff --git a/tools/meson.build b/tools/meson.build index fdc3549411..6349dec2fb 100644 --- a/tools/meson.build +++ b/tools/meson.build @@ -6,6 +6,11 @@ if not (with_driver_qemu or with_driver_lxc or with_driver_bhyve) with_tools_host_validate = false endif +with_tools_login_shell = get_option('with-tools-login-shell') +if not with_driver_lxc + with_tools_login_shell = false +endif + if with_tools_host_validate virt_host_validate_src = [ 'virt-host-validate.c', @@ -59,3 +64,55 @@ if with_tools_host_validate install_dir : join_paths(get_option('mandir'), 'man1') ) endif + +if with_tools_login_shell + virt_login_shell_inc = [ + top_inc_dir, + ] + virt_login_shell_src = [ + 'virt-login-shell.c', + ] + virt_login_shell = executable( + 'virt-login-shell', + install: true, + sources: virt_login_shell_src, + include_directories: virt_login_shell_inc, + # We'll let downstream turn on setuid bit if they + # feel it is justified for their needs + #install_mode: ['rwsr-x---', 'root', 'root'], + ) + + virt_login_shell_helper_src = [ + 'virt-login-shell-helper.c', + ] + virt_login_shell_helper_inc = common_inc_dir + virt_login_shell_helper_libs = [libvirt_dep, libvirt_lxc_dep, libxml_dep, gnulib_dep] + virt_login_shell_helper = executable( + 'virt-login-shell-helper', + install: true, + install_dir: libexec_dir, + sources: virt_login_shell_helper_src, + include_directories: virt_login_shell_helper_inc, + dependencies: virt_login_shell_helper_libs + ) + + install_data( + 'virt-login-shell.conf', + install_dir: pkg_sys_conf_dir, + ) + + virt_login_shell_man = custom_target( + 'virt_login_shell_man', + output : 'virt-login-shell.1', + input : 'virt-login-shell.pod', + command : [ + pod2man, + '--section=1', + '--center=Virtualization Support', + '--release=libvirt @0@'.format(meson.project_version()), + '@INPUT@', '@OUTPUT@' + ], + install : true, + install_dir : join_paths(get_option('mandir'), 'man1') + ) +endif -- 2.21.0

Switch over to using meson for building the virsh / virt-admin tools and supporting files. Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> --- libvirt.spec.in | 20 +---- m4/virt-bash-completion.m4 | 70 ---------------- meson.build | 7 ++ meson_options.txt | 1 + tools/Makefile.am | 123 ++------------------------- tools/bash-completion/meson.build | 19 +++++ tools/meson.build | 134 ++++++++++++++++++++++++++++++ 7 files changed, 167 insertions(+), 207 deletions(-) delete mode 100644 m4/virt-bash-completion.m4 create mode 100644 tools/bash-completion/meson.build diff --git a/libvirt.spec.in b/libvirt.spec.in index 9e33504e01..e8bcbf4fda 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -884,9 +884,6 @@ Requires: ncurses Requires: gettext # Needed by virt-pki-validate script. Requires: gnutls-utils -%if %{with_bash_completion} -Requires: %{name}-bash-completion = %{version}-%{release} -%endif %description client The client binaries needed to access the virtualization @@ -899,6 +896,7 @@ Requires: cyrus-sasl # Needed by default sasl.conf - no onerous extra deps, since # 100's of other things on a system already pull in krb5-libs Requires: cyrus-sasl-gssapi +Obsoletes: %{name}-bash-completion <= 5.8.0 %description libs Shared libraries for accessing the libvirt daemon. @@ -907,21 +905,10 @@ Shared libraries for accessing the libvirt daemon. Summary: Set of tools to control libvirt daemon Requires: %{name}-libs = %{version}-%{release} Requires: readline -%if %{with_bash_completion} -Requires: %{name}-bash-completion = %{version}-%{release} -%endif %description admin The client side utilities to control the libvirt daemon. -%if %{with_bash_completion} -%package bash-completion -Summary: Bash completion script - -%description bash-completion -Bash completion script stub. -%endif - %if %{with_wireshark} %package wireshark Summary: Wireshark dissector plugin for libvirt RPC transactions @@ -1937,11 +1924,6 @@ exit 0 %{_datadir}/bash-completion/completions/virt-admin %endif -%if %{with_bash_completion} -%files bash-completion -%{_datadir}/bash-completion/completions/vsh -%endif - %if %{with_wireshark} %files wireshark %{wireshark_plugindir}/libvirt.so diff --git a/m4/virt-bash-completion.m4 b/m4/virt-bash-completion.m4 deleted file mode 100644 index c8342176f8..0000000000 --- a/m4/virt-bash-completion.m4 +++ /dev/null @@ -1,70 +0,0 @@ -dnl Bash completion support -dnl -dnl Copyright (C) 2017 Red Hat, Inc. -dnl -dnl This library is free software; you can redistribute it and/or -dnl modify it under the terms of the GNU Lesser General Public -dnl License as published by the Free Software Foundation; either -dnl version 2.1 of the License, or (at your option) any later version. -dnl -dnl This library is distributed in the hope that it will be useful, -dnl but WITHOUT ANY WARRANTY; without even the implied warranty of -dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -dnl Lesser General Public License for more details. -dnl -dnl You should have received a copy of the GNU Lesser General Public -dnl License along with this library. If not, see -dnl <http://www.gnu.org/licenses/>. -dnl -dnl Inspired by libguestfs code. -dnl - -AC_DEFUN([LIBVIRT_ARG_BASH_COMPLETION],[ - LIBVIRT_ARG_WITH_FEATURE([BASH_COMPLETION], [bash-completion], [check], [2.0]) - LIBVIRT_ARG_WITH([BASH_COMPLETIONS_DIR], - [directory containing bash completions scripts], - [check]) -]) - -AC_DEFUN([LIBVIRT_CHECK_BASH_COMPLETION], [ - AC_REQUIRE([LIBVIRT_CHECK_READLINE]) - - if test "x$with_readline" != "xyes" ; then - if test "x$with_bash_completion" = "xyes" ; then - AC_MSG_ERROR([readline is required for bash completion support]) - else - with_bash_completion=no - fi - fi - - LIBVIRT_CHECK_PKG([BASH_COMPLETION], [bash-completion], [2.0]) - - if test "x$with_bash_completion" = "xyes" ; then - if test "x$with_bash_completions_dir" = "xcheck"; then - AC_MSG_CHECKING([for bash-completions directory]) - BASH_COMPLETIONS_DIR="$($PKG_CONFIG --variable=completionsdir bash-completion)" - AC_MSG_RESULT([$BASH_COMPLETIONS_DIR]) - - dnl Replace bash completions's exec_prefix with our own. - dnl Note that ${exec_prefix} is kept verbatim at this point in time, - dnl and will only be expanded later, when make is called: this makes - dnl it possible to override such prefix at compilation or installation - dnl time - bash_completions_prefix="$($PKG_CONFIG --variable=prefix bash-completion)" - if test "x$bash_completions_prefix" = "x" ; then - bash_completions_prefix="/usr" - fi - - BASH_COMPLETIONS_DIR='${exec_prefix}'"${BASH_COMPLETIONS_DIR#$bash_completions_prefix}" - elif test "x$with_bash_completions_dir" = "xno" || test "x$with_bash_completions_dir" = "xyes"; then - AC_MSG_ERROR([bash-completions-dir must be used only with valid path]) - else - BASH_COMPLETIONS_DIR=$with_bash_completions_dir - fi - AC_SUBST([BASH_COMPLETIONS_DIR]) - fi -]) - -AC_DEFUN([LIBVIRT_RESULT_BASH_COMPLETION],[ - LIBVIRT_RESULT_LIB([BASH_COMPLETION]) -]) diff --git a/meson.build b/meson.build index bda0ee0373..0178750c88 100644 --- a/meson.build +++ b/meson.build @@ -38,9 +38,16 @@ meson.add_dist_script('build-aux' / 'dist.py', meson.source_root(), meson.build_ yajl_min_version = '>= 2.0.3' libxml_min_version = '>= 2.9.1' +readline_min_version = '>= 7.0' +bash_completion_min_version = '>= 2.0' +threads_dep = dependency('threads') yajl_dep = dependency('yajl', version: yajl_min_version) libxml_dep = dependency('libxml-2.0', version: libxml_min_version) +readline_dep = dependency('readline', version: readline_min_version) +bash_completion_dep = dependency('bash-completion', version: bash_completion_min_version) + +bash_completion_dir = bash_completion_dep.get_pkgconfig_variable('completionsdir', define_variable: ['prefix', prefix]) subdir('src') subdir('examples') diff --git a/meson_options.txt b/meson_options.txt index d092f30ba7..6f7392a9e3 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -24,3 +24,4 @@ option('with-driver-storage', type: 'boolean', value: true, description: 'Enable option('with-tools-host-validate', type: 'boolean', value: true, description: 'Enable virt-host-validate tool') option('with-tools-login-shell', type: 'boolean', value: true, description: 'Enable virt-login-shell tool') +option('with-tools-bash-completion', type: 'boolean', value: true, description: 'Enable bash completion') diff --git a/tools/Makefile.am b/tools/Makefile.am index 94146632cb..6578295392 100644 --- a/tools/Makefile.am +++ b/tools/Makefile.am @@ -52,19 +52,16 @@ ICON_FILES = \ virsh_win_icon.rc PODFILES = \ - virt-admin.pod \ virt-pki-validate.pod \ virt-sanlock-cleanup.pod \ virt-xml-validate.pod \ - virsh.pod \ $(NULL) MANINFILES = \ - virt-admin.1.in \ + virt-pki-validate.1.in \ virt-sanlock-cleanup.8.in \ virt-xml-validate.1.in \ - virsh.1.in \ $(NULL) EXTRA_DIST = \ @@ -74,8 +71,6 @@ EXTRA_DIST = \ virt-pki-validate.in \ virt-sanlock-cleanup.in \ libvirt-guests.sysconf \ - virsh-edit.c \ - bash-completion/vsh \ libvirt_recover_xattrs.sh \ $(PODFILES) \ $(MANINFILES) \ @@ -90,13 +85,10 @@ confdir = $(sysconfdir)/libvirt conf_DATA = bin_SCRIPTS = virt-xml-validate virt-pki-validate -bin_PROGRAMS = virsh virt-admin libexec_SCRIPTS = libvirt-guests.sh man1_MANS = \ virt-pki-validate.1 \ - virt-xml-validate.1 \ - virsh.1 \ - virt-admin.1 + virt-xml-validate.1 if WITH_SANLOCK sbin_SCRIPTS = virt-sanlock-cleanup @@ -119,90 +111,7 @@ virt-sanlock-cleanup: virt-sanlock-cleanup.in Makefile -e 's|[@]localstatedir@|$(localstatedir)|' < $< > $@ \ || (rm $@ && exit 1) && chmod +x $@ -noinst_LTLIBRARIES = libvirt_shell.la -libvirt_shell_la_CFLAGS = \ - $(AM_CFLAGS) \ - $(READLINE_CFLAGS) \ - $(NULL) -libvirt_shell_la_LDFLAGS = \ - $(AM_LDFLAGS) \ - $(PIE_LDFLAGS) \ - $(COVERAGE_LDFLAGS) \ - $(NULL) -libvirt_shell_la_LIBADD = \ - ../src/libvirt.la \ - $(LIBXML_LIBS) \ - $(READLINE_LIBS) \ - ../gnulib/lib/libgnu.la \ - $(NULL) -libvirt_shell_la_SOURCES = \ - vsh.c vsh.h \ - vsh-table.c vsh-table.h - - -virsh_SOURCES = \ - virsh.c virsh.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) \ - $(PIE_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 \ - $(NULL) - -virt_admin_LDFLAGS = \ - $(AM_LDFLAGS) \ - $(COVERAGE_LDFLAGS) \ - $(STATIC_BINARIES) \ - $(PIE_LDFLAGS) \ - $(NULL) -virt_admin_LDADD = \ - ../src/libvirt-admin.la \ - libvirt_shell.la \ - $(LIBXML_LIBS) \ - $(NULL) -virt_admin_CFLAGS = \ - $(AM_CFLAGS) \ - $(READLINE_CFLAGS) + BUILT_SOURCES = if WITH_WIN_ICON @@ -267,11 +176,9 @@ POD2MAN = pod2man -c "Virtualization Support" -r "$(PACKAGE)-$(VERSION)" < $< > $@-t && \ mv $@-t $@ -install-data-local: install-systemd \ - install-bash-completion +install-data-local: install-systemd -uninstall-local: uninstall-systemd \ - uninstall-bash-completion +uninstall-local: uninstall-systemd install-sysconfig: $(MKDIR_P) $(DESTDIR)$(sysconfdir)/sysconfig @@ -330,26 +237,6 @@ libvirt-guests.service: libvirt-guests.service.in $(top_builddir)/config.status mv $@-t $@ -if WITH_BASH_COMPLETION -install-bash-completion: - $(MKDIR_P) "$(DESTDIR)$(BASH_COMPLETIONS_DIR)" - $(INSTALL_SCRIPT) $(srcdir)/bash-completion/vsh \ - "$(DESTDIR)$(BASH_COMPLETIONS_DIR)/vsh" - ( cd $(DESTDIR)$(BASH_COMPLETIONS_DIR) && \ - rm -f virsh virt-admin && \ - $(LN_S) vsh virsh && \ - $(LN_S) vsh virt-admin ) - -uninstall-bash-completion: - rm -f $(DESTDIR)$(BASH_COMPLETIONS_DIR)/vsh \ - $(DESTDIR)$(BASH_COMPLETIONS_DIR)/virsh \ - $(DESTDIR)$(BASH_COMPLETIONS_DIR)/virt-admin - rmdir $(DESTDIR)$(BASH_COMPLETIONS_DIR) ||: -else ! WITH_BASH_COMPLETION -install-bash-completion: -uninstall-bash-completion: -endif ! WITH_BASH_COMPLETION - EXTRA_DIST += wireshark/util/genxdrstub.pl diff --git a/tools/bash-completion/meson.build b/tools/bash-completion/meson.build new file mode 100644 index 0000000000..8994b22cef --- /dev/null +++ b/tools/bash-completion/meson.build @@ -0,0 +1,19 @@ + +with_tools_bash_completion = get_option('with-tools-bash-completion') +if host_machine.system() == 'windows' + with_tools_bash_completion = false +endif + +if with_tools_bash_completion + install_data( + 'vsh', + rename: 'virsh', + install_dir: bash_completion_dir, + ) + + install_data( + 'vsh', + rename: 'virt-admin', + install_dir: bash_completion_dir, + ) +endif diff --git a/tools/meson.build b/tools/meson.build index 6349dec2fb..f0d0ac90e6 100644 --- a/tools/meson.build +++ b/tools/meson.build @@ -116,3 +116,137 @@ if with_tools_login_shell install_dir : join_paths(get_option('mandir'), 'man1') ) endif + +libvirt_shell_src = [ + 'vsh.c', + 'vsh.h', + 'vsh-table.c', + 'vsh-table.h', +] +libvirt_shell_inc = common_inc_dir +libvirt_shell_libs = [libvirt_dep, readline_dep, libxml_dep, gnulib_dep] +libvirt_shell = static_library( + 'virt-shell', + libvirt_shell_src, + include_directories: libvirt_shell_inc, + dependencies: libvirt_shell_libs, +) +libvirt_shell_dep = declare_dependency( + link_with: libvirt_shell, +) + + +virsh_src = [ + 'virsh.c', + 'virsh.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', +] +virsh_inc = common_inc_dir +virsh_libs = [libvirt_shell_dep, libvirt_qemu_dep, libvirt_lxc_dep, libxml_dep, threads_dep, gnulib_dep] + +virsh = executable( + 'virsh', + install: true, + sources: virsh_src, + include_directories: virsh_inc, + dependencies: virsh_libs, +) +virsh_man = custom_target( + 'virsh_man', + output : 'virsh.1', + input : 'virsh.pod', + command : [ + pod2man, + '--section=1', + '--center=Virtualization Support', + '--release=libvirt @0@'.format(meson.project_version()), + '@INPUT@', '@OUTPUT@' + ], + install : true, + install_dir : join_paths(get_option('mandir'), 'man1') +) + + +virt_admin_src = [ + 'virt-admin.c', + 'virt-admin.h', + 'virt-admin-completer.c', + 'virt-admin-completer.h' +] +virt_admin_inc = common_inc_dir +virt_admin_libs = [libvirt_shell_dep, libvirt_admin_dep, libxml_dep, threads_dep, gnulib_dep] + +virt_admin = executable( + 'virt-admin', + install: true, + sources: virt_admin_src, + include_directories: virt_admin_inc, + dependencies: virt_admin_libs, +) +virt_admin_man = custom_target( + 'virt_admin_man', + output : 'virt-admin.1', + input : 'virt-admin.pod', + command : [ + pod2man, + '--section=1', + '--center=Virtualization Support', + '--release=libvirt @0@'.format(meson.project_version()), + '@INPUT@', '@OUTPUT@' + ], + install : true, + install_dir : join_paths(get_option('mandir'), 'man1') +) + +subdir('bash-completion') -- 2.21.0
participants (1)
-
Daniel P. Berrangé