From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <bruce.richardson@intel.com>
Received: from mga05.intel.com (mga05.intel.com [192.55.52.43])
 by dpdk.org (Postfix) with ESMTP id 6DF0F1B53A
 for <dev@dpdk.org>; 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 <bruce.richardson@intel.com>
To: dev@dpdk.org, ferruh.yigit@intel.com, Xiaolong Ye <xiaolong.ye@intel.com>
Cc: Bruce Richardson <bruce.richardson@intel.com>
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 <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Fri, 05 Apr 2019 15:33:32 -0000

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 <bruce.richardson@intel.com>
---
 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

From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from dpdk.org (dpdk.org [92.243.14.124])
	by dpdk.space (Postfix) with ESMTP id 71BA5A0679
	for <public@inbox.dpdk.org>; Fri,  5 Apr 2019 17:33:34 +0200 (CEST)
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 <dev@dpdk.org>; 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 <bruce.richardson@intel.com>
To: dev@dpdk.org, ferruh.yigit@intel.com, Xiaolong Ye <xiaolong.ye@intel.com>
Cc: Bruce Richardson <bruce.richardson@intel.com>
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 <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
Errors-To: dev-bounces@dpdk.org
Sender: "dev" <dev-bounces@dpdk.org>
Content-Type: text/plain; charset="UTF-8"
Message-ID: <20190405153320.LHBtaun6ifwZ4X54S5wPObGiqMv0YbaJvWLMyqvPK8M@z>

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 <bruce.richardson@intel.com>
---
 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