Thread (46 messages) 46 messages, 8 authors, 2021-07-07

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

From: Bruce Richardson <hidden>
Date: 2021-06-03 08:15:01

On Thu, Jun 03, 2021 at 09:53:44AM +0200, David Marchand wrote:
On Thu, Jun 3, 2021 at 9:23 AM David Marchand [off-list ref]
wrote:
quoted
quoted
quoted
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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help