summaryrefslogtreecommitdiffstats
path: root/m4macros
diff options
context:
space:
mode:
authorAndrei Pavel <andrei@isc.org>2021-08-13 11:07:46 +0200
committerAndrei Pavel <andrei@isc.org>2021-08-13 12:29:14 +0200
commit4ad1cf13fed9d9fec23c6bba149732843090bf17 (patch)
treeb392317ac417f101c8c00514ff22bb19e2f608ca /m4macros
parent[#1978] ChangeLog added (diff)
downloadkea-4ad1cf13fed9d9fec23c6bba149732843090bf17.tar.xz
kea-4ad1cf13fed9d9fec23c6bba149732843090bf17.zip
[#1990] add directory of .pc file to pkgconf path
Diffstat (limited to 'm4macros')
-rw-r--r--m4macros/ax_find_library.m414
1 files changed, 8 insertions, 6 deletions
diff --git a/m4macros/ax_find_library.m4 b/m4macros/ax_find_library.m4
index ba2c595d5b..74039eaa6b 100644
--- a/m4macros/ax_find_library.m4
+++ b/m4macros/ax_find_library.m4
@@ -50,12 +50,7 @@ AC_DEFUN([AX_FIND_LIBRARY], [
if test -f "${library_pc}"; then
if test -n "${PKG_CONFIG}"; then
- # Check that pkg-config is able to interpret the file.
- if "${PKG_CONFIG}" "${library_pc}" > /dev/null 2>&1; then
- AX_FIND_LIBRARY_WITH_PKG_CONFIG("${library_pc}", ["${list_of_variables}"], ["${pkg_config_paths}"])
- else
- AX_ADD_TO_LIBRARY_WARNINGS(["pkg-config ${library_pc}" doesn't work properly. It seems like a bad pkg-config file.])
- fi
+ AX_FIND_LIBRARY_WITH_PKG_CONFIG("${library_pc}", ["${list_of_variables}"], ["${pkg_config_paths}"])
else
AX_ADD_TO_LIBRARY_WARNINGS([pkg-config file found at ${library_pc}, but pkg-config is not available])
fi
@@ -169,6 +164,13 @@ AC_DEFUN([AX_FIND_LIBRARY_WITH_PKG_CONFIG], [
# Save the previous PKG_CONFIG_PATH.
save_pkg_config_path="${PKG_CONFIG_PATH}"
+ # If file was given, append its residing directory to PKG_CONFIG_PATH.
+ # Some old versions of pkg-config (e.g. 0.29.1 in Ubuntu 20.04) seem to
+ # require it when searching for dependencies.
+ if test -f "${library_pc_or_name}"; then
+ pkg_config_paths="${pkg_config_paths}:$(dirname "${library_pc_or_name}")"
+ fi
+
# Append some usual paths and the requested paths.
export PKG_CONFIG_PATH="${PKG_CONFIG_PATH}:/usr/lib/pkgconfig:/usr/local/lib/pkgconfig:${pkg_config_paths}"