From nobody Sun Feb 8 18:39:35 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) client-ip=205.139.110.61; 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 205.139.110.61 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=1594893744; cv=none; d=zohomail.com; s=zohoarc; b=CFTKtgkJChiea6x8wUW6G0z/fVHuaZXo9P98+Tf8teRx/l4TyIJG1P38Wm+T7lybL8fuLmFEuxzZ6jpzLJIDIqnWhz4HH3Hhnx+MiykFpraSk9jMpubK1Zny+zQUUa9QGKq/JTwRqUXORtXeWXTLUwAQCrkv/TU7+TnILVIo8Kw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1594893744; 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=4aH998LiFL8RmHXWBxvWo4oNM0dz1koBBfE5Pdn4B/U=; b=hyMRvXTPn8+oCMGhJjunKkbO/HBLlyQcodinfFwt+czAiYrNzrvQ2O03OziJHcdLeczIOIc0HARghZrf7UeiOtsf/2g+h3o8CHMflCybdBPi+WPJyAan9abhjbsFK0sm5dKw91gJNNTnJsGoW1ca9NVvgKjcel+dFVb6fio90DI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 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 [205.139.110.61]) by mx.zohomail.com with SMTPS id 159489374492959.57575317204555; Thu, 16 Jul 2020 03:02:24 -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-123-omOHDn6SNXGjS80hXL0wHQ-1; Thu, 16 Jul 2020 06:01:00 -0400 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id 6D18880BCAE; Thu, 16 Jul 2020 10:00:54 +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 4D3637980F; Thu, 16 Jul 2020 10:00:54 +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 1BD631804759; Thu, 16 Jul 2020 10:00:54 +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 06GA0mDa015491 for ; Thu, 16 Jul 2020 06:00:48 -0400 Received: by smtp.corp.redhat.com (Postfix) id B0D162DE71; Thu, 16 Jul 2020 10:00:48 +0000 (UTC) Received: from antique-work.redhat.com (unknown [10.40.194.85]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2A5B92DE6F for ; Thu, 16 Jul 2020 10:00:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1594893743; 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=4aH998LiFL8RmHXWBxvWo4oNM0dz1koBBfE5Pdn4B/U=; b=F9JvG3Yx9DVHIdq2vIApA3HO2PBF5XB5lOo4vF5jXTf/0X+74sjtopKbqJSZuvX7bASUTj hXEjUHhAwq+gL+kNArLU9ay39xcDQHjmEFrfc3CP1aZdUHveAHdRaY0CudunnfHuj0Qv+g 3b2iGKClQHAonHSP/lkdQgv2ReOR/Qs= X-MC-Unique: omOHDn6SNXGjS80hXL0wHQ-1 From: Pavel Hrdina To: libvir-list@redhat.com Subject: [libvirt PATCH 027/351] meson: add symbols check Date: Thu, 16 Jul 2020 11:54:23 +0200 Message-Id: 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.79 on 10.5.11.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com 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 | 87 ---------------------------------------------------- meson.build | 72 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 72 insertions(+), 87 deletions(-) diff --git a/configure.ac b/configure.ac index 4a40f3fc34e..1ffa4f931ee 100644 --- a/configure.ac +++ b/configure.ac @@ -207,9 +207,6 @@ LIBVIRT_CHECK_YAJL =20 AC_CHECK_SIZEOF([long]) =20 -dnl Check whether endian provides handy macros. -AC_CHECK_DECLS([htole64], [], [], [[#include ]]) - AC_CHECK_TYPE([struct ifreq], [AC_DEFINE([HAVE_STRUCT_IFREQ],[1], [Defined if struct ifreq exists in net/if.h])], @@ -223,16 +220,6 @@ AC_CHECK_TYPE([struct sockpeercred], [], [[#include ]]) =20 -AC_CHECK_DECLS([ETH_FLAG_TXVLAN, ETH_FLAG_NTUPLE, ETH_FLAG_RXHASH, ETH_FLA= G_LRO, - ETHTOOL_GGSO, ETHTOOL_GGRO, ETHTOOL_GFLAGS, ETHTOOL_GFEATU= RES, - ETHTOOL_SCOALESCE, ETHTOOL_GCOALESCE], - [], [], [[#include - ]]) - -AC_CHECK_DECLS([SEEK_HOLE], [], [], - [#include - #include ]) - =20 AC_CHECK_LIB([intl],[gettext],[]) AC_CHECK_LIB([util],[openpty],[]) @@ -407,27 +394,6 @@ if test $with_storage =3D yes; then fi AM_CONDITIONAL([WITH_STORAGE], [test "$with_storage" =3D "yes"]) =20 -dnl -dnl check for DEVLINK_CMD_ESWITCH_GET -dnl -dnl Assume DEVLINK_ESWITCH_MODE_SWITCHDEV is also -dnl available, as it was introudced in kernel 4.8 -dnl along with the original spelling of this constant -dnl (DEVLINK_CMD_ESWITCH_MODE_GET, not supported by libvirt) -dnl -if test "$with_linux" =3D "yes"; then - AC_CHECK_DECLS([DEVLINK_CMD_ESWITCH_GET], [], [], - [[#include ]]) -fi - -dnl -dnl check for VHOST_VSOCK_SET_GUEST_CID -dnl -if test "$with_linux" =3D "yes"; then - AC_CHECK_DECLS([VHOST_VSOCK_SET_GUEST_CID], [], [], - [[#include ]]) -fi - dnl Allow perl/python overrides AC_PATH_PROGS([PYTHON], [python3]) if test -z "$PYTHON"; then @@ -478,9 +444,6 @@ then fi AM_CONDITIONAL([WITH_NODE_DEVICES], [test "$with_nodedev" =3D "yes"]) =20 -dnl GET_VLAN_VID_CMD is required for virNetDevGetVLanID -AC_CHECK_DECLS([GET_VLAN_VID_CMD], [], [], [[#include ]]) - # Check for Linux vs. BSD ifreq members AC_CHECK_MEMBERS([struct ifreq.ifr_newname, struct ifreq.ifr_ifindex, @@ -491,41 +454,6 @@ AC_CHECK_MEMBERS([struct ifreq.ifr_newname, #include ]) =20 -# Check for BSD approach for setting MAC addr -AC_LINK_IFELSE([AC_LANG_PROGRAM( - [[ - #include - #include - #include - ]], - [[ - link_addr(0, 0)]])], - [AC_DEFINE([HAVE_DECL_LINK_ADDR], - [1], - [whether link_addr is available])]) - -# Check for BSD approach for bridge management -AC_CHECK_DECLS([BRDGSFD, BRDGADD, BRDGDEL], - [AC_DEFINE([HAVE_BSD_BRIDGE_MGMT], - [1], - [whether BSD style bridge management is availabl= e])], - [], - [#include - #include - #include - #include - ]) - -# Check for BSD CPU affinity availability -AC_CHECK_DECLS([cpuset_getaffinity], - [AC_DEFINE([HAVE_BSD_CPU_AFFINITY], - [1], - [whether BSD CPU affinity management is availabl= e])], - [], - [#include - #include - ]) - # Check for BSD kvm (kernel memory interface) if test $with_freebsd =3D yes; then AC_CHECK_LIB([kvm], [kvm_getprocs], [], @@ -533,21 +461,6 @@ if test $with_freebsd =3D yes; then ) fi =20 -AC_CHECK_DECLS([clock_serv_t, host_get_clock_service, clock_get_time], - [AC_DEFINE([HAVE_MACH_CLOCK_ROUTINES], - [1], - [whether Mach clock routines are available])], - [], - [#include - #include - ]) - -# Check if we have new enough kernel to support BPF devices for cgroups v2 -if test "$with_linux" =3D "yes"; then - AC_CHECK_DECLS([BPF_PROG_QUERY, BPF_CGROUP_DEVICE], - [], [], [#include ]) -fi - # Check if we need to look for ifconfig if test "$want_ifconfig" =3D "yes"; then AC_PATH_PROG([IFCONFIG_PATH], [ifconfig]) diff --git a/meson.build b/meson.build index 62e51230888..c79d557b289 100644 --- a/meson.build +++ b/meson.build @@ -736,6 +736,78 @@ if host_machine.system() =3D=3D 'linux' endif =20 =20 +# check various symbols + +symbols =3D [ + # Check whether endian provides handy macros. + [ 'endian.h', 'htole64' ], + + [ 'linux/ethtool.h', 'ETH_FLAG_TXVLAN' ], + [ 'linux/ethtool.h', 'ETH_FLAG_NTUPLE' ], + [ 'linux/ethtool.h', 'ETH_FLAG_RXHASH' ], + [ 'linux/ethtool.h', 'ETH_FLAG_LRO' ], + [ 'linux/ethtool.h', 'ETHTOOL_GGSO' ], + [ 'linux/ethtool.h', 'ETHTOOL_GGRO' ], + [ 'linux/ethtool.h', 'ETHTOOL_GFLAGS' ], + [ 'linux/ethtool.h', 'ETHTOOL_GFEATURES' ], + [ 'linux/ethtool.h', 'ETHTOOL_SCOALESCE' ], + [ 'linux/ethtool.h', 'ETHTOOL_GCOALESCE' ], + + # GET_VLAN_VID_CMD is required for virNetDevGetVLanID + [ 'linux/if_vlan.h', 'GET_VLAN_VID_CMD' ], + + [ 'unistd.h', 'SEEK_HOLE' ], + + # GET_VLAN_VID_CMD is required for virNetDevGetVLanID + [ 'linux/if_vlan.h', 'GET_VLAN_VID_CMD' ], + + # Check for BSD approach for setting MAC addr + [ 'net/if_dl.h', 'link_addr' ], +] + +if host_machine.system() =3D=3D 'linux' + symbols +=3D [ + # check for DEVLINK_CMD_ESWITCH_GET + # Assume DEVLINK_ESWITCH_MODE_SWITCHDEV is also available, as it was + # introudced in kernel 4.8 along with the original spelling of this + # constant (DEVLINK_CMD_ESWITCH_MODE_GET, not supported by libvirt). + [ 'linux/devlink.h', 'DEVLINK_CMD_ESWITCH_GET' ], + + # check for VHOST_VSOCK_SET_GUEST_CID + [ 'linux/vhost.h', 'VHOST_VSOCK_SET_GUEST_CID' ], + + # Check if we have new enough kernel to support BPF devices for cgroup= s v2 + [ 'linux/bpf.h', 'BPF_PROG_QUERY' ], + [ 'linux/bpf.h', 'BPF_CGROUP_DEVICE' ], + ] +endif + +foreach symbol : symbols + if cc.has_header_symbol(symbol[0], symbol[1]) + conf.set('HAVE_DECL_@0@'.format(symbol[1].to_upper()), 1) + endif +endforeach + +# Check for BSD approach for bridge management +if (cc.has_header_symbol('net/if_bridgevar.h', 'BRDGSFD') and + cc.has_header_symbol('net/if_bridgevar.h', 'BRDGADD') and + cc.has_header_symbol('net/if_bridgevar.h', 'BRDGDEL')) + conf.set('HAVE_BSD_BRIDGE_MGMT', 1) +endif + +# Check for BSD CPU affinity availability +if cc.has_header_symbol('sys/cpuset.h', 'cpuset_getaffinity') + conf.set('HAVE_BSD_CPU_AFFINITY', 1) +endif + +# whether Mach clock routines are available +if (cc.has_header_symbol('mach/clock.h', 'clock_serv_t') and + cc.has_header_symbol('mach/clock.h', 'host_get_clock_service') and + cc.has_header_symbol('mach/clock.h', 'clock_get_time')) + conf.set('HAVE_MACH_CLOCK_ROUTINES', 1) +endif + + # define top include directory =20 top_inc_dir =3D include_directories('.') --=20 2.26.2