Commit graph

2 commits

Author SHA1 Message Date
Thomas Monjalon 2cca60310a buildtools: get static mlx dependencies for meson
The shell script options-ibverbs-static.sh was used with make
in forcing static linkage of ibverbs libraries.

When choosing to link with a static dependency in meson,
the generated .pc file will not force such static linkage.
The solution will rely on using this script in meson.

If linking with libraries installed in a non-standard path,
an option -L is provided via EXTRA_LDFLAGS in case of using make.
With meson, tuning PKG_CONFIG_PATH for pkg-config should be enough.
When statically linking an application, the .pc file must save the
-L path so the application link will work without any extra option.
That's why --libs-only-l is replaced with --libs which includes -L.
Options which are neither -l or -L are filtered out because not needed
and can cause compilation issues with the legacy system using make.

The other change in this script is to drop the first occurrences of the
main library file (libiverbs.a). Only the last occurrence is kept.
It fixes some undefined references when linking a static application
using libdpdk.pc.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2020-02-14 12:42:13 +01:00
Thomas Monjalon 2c0dd7b69f config: add static linkage of mlx dependency
The libraries provided by rdma-core may be statically linked
if enabling CONFIG_RTE_IBVERBS_LINK_STATIC in the make-based build.
If CONFIG_RTE_BUILD_SHARED_LIB is disabled, the applications
will embed the mlx PMDs with ibverbs and the mlx libraries.
If CONFIG_RTE_BUILD_SHARED_LIB is enabled,
the mlx PMDs will embed ibverbs and the mlx libraries.

Support with meson may be added later.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
2019-01-14 17:44:29 +01:00