DPDK patches and discussions
 help / color / mirror / Atom feed
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>
Subject: [dpdk-dev] [PATCH] net/af_xdp: simplify meson build specification
Date: Fri,  5 Apr 2019 16:33:20 +0100	[thread overview]
Message-ID: <20190405153320.61694-1-bruce.richardson@intel.com> (raw)
Message-ID: <20190405153320.LHBtaun6ifwZ4X54S5wPObGiqMv0YbaJvWLMyqvPK8M@z> (raw)
In-Reply-To: <20190405152041.47092-1-ferruh.yigit@intel.com>

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


  parent reply	other threads:[~2019-04-05 15:33 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-05 15:20 [dpdk-dev] [PATCH] net/af_xdp: fix meson for non Linux platforms Ferruh Yigit
2019-04-05 15:20 ` Ferruh Yigit
2019-04-05 15:33 ` Bruce Richardson [this message]
2019-04-05 15:33   ` [dpdk-dev] [PATCH] net/af_xdp: simplify meson build specification Bruce Richardson
2019-04-05 15:41   ` Ferruh Yigit
2019-04-05 15:41     ` Ferruh Yigit
2019-04-05 15:45   ` Ferruh Yigit
2019-04-05 15:45     ` Ferruh Yigit

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190405153320.61694-1-bruce.richardson@intel.com \
    --to=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=xiaolong.ye@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).