DPDK patches and discussions
 help / color / mirror / Atom feed
From: Ferruh Yigit <ferruh.yigit@intel.com>
To: Bruce Richardson <bruce.richardson@intel.com>,
	dev@dpdk.org, Xiaolong Ye <xiaolong.ye@intel.com>
Subject: Re: [dpdk-dev] [PATCH] net/af_xdp: simplify meson build specification
Date: Fri, 5 Apr 2019 16:41:10 +0100	[thread overview]
Message-ID: <2e488532-5911-eac8-1c8f-5f826f357713@intel.com> (raw)
Message-ID: <20190405154110.pGRfCJUi7kJAGlbwR0sEO18O2Yd1u1QCab-WHo9VhVE@z> (raw)
In-Reply-To: <20190405153320.61694-1-bruce.richardson@intel.com>

On 4/5/2019 4:33 PM, Bruce Richardson wrote:
> 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')
> 

Looks good to me.

  parent reply	other threads:[~2019-04-05 15:41 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 ` [dpdk-dev] [PATCH] net/af_xdp: simplify meson build specification Bruce Richardson
2019-04-05 15:33   ` Bruce Richardson
2019-04-05 15:41   ` Ferruh Yigit [this message]
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=2e488532-5911-eac8-1c8f-5f826f357713@intel.com \
    --to=ferruh.yigit@intel.com \
    --cc=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    --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).