From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 544BCC47096 for ; Thu, 3 Jun 2021 08:15:01 +0000 (UTC) Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by mail.kernel.org (Postfix) with ESMTP id DBC42613DC for ; Thu, 3 Jun 2021 08:15:00 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DBC42613DC Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dev-bounces@dpdk.org Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1B67F4069F; Thu, 3 Jun 2021 10:15:00 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mails.dpdk.org (Postfix) with ESMTP id 8D76640689 for ; Thu, 3 Jun 2021 10:14:56 +0200 (CEST) IronPort-SDR: kGaSs8GUsr3OzVwSYuiCIAgpmpArW1ZrgzMBe7LvIh6AFKgRVOIti1YXODU8uEWDS7/omEwrRn 4gSILA30Ynog== X-IronPort-AV: E=McAfee;i="6200,9189,10003"; a="203983110" X-IronPort-AV: E=Sophos;i="5.83,244,1616482800"; d="scan'208";a="203983110" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jun 2021 01:14:52 -0700 IronPort-SDR: EYmk1WSLsssDx08NVo/XzBUA8qUjzlNmntbGuoOWi9jMY0ECpxWfHrrNWiyzfCdLlXiiD9XNgN QotXaqhDjXVA== X-IronPort-AV: E=Sophos;i="5.83,244,1616482800"; d="scan'208";a="417306049" Received: from bricha3-mobl.ger.corp.intel.com ([10.252.7.186]) by orsmga002-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-SHA; 03 Jun 2021 01:14:48 -0700 Date: Thu, 3 Jun 2021 09:14:43 +0100 From: Bruce Richardson To: David Marchand Cc: Dmitry Kozlyuk , dev , Aaron Conole , Michael Santana , Rasesh Mody , Shahed Shaikh , Qiming Yang , Qi Zhang , Heinrich Kuhn , Devendra Singh Rawat , Igor Russkikh , Ray Kinsella , Neil Horman , Narcisa Ana Maria Vasile , Dmitry Malloy , Pallavi Kadam Message-ID: References: <20210602095836.24901-1-david.marchand@redhat.com> <20210602095836.24901-3-david.marchand@redhat.com> <20210603001919.7ea9c273@sovereign> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: Re: [dpdk-dev] [PATCH 2/2] eal: handle compressed firmwares X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Thu, Jun 03, 2021 at 09:53:44AM +0200, David Marchand wrote: > On Thu, Jun 3, 2021 at 9:23 AM David Marchand > wrote: > > > > diff --git a/config/meson.build b/config/meson.build index > > > > 017bb2efbb..337daa2719 100644 --- a/config/meson.build +++ > > > > b/config/meson.build @@ -166,6 +166,15 @@ if fdt_dep.found() and > > > > cc.has_header('fdt.h') dpdk_extra_ldflags += '-lfdt' endif > > > > > > > > +has_libarchive = 0 +archive_dep = cc.find_library('libarchive', > > > > required: false) +if archive_dep.found() and > > > > cc.has_header('archive.h') + > > > > dpdk_conf.set10('RTE_HAS_LIBARCHIVE', true) + has_libarchive = 1 > > > > + add_project_link_arguments('-larchive', language: 'c') + > > > > dpdk_extra_ldflags += '-larchive' +endif + > > > > > > Why not use pkg-config? `has_libarchive` is unused. > > > > Frankly, I just copied the logic already present in config/meson.build. > > If there is better to do, please advise. > > Ah ok, I think I understand. Do you mean to align on libbsd? > Yep. "dependency()" should be used for libs/packages that have a pkg-config file, while "find_library()" is a fallback for literally just trying to find a library that doesn't have a .pc file. When specifying dependencies, it's best to explicitly state the lookup method as pkg-config (only), because if not found via pkg-config, meson will by default then attempt to use cmake (if present) to find the requested package, and that can cause issues with cmake finding the incorrect package version e.g. when doing 32-bit builds on 64-bit systems. There is almost certainly a way to configure cmake not to do this, but by limiting search to pkg-config it saves us having to document how to configure proper library search paths for multiple tools. Setting PKG_CONFIG_LIBDIR should be enough! /Bruce