[dpdk-dev] [PATCH 2/2] eal: handle compressed firmwares

Bruce Richardson bruce.richardson at intel.com
Thu Jun 3 10:14:43 CEST 2021


On Thu, Jun 03, 2021 at 09:53:44AM +0200, David Marchand wrote:
> On Thu, Jun 3, 2021 at 9:23 AM David Marchand <david.marchand at redhat.com>
> wrote:
> > > > diff --git a/config/meson.build b/config/meson.build index
> > > > 017bb2efbb..337daa2719 100644 --- a/config/meson.build +++
> > > > b/config/meson.build @@ -166,6 +166,15 @@ if fdt_dep.found() and
> > > > cc.has_header('fdt.h') dpdk_extra_ldflags += '-lfdt' endif
> > > >
> > > > +has_libarchive = 0 +archive_dep = cc.find_library('libarchive',
> > > > required: false) +if archive_dep.found() and
> > > > cc.has_header('archive.h') +
> > > > dpdk_conf.set10('RTE_HAS_LIBARCHIVE', true) +    has_libarchive = 1
> > > > +    add_project_link_arguments('-larchive', language: 'c') +
> > > > dpdk_extra_ldflags += '-larchive' +endif +
> > >
> > > Why not use pkg-config?  `has_libarchive` is unused.
> >
> > Frankly, I just copied the logic already present in config/meson.build.
> > If there is better to do, please advise.
> 
> Ah ok, I think I understand.  Do you mean to align on libbsd?
> 
Yep. "dependency()" should be used for libs/packages that have a pkg-config
file, while "find_library()" is a fallback for literally just trying to
find a library that doesn't have a .pc file.


When specifying dependencies, it's best to explicitly state the lookup
method as pkg-config (only), because if not found via pkg-config, meson
will by default then attempt to use cmake (if present) to find the
requested package, and that can cause issues with cmake finding the
incorrect package version e.g. when doing 32-bit builds on 64-bit systems.
There is almost certainly a way to configure cmake not to do this, but by
limiting search to pkg-config it saves us having to document how to
configure proper library search paths for multiple tools. Setting
PKG_CONFIG_LIBDIR should be enough!

/Bruce


More information about the dev mailing list