From nobody Sun Feb 8 12:20:37 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 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=1594893674; cv=none; d=zohomail.com; s=zohoarc; b=P6umHZ8MdvD+nRZoIB5gqBH/esNsqrNvrbey/zJ+IkBgDLFnMZtq86Iq8BChTmFt3mvCCxXwBryomTc3VUFd9/mfwsT8mp5SL/Z0iBkQAjvLWdeXAW9ZrPWsbE4zzlZlYcetUyfFEwp/6FAguqauvR5NfHjwLSo6l7ZvoT8vDkU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1594893674; h=Content-Type:Content-Transfer-Encoding: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; bh=0DRglel3DZiNUcnDW81UCtkeBhBEag/7ckM10dSLi1k=; b=f1lv2JTPIT3KnfXkA7V5x14mthXKsyoV6N/WINZ/s2ie6ZGSGoDMTvNi3zgouG5r2CvBeg2C28BP/OAtKWe9p0r484i+AzNnUTeMfX/kpqYpS7z6PDbAGiHTiLkUoXm4otOFdXIoMSk8/1vQw5z5EnBaLetgB3ZeVdGxYJOZuZU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 1594893674398915.2429242696039; Thu, 16 Jul 2020 03:01:14 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-179-itsYh2QUObq9qW-r1X1OVg-1; Thu, 16 Jul 2020 06:01:06 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 4129A8027F7; Thu, 16 Jul 2020 10:00:59 +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 1B4AE2DE6F; Thu, 16 Jul 2020 10:00:59 +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 DC2451809561; Thu, 16 Jul 2020 10:00:58 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 06GA0qo9015551 for ; Thu, 16 Jul 2020 06:00:52 -0400 Received: by smtp.corp.redhat.com (Postfix) id 5106E2DE6B; Thu, 16 Jul 2020 10:00:52 +0000 (UTC) Received: from antique-work.redhat.com (unknown [10.40.194.85]) by smtp.corp.redhat.com (Postfix) with ESMTP id BFCBF2B6DC for ; Thu, 16 Jul 2020 10:00:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1594893673; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=0DRglel3DZiNUcnDW81UCtkeBhBEag/7ckM10dSLi1k=; b=Eh4XIhtnb2WH9XAI9kxoQwWcg8M5F82A0QwAvWqzMjJ8OHo25z/xzd8Hf+ADkg3RvYjwgn BlaKbSUmz+MLGv88RqAzLLY6lCrjCkZhQbjUhRKpTnxScFjouu9gdEUCdCYkxQdl8lQbz7 ZUGs57RWc9mJAHC3+Woi4EebG9u8rqg= X-MC-Unique: itsYh2QUObq9qW-r1X1OVg-1 From: Pavel Hrdina To: libvir-list@redhat.com Subject: [libvirt PATCH 031/351] meson: add programs checks Date: Thu, 16 Jul 2020 11:54:27 +0200 Message-Id: <258be7c3061dfed2e467e55aaeb61eadbacd72c0.1594891445.git.phrdina@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com 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: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Signed-off-by: Pavel Hrdina --- configure.ac | 39 ------------- m4/virt-external-programs.m4 | 106 ----------------------------------- meson.build | 82 +++++++++++++++++++++++++++ 3 files changed, 82 insertions(+), 145 deletions(-) delete mode 100644 m4/virt-external-programs.m4 diff --git a/configure.ac b/configure.ac index b85fa9a9a6f..d8ff2ba3900 100644 --- a/configure.ac +++ b/configure.ac @@ -40,9 +40,6 @@ m4_ifndef([AM_SILENT_RULES], =20 AC_CANONICAL_HOST =20 -dnl Where we look for daemons and admin binaries during configure -LIBVIRT_SBIN_PATH=3D"$PATH:/sbin:/usr/sbin:/usr/local/sbin" - dnl Checks for C compiler. AC_PROG_CC AC_PROG_INSTALL @@ -62,10 +59,6 @@ m4_ifndef([LT_INIT], [ AM_PROG_CC_C_O AM_PROG_LD =20 -dnl Specify if we rely on ifconfig instead of iproute2 (e.g. in case -dnl we're working on BSD) -want_ifconfig=3Dno - dnl Make some notes about which OS we're compiling for, as the lxc and qemu dnl drivers require linux headers, and storage_mpath, dtrace, and nwfilter dnl are also linux specific. The "network" and storage_fs drivers are kno= wn @@ -90,7 +83,6 @@ if test $with_linux =3D no; then fi =20 if test $with_freebsd =3D yes; then - want_ifconfig=3Dyes with_firewalld=3Dno fi =20 @@ -208,12 +200,6 @@ AC_CHECK_LIB([intl],[gettext],[]) AC_CHECK_LIB([util],[openpty],[]) =20 =20 -dnl -dnl Check for external programs -dnl - -LIBVIRT_CHECK_EXTERNAL_PROGRAMS - dnl dnl Virtualization drivers check dnl @@ -377,17 +363,6 @@ if test $with_storage =3D yes; then fi AM_CONDITIONAL([WITH_STORAGE], [test "$with_storage" =3D "yes"]) =20 -dnl Allow perl/python overrides -AC_PATH_PROGS([PYTHON], [python3]) -if test -z "$PYTHON"; then - AC_MSG_ERROR(['python3' binary is required to build libvirt]) -fi -AC_DEFINE_UNQUOTED([PYTHON], "$PYTHON", [path to python binary]) -AC_PATH_PROG([FLAKE8], [flake8]) -if test -z "$FLAKE8"; then - AC_MSG_WARN(['flake8' binary is required to check python code style]) -fi - dnl Python3 < 3.7 treats the C locale as 7-bit only. dnl We must force env vars so it treats it as UTF-8 dnl regardless of the user's locale. @@ -395,11 +370,6 @@ RUNUTF8=3D"LC_ALL=3D LANG=3DC LC_CTYPE=3Den_US.UTF-8" AC_SUBST(RUNUTF8) =20 =20 -AC_PATH_PROG([PERL], [perl]) -if test -z "$PERL"; then - AC_MSG_ERROR(['perl' binary is required to build libvirt]) -fi - dnl MinGW checks LIBVIRT_WIN_CHECK_COMMON LIBVIRT_WIN_CHECK_MINGW @@ -435,15 +405,6 @@ if test $with_freebsd =3D yes; then ) fi =20 -# Check if we need to look for ifconfig -if test "$want_ifconfig" =3D "yes"; then - AC_PATH_PROG([IFCONFIG_PATH], [ifconfig]) - if test -z "$IFCONFIG_PATH"; then - AC_MSG_ERROR([Failed to find ifconfig.]) - fi - AC_DEFINE_UNQUOTED([IFCONFIG_PATH], "$IFCONFIG_PATH", [path to ifconf= ig binary]) -fi - GNUmakefile=3DGNUmakefile m4_if(m4_version_compare([2.61a.100], m4_defn([m4_PACKAGE_VERSION])), [1], [], diff --git a/m4/virt-external-programs.m4 b/m4/virt-external-programs.m4 deleted file mode 100644 index d905beed71d..00000000000 --- a/m4/virt-external-programs.m4 +++ /dev/null @@ -1,106 +0,0 @@ -dnl The External programs check -dnl -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 . -dnl - -AC_DEFUN([LIBVIRT_CHECK_EXTERNAL_PROGRAMS], [ - dnl Do we have rpcgen? - AC_PATH_PROGS([RPCGEN], [rpcgen portable-rpcgen], [no]) - AM_CONDITIONAL([HAVE_RPCGEN], [test "x$ac_cv_path_RPCGEN" !=3D "xno"]) - - dnl Miscellaneous external programs. - AC_PATH_PROG([XMLLINT], [xmllint], []) - if test -z "$XMLLINT" - then - AC_MSG_ERROR("xmllint is required to build libvirt") - fi - AC_PATH_PROG([XSLTPROC], [xsltproc], []) - if test -z "$XSLTPROC" - then - AC_MSG_ERROR("xsltproc is required to build libvirt") - fi - - dnl Drop the rst2html (aka HTML4) variants once we - dnl stop supporting Ubuntu 16.04 (Xenial) - AC_PATH_PROGS([RST2HTML], [rst2html5 rst2html5.py rst2html5-3 rst2html r= st2html.py rst2html-3], []) - if test -z "$RST2HTML" - then - AC_MSG_ERROR("rst2html5/rst2html is required to build libvirt") - fi - AC_PATH_PROGS([RST2MAN], [rst2man rst2man.py rst2man-3], []) - if test -z "$RST2MAN" - then - AC_MSG_ERROR("rst2man is required to build libvirt") - fi - AC_PATH_PROG([AUGPARSE], [augparse], [/usr/bin/augparse]) - AC_PROG_MKDIR_P - AC_PROG_LN_S - - dnl External programs that we can use if they are available. - dnl We will hard-code paths to these programs unless we cannot - dnl detect them, in which case we'll search for the program - dnl along the $PATH at runtime and fail if it's not there. - AC_PATH_PROG([DMIDECODE], [dmidecode], [dmidecode], [$LIBVIRT_SBIN_PATH]) - AC_PATH_PROG([DNSMASQ], [dnsmasq], [dnsmasq], [$LIBVIRT_SBIN_PATH]) - AC_PATH_PROG([RADVD], [radvd], [radvd], [$LIBVIRT_SBIN_PATH]) - AC_PATH_PROG([TC], [tc], [tc], [$LIBVIRT_SBIN_PATH]) - AC_PATH_PROG([UDEVADM], [udevadm], [udevadm], [$LIBVIRT_SBIN_PATH]) - AC_PATH_PROG([MODPROBE], [modprobe], [modprobe], [$LIBVIRT_SBIN_PATH]) - AC_PATH_PROG([RMMOD], [rmmod], [rmmod], [$LIBVIRT_SBIN_PATH]) - AC_PATH_PROG([MM_CTL], [mm-ctl], [mm-ctl], [$LIBVIRT_SBIN_PATH]) - AC_PATH_PROG([OVS_VSCTL], [ovs-vsctl], [ovs-vsctl], [$LIBVIRT_SBIN_PATH]) - AC_PATH_PROG([SCRUB], [scrub], [scrub], [$LIBVIRT_SBIN_PATH]) - AC_PATH_PROG([ADDR2LINE], [addr2line], [addr2line], [$LIBVIRT_SBIN_PATH]) - AC_PATH_PROG([MDEVCTL], [mdevctl], [mdevctl], [$LIBVIRT_SBIN_PATH]) - - AC_DEFINE_UNQUOTED([DMIDECODE], ["$DMIDECODE"], - [Location or name of the dmidecode program]) - AC_DEFINE_UNQUOTED([DNSMASQ], ["$DNSMASQ"], - [Location or name of the dnsmasq program]) - AC_DEFINE_UNQUOTED([RADVD], ["$RADVD"], - [Location or name of the radvd program]) - AC_DEFINE_UNQUOTED([TC], ["$TC"], - [Location or name of the tc program (see iproute2)]) - AC_DEFINE_UNQUOTED([MM_CTL], ["$MM_CTL"], - [Location or name of the mm-ctl program]) - AC_DEFINE_UNQUOTED([OVS_VSCTL], ["$OVS_VSCTL"], - [Location or name of the ovs-vsctl program]) - AC_DEFINE_UNQUOTED([UDEVADM], ["$UDEVADM"], - [Location or name of the udevadm program]) - AC_DEFINE_UNQUOTED([MODPROBE], ["$MODPROBE"], - [Location or name of the modprobe program]) - AC_DEFINE_UNQUOTED([RMMOD], ["$RMMOD"], - [Location or name of the rmmod program]) - AC_DEFINE_UNQUOTED([SCRUB], ["$SCRUB"], - [Location or name of the scrub program (for wiping al= gorithms)]) - AC_DEFINE_UNQUOTED([ADDR2LINE], ["$ADDR2LINE"], - [Location of addr2line program]) - AC_DEFINE_UNQUOTED([MDEVCTL], ["$MDEVCTL"], - [Location or name of the mdevctl program]) - - AC_PATH_PROG([IP_PATH], [ip], [/sbin/ip], [$LIBVIRT_SBIN_PATH]) - AC_DEFINE_UNQUOTED([IP_PATH], ["$IP_PATH"], [path to ip binary]) - - AC_PATH_PROG([IPTABLES_PATH], [iptables], /sbin/iptables, [$LIBVIRT_SBIN= _PATH]) - AC_DEFINE_UNQUOTED([IPTABLES_PATH], ["$IPTABLES_PATH"], [path to iptable= s binary]) - - AC_PATH_PROG([IP6TABLES_PATH], [ip6tables], [/sbin/ip6tables], [$LIBVIRT= _SBIN_PATH]) - AC_DEFINE_UNQUOTED([IP6TABLES_PATH], ["$IP6TABLES_PATH"], [path to ip6ta= bles binary]) - - AC_PATH_PROG([EBTABLES_PATH], [ebtables], [/sbin/ebtables], [$LIBVIRT_SB= IN_PATH]) - AC_DEFINE_UNQUOTED([EBTABLES_PATH], ["$EBTABLES_PATH"], [path to ebtable= s binary]) -]) diff --git a/meson.build b/meson.build index 121022e5f78..3f86f931de0 100644 --- a/meson.build +++ b/meson.build @@ -859,6 +859,88 @@ endforeach conf.set('SIZEOF_LONG', cc.sizeof('long')) =20 =20 +# Where we look for daemons and admin binaries during configure + +libvirt_sbin_path =3D [ + '/sbin', + '/usr/sbin', + '/usr/local/sbin', +] + + +# required programs check + +required_programs =3D [ + 'perl', + 'python3', + 'xmllint', + 'xsltproc', +] + +required_programs_groups =3D [ + {'name':'rpcgen', 'prog':['rpcgen', 'portable-rpcgen']}, + # Drop the rst2html (aka HTML4) variants once we stop supporting Ubuntu = 16.04 (Xenial) + {'name':'rst2html', 'prog':['rst2html5', 'rst2html5.py', 'rst2html5-3', = 'rst2html', 'rst2html.py', 'rst2html-3']}, + {'name':'rst2man', 'prog':['rst2man', 'rst2man.py', 'rst2man-3']}, +] + +if host_machine.system() =3D=3D 'freebsd' + required_programs +=3D 'ifconfig' +endif + +foreach name : required_programs + prog =3D find_program(name, required: true, dirs: libvirt_sbin_path) + varname =3D name.underscorify() + conf.set_quoted(varname.to_upper(), prog.path()) + set_variable('@0@_prog'.format(varname), prog) +endforeach + +foreach item : required_programs_groups + prog =3D find_program(item.get('prog'), required: true, dirs: libvirt_sb= in_path) + varname =3D item.get('name').underscorify() + conf.set_quoted(varname.to_upper(), prog.path()) + set_variable('@0@_prog'.format(varname), prog) +endforeach + + +# optional programs + +optional_programs =3D [ + 'addr2line', + 'augparse', + 'dmidecode', + 'dnsmasq', + 'ebtables', + 'flake8', + 'ip', + 'ip6tables', + 'iptables', + 'mdevctl', + 'mm-ctl', + 'modprobe', + 'ovs-vsctl', + 'radvd', + 'rmmod', + 'scrub', + 'tc', + 'udevadm', +] + +foreach name : optional_programs + prog =3D find_program(name, required: false, dirs: libvirt_sbin_path) + varname =3D name.underscorify() + if prog.found() + prog_path =3D prog.path() + else + prog_path =3D name + endif + + conf.set_quoted(varname.to_upper(), prog_path) + conf.set_quoted('@0@_PATH'.format(varname.to_upper()), prog_path) + set_variable('@0@_prog'.format(varname), prog) +endforeach + + # define top include directory =20 top_inc_dir =3D include_directories('.') --=20 2.26.2