diff options
author | Klaus Aehlig <klaus.aehlig@huawei.com> | 2023-09-27 17:04:45 +0200 |
---|---|---|
committer | Klaus Aehlig <klaus.aehlig@huawei.com> | 2023-09-28 12:58:09 +0200 |
commit | e19b55e9101b77146a9b71d3299097f6b23b0ea6 (patch) | |
tree | 99882b8e849a589882c76f0d7300934a72170e3b /CC/pkgconfig/RULES | |
parent | 7a7bdef2344c4982d35493a6ce8c5be7b9dfa812 (diff) | |
download | rules-cc-e19b55e9101b77146a9b71d3299097f6b23b0ea6.tar.gz |
["CC/pkgconfig", "system_library"] Add -rpath
When a shared library is picked up from the host system via pkg-config
that is located at a non-standard location, binaries linked against
this library by a standard linker either need LD_LIBRARY_PATH set
appropriately, or -rpath set at link time. However, not all custom
installations set -rpath in the link flags in their pkg-config file.
Therefore, in order to get working binaries (and not have to set
custom paths in tests), add a -rpath for every -L option found in
the ldflags provided by pkg-config.
Diffstat (limited to 'CC/pkgconfig/RULES')
-rw-r--r-- | CC/pkgconfig/RULES | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/CC/pkgconfig/RULES b/CC/pkgconfig/RULES index 4424cb2..1d3b613 100644 --- a/CC/pkgconfig/RULES +++ b/CC/pkgconfig/RULES @@ -1,7 +1,8 @@ { "system_library": { "doc": ["A system library via pkg-config"] , "string_fields": ["name", "args", "stage"] - , "implicit": {"defaults": [["./", "..", "defaults"]]} + , "implicit": + {"defaults": [["./", "..", "defaults"]], "add_rpath": ["add_rpath"]} , "config_vars": ["PKG_CONFIG_ARGS", "ENV"] , "field_doc": { "name": ["The pkg-config name of the library."] |