From nobody Tue Feb 10 19:47:42 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.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 170.10.133.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=1622536812; cv=none; d=zohomail.com; s=zohoarc; b=hMJnpPzMoC+ANEsL04xhOCgz+IDlAuQNOjrNcyTG5KY5jlq9NN4JvtC5fTnMVlrsi40K8oEXgCOXO4yIWdwqWg7BPrPMhEfahlt0fhSARQdvmlXMnIQuAXA60SnxMoGJBh0EnuB2b0FIlB/w1MfZ7V2E55rlV6HkbybuW5SBts8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622536812; 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=PwvPGZh6P8fAWhq9Lh4xxRluuzy3o8QHMY3UrvPTpgc=; b=XzQpNWgXZYaGuovnPgkCmQy+2b8YQGOCxwqQE4Fxrc7sP3Uwd3L47qxL0rW22dZJAMOV5a+7ict1eVlVB2JtxU0kRsTSgScGRcjQOZrkpKIGHVPwxpEnZl5WM+tVNI+lww6+n1ET2h7YShvAcgA2+d0wi1UnDWECqC/th9yW5ew= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.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 [170.10.133.124]) by mx.zohomail.com with SMTPS id 1622536812718589.1394923180745; Tue, 1 Jun 2021 01:40:12 -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-107-gjTqLJcpPeW287T4_wrwDw-1; Tue, 01 Jun 2021 04:38:42 -0400 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id AFADC8042B7; Tue, 1 Jun 2021 08:38:34 +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 8B7EE1E6; Tue, 1 Jun 2021 08:38:34 +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 521903FB4A; Tue, 1 Jun 2021 08:38:34 +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 1518cTH9026111 for ; Tue, 1 Jun 2021 04:38:29 -0400 Received: by smtp.corp.redhat.com (Postfix) id 6E406E2D8; Tue, 1 Jun 2021 08:38:29 +0000 (UTC) Received: from harajuku.usersys.redhat.com (unknown [10.40.195.114]) by smtp.corp.redhat.com (Postfix) with ESMTPS id CB40BE2D4 for ; Tue, 1 Jun 2021 08:38:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1622536811; 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=PwvPGZh6P8fAWhq9Lh4xxRluuzy3o8QHMY3UrvPTpgc=; b=PeX6xvWaQjg15UuKHmO76ioNUci+6QuYxp3K/xvS2uuYZhsNXcjsTqsXjxOZdVPWNxNwb6 h6CJmpBjyMLsznWvHJ60T7uL8GeKnlV0SqvA0lZYy3t2Bzn/A4u9B51NSmUbWSmxMRWJ9S CxxfZpFWadPbtv9qdmteC7yslyUpuyU= X-MC-Unique: gjTqLJcpPeW287T4_wrwDw-1 From: Andrea Bolognani To: libvir-list@redhat.com Subject: [libvirt PATCH 18/26] meson: Use dependency() when possible Date: Tue, 1 Jun 2021 10:37:49 +0200 Message-Id: <20210601083757.10194-19-abologna@redhat.com> In-Reply-To: <20210601083757.10194-1-abologna@redhat.com> References: <20210601083757.10194-1-abologna@redhat.com> 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.16 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" This is the preferred way to figure out whether a library is available, and for the most part we can just adopt it right away; in a few cases, unfortunately, we're stuck with using cc.find_library() until further down the road, when all our target platforms ship with pkg-config enabled versions of the various libraries. Signed-off-by: Andrea Bolognani --- meson.build | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/meson.build b/meson.build index 301cebab5c..a9f87473db 100644 --- a/meson.build +++ b/meson.build @@ -844,6 +844,7 @@ endforeach =20 # generic build dependencies =20 +# FIXME rewrite to use dependency() acl_dep =3D cc.find_library('acl', required: false) if acl_dep.found() conf.set('WITH_LIBACL', 1) @@ -859,12 +860,13 @@ if apparmor_dep.found() conf.set_quoted('APPARMOR_PROFILES_PATH', '/sys/kernel/security/apparmor= /profiles') endif =20 +# FIXME rewrite to use dependency() once we can use 2.4.48 attr_dep =3D cc.find_library('attr', required: get_option('attr')) if attr_dep.found() conf.set('WITH_LIBATTR', 1) endif =20 -audit_dep =3D cc.find_library('audit', required: get_option('audit')) +audit_dep =3D dependency('audit', required: get_option('audit')) if audit_dep.found() conf.set('WITH_AUDIT', 1) endif @@ -878,7 +880,7 @@ if blkid_dep.found() conf.set('WITH_BLKID', 1) endif =20 -capng_dep =3D cc.find_library('cap-ng', required: get_option('capng')) +capng_dep =3D dependency('libcap-ng', required: get_option('capng')) if capng_dep.found() conf.set('WITH_CAPNG', 1) endif @@ -1071,6 +1073,7 @@ else intl_dep =3D dependency('', required: false) endif =20 +# FIXME rewrite to use dependency() once we can use 2.0.14 numactl_dep =3D cc.find_library('numa', required: get_option('numactl')) if numactl_dep.found() conf.set('WITH_NUMACTL', 1) @@ -1160,7 +1163,7 @@ else sasl_dep =3D dependency('', required: false) endif =20 -selinux_dep =3D cc.find_library('selinux', required: get_option('selinux')) +selinux_dep =3D dependency('libselinux', required: get_option('selinux')) if selinux_dep.found() selinux_mount =3D get_option('selinux_mount') if selinux_mount =3D=3D '' @@ -1269,7 +1272,7 @@ elif host_machine.system() =3D=3D 'linux' elif host_machine.system() in [ 'freebsd', 'darwin' ] xdr_dep =3D cc.find_library('c', required: false) else - xdr_dep =3D declare_dependency() + xdr_dep =3D dependency('', required: false) endif =20 yajl_version =3D '2.0.3' @@ -1469,16 +1472,16 @@ if not get_option('driver_libxl').disabled() and co= nf.has('WITH_LIBVIRTD') if cc.has_header('libxlutil.h') conf.set('WITH_LIBXLUTIL_H', 1) endif - xl_util_dep =3D cc.find_library('xlutil') + xl_util_dep =3D dependency('xlutil') =20 - xen_store_dep =3D cc.find_library('xenstore') + xen_store_dep =3D dependency('xenstore') =20 # xtl_* infrastructure is in libxentoollog since Xen 4.7 previously # it was in libxenctrl. if libxl_dep.version().version_compare('>=3D4.7.0') - xtl_link_dep =3D cc.find_library('xentoollog') + xtl_link_dep =3D dependency('xentoollog') else - xtl_link_dep =3D cc.find_library('xenctrl') + xtl_link_dep =3D dependency('xenctrl') endif =20 if libxl_dep.version().version_compare('>=3D4.13.0') --=20 2.31.1