[dpdk-dev] [PATCH] build: add combined libs
Luca Boccassi
bluca at debian.org
Thu Feb 20 11:13:44 CET 2020
On Wed, 2020-02-19 at 11:13 -0800, Ruslan Babayev wrote:
> Add combined libdpdk.a and libdpdk.so libs for Meson similar to how
> it's done for Make builds
>
> Signed-off-by: Ruslan Babayev <
> ruslan at babayev.com
> >
> ---
> buildtools/group-libs.sh | 2 ++
> buildtools/meson.build | 1 +
> meson.build | 17 +++++++++++++++++
> 3 files changed, 20 insertions(+)
> create mode 100755 buildtools/group-libs.sh
>
> diff --git a/buildtools/group-libs.sh b/buildtools/group-libs.sh
> new file mode 100755
> index 000000000..b6e4c1c35
> --- /dev/null
> +++ b/buildtools/group-libs.sh
> @@ -0,0 +1,2 @@
> +#!/bin/sh
> +echo 'GROUP (' $(echo $* | xargs -n1 basename | sort | xargs) ')'
> diff --git a/buildtools/meson.build b/buildtools/meson.build
> index 9812917e5..eac8bc4ff 100644
> --- a/buildtools/meson.build
> +++ b/buildtools/meson.build
> @@ -6,6 +6,7 @@ subdir('pmdinfogen')
> pkgconf = find_program('pkg-config', 'pkgconf', required: false)
> pmdinfo = find_program('gen-pmdinfo-cfile.sh')
> list_dir_globs = find_program('list-dir-globs.py')
> +group_libs = find_program('group-libs.sh')
> check_experimental_syms = find_program('check-experimental-syms.sh')
> ldflags_ibverbs_static = find_program('options-ibverbs-static.sh')
>
> diff --git a/meson.build b/meson.build
> index b7ae9c8d9..eb6974d35 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -61,6 +61,23 @@ configure_file(output: build_cfg,
> install_dir: join_paths(get_option('includedir'),
> get_option('include_subdir_arch')))
>
> +
> +custom_target('group_shared_libs',
> + input: dpdk_libraries,
> + output: 'libdpdk.so',
> + capture: true,
> + install: true,
> + install_dir: get_option('libdir'),
> + command: [group_libs, '@INPUT@'])
> +
> +custom_target('group_static_libs',
> + input: dpdk_static_libraries + dpdk_drivers,
> + output: 'libdpdk.a',
> + capture: true,
> + install: true,
> + install_dir: get_option('libdir'),
> + command: [group_libs, '@INPUT@'])
> +
> # for static builds, include the drivers as libs and we need to
> "whole-archive"
> # them.
> dpdk_drivers = ['-Wl,--whole-archive'] + dpdk_drivers + ['-Wl,--no-
> whole-archive']
Hi,
As far as I'm aware all usage of the old hacky linker script can be
replaced with pkg-config, and that's why it was left behind. Same for
the static archive.
Is there any use case that pkg-config doesn't cover?
--
Kind regards,
Luca Boccassi
More information about the dev
mailing list