[1/2] net/nfb: fix dependency check

Message ID 20190914093700.11451-2-thomas@monjalon.net (mailing list archive)
State Accepted, archived
Delegated to: Ferruh Yigit
Headers
Series use pkg-config to find Netcope dependencies |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK
ci/iol-dpdk_compile_ovs success Compile Testing PASS
ci/iol-dpdk_compile success Compile Testing PASS
ci/iol-dpdk_compile_spdk success Compile Testing PASS
ci/intel-Performance success Performance Testing PASS
ci/mellanox-Performance success Performance Testing PASS

Commit Message

Thomas Monjalon Sept. 14, 2019, 9:36 a.m. UTC
  The library libnfb is part of netcope-common which provides
a pkg-config file: netcope-common.pc.
Looking for this .pc file - with dependency() - is preferred
than looking for the library - with cc.find_library().

If the library is not installed in a standard path,
it can be found thanks to PKG_CONFIG_PATH variable.
The previous solution required to use CFLAGS and LDFLAGS
environment variables.

Fixes: 6435f9a0ac22 ("net/nfb: add new netcope driver")
Cc: stable@dpdk.org

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
 drivers/net/nfb/meson.build | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)
  

Comments

Jan Remes Sept. 15, 2019, 12:04 p.m. UTC | #1
On Sat, Sep 14, 2019 at 11:37 AM Thomas Monjalon <thomas@monjalon.net> wrote:
>
> The library libnfb is part of netcope-common which provides
> a pkg-config file: netcope-common.pc.
> Looking for this .pc file - with dependency() - is preferred
> than looking for the library - with cc.find_library().
>
> If the library is not installed in a standard path,
> it can be found thanks to PKG_CONFIG_PATH variable.
> The previous solution required to use CFLAGS and LDFLAGS
> environment variables.
>
> Fixes: 6435f9a0ac22 ("net/nfb: add new netcope driver")
> Cc: stable@dpdk.org
>
> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Jan Remes <remes@netcope.com>

> ---
>  drivers/net/nfb/meson.build | 9 ++-------
>  1 file changed, 2 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/net/nfb/meson.build b/drivers/net/nfb/meson.build
> index 4502c3f76..d53e8eca7 100644
> --- a/drivers/net/nfb/meson.build
> +++ b/drivers/net/nfb/meson.build
> @@ -3,14 +3,9 @@
>  # Copyright(c) 2019 Netcope Technologies, a.s. <info@netcope.com>
>  # All rights reserved.
>
> -dep = cc.find_library('nfb', required: false)
> +dep = dependency('netcope-common', required: false)
>  reason = 'missing dependency, "libnfb"'
> -
> -build = dep.found() and cc.has_header('nfb/nfb.h', dependencies: dep)
> -
> -nc = dependency('netcope-common', required: false)
> -
> +build = dep.found()
>  ext_deps += dep
> -ext_deps += nc
>
>  sources = files('nfb_rx.c', 'nfb_tx.c', 'nfb_stats.c', 'nfb_ethdev.c', 'nfb_rxmode.c')
> --
> 2.23.0
>
  
Thomas Monjalon Sept. 16, 2019, 3:46 p.m. UTC | #2
15/09/2019 14:04, Jan Remeš:
> On Sat, Sep 14, 2019 at 11:37 AM Thomas Monjalon <thomas@monjalon.net> wrote:
> >
> > The library libnfb is part of netcope-common which provides
> > a pkg-config file: netcope-common.pc.
> > Looking for this .pc file - with dependency() - is preferred
> > than looking for the library - with cc.find_library().
> >
> > If the library is not installed in a standard path,
> > it can be found thanks to PKG_CONFIG_PATH variable.
> > The previous solution required to use CFLAGS and LDFLAGS
> > environment variables.
> >
> > Fixes: 6435f9a0ac22 ("net/nfb: add new netcope driver")
> > Cc: stable@dpdk.org
> >
> > Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
> Acked-by: Jan Remes <remes@netcope.com>

Series applied
  
Thomas Monjalon Sept. 16, 2019, 3:51 p.m. UTC | #3
16/09/2019 17:46, Thomas Monjalon:
> 15/09/2019 14:04, Jan Remeš:
> > On Sat, Sep 14, 2019 at 11:37 AM Thomas Monjalon <thomas@monjalon.net> wrote:
> > >
> > > The library libnfb is part of netcope-common which provides
> > > a pkg-config file: netcope-common.pc.
> > > Looking for this .pc file - with dependency() - is preferred
> > > than looking for the library - with cc.find_library().
> > >
> > > If the library is not installed in a standard path,
> > > it can be found thanks to PKG_CONFIG_PATH variable.
> > > The previous solution required to use CFLAGS and LDFLAGS
> > > environment variables.
> > >
> > > Fixes: 6435f9a0ac22 ("net/nfb: add new netcope driver")
> > > Cc: stable@dpdk.org
> > >
> > > Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
> > Acked-by: Jan Remes <remes@netcope.com>
> 
> Series applied

Sorry no, not applied on master.
It should go in next-net after Ferruh's review.
  

Patch

diff --git a/drivers/net/nfb/meson.build b/drivers/net/nfb/meson.build
index 4502c3f76..d53e8eca7 100644
--- a/drivers/net/nfb/meson.build
+++ b/drivers/net/nfb/meson.build
@@ -3,14 +3,9 @@ 
 # Copyright(c) 2019 Netcope Technologies, a.s. <info@netcope.com>
 # All rights reserved.
 
-dep = cc.find_library('nfb', required: false)
+dep = dependency('netcope-common', required: false)
 reason = 'missing dependency, "libnfb"'
-
-build = dep.found() and cc.has_header('nfb/nfb.h', dependencies: dep)
-
-nc = dependency('netcope-common', required: false)
-
+build = dep.found()
 ext_deps += dep
-ext_deps += nc
 
 sources = files('nfb_rx.c', 'nfb_tx.c', 'nfb_stats.c', 'nfb_ethdev.c', 'nfb_rxmode.c')