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=-9.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS,USER_AGENT_GIT 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 56924C4360F for ; Fri, 5 Apr 2019 15:33:34 +0000 (UTC) Received: from dpdk.org (dpdk.org [92.243.14.124]) by mail.kernel.org (Postfix) with ESMTP id 132DB2175B for ; Fri, 5 Apr 2019 15:33:33 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 132DB2175B 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 [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 5EBB41B53E; Fri, 5 Apr 2019 17:33:32 +0200 (CEST) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id 6DF0F1B53A for ; Fri, 5 Apr 2019 17:33:31 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 Apr 2019 08:33:29 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,313,1549958400"; d="scan'208";a="128929051" Received: from silpixa00399126.ir.intel.com (HELO silpixa00399126.ger.corp.intel.com) ([10.237.222.236]) by orsmga007.jf.intel.com with ESMTP; 05 Apr 2019 08:33:28 -0700 From: Bruce Richardson To: dev@dpdk.org, ferruh.yigit@intel.com, Xiaolong Ye Cc: Bruce Richardson Date: Fri, 5 Apr 2019 16:33:20 +0100 Message-Id: <20190405153320.61694-1-bruce.richardson@intel.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190405152041.47092-1-ferruh.yigit@intel.com> References: <20190405152041.47092-1-ferruh.yigit@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH] net/af_xdp: simplify meson build specification 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" The build spec has lots of levels of indentation, which can be reduced by not explicitly checking for linux, but for the needed header and library files needed for the driver. Signed-off-by: Bruce Richardson --- drivers/net/af_xdp/meson.build | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/drivers/net/af_xdp/meson.build b/drivers/net/af_xdp/meson.build index 840c93728..7904840f0 100644 --- a/drivers/net/af_xdp/meson.build +++ b/drivers/net/af_xdp/meson.build @@ -1,19 +1,16 @@ # SPDX-License-Identifier: BSD-3-Clause # Copyright(c) 2019 Intel Corporation -if host_machine.system() == 'linux' - bpf_dep = dependency('libbpf', required: false) - if bpf_dep.found() - build = true - else - bpf_dep = cc.find_library('bpf', required: false) - if bpf_dep.found() and cc.has_header('bpf/xsk.h', dependencies: bpf_dep) and cc.has_header('linux/if_xdp.h') - build = true - pkgconfig_extra_libs += '-lbpf' - else - build = false - endif - endif +sources = files('rte_eth_af_xdp.c') + +bpf_dep = dependency('libbpf', required: false) +if not bpf_dep.found() + bpf_dep = cc.find_library('bpf', required: false) +endif + +if bpf_dep.found() and cc.has_header('bpf/xsk.h') and cc.has_header('linux/if_xdp.h') ext_deps += bpf_dep + pkgconfig_extra_libs += '-lbpf' +else + build = false endif -sources = files('rte_eth_af_xdp.c') -- 2.20.1