Skip to content

Commit

Permalink
build: add libarchive to optional external dependencies
Browse files Browse the repository at this point in the history
[ upstream commit 22f7184e8b5f1b546ac26dd0bde8c3c6038a7e03 ]

In order to avoid linking with Libs.private, libarchive
is not added to ext_deps during the meson setup stage.

Since libarchive is not added to ext_deps, cross-compilation
or native compilation with libarchive installed in non-standard
location fails with errors related to "cannot find -larchive"
or "archive.h: No such file or directory". In order to fix the
build failures, user is required to define the 'c_args' and
'c_link_args' with '-I<includedir>' and '-L<libdir>'.

This patch adds libarchive to ext_deps and further would not
require setting c_args and c_link_args externally.

Fixes: 40edb9c ("eal: handle compressed firmware")

Signed-off-by: Srikanth Yalavarthi <syalavarthi@marvell.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
  • Loading branch information
syalavarthi authored and kevintraynor committed Nov 16, 2023
1 parent c268e6c commit aa40722
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
5 changes: 0 additions & 5 deletions config/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -207,11 +207,6 @@ dpdk_conf.set('RTE_BACKTRACE', cc.has_header('execinfo.h') or is_windows)
libarchive = dependency('libarchive', required: false, method: 'pkg-config')
if libarchive.found()
dpdk_conf.set('RTE_HAS_LIBARCHIVE', 1)
# Push libarchive link dependency at the project level to support
# statically linking dpdk apps. Details at:
# https://inbox.dpdk.org/dev/20210605004024.660267a1@sovereign/
add_project_link_arguments('-larchive', language: 'c')
dpdk_extra_ldflags += '-larchive'
endif

# check for libbsd
Expand Down
3 changes: 3 additions & 0 deletions lib/eal/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ endif
if dpdk_conf.has('RTE_USE_LIBBSD')
ext_deps += libbsd
endif
if dpdk_conf.has('RTE_HAS_LIBARCHIVE')
ext_deps += libarchive
endif
if cc.has_function('getentropy', prefix : '#include <unistd.h>')
cflags += '-DRTE_LIBEAL_USE_GETENTROPY'
endif

0 comments on commit aa40722

Please sign in to comment.