From nobody Fri May 3 07:14:40 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1569582729; cv=none; d=zoho.com; s=zohoarc; b=oAHlZ9dTU3DfE/tTDo2yhMcPUk20Lf1aEd415wPfGc5AN2H/dz5wVc5XUDMyBAw3Wc7FJNDeODQd+3csb8XvctmLl6Tun5XsQoZ4pYSQiOe8pq+xhOEF2ZYCr4r5Is/+Gi/RXS5L1e5RCwZlvwpF12fGTwxWpaKX6h8ueMfUMbI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1569582729; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=pbZznwIhKJ14vdNWi0qldHf7lbyR5layGjPDdA+G9Pc=; b=i+C+i9BX1XmihCUO8c3T/ylnw8tQYQDd8BE7yzakLG3HzCGaw9A6Xs4ADS/35aKw3KBeHRF0tCeGOSt3jaStjz3PwYj68hyfYgIVrysczddhOkAL0uJwHKtFWZ3VRYCr/t8wfPc3wSZAOnNESH8nV4h0kciup28ZlKJVAJL/W1E= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1569582729021869.6766238556147; Fri, 27 Sep 2019 04:12:09 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id DDD663099F56; Fri, 27 Sep 2019 11:12:06 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id AA02260126; Fri, 27 Sep 2019 11:12:06 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 4A69683542; Fri, 27 Sep 2019 11:12:06 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x8RBC3pp028187 for ; Fri, 27 Sep 2019 07:12:03 -0400 Received: by smtp.corp.redhat.com (Postfix) id E476560C18; Fri, 27 Sep 2019 11:12:03 +0000 (UTC) Received: from domokun.gsslab.fab.redhat.com (dhcp-94.gsslab.fab.redhat.com [10.33.9.94]) by smtp.corp.redhat.com (Postfix) with ESMTP id 34C1260BE2; Fri, 27 Sep 2019 11:12:03 +0000 (UTC) From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Date: Fri, 27 Sep 2019 12:11:48 +0100 Message-Id: <20190927111158.20653-2-berrange@redhat.com> In-Reply-To: <20190927111158.20653-1-berrange@redhat.com> References: <20190927111158.20653-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Cc: Pavel Hrdina Subject: [libvirt] [PATCH 01/11] build: mandate use of a build dir != src dir X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.41]); Fri, 27 Sep 2019 11:12:07 +0000 (UTC) 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=C3=A9 --- 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 . =20 AC_INIT([libvirt], [5.8.0], [libvir-list@redhat.com], [], [https://libvirt= .org]) + +if test $srcdir =3D "." +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=3D$(stat --printf=3D'%Y' %{= _specdir}/%{name}.spec) %endif =20 rm -f po/stamp-po -%configure --with-runstatedir=3D%{_rundir} \ + +%define _configure ../configure +mkdir %{_vpath_builddir} +cd %{_vpath_builddir} + +%configure --enable-dependency-tracking \ + --with-runstatedir=3D%{_rundir} \ %{?arg_qemu} \ %{?arg_openvz} \ %{?arg_lxc} \ @@ -1231,6 +1237,7 @@ rm -fr %{buildroot} =20 export SOURCE_DATE_EPOCH=3D$(stat --printf=3D'%Y' %{_specdir}/%{name}.spec) =20 +cd %{_vpath_builddir} %make_install %{?_smp_mflags} SYSTEMD_UNIT_DIR=3D%{_unitdir} V=3D1 =20 rm -f $RPM_BUILD_ROOT%{_libdir}/*.la @@ -1312,6 +1319,7 @@ mv $RPM_BUILD_ROOT%{_datadir}/systemtap/tapset/libvir= t_qemu_probes.stp \ %endif =20 %check +cd %{_vpath_builddir} if ! make %{?_smp_mflags} check VIR_TEST_DEBUG=3D1 then cat test-suite.log || true --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri May 3 07:14:40 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1569582728; cv=none; d=zoho.com; s=zohoarc; b=Bzg5HBjWNi68G4YK7VkQbVbSmB8InQnYD/BVKdETrxE+aQZkcSfdC6/LE5lF7cC7MXPABxZdlv/QfxNSxhJqya6IyOBR3A+gXGu92mcwk7cNH8LB2JLbfXVvHm5Tj6VnuVJruS0h/PZ/L7IBrFOLG9yJuEvEXWJPXhlaNCf68Ic= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1569582728; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=rl5I312l040gtvWPpH9eqXn+pZeDjaXyFDF35h4ViiQ=; b=b3CpenlNRz5K0pvPUpj5xDoEdI7prCRHniuH5EEam+w0o5Dfj7oXz+4WS0wQEnb+QHvCK0zV8PLGAJY4lPdpptVHXRxHFg21HIGMCgqfOuMsjGh8WTuriNyF6rK7CLBFHH4v+gsJvFt9d8FiYanxQID2/eHHI8/kawZMdqGb9So= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1569582728761183.52715690354842; Fri, 27 Sep 2019 04:12:08 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id AB42E300894D; Fri, 27 Sep 2019 11:12:06 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 77A58600C6; Fri, 27 Sep 2019 11:12:06 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 08B691803B47; Fri, 27 Sep 2019 11:12:06 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x8RBC4PI028195 for ; Fri, 27 Sep 2019 07:12:04 -0400 Received: by smtp.corp.redhat.com (Postfix) id E576760C18; Fri, 27 Sep 2019 11:12:04 +0000 (UTC) Received: from domokun.gsslab.fab.redhat.com (dhcp-94.gsslab.fab.redhat.com [10.33.9.94]) by smtp.corp.redhat.com (Postfix) with ESMTP id 358C460BF3; Fri, 27 Sep 2019 11:12:04 +0000 (UTC) From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Date: Fri, 27 Sep 2019 12:11:49 +0100 Message-Id: <20190927111158.20653-3-berrange@redhat.com> In-Reply-To: <20190927111158.20653-1-berrange@redhat.com> References: <20190927111158.20653-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Cc: Pavel Hrdina Subject: [libvirt] [PATCH 02/11] build: drop support for python2, requiring python3 only X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.48]); Fri, 27 Sep 2019 11:12:07 +0000 (UTC) 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=C3=A9 --- 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" =3D "yes"; then fi =20 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 b= uild 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 # =20 -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 =20 # reformat-news.py: Reformat the NEWS file properly # @@ -18,8 +18,6 @@ # License along with this library. If not, see # . =20 -from __future__ import print_function - import sys =20 COLUMNS =3D 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 @@ =20 %define with_bash_completion 0%{!?_without_bash_completion:1} =20 -# Use Python 3 when possible, Python 2 otherwise -%if 0%{?fedora} || 0%{?rhel} > 7 - %define python python3 -%else - %define python python2 -%endif - =20 %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 =20 # # esx_vi_generator.py: generates most of the SOAP type mapping code @@ -22,8 +22,6 @@ # . # =20 -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_gen= erator.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 =20 # # hyperv_wmi_generator.py: generates most of the WMI type mapping code @@ -20,8 +20,6 @@ # . # =20 -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 =20 -for python in python3 python2; do - $python < (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 156958273497911.80355641848098; Fri, 27 Sep 2019 04:12:14 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id F1A35300BEAD; Fri, 27 Sep 2019 11:12:12 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C41DC6012C; Fri, 27 Sep 2019 11:12:12 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 88D831803B4A; Fri, 27 Sep 2019 11:12:12 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x8RBC5q3028202 for ; Fri, 27 Sep 2019 07:12:05 -0400 Received: by smtp.corp.redhat.com (Postfix) id E5B0760BF3; Fri, 27 Sep 2019 11:12:05 +0000 (UTC) Received: from domokun.gsslab.fab.redhat.com (dhcp-94.gsslab.fab.redhat.com [10.33.9.94]) by smtp.corp.redhat.com (Postfix) with ESMTP id 35C0B60BE2; Fri, 27 Sep 2019 11:12:05 +0000 (UTC) From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Date: Fri, 27 Sep 2019 12:11:50 +0100 Message-Id: <20190927111158.20653-4-berrange@redhat.com> In-Reply-To: <20190927111158.20653-1-berrange@redhat.com> References: <20190927111158.20653-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Cc: Pavel Hrdina Subject: [libvirt] [PATCH 03/11] build: introduce bare minimum use of meson as a build system X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.42]); Fri, 27 Sep 2019 11:12:13 +0000 (UTC) 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 !=3D 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=C3=A9 --- 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) !=3D 3: + print("syntax: %s SOURCE-ROOT BUILD-ROOT", sys.argv[0]) + sys.exit(1) + +srcroot =3D sys.argv[1] +buildroot =3D sys.argv[2] +distdir =3D 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 =3D os.path.join(distdir, ".gnulib") +shutil.rmtree(gnulibmod) + +autotools =3D { + "/": [ + "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 =3D os.path.join(srcroot, *dirname[1:].split("/")) + dstdir =3D 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=3DTrue) + for filename in autotools[dirname]: + srcfile =3D os.path.join(srcdir, filename) + dstfile =3D 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 =3D time.time() +for dirname, subdirs, files in os.walk(distdir): + for filename in files: + dstfile =3D os.path.join(dirname, filename) + os.utime(dstfile, (now, now)) + + +# Some auto-generated files we want to include +extra_dist =3D [ + "libvirt.spec", + "NEWS" +] +for filename in extra_dist: + filesrc =3D os.path.join(buildroot, filename) + filedst =3D os.path.join(distdir, filename) + + shutil.copyfile(filesrc, filedst) + +authors =3D subprocess.check_output(["git", "log", "--pretty=3Dformat:%aN = <%aE>"]) +authorlist =3D sorted(set(authors.decode("utf8").split("\n"))) + +authorssrc =3D os.path.join(srcroot, "AUTHORS.in") +authorsdst =3D os.path.join(distdir, "AUTHORS") +with open(authorssrc, "r") as src, open(authorsdst, "w") as dst: + for line in src: + if line.find("#contributorslist#") !=3D -1: + for name in authorlist: + print(name, file=3Ddst) + else: + print(line, end=3D'', file=3Ddst) + 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=3Dsystemd \ %{?arg_login_shell} make %{?_smp_mflags} V=3D1 +cd .. +%meson +%meson_build =20 %install rm -fr %{buildroot} @@ -1232,6 +1236,8 @@ export SOURCE_DATE_EPOCH=3D$(stat --printf=3D'%Y' %{_= specdir}/%{name}.spec) =20 cd %{_vpath_builddir} %make_install %{?_smp_mflags} SYSTEMD_UNIT_DIR=3D%{_unitdir} V=3D1 +cd .. +%meson_install =20 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 =20 %post libs %if 0%{?rhel} =3D=3D 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=3Ddebugoptimized', + 'c_std=3Dgnu99', + ], + meson_version: '>=3D 0.49.0' +) + +prefix =3D get_option('prefix') +bin_dir =3D get_option('bindir') +lib_dir =3D get_option('libdir') +sys_conf_dir =3D get_option('sysconfdir') +data_dir =3D get_option('datadir') +local_state_dir =3D get_option('localstatedir') +pkg_data_dir =3D data_dir / meson.project_name() +pkg_doc_dir =3D data_dir / 'doc' / meson.project_name() + '-' + meson.proj= ect_version() + +meson.add_dist_script('build-aux' / 'dist.py', meson.source_root(), meson.= build_root()) --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri May 3 07:14:40 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1569582734; cv=none; d=zoho.com; s=zohoarc; b=HIIzBJMntrVg5wYVQv5IbHJBX01iSH4MIAbYNh1efheTESq7pfmQhi4lKEvsKqtKioj7V+zihh2qICWeAkp3stl8C6TCDIhh/Ka90ePW8zKMKdlDbo/qYpVZYpOqftWHhyH3qhWYbufImNBux4NbLneyrBys6qRYOknjjzfEdIk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1569582734; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=W0ION/UFauHZcMiQY0m90Jqxr2jpc/ajQG7KcIb6LQg=; b=MB6Di4WmthyUUjNcWnZAlbkuLbEz3XFl4OqNRTdI3ZXizpnxAWy8Tz4LygsHsJf4vron5aoFq0lMewXCJiCHIZwdol/k/kSyUA3I3NalONqeuCSQwye/1DPZbCbhmfPNIfous766AsDw2ztAiT2m4ByS2yQE+SSq4XfRVDQd3/0= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1569582734603846.9298766096817; Fri, 27 Sep 2019 04:12:14 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C020ECA377; Fri, 27 Sep 2019 11:12:12 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9B5AE6060D; Fri, 27 Sep 2019 11:12:12 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 5BC9383545; Fri, 27 Sep 2019 11:12:12 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x8RBC97p028222 for ; Fri, 27 Sep 2019 07:12:09 -0400 Received: by smtp.corp.redhat.com (Postfix) id 4F7D660C5D; Fri, 27 Sep 2019 11:12:09 +0000 (UTC) Received: from domokun.gsslab.fab.redhat.com (dhcp-94.gsslab.fab.redhat.com [10.33.9.94]) by smtp.corp.redhat.com (Postfix) with ESMTP id 93BC660BF3; Fri, 27 Sep 2019 11:12:06 +0000 (UTC) From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Date: Fri, 27 Sep 2019 12:11:51 +0100 Message-Id: <20190927111158.20653-5-berrange@redhat.com> In-Reply-To: <20190927111158.20653-1-berrange@redhat.com> References: <20190927111158.20653-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Cc: Pavel Hrdina Subject: [libvirt] [PATCH 04/11] build: declare deps for libraries built by autotools X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Fri, 27 Sep 2019 11:12:13 +0000 (UTC) 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=C3=A9 --- 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 =3D get_option('localstatedir') pkg_data_dir =3D data_dir / meson.project_name() pkg_doc_dir =3D data_dir / 'doc' / meson.project_name() + '-' + meson.proj= ect_version() =20 +public_inc_dir =3D include_directories('include') +gnulib_inc_dir =3D include_directories('gnulib/lib') + +cc =3D meson.get_compiler('c') + +gnulib =3D cc.find_library('libgnu', dirs: [meson.build_root() / 'gnulib' = / 'lib' / '.libs']) +gnulib_dep =3D 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 =3D cc.find_library('libvirt', dirs: [meson.build_root() / 'src' /= '.libs']) +libvirt_admin =3D cc.find_library('libvirt-admin', dirs: [meson.build_root= () / 'src' / '.libs']) +libvirt_qemu =3D cc.find_library('libvirt-qemu', dirs: [meson.build_root()= / 'src' / '.libs']) +libvirt_lxc =3D cc.find_library('libvirt-lxc', dirs: [meson.build_root() /= 'src' / '.libs']) + +libvirt_dep =3D declare_dependency( + dependencies: libvirt, + include_directories: [public_inc_dir] +) + +libvirt_admin_dep =3D declare_dependency( + dependencies: libvirt_admin, + include_directories: [public_inc_dir] +) + +libvirt_qemu_dep =3D declare_dependency( + dependencies: libvirt_qemu, + include_directories: [public_inc_dir] +) + +libvirt_lxc_dep =3D declare_dependency( + dependencies: libvirt_lxc, + include_directories: [public_inc_dir] +) --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri May 3 07:14:40 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1569582738; cv=none; d=zoho.com; s=zohoarc; b=CKQrt5wncM8matxDpQc27Rlp1M2QTnuJOmBUjhhzB1iFuHEk+ohf1/z0XziT/KOCMPzbm5TqbcAPqS3o9DJd8laRkCWjStXsnC/pCNk6j2Gc/JoHFRQTkxIDC9JhKf5yGU7nhgayrTX7Fp42w0jxaTEnlU0rq+T1l2au/Xw8zfw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1569582738; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=JW/MAOShb5H2nNLLALk8uJF6HOodRrMbf8yqAiCzmp8=; b=mtRbK89XG0f9A9SGz8omXanT0Xzt6Pa2xt9X1viJwLBvE4oDBCUpvFInEvUxyPzY/oGJGJVu42CJ8poD+mFi6SXHYJ3FuGtks0m8aXdMbWNJ+eBkYTWdHTUuVxnDKegveXWPZhzwywZXvpU+qy5Cj9j22tc+0dQzKs38m7UHkG8= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1569582738058190.2515497794476; Fri, 27 Sep 2019 04:12:18 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 37914C05AA52; Fri, 27 Sep 2019 11:12:16 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0B42F6092F; Fri, 27 Sep 2019 11:12:16 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id BA8AD1803B4B; Fri, 27 Sep 2019 11:12:15 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x8RBCAiD028230 for ; Fri, 27 Sep 2019 07:12:10 -0400 Received: by smtp.corp.redhat.com (Postfix) id 4FCE560E1C; Fri, 27 Sep 2019 11:12:10 +0000 (UTC) Received: from domokun.gsslab.fab.redhat.com (dhcp-94.gsslab.fab.redhat.com [10.33.9.94]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9445360BF3; Fri, 27 Sep 2019 11:12:09 +0000 (UTC) From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Date: Fri, 27 Sep 2019 12:11:52 +0100 Message-Id: <20190927111158.20653-6-berrange@redhat.com> In-Reply-To: <20190927111158.20653-1-berrange@redhat.com> References: <20190927111158.20653-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Cc: Pavel Hrdina Subject: [libvirt] [PATCH 05/11] build: use meson for building the example programs X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Fri, 27 Sep 2019 11:12:16 +0000 (UTC) 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=C3=A9 --- 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 =3D \ $(TEST_XML_EXAMPLES) \ $(NULL) =20 -AM_CPPFLAGS =3D \ - -I$(top_builddir)/include \ - -I$(top_srcdir)/include \ - $(NULL) - -AM_CFLAGS =3D \ - $(WARN_CFLAGS) \ - $(NULL) - -AM_LDFLAGS =3D \ - $(STATIC_BINARIES) \ - $(NULL) - -LDADD =3D \ - $(top_builddir)/src/libvirt.la \ - $(top_builddir)/src/libvirt-admin.la \ - $(NULL) - -noinst_PROGRAMS =3D \ - 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 =3D c/admin/client_close.c -c_admin_client_info_SOURCES =3D c/admin/client_info.c -c_admin_client_limits_SOURCES =3D c/admin/client_limits.c -c_admin_list_clients_SOURCES =3D c/admin/list_clients.c -c_admin_list_servers_SOURCES =3D c/admin/list_servers.c -c_admin_logging_SOURCES =3D c/admin/logging.c -c_admin_threadpool_params_SOURCES =3D c/admin/threadpool_params.c -c_domain_dommigrate_SOURCES =3D c/domain/dommigrate.c -c_domain_domtop_SOURCES =3D c/domain/domtop.c -c_domain_info1_SOURCES =3D c/domain/info1.c -c_domain_rename_SOURCES =3D c/domain/rename.c -c_domain_suspend_SOURCES =3D c/domain/suspend.c -c_misc_event_test_SOURCES =3D c/misc/event-test.c -c_misc_hellolibvirt_SOURCES =3D c/misc/hellolibvirt.c -c_misc_openauth_SOURCES =3D c/misc/openauth.c - examplesdir =3D $(docdir)/examples =20 adminexamplesdir =3D $(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 =3D [libvirt_dep, libvirt_admin_dep] + +client_close_src =3D ['client_close.c'] +client_close =3D executable( + 'client_close', + client_close_src, + dependencies: examples_admin_deps +) + +client_info_src =3D ['client_info.c'] +client_info =3D executable( + 'client_info', + client_info_src, + dependencies: examples_admin_deps +) + +client_limits_src =3D ['client_limits.c'] +client_limits =3D executable( + 'client_limits', + client_limits_src, + dependencies: examples_admin_deps +) + +list_clients_src =3D ['list_clients.c'] +list_clients =3D executable( + 'list_clients', + list_clients_src, + dependencies: examples_admin_deps +) + +list_server_src =3D ['list_servers.c'] +list_servers =3D executable( + 'list_servers', + list_server_src, + dependencies: examples_admin_deps +) + +logging_src =3D ['logging.c'] +logging =3D executable( + 'logging', + logging_src, + dependencies: examples_admin_deps +) + +threadpool_params_src =3D ['threadpool_params.c'] +threadpool_params =3D 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 =3D [libvirt_dep] + +dommigrate_src =3D ['dommigrate.c'] +dommigrate =3D executable( + 'dommigrate', + dommigrate_src, + dependencies: examples_domain_deps +) + +domtop_src =3D ['domtop.c'] +domtop =3D executable( + 'domtop', + domtop_src, + dependencies: examples_domain_deps +) + +info1_src =3D ['info1.c'] +info1 =3D executable( + 'info1', + info1_src, + dependencies: examples_domain_deps +) + +rename_src =3D ['rename.c'] +rename =3D executable( + 'rename', + rename_src, + dependencies: examples_domain_deps +) + +suspend_src =3D ['suspend.c'] +suspend =3D 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 =3D [libvirt_dep] + +hellolibvirt_src =3D ['hellolibvirt.c'] +hellolibvirt =3D executable( + 'hellolibvirt', + hellolibvirt_src, + dependencies: examples_misc_deps +) + +eventtest_src =3D ['event-test.c'] +eventtest =3D executable( + 'event-test', + eventtest_src, + dependencies: examples_misc_deps +) + +openauth_src =3D ['openauth.c'] +openauth =3D 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 =3D declare_dependency( meson.add_dist_script('build-aux' / 'dist.py', meson.source_root(), meson.= build_root()) =20 subdir('src') +subdir('examples') --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri May 3 07:14:40 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1569582738; cv=none; d=zoho.com; s=zohoarc; b=LUoELUHaAD4JaFayWNstyQN+yNjKB2QBotU0H4yQ0CoY+B2ayimbFhDN+kaXA490icGIu//0YT8/1xl/dce87XSsRJ7AZIzwm/9NwdfjfIE2gFjgTPi2tAqL7jtOY9sCZnSYQLhu8hlvggFgIJGM2Ni9bzX+QDNsx4dP2C2OxKk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1569582738; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=6e4gJtzgdehdDYygBsLyexItvw32cNI8hAUEuC7L4oI=; b=SoM6152H3Ywfc5vMopFPE88XcH6vVWLF2MnkloGfUcLODl0fkYkAZTmdi2p098Djk+Fz9qHDE0zy9nAfdbxJAPXMKMHaHihTa5geK9mVitolMqUlzZx4bf2Ur/P3YibExfXfXPflNO54Rpr9J0muIrCxbxehpnJP+1smxoVPxuA= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1569582738393951.965033567381; Fri, 27 Sep 2019 04:12:18 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6A3AB30ADBB8; Fri, 27 Sep 2019 11:12:16 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 3ACF0100EBD6; Fri, 27 Sep 2019 11:12:16 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id E42E81803B4D; Fri, 27 Sep 2019 11:12:15 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x8RBCBNw028240 for ; Fri, 27 Sep 2019 07:12:11 -0400 Received: by smtp.corp.redhat.com (Postfix) id 5115D60BF3; Fri, 27 Sep 2019 11:12:11 +0000 (UTC) Received: from domokun.gsslab.fab.redhat.com (dhcp-94.gsslab.fab.redhat.com [10.33.9.94]) by smtp.corp.redhat.com (Postfix) with ESMTP id 94ACD60F88; Fri, 27 Sep 2019 11:12:10 +0000 (UTC) From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Date: Fri, 27 Sep 2019 12:11:53 +0100 Message-Id: <20190927111158.20653-7-berrange@redhat.com> In-Reply-To: <20190927111158.20653-1-berrange@redhat.com> References: <20190927111158.20653-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Cc: Pavel Hrdina Subject: [libvirt] [PATCH 06/11] build: use meson for installing example program src / data X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.47]); Fri, 27 Sep 2019 11:12:17 +0000 (UTC) This uses meson to install the example data files and example program source. Signed-off-by: Daniel P. Berrang=C3=A9 --- 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 =3D lcov GENHTML =3D genhtml =20 SUBDIRS =3D . gnulib/lib include/libvirt src tools docs gnulib/tests \ - tests po examples + tests po =20 XZ_OPT ?=3D -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 -## . - -ADMIN_EXAMPLES =3D \ - $(wildcard $(srcdir)/c/admin/*.c) \ - $(NULL) - -DOMAIN_EXAMPLES =3D \ - $(wildcard $(srcdir)/c/domain/*.c) \ - $(NULL) - -MISC_EXAMPLES =3D \ - $(wildcard $(srcdir)/c/misc/*.c) \ - $(NULL) - -POLKIT_EXAMPLES =3D \ - $(wildcard $(srcdir)/polkit/*.rules) \ - $(NULL) - -SH_EXAMPLES =3D \ - $(wildcard $(srcdir)/sh/*) \ - $(NULL) - -STORAGE_XML_EXAMPLES =3D \ - $(wildcard $(srcdir)/xml/storage/*.xml) \ - $(NULL) - -SYSTEMTAP_EXAMPLES =3D \ - $(wildcard $(srcdir)/systemtap/*.stp) \ - $(NULL) - -TEST_XML_EXAMPLES =3D \ - $(wildcard $(srcdir)/xml/test/*.xml) \ - $(NULL) - -EXTRA_DIST =3D \ - $(POLKIT_EXAMPLES) \ - $(SH_EXAMPLES) \ - $(STORAGE_XML_EXAMPLES) \ - $(SYSTEMTAP_EXAMPLES) \ - $(TEST_XML_EXAMPLES) \ - $(NULL) - -examplesdir =3D $(docdir)/examples - -adminexamplesdir =3D $(examplesdir)/c/admin -adminexamples_DATA =3D $(ADMIN_EXAMPLES) - -domainexamplesdir =3D $(examplesdir)/c/domain -domainexamples_DATA =3D $(DOMAIN_EXAMPLES) - -miscexamplesdir =3D $(examplesdir)/c/misc -miscexamples_DATA =3D $(MISC_EXAMPLES) - -polkitexamplesdir =3D $(examplesdir)/polkit -polkitexamples_DATA =3D $(POLKIT_EXAMPLES) - -shexamplesdir =3D $(examplesdir)/sh -shexamples_DATA =3D $(SH_EXAMPLES) - -storagexmlexamplesdir =3D $(examplesdir)/xml/storage -storagexmlexamples_DATA =3D $(STORAGE_XML_EXAMPLES) - -systemtapexamplesdir =3D $(examplesdir)/systemtap -systemtapexamples_DATA =3D $(SYSTEMTAP_EXAMPLES) - -testxmlexamplesdir =3D $(examplesdir)/xml/test -testxmlexamples_DATA =3D $(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 @@ =20 +examples_admin_dir =3D examples_dir / 'c' / 'admin' examples_admin_deps =3D [libvirt_dep, libvirt_admin_dep] =20 client_close_src =3D ['client_close.c'] @@ -7,6 +8,7 @@ client_close =3D executable( client_close_src, dependencies: examples_admin_deps ) +install_data(client_close_src, install_dir: examples_admin_dir) =20 client_info_src =3D ['client_info.c'] client_info =3D executable( @@ -14,6 +16,7 @@ client_info =3D executable( client_info_src, dependencies: examples_admin_deps ) +install_data(client_info_src, install_dir: examples_admin_dir) =20 client_limits_src =3D ['client_limits.c'] client_limits =3D executable( @@ -21,6 +24,7 @@ client_limits =3D executable( client_limits_src, dependencies: examples_admin_deps ) +install_data(client_limits_src, install_dir: examples_admin_dir) =20 list_clients_src =3D ['list_clients.c'] list_clients =3D executable( @@ -28,6 +32,7 @@ list_clients =3D executable( list_clients_src, dependencies: examples_admin_deps ) +install_data(list_clients_src, install_dir: examples_admin_dir) =20 list_server_src =3D ['list_servers.c'] list_servers =3D executable( @@ -35,6 +40,7 @@ list_servers =3D executable( list_server_src, dependencies: examples_admin_deps ) +install_data(list_server_src, install_dir: examples_admin_dir) =20 logging_src =3D ['logging.c'] logging =3D executable( @@ -42,6 +48,7 @@ logging =3D executable( logging_src, dependencies: examples_admin_deps ) +install_data(logging_src, install_dir: examples_admin_dir) =20 threadpool_params_src =3D ['threadpool_params.c'] threadpool_params =3D executable( @@ -49,3 +56,4 @@ threadpool_params =3D 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 @@ =20 +examples_domain_dir =3D examples_dir / 'c' / 'domain' examples_domain_deps =3D [libvirt_dep] =20 dommigrate_src =3D ['dommigrate.c'] @@ -7,6 +8,7 @@ dommigrate =3D executable( dommigrate_src, dependencies: examples_domain_deps ) +install_data(dommigrate_src, install_dir: examples_domain_dir) =20 domtop_src =3D ['domtop.c'] domtop =3D executable( @@ -14,6 +16,7 @@ domtop =3D executable( domtop_src, dependencies: examples_domain_deps ) +install_data(domtop_src, install_dir: examples_domain_dir) =20 info1_src =3D ['info1.c'] info1 =3D executable( @@ -21,6 +24,7 @@ info1 =3D executable( info1_src, dependencies: examples_domain_deps ) +install_data(info1_src, install_dir: examples_domain_dir) =20 rename_src =3D ['rename.c'] rename =3D executable( @@ -28,6 +32,7 @@ rename =3D executable( rename_src, dependencies: examples_domain_deps ) +install_data(rename_src, install_dir: examples_domain_dir) =20 suspend_src =3D ['suspend.c'] suspend =3D executable( @@ -35,3 +40,4 @@ suspend =3D 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 @@ =20 +examples_misc_dir =3D examples_dir / 'c' / 'misc' examples_misc_deps =3D [libvirt_dep] =20 hellolibvirt_src =3D ['hellolibvirt.c'] @@ -7,6 +8,7 @@ hellolibvirt =3D executable( hellolibvirt_src, dependencies: examples_misc_deps ) +install_data(hellolibvirt_src, install_dir: examples_misc_dir) =20 eventtest_src =3D ['event-test.c'] eventtest =3D executable( @@ -14,6 +16,7 @@ eventtest =3D executable( eventtest_src, dependencies: examples_misc_deps ) +install_data(eventtest_src, install_dir: examples_misc_dir) =20 openauth_src =3D ['openauth.c'] openauth =3D executable( @@ -21,3 +24,4 @@ openauth =3D 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 @@ =20 +examples_dir =3D 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 =3D examples_dir / 'polkit' + +polkit_rules =3D ['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 =3D examples_dir / 'sh' + +sh_scripts =3D ['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 =3D examples_dir / 'systemtap' + +systemtap_scripts =3D ['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 =3D examples_dir / 'xml' / 'storage' + +storage_xml =3D ['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 =3D examples_dir / 'xml' / 'test' + +test_xml =3D ['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) --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri May 3 07:14:40 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1569582741; cv=none; d=zoho.com; s=zohoarc; b=hAxirP/n9xwmRRVNy/U664kHXoVcFYFWIHExAdaZ7DzZuojaGF/Cw/qt1rld/d7fzZ3me/2lkmEzKRu2kPSwjurYJOHNCksU6mn3Po0zP8hxuUWaucnnZem3iAuhCpjoVqZk0E3Kdu0ap4sMEG7J3fY2PW/j+EJsvUl72q+DYVM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1569582741; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=S64EWXFUE7Ga7memGhUW/iX76R28tL/C5TMwj8pxdTA=; b=JxfIhf5sAH4qFrAgriNjztongw10stwkbCqGCueLIdgFxEg2AeAR3L+yFbwHUJrOumtqOxoRl/208aPCoOOYf4CC95QqSh2cOcNC9NE15p1aFR4sgNL7U55sMyT5FuHjcIIE+P+t2McksDv6xWlKrtpjXlLuMBuN7IPTB0JtgXk= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1569582741814210.46280585192164; Fri, 27 Sep 2019 04:12:21 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 114DDC02490A; Fri, 27 Sep 2019 11:12:20 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E2C705D9E1; Fri, 27 Sep 2019 11:12:19 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 9753883549; Fri, 27 Sep 2019 11:12:19 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x8RBCCTh028247 for ; Fri, 27 Sep 2019 07:12:12 -0400 Received: by smtp.corp.redhat.com (Postfix) id 51E7060F88; Fri, 27 Sep 2019 11:12:12 +0000 (UTC) Received: from domokun.gsslab.fab.redhat.com (dhcp-94.gsslab.fab.redhat.com [10.33.9.94]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9544760BF3; Fri, 27 Sep 2019 11:12:11 +0000 (UTC) From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Date: Fri, 27 Sep 2019 12:11:54 +0100 Message-Id: <20190927111158.20653-8-berrange@redhat.com> In-Reply-To: <20190927111158.20653-1-berrange@redhat.com> References: <20190927111158.20653-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Cc: Pavel Hrdina Subject: [libvirt] [PATCH 07/11] build: use meson for building NSS modules X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Fri, 27 Sep 2019 11:12:20 +0000 (UTC) Switch over to using meson for building the two NSS modules Signed-off-by: Daniel P. Berrang=C3=A9 --- 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 =3D data_dir / 'doc' / meson.project_name() += '-' + meson.project_vers =20 public_inc_dir =3D include_directories('include') gnulib_inc_dir =3D include_directories('gnulib/lib') +top_inc_dir =3D include_directories('.') =20 cc =3D meson.get_compiler('c') =20 @@ -32,5 +33,9 @@ gnulib_dep =3D declare_dependency( =20 meson.add_dist_script('build-aux' / 'dist.py', meson.source_root(), meson.= build_root()) =20 +yajl_min_version =3D '>=3D 2.0.3' +yajl_dep =3D 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 =3D pod2man -c "Virtualization Support" -r "$= (PACKAGE)-$(VERSION)" < $< > $@-t && \ mv $@-t $@ =20 -install-data-local: install-systemd install-nss \ +install-data-local: install-systemd \ install-bash-completion =20 -uninstall-local: uninstall-systemd uninstall-nss \ +uninstall-local: uninstall-systemd \ uninstall-bash-completion =20 install-sysconfig: @@ -470,114 +470,6 @@ wireshark/src/libvirt/protocol.h: wireshark/util/genx= drstub.pl \ =20 endif WITH_WIRESHARK_DISSECTOR =20 -if WITH_BSD_NSS -LIBVIRT_NSS_SYMBOL_FILE =3D \ - $(srcdir)/nss/libvirt_nss_bsd.syms -LIBVIRT_GUEST_NSS_SYMBOL_FILE =3D \ - $(LIBVIRT_NSS_SYMBOL_FILE) -NSS_SO_VER =3D 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 =3D \ - $(srcdir)/nss/libvirt_nss.syms -LIBVIRT_GUEST_NSS_SYMBOL_FILE =3D \ - $(srcdir)/nss/libvirt_guest_nss.syms -NSS_SO_VER =3D 2 - -install-nss: -uninstall-nss: -endif ! WITH_BSD_NSS - -LIBVIRT_NSS_SOURCES =3D \ - nss/libvirt_nss.c \ - nss/libvirt_nss.h \ - nss/libvirt_nss_leases.c \ - nss/libvirt_nss_leases.h \ - $(NULL) - -if WITH_NSS -noinst_LTLIBRARIES +=3D nss/libnss_libvirt_impl.la -nss_libnss_libvirt_impl_la_SOURCES =3D \ - $(LIBVIRT_NSS_SOURCES) - -nss_libnss_libvirt_impl_la_CPPFLAGS =3D $(STANDALONE_CPPFLAGS) -nss_libnss_libvirt_impl_la_CFLAGS =3D \ - -DLIBVIRT_NSS \ - $(YAJL_CFLAGS) \ - $(AM_CFLAGS) \ - $(NULL) - -nss_libnss_libvirt_impl_la_LIBADD =3D \ - $(YAJL_LIBS) \ - $(NULL) - -nss_libnss_libvirt_la_SOURCES =3D -nss_libnss_libvirt_la_LDFLAGS =3D \ - $(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 =3D \ - nss/libnss_libvirt_impl.la - -noinst_LTLIBRARIES +=3D nss/libnss_libvirt_guest_impl.la -nss_libnss_libvirt_guest_impl_la_SOURCES =3D \ - $(LIBVIRT_NSS_SOURCES) \ - nss/libvirt_nss_macs.h \ - nss/libvirt_nss_macs.c \ - $(NULL) - -nss_libnss_libvirt_guest_impl_la_CPPFLAGS =3D $(STANDALONE_CPPFLAGS) -nss_libnss_libvirt_guest_impl_la_CFLAGS =3D \ - -DLIBVIRT_NSS \ - -DLIBVIRT_NSS_GUEST \ - $(YAJL_CFLAGS) \ - $(AM_CFLAGS) \ - $(NULL) - -nss_libnss_libvirt_guest_impl_la_LIBADD =3D \ - $(YAJL_LIBS) \ - $(NULL) - -nss_libnss_libvirt_guest_la_SOURCES =3D -nss_libnss_libvirt_guest_la_LDFLAGS =3D \ - $(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 =3D \ - nss/libnss_libvirt_guest_impl.la - -lib_LTLIBRARIES =3D \ - nss/libnss_libvirt.la \ - nss/libnss_libvirt_guest.la - -endif WITH_NSS - -EXTRA_DIST +=3D $(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 =20 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() =3D=3D 'freebsd' + with_nss =3D true + libnss_prefix =3D '' + libnss_so_version =3D '1' + libnss_syms =3D 'libvirt_nss_bsd.syms' + libnss_guest_syms =3D 'libvirt_nss_bsd.syms' +elif host_machine.system() =3D=3D 'linux' + with_nss =3D true + libnss_prefix =3D 'lib' + libnss_so_version =3D '2' + libnss_syms =3D 'libvirt_nss.syms' + libnss_guest_syms =3D 'libvirt_guest_nss.syms' +else + with_nss =3D false +endif + +if with_nss + libnss_common_src =3D [ + 'libvirt_nss.c', + 'libvirt_nss.h', + 'libvirt_nss_leases.c', + 'libvirt_nss_leases.h' + ] + + libnss_src =3D libnss_common_src + libnss_guest_src =3D libnss_common_src + [ + 'libvirt_nss_macs.c', + 'libvirt_nss_macs.h', + ] + + libnss_deps =3D [yajl_dep] + libnss_link_args =3D [ + '-Wl,--version-script,@0@/@1@'.format(meson.current_source_dir(), libn= ss_syms) + ] + libnss_guest_link_args =3D [ + '-Wl,--version-script,@0@/@1@'.format(meson.current_source_dir(), libn= ss_guest_syms) + ] + libnss_inc_dirs =3D [top_inc_dir] + + libnss_libvirt_so =3D 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 =3D 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 --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri May 3 07:14:40 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1569582736; cv=none; d=zoho.com; s=zohoarc; b=jmZPb3ZH+ohvIn1Afy6Y1R52yvwjMSmO8t4Yq4zkXo4NZqRmmMl1P+GrolXgun65oF7M43+xEtOBKfcMre8lsv1MRtlEp4NjzfjbsXOuVEYfbftVCEiZO28bu0aEUQifjEq0y3nQwMHjja3LzlnqyIvq85v9fQHfgWicNSuPGZM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1569582736; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=Ega95enZd+S5OoiqG1lV5Mf+QYbpE19iBlKWVj5uJds=; b=UlmO+tYWjlcJvAvzZHCprxEcRC+FlycFXkT7KcBBddxQT4+0DNRmJQwx2CnlGyjxVf3bWnKrIhMCEtwgYin1Zf3K6Ub86qwYWINla8FI1rkE8Dsab4YRMVXjspOVkFZ96p560gPettvP62EDZO6LI1FJmm96/TyO7Pw5dpwPP7E= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 156958273657346.81249673834873; Fri, 27 Sep 2019 04:12:16 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E463E18CB8E0; Fri, 27 Sep 2019 11:12:14 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C1B815C220; Fri, 27 Sep 2019 11:12:14 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 866B1180BA99; Fri, 27 Sep 2019 11:12:14 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x8RBCDql028256 for ; Fri, 27 Sep 2019 07:12:13 -0400 Received: by smtp.corp.redhat.com (Postfix) id 5236660C18; Fri, 27 Sep 2019 11:12:13 +0000 (UTC) Received: from domokun.gsslab.fab.redhat.com (dhcp-94.gsslab.fab.redhat.com [10.33.9.94]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9743A60C5D; Fri, 27 Sep 2019 11:12:12 +0000 (UTC) From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Date: Fri, 27 Sep 2019 12:11:55 +0100 Message-Id: <20190927111158.20653-9-berrange@redhat.com> In-Reply-To: <20190927111158.20653-1-berrange@redhat.com> References: <20190927111158.20653-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Cc: Pavel Hrdina Subject: [libvirt] [PATCH 08/11] build: add command line options for enabling each driver X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.63]); Fri, 27 Sep 2019 11:12:15 +0000 (UTC) Placeholder options for enabling each driver, which will be fleshed out in later commits. Signed-off-by: Daniel P. Berrang=C3=A9 --- 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: 'E= nable remote driver') +option('with-remote-daemon', type: 'boolean', value: true, description: 'E= nable remote daemon') + +option('with-driver-bhyve', type: 'boolean', value: true, description: 'En= able bhyve driver') +option('with-driver-esx', type: 'boolean', value: true, description: 'Enab= le esx driver') +option('with-driver-hyperv', type: 'boolean', value: true, description: 'E= nable hyperv driver') +option('with-driver-libxl', type: 'boolean', value: true, description: 'En= able libxl driver') +option('with-driver-lxc', type: 'boolean', value: true, description: 'Enab= le lxc driver') +option('with-driver-openvz', type: 'boolean', value: true, description: 'E= nable openvz driver') +option('with-driver-phyp', type: 'boolean', value: true, description: 'Ena= ble phyp driver') +option('with-driver-qemu', type: 'boolean', value: true, description: 'Ena= ble qemu driver') +option('with-driver-test', type: 'boolean', value: true, description: 'Ena= ble test driver') +option('with-driver-vbox', type: 'boolean', value: true, description: 'Ena= ble vbox driver') +option('with-driver-vz', type: 'boolean', value: true, description: 'Enabl= e vz driver') +option('with-driver-vmware', type: 'boolean', value: true, description: 'E= nable 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: 'E= nable 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 =3D get_option('with-driver-bhyve') +if not with_remote_daemon or host_machine.system() !=3D 'freebsd' + with_driver_bhyve =3D 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 =3D 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 =3D 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 =3D get_option('with-driver-interface') +if not with_remote_daemon + with_driver_interface =3D 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 =3D get_option('with-driver-libxl') +if not with_remote_daemon or host_machine.system() !=3D 'linux' + with_driver_libxl =3D 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 =3D get_option('with-driver-lxc') +if not with_remote_daemon or host_machine.system() !=3D 'linux' + with_driver_lxc =3D 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 =3D 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 =3D get_option('with-driver-network') +if not with_remote_daemon + with_driver_network =3D 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 =3D get_option('with-driver-nodedev') +if not with_remote_daemon + with_driver_nodedev =3D 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 =3D get_option('with-driver-nwfilter') +if not with_remote_daemon + with_driver_nwfilter =3D 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 =3D 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 =3D 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 =3D get_option('with-driver-qemu') +if not with_remote_daemon + with_driver_qemu =3D 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 =3D get_option('with-driver-remote') +with_remote_daemon =3D get_option('with-remote-daemon') +if not with_remote_daemon or host_machine.system() =3D=3D 'windows' + with_remote_daemon =3D 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 =3D get_option('with-driver-secret') +if not with_remote_daemon + with_driver_secret =3D 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 =3D get_option('with-driver-storage') +if not with_remote_daemon + with_driver_storage =3D 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 =3D 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 =3D 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 =3D 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 =3D get_option('with-driver-vz') +if not with_remote_daemon + with_driver_vz =3D false +endif --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri May 3 07:14:40 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1569582742; cv=none; d=zoho.com; s=zohoarc; b=TPDNNXIWZGUDqW63P1UmbCpXjZLn3M7iE3z9F2hbBMblV0QXIcgQh37OQXjjFY7odb4dYdQ78fU5D+1x7YJqymFSjUs5hCka9XjCuM7/3fGj2+gATdFTyJ6ZfStjcm84qpHolAdHNflrLL1T0VrhKSJV6hW/tI3KuOVXq8/J/zM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1569582742; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=lWXjAkczCztiCxm7zl/SIadLqaj12vmzDdWCXTWzL84=; b=l/+udFVx02w21LeT+9WGenWJ/xzbVSPI+Uxjcne9p7gWb30sU+2b9TOPJwzjCmdO6CDrFucR6ejifx+ATfaUaR8nMp/Fve8YkEk+dcIgFZjMDB6uUyzHQ5Bu10dUP4Nm/qU2zDCaI3bBTy/CiZ+5FweDzdLJ8rg1qa5lslskFzw= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1569582742003887.8196847197661; Fri, 27 Sep 2019 04:12:22 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 34D3789811C; Fri, 27 Sep 2019 11:12:20 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 06BF26092F; Fri, 27 Sep 2019 11:12:20 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id B0E08180BA9C; Fri, 27 Sep 2019 11:12:19 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x8RBCGev028276 for ; Fri, 27 Sep 2019 07:12:16 -0400 Received: by smtp.corp.redhat.com (Postfix) id 566BF60BF3; Fri, 27 Sep 2019 11:12:16 +0000 (UTC) Received: from domokun.gsslab.fab.redhat.com (dhcp-94.gsslab.fab.redhat.com [10.33.9.94]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9A14660F9E; Fri, 27 Sep 2019 11:12:13 +0000 (UTC) From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Date: Fri, 27 Sep 2019 12:11:56 +0100 Message-Id: <20190927111158.20653-10-berrange@redhat.com> In-Reply-To: <20190927111158.20653-1-berrange@redhat.com> References: <20190927111158.20653-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Cc: Pavel Hrdina Subject: [libvirt] [PATCH 09/11] build: use meson for building virt-host-validate X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.67]); Fri, 27 Sep 2019 11:12:20 +0000 (UTC) Switch over to using meson for building the virt-host-validate tool Signed-off-by: Daniel P. Berrang=C3=A9 --- 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 =20 @@ -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 . - -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" !=3D "xno"; then - if test "x$with_win" =3D "xyes"; then - if test "x$with_host_validate" =3D "xyes"; then - AC_MSG_ERROR([virt-host-validate is not supported on Windows]) - else - with_host_validate=3Dno; - fi - else - with_host_validate=3Dyes; - fi - fi - - if test "x$with_host_validate" =3D "xyes" ; then - AC_DEFINE_UNQUOTED([WITH_HOST_VALIDATE], 1, [whether virt-host-valid= ate is built]) - fi - AM_CONDITIONAL([WITH_HOST_VALIDATE], [test "x$with_host_validate" =3D "x= yes"]) -]) - -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 =3D include_directories('gnulib/lib') top_inc_dir =3D include_directories('.') =20 cc =3D meson.get_compiler('c') +pod2man =3D find_program('pod2man') =20 gnulib =3D cc.find_library('libgnu', dirs: [meson.build_root() / 'gnulib' = / 'lib' / '.libs']) gnulib_dep =3D declare_dependency( @@ -34,7 +35,10 @@ gnulib_dep =3D declare_dependency( meson.add_dist_script('build-aux' / 'dist.py', meson.source_root(), meson.= build_root()) =20 yajl_min_version =3D '>=3D 2.0.3' +libxml_min_version =3D '>=3D 2.9.1' + yajl_dep =3D dependency('yajl', version: yajl_min_version) +libxml_dep =3D dependency('libxml-2.0', version: libxml_min_version) =20 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: tru= e, description: 'Enable option('with-driver-nwfilter', type: 'boolean', value: true, description: = 'Enable nwfilter driver') option('with-driver-secret', type: 'boolean', value: true, description: 'E= nable secret driver') option('with-driver-storage', type: 'boolean', value: true, description: '= Enable storage driver') + +option('with-tools-host-validate', type: 'boolean', value: true, descripti= on: '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 @@ =20 +src_inc_dir =3D include_directories('.') +util_inc_dir =3D include_directories('util') +common_inc_dir =3D [ + gnulib_inc_dir, + public_inc_dir, + top_inc_dir, + src_inc_dir, + util_inc_dir, +] + + libvirt =3D cc.find_library('libvirt', dirs: [meson.build_root() / 'src' /= '.libs']) libvirt_admin =3D cc.find_library('libvirt-admin', dirs: [meson.build_root= () / 'src' / '.libs']) libvirt_qemu =3D 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 =3D \ =20 PODFILES =3D \ virt-admin.pod \ - virt-host-validate.pod \ virt-login-shell.pod \ virt-pki-validate.pod \ virt-sanlock-cleanup.pod \ @@ -63,7 +62,6 @@ PODFILES =3D \ =20 MANINFILES =3D \ 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 =3D virt-login-shell-helper man1_MANS +=3D virt-login-shell.1 endif WITH_LOGIN_SHELL =20 -if WITH_HOST_VALIDATE -bin_PROGRAMS +=3D virt-host-validate -man1_MANS +=3D 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 =3D \ vsh.c vsh.h \ vsh-table.c vsh-table.h =20 -virt_host_validate_SOURCES =3D \ - virt-host-validate.c \ - virt-host-validate-common.c virt-host-validate-common.h - -VIRT_HOST_VALIDATE_QEMU =3D \ - virt-host-validate-qemu.c \ - virt-host-validate-qemu.h -VIRT_HOST_VALIDATE_LXC =3D \ - virt-host-validate-lxc.c \ - virt-host-validate-lxc.h -VIRT_HOST_VALIDATE_BHYVE =3D \ - virt-host-validate-bhyve.c \ - virt-host-validate-bhyve.h -if WITH_QEMU -virt_host_validate_SOURCES +=3D $(VIRT_HOST_VALIDATE_QEMU) -else ! WITH_QEMU -EXTRA_DIST +=3D $(VIRT_HOST_VALIDATE_QEMU) -endif ! WITH_QEMU - -if WITH_LXC -virt_host_validate_SOURCES +=3D $(VIRT_HOST_VALIDATE_LXC) -else ! WITH_LXC -EXTRA_DIST +=3D $(VIRT_HOST_VALIDATE_LXC) -endif ! WITH_LXC - -if WITH_BHYVE -virt_host_validate_SOURCES +=3D $(VIRT_HOST_VALIDATE_BHYVE) -else ! WITH_BHYVE -EXTRA_DIST +=3D $(VIRT_HOST_VALIDATE_BHYVE) -endif ! WITH_BHYVE - -virt_host_validate_LDFLAGS =3D \ - $(AM_LDFLAGS) \ - $(PIE_LDFLAGS) \ - $(COVERAGE_LDFLAGS) \ - $(NULL) - -virt_host_validate_LDADD =3D \ - ../src/libvirt.la \ - ../gnulib/lib/libgnu.la \ - $(NULL) - -virt_host_validate_CFLAGS =3D \ - $(AM_CFLAGS) \ - $(NULL) =20 # 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 @@ =20 subdir('nss') + +with_tools_host_validate =3D get_option('with-tools-host-validate') +if not (with_driver_qemu or with_driver_lxc or with_driver_bhyve) + with_tools_host_validate =3D false +endif + +if with_tools_host_validate + virt_host_validate_src =3D [ + 'virt-host-validate.c', + 'virt-host-validate-common.c', + 'virt-host-validate-common.h', + ] + + if with_driver_qemu + virt_host_validate_src +=3D [ + 'virt-host-validate-qemu.c', + 'virt-host-validate-qemu.h', + ] + endif + + if with_driver_lxc + virt_host_validate_src +=3D [ + 'virt-host-validate-lxc.c', + 'virt-host-validate-lxc.h', + ] + endif + + if with_driver_bhyve + virt_host_validate_src +=3D [ + 'virt-host-validate-bhyve.c', + 'virt-host-validate-bhyve.h', + ] + endif + + virt_host_validate_inc =3D common_inc_dir + virt_host_validate_libs =3D [libvirt_dep, libxml_dep, gnulib_dep] + virt_host_validate =3D 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 =3D custom_target( + 'virt_host_validate_man', + output : 'virt-host-validate.1', + input : 'virt-host-validate.pod', + command : [ + pod2man, + '--section=3D1', + '--center=3DVirtualization Support', + '--release=3Dlibvirt @0@'.format(meson.project_version()), + '@INPUT@', '@OUTPUT@' + ], + install : true, + install_dir : join_paths(get_option('mandir'), 'man1') + ) +endif --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri May 3 07:14:40 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1569582746; cv=none; d=zoho.com; s=zohoarc; b=kX/8c6Zmbqyx6w8PMOh88pzskyfJyc400kK1UTu6E5Sc+NrAsQPWrUZM8LuLIC2020dxArcXXzPGvUpGtxKuQUraR9dnnuBORgPf8beHa+X0WSYZNtxdOJZTOiwT+bbzmrWiujun93+94urm4Xm77Y1gTnB1UqSsMa9pc/s62Io= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1569582746; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=0+EkJl7IKHU2ps/J0m6q6A0eOabvzGwd3CSs51NyD3Q=; b=njGdQde5OICH8eqMebkPlGsKLHEfTzE5SCPovxITgrsX8x7XZEpsWO0AjiDet8j8m1NFX1GfPxCMOdUS+tAzZ67dVn5CW3HPthjVNwy+VPPHL5t29alUK5lr854ejBfizsDtBA2HqI0la4l2NcNZG64rEzS6vZGppfY9hgH5flA= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1569582746023354.9908097004178; Fri, 27 Sep 2019 04:12:26 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 3A14B6445D; Fri, 27 Sep 2019 11:12:24 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 14AFC60BF3; Fri, 27 Sep 2019 11:12:24 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id C68C3180BA9E; Fri, 27 Sep 2019 11:12:23 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x8RBCHCT028283 for ; Fri, 27 Sep 2019 07:12:17 -0400 Received: by smtp.corp.redhat.com (Postfix) id 5585360C18; Fri, 27 Sep 2019 11:12:17 +0000 (UTC) Received: from domokun.gsslab.fab.redhat.com (dhcp-94.gsslab.fab.redhat.com [10.33.9.94]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9A26C60BF3; Fri, 27 Sep 2019 11:12:16 +0000 (UTC) From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Date: Fri, 27 Sep 2019 12:11:57 +0100 Message-Id: <20190927111158.20653-11-berrange@redhat.com> In-Reply-To: <20190927111158.20653-1-berrange@redhat.com> References: <20190927111158.20653-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Cc: Pavel Hrdina Subject: [libvirt] [PATCH 10/11] build: use meson for building virt-login-shell X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Fri, 27 Sep 2019 11:12:24 +0000 (UTC) Switch over to using meson for building the virt-login-shell tool Signed-off-by: Daniel P. Berrang=C3=A9 --- 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 . - -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" !=3D "xno"; then - if test "x$with_linux" !=3D "xyes"; then - if test "x$with_login_shell" =3D "xyes"; then - AC_MSG_ERROR([virt-login-shell is supported on Linux only]) - else - with_login_shell=3Dno; - fi - else - with_login_shell=3Dyes; - fi - fi - - if test "x$with_login_shell" =3D "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" =3D "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 =3D get_option('prefix') bin_dir =3D get_option('bindir') lib_dir =3D get_option('libdir') +libexec_dir =3D get_option('libexecdir') sys_conf_dir =3D get_option('sysconfdir') data_dir =3D get_option('datadir') local_state_dir =3D get_option('localstatedir') pkg_data_dir =3D data_dir / meson.project_name() pkg_doc_dir =3D data_dir / 'doc' / meson.project_name() + '-' + meson.proj= ect_version() +pkg_sys_conf_dir =3D sys_conf_dir / 'libvirt' =20 public_inc_dir =3D include_directories('include') gnulib_inc_dir =3D 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') =20 option('with-tools-host-validate', type: 'boolean', value: true, descripti= on: '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 =3D \ =20 PODFILES =3D \ virt-admin.pod \ - virt-login-shell.pod \ virt-pki-validate.pod \ virt-sanlock-cleanup.pod \ virt-xml-validate.pod \ @@ -62,7 +61,6 @@ PODFILES =3D \ =20 MANINFILES =3D \ 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 =3D \ 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 =3D virt-sanlock-cleanup.8 DISTCLEANFILES +=3D virt-sanlock-cleanup endif WITH_SANLOCK =20 -if WITH_LOGIN_SHELL -conf_DATA +=3D virt-login-shell.conf -bin_PROGRAMS +=3D virt-login-shell -libexec_PROGRAMS =3D virt-login-shell-helper -man1_MANS +=3D 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 =3D \ vsh-table.c vsh-table.h =20 =20 -# 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 =3D \ - virt-login-shell.c - -virt_login_shell_CPPFLAGS =3D $(STANDALONE_CPPFLAGS) - -virt_login_shell_helper_SOURCES =3D \ - virt-login-shell-helper.c - -virt_login_shell_helper_LDFLAGS =3D \ - $(AM_LDFLAGS) \ - $(PIE_LDFLAGS) \ - $(COVERAGE_LDFLAGS) \ - $(NULL) -virt_login_shell_helper_LDADD =3D \ - ../src/libvirt.la \ - ../src/libvirt-lxc.la \ - ../gnulib/lib/libgnu.la - -virt_login_shell_helper_CFLAGS =3D \ - $(AM_CFLAGS) \ - $(NULL) - virsh_SOURCES =3D \ 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 =3D false endif =20 +with_tools_login_shell =3D get_option('with-tools-login-shell') +if not with_driver_lxc + with_tools_login_shell =3D false +endif + if with_tools_host_validate virt_host_validate_src =3D [ '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 =3D [ + top_inc_dir, + ] + virt_login_shell_src =3D [ + 'virt-login-shell.c', + ] + virt_login_shell =3D 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 =3D [ + 'virt-login-shell-helper.c', + ] + virt_login_shell_helper_inc =3D common_inc_dir + virt_login_shell_helper_libs =3D [libvirt_dep, libvirt_lxc_dep, libxml_d= ep, gnulib_dep] + virt_login_shell_helper =3D 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 =3D custom_target( + 'virt_login_shell_man', + output : 'virt-login-shell.1', + input : 'virt-login-shell.pod', + command : [ + pod2man, + '--section=3D1', + '--center=3DVirtualization Support', + '--release=3Dlibvirt @0@'.format(meson.project_version()), + '@INPUT@', '@OUTPUT@' + ], + install : true, + install_dir : join_paths(get_option('mandir'), 'man1') + ) +endif --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri May 3 07:14:40 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1569582749; cv=none; d=zoho.com; s=zohoarc; b=iSqJSwDkI8CTTwKttx2Qqy6r1CylvmqBkCFhEgb/kYjqt5yOGU+SMHCa4p2dJfvrV9SetVB8bIY8J6IxCTIew6ydgjOUy7D6alOOJZLKp3SRr1AO5H9GHdl/VNqNxLsVVnDySbn7DQ8m4c3OTy61Lrb6sVE2VeUbrBmZqwMgMFI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1569582749; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=Z23McmbrdeFwm3pLEh2GDm2lVHed7qppv5WoyFADoRM=; b=eaFzoPo4qBRpHpTo4pX6rKrAFp6IjbCF05LwTczkBebwNcZa56TAj5L/3VaygGilq8gboWma/hllhDYIG5NXSfHKh2iP3lxG+WOv8f/UpNdghlN52MDH5wGINsL0vmazy6qKjWOgc9VMPu8LWSQvXXECToTBrxQItHQHukBgMyA= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1569582749434733.1014325075311; Fri, 27 Sep 2019 04:12:29 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E2AD2190C020; Fri, 27 Sep 2019 11:12:27 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id BCBA65D6B2; Fri, 27 Sep 2019 11:12:27 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 7A1B3180BAA4; Fri, 27 Sep 2019 11:12:27 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x8RBCIxr028291 for ; Fri, 27 Sep 2019 07:12:18 -0400 Received: by smtp.corp.redhat.com (Postfix) id AFAA860F88; Fri, 27 Sep 2019 11:12:18 +0000 (UTC) Received: from domokun.gsslab.fab.redhat.com (dhcp-94.gsslab.fab.redhat.com [10.33.9.94]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9AAAB60BF3; Fri, 27 Sep 2019 11:12:17 +0000 (UTC) From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Date: Fri, 27 Sep 2019 12:11:58 +0100 Message-Id: <20190927111158.20653-12-berrange@redhat.com> In-Reply-To: <20190927111158.20653-1-berrange@redhat.com> References: <20190927111158.20653-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Cc: Pavel Hrdina Subject: [libvirt] [PATCH 11/11] build: use meson for building virsh / virt-admin X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.70]); Fri, 27 Sep 2019 11:12:28 +0000 (UTC) Switch over to using meson for building the virsh / virt-admin tools and supporting files. Signed-off-by: Daniel P. Berrang=C3=A9 --- 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 =3D %{version}-%{release} -%endif =20 %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 <=3D 5.8.0 =20 %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 =3D %{version}-%{release} Requires: readline -%if %{with_bash_completion} -Requires: %{name}-bash-completion =3D %{version}-%{release} -%endif =20 %description admin The client side utilities to control the libvirt daemon. =20 -%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 =20 -%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 . -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" !=3D "xyes" ; then - if test "x$with_bash_completion" =3D "xyes" ; then - AC_MSG_ERROR([readline is required for bash completion support]) - else - with_bash_completion=3Dno - fi - fi - - LIBVIRT_CHECK_PKG([BASH_COMPLETION], [bash-completion], [2.0]) - - if test "x$with_bash_completion" =3D "xyes" ; then - if test "x$with_bash_completions_dir" =3D "xcheck"; then - AC_MSG_CHECKING([for bash-completions directory]) - BASH_COMPLETIONS_DIR=3D"$($PKG_CONFIG --variable=3Dcompletionsdir ba= sh-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 installati= on - dnl time - bash_completions_prefix=3D"$($PKG_CONFIG --variable=3Dprefix bash-co= mpletion)" - if test "x$bash_completions_prefix" =3D "x" ; then - bash_completions_prefix=3D"/usr" - fi - - BASH_COMPLETIONS_DIR=3D'${exec_prefix}'"${BASH_COMPLETIONS_DIR#$bash= _completions_prefix}" - elif test "x$with_bash_completions_dir" =3D "xno" || test "x$with_bash= _completions_dir" =3D "xyes"; then - AC_MSG_ERROR([bash-completions-dir must be used only with valid path= ]) - else - BASH_COMPLETIONS_DIR=3D$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.sou= rce_root(), meson.build_ =20 yajl_min_version =3D '>=3D 2.0.3' libxml_min_version =3D '>=3D 2.9.1' +readline_min_version =3D '>=3D 7.0' +bash_completion_min_version =3D '>=3D 2.0' =20 +threads_dep =3D dependency('threads') yajl_dep =3D dependency('yajl', version: yajl_min_version) libxml_dep =3D dependency('libxml-2.0', version: libxml_min_version) +readline_dep =3D dependency('readline', version: readline_min_version) +bash_completion_dep =3D dependency('bash-completion', version: bash_comple= tion_min_version) + +bash_completion_dir =3D bash_completion_dep.get_pkgconfig_variable('comple= tionsdir', define_variable: ['prefix', prefix]) =20 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: tru= e, description: 'Enable =20 option('with-tools-host-validate', type: 'boolean', value: true, descripti= on: '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, descrip= tion: '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 =3D \ virsh_win_icon.rc =20 PODFILES =3D \ - virt-admin.pod \ virt-pki-validate.pod \ virt-sanlock-cleanup.pod \ virt-xml-validate.pod \ - virsh.pod \ $(NULL) =20 MANINFILES =3D \ - virt-admin.1.in \ + virt-pki-validate.1.in \ virt-sanlock-cleanup.8.in \ virt-xml-validate.1.in \ - virsh.1.in \ $(NULL) =20 EXTRA_DIST =3D \ @@ -74,8 +71,6 @@ EXTRA_DIST =3D \ 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 =3D $(sysconfdir)/libvirt conf_DATA =3D =20 bin_SCRIPTS =3D virt-xml-validate virt-pki-validate -bin_PROGRAMS =3D virsh virt-admin libexec_SCRIPTS =3D libvirt-guests.sh man1_MANS =3D \ virt-pki-validate.1 \ - virt-xml-validate.1 \ - virsh.1 \ - virt-admin.1 + virt-xml-validate.1 =20 if WITH_SANLOCK sbin_SCRIPTS =3D virt-sanlock-cleanup @@ -119,90 +111,7 @@ virt-sanlock-cleanup: virt-sanlock-cleanup.in Makefile -e 's|[@]localstatedir@|$(localstatedir)|' < $< > $@ \ || (rm $@ && exit 1) && chmod +x $@ =20 -noinst_LTLIBRARIES =3D libvirt_shell.la -libvirt_shell_la_CFLAGS =3D \ - $(AM_CFLAGS) \ - $(READLINE_CFLAGS) \ - $(NULL) -libvirt_shell_la_LDFLAGS =3D \ - $(AM_LDFLAGS) \ - $(PIE_LDFLAGS) \ - $(COVERAGE_LDFLAGS) \ - $(NULL) -libvirt_shell_la_LIBADD =3D \ - ../src/libvirt.la \ - $(LIBXML_LIBS) \ - $(READLINE_LIBS) \ - ../gnulib/lib/libgnu.la \ - $(NULL) -libvirt_shell_la_SOURCES =3D \ - vsh.c vsh.h \ - vsh-table.c vsh-table.h - - -virsh_SOURCES =3D \ - 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 =3D \ - $(AM_LDFLAGS) \ - $(PIE_LDFLAGS) \ - $(COVERAGE_LDFLAGS) \ - $(NULL) -virsh_LDADD =3D \ - $(STATIC_BINARIES) \ - ../src/libvirt-lxc.la \ - ../src/libvirt-qemu.la \ - libvirt_shell.la -virsh_CFLAGS =3D \ - $(AM_CFLAGS) \ - $(READLINE_CFLAGS) - -virt_admin_SOURCES =3D \ - virt-admin.c virt-admin.h \ - virt-admin-completer.c virt-admin-completer.h \ - $(NULL) - -virt_admin_LDFLAGS =3D \ - $(AM_LDFLAGS) \ - $(COVERAGE_LDFLAGS) \ - $(STATIC_BINARIES) \ - $(PIE_LDFLAGS) \ - $(NULL) -virt_admin_LDADD =3D \ - ../src/libvirt-admin.la \ - libvirt_shell.la \ - $(LIBXML_LIBS) \ - $(NULL) -virt_admin_CFLAGS =3D \ - $(AM_CFLAGS) \ - $(READLINE_CFLAGS) + BUILT_SOURCES =3D =20 if WITH_WIN_ICON @@ -267,11 +176,9 @@ POD2MAN =3D pod2man -c "Virtualization Support" -r "$(= PACKAGE)-$(VERSION)" < $< > $@-t && \ mv $@-t $@ =20 -install-data-local: install-systemd \ - install-bash-completion +install-data-local: install-systemd =20 -uninstall-local: uninstall-systemd \ - uninstall-bash-completion +uninstall-local: uninstall-systemd =20 install-sysconfig: $(MKDIR_P) $(DESTDIR)$(sysconfdir)/sysconfig @@ -330,26 +237,6 @@ libvirt-guests.service: libvirt-guests.service.in $(to= p_builddir)/config.status mv $@-t $@ =20 =20 -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 - =20 EXTRA_DIST +=3D wireshark/util/genxdrstub.pl =20 diff --git a/tools/bash-completion/meson.build b/tools/bash-completion/meso= n.build new file mode 100644 index 0000000000..8994b22cef --- /dev/null +++ b/tools/bash-completion/meson.build @@ -0,0 +1,19 @@ + +with_tools_bash_completion =3D get_option('with-tools-bash-completion') +if host_machine.system() =3D=3D 'windows' + with_tools_bash_completion =3D 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 =3D [ + 'vsh.c', + 'vsh.h', + 'vsh-table.c', + 'vsh-table.h', +] +libvirt_shell_inc =3D common_inc_dir +libvirt_shell_libs =3D [libvirt_dep, readline_dep, libxml_dep, gnulib_dep] +libvirt_shell =3D static_library( + 'virt-shell', + libvirt_shell_src, + include_directories: libvirt_shell_inc, + dependencies: libvirt_shell_libs, +) +libvirt_shell_dep =3D declare_dependency( + link_with: libvirt_shell, +) + + +virsh_src =3D [ + '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 =3D common_inc_dir +virsh_libs =3D [libvirt_shell_dep, libvirt_qemu_dep, libvirt_lxc_dep, libx= ml_dep, threads_dep, gnulib_dep] + +virsh =3D executable( + 'virsh', + install: true, + sources: virsh_src, + include_directories: virsh_inc, + dependencies: virsh_libs, +) +virsh_man =3D custom_target( + 'virsh_man', + output : 'virsh.1', + input : 'virsh.pod', + command : [ + pod2man, + '--section=3D1', + '--center=3DVirtualization Support', + '--release=3Dlibvirt @0@'.format(meson.project_version()), + '@INPUT@', '@OUTPUT@' + ], + install : true, + install_dir : join_paths(get_option('mandir'), 'man1') +) + + +virt_admin_src =3D [ + 'virt-admin.c', + 'virt-admin.h', + 'virt-admin-completer.c', + 'virt-admin-completer.h' +] +virt_admin_inc =3D common_inc_dir +virt_admin_libs =3D [libvirt_shell_dep, libvirt_admin_dep, libxml_dep, thr= eads_dep, gnulib_dep] + +virt_admin =3D executable( + 'virt-admin', + install: true, + sources: virt_admin_src, + include_directories: virt_admin_inc, + dependencies: virt_admin_libs, +) +virt_admin_man =3D custom_target( + 'virt_admin_man', + output : 'virt-admin.1', + input : 'virt-admin.pod', + command : [ + pod2man, + '--section=3D1', + '--center=3DVirtualization Support', + '--release=3Dlibvirt @0@'.format(meson.project_version()), + '@INPUT@', '@OUTPUT@' + ], + install : true, + install_dir : join_paths(get_option('mandir'), 'man1') +) + +subdir('bash-completion') --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list