From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 113B4A04BC; Fri, 9 Oct 2020 16:19:28 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id EE07F1D6E3; Fri, 9 Oct 2020 16:19:25 +0200 (CEST) Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by dpdk.org (Postfix) with ESMTP id C35FD1D6E2 for ; Fri, 9 Oct 2020 16:19:24 +0200 (CEST) IronPort-SDR: gPPJP4/WRvMpD/watSRuwpoUO0qjjYK/I1BJd5hHzyuMbQqI5rWqWYF7MCWbbRvOxS23YEWiFj tWo8CGa4hMew== X-IronPort-AV: E=McAfee;i="6000,8403,9768"; a="227138472" X-IronPort-AV: E=Sophos;i="5.77,355,1596524400"; d="scan'208";a="227138472" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Oct 2020 07:19:22 -0700 IronPort-SDR: JzbUrYZOd18P27bMhTvUgw34BKGZSlV3ZTlZlablEzwGufZuvY+MGd4Eu/cdTVsAoSdDKPmV4r pIe88aC2iLSA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,355,1596524400"; d="scan'208";a="462210443" Received: from silpixa00399126.ir.intel.com ([10.237.222.4]) by orsmga004.jf.intel.com with ESMTP; 09 Oct 2020 07:19:21 -0700 From: Bruce Richardson To: dev@dpdk.org Cc: bluca@debian.org, Bruce Richardson Date: Fri, 9 Oct 2020 15:19:14 +0100 Message-Id: <20201009141914.205284-1-bruce.richardson@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201008170536.124111-1-bruce.richardson@intel.com> References: <20201008170536.124111-1-bruce.richardson@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v2] build: skip detecting libpcap via pcap-config X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 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" When compiling for a slightly different architecture, e.g. 32-bit on 64-bit systems using CFLAGS rather than a cross-file, the pcap-config utility can often return parameters that are unusable for the build in question, i.e. providing the native 64-bit library paths rather than checking for 32-bit equivalent. Since many distros now include a version of libpcap with a pkg-config file, and for those that don't find-library should work ok as a fallback, we can explicitly just use pkg-config in the dependency search, causing meson to skip trying to use pcap-config. Signed-off-by: Bruce Richardson --- config/meson.build | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/config/meson.build b/config/meson.build index 69f2aeb60..9fb903c9b 100644 --- a/config/meson.build +++ b/config/meson.build @@ -163,11 +163,9 @@ if libbsd.found() endif # check for pcap -pcap_dep = dependency('pcap', required: false) -if pcap_dep.found() - # pcap got a pkg-config file only in 1.9.0 and before that meson uses - # an internal pcap-config finder, which is not compatible with - # cross-compilation, so try to fallback to find_library +pcap_dep = dependency('libpcap', required: false, method: 'pkg-config') +if not pcap_dep.found() + # pcap got a pkg-config file only in 1.9.0 pcap_dep = cc.find_library('pcap', required: false) endif if pcap_dep.found() and cc.has_header('pcap.h', dependencies: pcap_dep) -- 2.25.1