From nobody Sun Feb 8 02:22:01 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) client-ip=63.128.21.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 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=1602165610; cv=none; d=zohomail.com; s=zohoarc; b=a5/HFz2x/OmhWiTJjTjdLO4swPry6EPMW9m0i4NBeEQF9nsOdOpW7MGyGyJR+cCvOkWrWy/BYsjGGHYUNLtXlltC/x9UnoAtD7x7qETjHOjI+AQmRZ7JWnwkad+3Z7p+Jg0ZeIG+cWKuPlL0OIpbpZbonQEPK5IgiwRWnDwUK8g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1602165610; 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=Xve9dbRgNSl8IBkNnY8N/u17sk1xXqtzFRzf3ktJB9M=; b=WnPZuE9veu/lI2hrFbUFDnXzVhOiLOBafzKpIQSonAdrToOke/nYtdOePJasJT1Kz7vO+idI645hsP2SMzbCKC77NZcuDEIo5ep5LIjI3ZqhmzF65vJWqR+zNISVFPqEP7Gses4QBVtOSbJNYCc/8GqFFYkq+hJo3yuoAB7S4lQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 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-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mx.zohomail.com with SMTPS id 1602165610822584.8174853717142; Thu, 8 Oct 2020 07:00:10 -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-583-6HxTY5Y-NzO0pkuIESov0A-1; Thu, 08 Oct 2020 09:59:23 -0400 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id B6C85108E1BE; Thu, 8 Oct 2020 13:59:15 +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 9682768432; Thu, 8 Oct 2020 13:59:15 +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 618118C7C8; Thu, 8 Oct 2020 13:59:15 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 098DxCsx013652 for ; Thu, 8 Oct 2020 09:59:12 -0400 Received: by smtp.corp.redhat.com (Postfix) id 8EB885D9F1; Thu, 8 Oct 2020 13:59:12 +0000 (UTC) Received: from antique-work.redhat.com (unknown [10.40.194.193]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0C3CA5D9E8 for ; Thu, 8 Oct 2020 13:59:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1602165607; 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=Xve9dbRgNSl8IBkNnY8N/u17sk1xXqtzFRzf3ktJB9M=; b=N92RifCx+1RnIPniRIiRdgJxR6qBmtc33ePLY4KXXqrzhoD/D32xUgC0mgD54tEedxia3q gUfPC8jPc/3c/6DU7DNJMtaxPdQxWz0JSmRfzWi4rrrT+a9aafL4kCeHSbKgqiOpSmZKnV uDGaExWQU0v38oE3Xxlpt5PFKkex5dA= X-MC-Unique: 6HxTY5Y-NzO0pkuIESov0A-1 From: Pavel Hrdina To: libvir-list@redhat.com Subject: [libvirt PATCH 05/15] meson: properly handle libpcap if it's explicitly disabled Date: Thu, 8 Oct 2020 15:58:54 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 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.12 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" If libpcap is detected using pkg-config it would ignore the libpcap option. Signed-off-by: Pavel Hrdina --- meson.build | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/meson.build b/meson.build index 48d0d00288..0941be8136 100644 --- a/meson.build +++ b/meson.build @@ -1101,17 +1101,22 @@ if libparted_dep.found() 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, - ) +if not get_option('libpcap').disabled() + libpcap_dep =3D dependency('libpcap', version: '>=3D' + libpcap_version,= required: false) + + if not libpcap_dep.found() + pcap_config_prog =3D find_program('pcap-config', required: get_option(= 'libpcap')) + if pcap_config_prog.found() + pcap_args =3D run_command(pcap_config_prog, '--cflags').stdout().str= ip().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 +else + libpcap_dep =3D dependency('', required: false) endif if libpcap_dep.found() conf.set('WITH_LIBPCAP', 1) --=20 2.26.2