From e19b55e9101b77146a9b71d3299097f6b23b0ea6 Mon Sep 17 00:00:00 2001 From: Klaus Aehlig Date: Wed, 27 Sep 2023 17:04:45 +0200 Subject: ["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. --- CC/pkgconfig/RULES | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'CC/pkgconfig/RULES') 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."] -- cgit v1.2.3