From nobody Sun Feb 8 16:17:46 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=1594893765; cv=none; d=zohomail.com; s=zohoarc; b=YIBdLS4HE2jqOGfQ4ZKmA+vWxd10cOU6dCJYaery8hZytYYivb8sDOxS0A2kceVOcStYVEbGNLPlSC609h09n8ZWBMY67PvDSNIXigMmYcOXtbWkOyYqfXILcLVruyWpd3a0es8SCMo3y9kyqKYZIkYx2rqAeoDAz/2wMzh2IsI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1594893765; 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=QVyo1Qphxk5LIhjd0Rtbw22rkDDdNL763qPK7429p5w=; b=c9oOjRsUJ43w/VrEHVrc6wSMU9yeZs1wy4fCy7sHQKEIN4JBCD8fSOLUW7yaieumBoS3AQeto15X7XJMsbrcH6Iws3uV70oltz8G7pUlJYnb+ohjLN25x0WtEaz5Ucmv/F8ZESHkM6tf8m8tItsHd9vOtBw+r8xDHQ0Es6R8YBQ= 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-1.mimecast.com [205.139.110.61]) by mx.zohomail.com with SMTPS id 1594893765904375.50672833211604; Thu, 16 Jul 2020 03:02:45 -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-451-jra1PFfjMA-pcgTR6NmTRQ-1; Thu, 16 Jul 2020 06:02:36 -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 E15AE100CD49; Thu, 16 Jul 2020 10:02:26 +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 BD07F79D06; Thu, 16 Jul 2020 10:02:26 +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 884DC1809561; Thu, 16 Jul 2020 10:02:26 +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 06GA2BdC016210 for ; Thu, 16 Jul 2020 06:02:11 -0400 Received: by smtp.corp.redhat.com (Postfix) id A77D92B6E6; Thu, 16 Jul 2020 10:02:11 +0000 (UTC) Received: from antique-work.redhat.com (unknown [10.40.194.85]) by smtp.corp.redhat.com (Postfix) with ESMTP id 228F92B6DB for ; Thu, 16 Jul 2020 10:02:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1594893764; 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=QVyo1Qphxk5LIhjd0Rtbw22rkDDdNL763qPK7429p5w=; b=eqp6Mr/GzDQs1ALHTnrXxxGMGCH1P8E+jpQP3gEcikYd5IDklMQBXzbp8saNj+sXYjMlud VGOpzN2nBKIN9Q/Aa+xCXqyTJON0zjo26T5nawZobKL+M26cipx4otjnuC91LFtCYO0HUT WN9tLgsxigxh7yZpfMjVzL5DbwzY5N8= X-MC-Unique: jra1PFfjMA-pcgTR6NmTRQ-1 From: Pavel Hrdina To: libvir-list@redhat.com Subject: [libvirt PATCH 057/351] meson: add libpcap build option Date: Thu, 16 Jul 2020 11:54:53 +0200 Message-Id: <8296c33e3f006cce07cfa827952615e30e3e660b.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.79 on 10.5.11.13 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 | 3 --- m4/virt-libpcap.m4 | 62 ---------------------------------------------- meson.build | 18 ++++++++++++++ meson_options.txt | 1 + 4 files changed, 19 insertions(+), 65 deletions(-) delete mode 100644 m4/virt-libpcap.m4 diff --git a/configure.ac b/configure.ac index b09a185c053..6d5e4e034fb 100644 --- a/configure.ac +++ b/configure.ac @@ -110,7 +110,6 @@ fi =20 # Check for compiler and library settings. =20 -LIBVIRT_ARG_LIBPCAP LIBVIRT_ARG_LIBSSH LIBVIRT_ARG_LIBXML LIBVIRT_ARG_NETCF @@ -130,7 +129,6 @@ LIBVIRT_ARG_VIRTUALPORT LIBVIRT_ARG_WIRESHARK LIBVIRT_ARG_YAJL =20 -LIBVIRT_CHECK_LIBPCAP LIBVIRT_CHECK_LIBSSH LIBVIRT_CHECK_LIBXML LIBVIRT_CHECK_NETCF @@ -430,7 +428,6 @@ LIBVIRT_RESULT_DRIVER_MODULES AC_MSG_NOTICE([]) AC_MSG_NOTICE([Libraries]) AC_MSG_NOTICE([]) -LIBVIRT_RESULT_LIBPCAP LIBVIRT_RESULT_LIBSSH LIBVIRT_RESULT_LIBXL LIBVIRT_RESULT_LIBXML diff --git a/m4/virt-libpcap.m4 b/m4/virt-libpcap.m4 deleted file mode 100644 index 605c2fdea71..00000000000 --- a/m4/virt-libpcap.m4 +++ /dev/null @@ -1,62 +0,0 @@ -dnl The pcap library -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_ARG_LIBPCAP], [ - LIBVIRT_ARG_WITH([LIBPCAP], [libpcap location], [check]) -]) - -AC_DEFUN([LIBVIRT_CHECK_LIBPCAP], [ - LIBPCAP_REQUIRED=3D"1.5.0" - LIBPCAP_CONFIG=3D"pcap-config" - LIBPCAP_CFLAGS=3D"" - LIBPCAP_LIBS=3D"" - - if test "x$with_libpcap" !=3D "xno"; then - case $with_libpcap in - ''|yes|check) LIBPCAP_CONFIG=3D"pcap-config" ;; - *) LIBPCAP_CONFIG=3D"$with_libpcap/bin/pcap-config" ;; - esac - AS_IF([test "x$LIBPCAP_CONFIG" !=3D "x"], [ - AC_MSG_CHECKING(libpcap $LIBPCAP_CONFIG >=3D $LIBPCAP_REQUIRED ) - if ! $LIBPCAP_CONFIG --libs > /dev/null 2>&1 ; then - if test "x$with_libpcap" !=3D "xcheck"; then - AC_MSG_ERROR([You must install libpcap >=3D $LIBPCAP_REQUIRED to= compile libvirt]) - fi - AC_MSG_RESULT(no) - with_libpcap=3D"no" - else - LIBPCAP_LIBS=3D"`$LIBPCAP_CONFIG --libs`" - LIBPCAP_CFLAGS=3D"`$LIBPCAP_CONFIG --cflags`" - with_libpcap=3D"yes" - AC_MSG_RESULT(yes) - fi - ]) - fi - - if test "x$with_libpcap" =3D "xyes"; then - AC_DEFINE_UNQUOTED([HAVE_LIBPCAP], 1, [whether libpcap can be used]) - fi - - AC_SUBST([LIBPCAP_CFLAGS]) - AC_SUBST([LIBPCAP_LIBS]) -]) - -AC_DEFUN([LIBVIRT_RESULT_LIBPCAP], [ - LIBVIRT_RESULT_LIB([LIBPCAP]) -]) diff --git a/meson.build b/meson.build index 38e18f5c750..2346ae31d5a 100644 --- a/meson.build +++ b/meson.build @@ -1094,6 +1094,23 @@ if libparted_dep.found() endif endif =20 +libpcap_version =3D '1.5.0' +libpcap_dep =3D dependency('libpcap', version: '>=3D' + libpcap_version, r= equired: false) +if not libpcap_dep.found() + pcap_config_prog =3D find_program('pcap-config', required: get_option('l= ibpcap')) + if pcap_config_prog.found() + pcap_args =3D run_command(pcap_config_prog, '--cflags').stdout().strip= ().split() + pcap_libs =3D run_command(pcap_config_prog, '--libs').stdout().strip()= .split() + libpcap_dep =3D declare_dependency( + compile_args: pcap_args, + link_args: pcap_libs, + ) + endif +endif +if libpcap_dep.found() + conf.set('HAVE_LIBPCAP', 1) +endif + use_macvtap =3D false if not get_option('macvtap').disabled() if (cc.has_header_symbol('linux/if_link.h', 'MACVLAN_MODE_BRIDGE') and @@ -1259,6 +1276,7 @@ libs_summary =3D { 'hal': hal_dep.found(), 'libiscsi': libiscsi_dep.found(), 'libnl': libnl_dep.found(), + 'libpcap': libpcap_dep.found(), 'macvtap': conf.has('WITH_MACVTAP'), 'readline': readline_dep.found(), } diff --git a/meson_options.txt b/meson_options.txt index 44e756bdcf3..9e4e3f66429 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -24,5 +24,6 @@ option('fuse', type: 'feature', value: 'auto', descriptio= n: 'fuse support') option('glusterfs', type: 'feature', value: 'auto', description: 'glusterf= s support') option('hal', type: 'feature', value: 'auto', description: 'hal support') option('libiscsi', type: 'feature', value: 'auto', description: 'libiscsi = support') +option('libpcap', type: 'feature', value: 'auto', description: 'libpcap su= pport') option('macvtap', type: 'feature', value: 'auto', description: 'enable mac= vtap device') option('readline', type: 'feature', value: 'auto', description: 'readline = support') --=20 2.26.2