2 # SPDX-License-Identifier: BSD-3-Clause
4 # Print link options -l for static link of ibverbs.
6 # Static flavour of ibverbs and the providers libs are explicitly picked,
7 # thanks to the syntax -l:libfoo.a
8 # Other libs (pthread and nl) are unchanged, i.e. linked dynamically by default.
10 # PKG_CONFIG_PATH may be required to be set if libibverbs.pc is not installed.
15 pkg-config --libs --static $lib |
17 sed -r "/^-l($deps)/! s,(^-l)(.*),\1:lib\2.a," | # explicit .a
18 sed -n '/^-[Ll]/p' | # extra link options may break with make
20 awk "/^-l:$lib.a/&&c++ {next} 1" | # drop first duplicates of main lib