path: root/buildtools
diff options
authorThomas Monjalon <>2019-01-09 15:23:19 +0100
committerFerruh Yigit <>2019-01-14 17:44:29 +0100
commit2c0dd7b69fb00fc3e422a6058ff8429edc869f68 (patch)
treefeeb13844b171079eaf058825c1fca2cfecb4b5c /buildtools
parent72b934adce8f5f9ed035c04ebed8b386243e5a2e (diff)
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 <> Acked-by: Shahaf Shuler <>
Diffstat (limited to 'buildtools')
1 files changed, 14 insertions, 0 deletions
diff --git a/buildtools/ b/buildtools/
new file mode 100755
index 0000000..0f285a3
--- /dev/null
+++ b/buildtools/
@@ -0,0 +1,14 @@
+#! /bin/sh
+# SPDX-License-Identifier: BSD-3-Clause
+# Print link options -l for static link of ibverbs.
+# Static flavour of ibverbs and the providers libs are explicitly picked,
+# thanks to the syntax -l:libfoo.a
+# Other libs (pthread and nl) are unchanged, i.e. linked dynamically by default.
+# PKG_CONFIG_PATH may be required to be set if libibverbs.pc is not installed.
+pkg-config --libs-only-l --static libibverbs |
+ tr '[:space:]' '\n' |
+ sed -r '/^-l(pthread|nl)/! s,(^-l)(.*),\1:lib\2.a,'