summaryrefslogtreecommitdiffstats
path: root/m4macros
diff options
context:
space:
mode:
authorAndrei Pavel <andrei@isc.org>2021-07-28 10:14:14 +0200
committerAndrei Pavel <andrei@isc.org>2021-08-12 17:33:27 +0200
commit4b94ea4e67e171ab5b80d5385e262197994e23d9 (patch)
tree8518071e5651e6d398de5eabf680b3e06fb13272 /m4macros
parent[#1990] AX_DISPLAY_LIBRARY_WARNINGS (diff)
downloadkea-4b94ea4e67e171ab5b80d5385e262197994e23d9.tar.xz
kea-4b94ea4e67e171ab5b80d5385e262197994e23d9.zip
[#1990] AX_FIND_LIBRARY: append usual paths in PKG_CONFIG_PATH
Diffstat (limited to 'm4macros')
-rw-r--r--m4macros/ax_find_library.m419
1 files changed, 10 insertions, 9 deletions
diff --git a/m4macros/ax_find_library.m4 b/m4macros/ax_find_library.m4
index be949d181a..7ef77b42f9 100644
--- a/m4macros/ax_find_library.m4
+++ b/m4macros/ax_find_library.m4
@@ -165,14 +165,15 @@ AC_DEFUN([AX_FIND_LIBRARY_WITH_PKG_CONFIG], [
LIBRARY_FOUND=false
# Check that we have pkg-config installed on the system.
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
- # Save the previous PKG_CONFIG_PATH.
- save_pkg_config_path="${PKG_CONFIG_PATH}"
- # Append the requested paths.
- export PKG_CONFIG_PATH="${PKG_CONFIG_PATH}:${pkg_config_paths}"
+ # Save the previous PKG_CONFIG_PATH.
+ save_pkg_config_path="${PKG_CONFIG_PATH}"
+
+ # 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}"
+ # Check that pkg-config is able to interpret the file.
+ if "${PKG_CONFIG}" "${library_pc_or_name}" > /dev/null 2>&1; then
# Get the flags.
LIBRARY_CPPFLAGS=$("${PKG_CONFIG}" --cflags-only-other "${library_pc_or_name}")
LIBRARY_INCLUDEDIR=$("${PKG_CONFIG}" --cflags-only-I "${library_pc_or_name}")
@@ -187,12 +188,12 @@ AC_DEFUN([AX_FIND_LIBRARY_WITH_PKG_CONFIG], [
export "${i}"="$("${PKG_CONFIG}" --variable="${i}" "${library_pc_or_name}")"
done
- # Restore the previous PKG_CONFIG_PATH.
- PKG_CONFIG_PATH="${save_pkg_config_path}"
-
# Mark that we have the required flags for our library.
LIBRARY_FOUND=true
fi
+
+ # Restore the previous PKG_CONFIG_PATH.
+ PKG_CONFIG_PATH="${save_pkg_config_path}"
fi
])