2
0
mirror of https://gitlab.isc.org/isc-projects/kea synced 2025-08-31 22:15:23 +00:00

[#2049] AX_FIND_LIBRARY: add libdir to rpath

This commit is contained in:
Andrei Pavel
2021-09-07 11:37:42 +03:00
committed by Andrei Pavel
parent 6fe151c002
commit 089243ff32
2 changed files with 12 additions and 3 deletions

View File

@@ -101,7 +101,10 @@ AC_DEFUN([AX_FIND_LIBRARY], [
fi fi
libraries_found=true libraries_found=true
LIBRARY_LIBS="-L${p}/lib -Wl,-rpath=${p}/lib" LIBRARY_LIBS="-L${p}/lib"
if test -n "${ISC_RPATH_FLAG}"; then
LIBRARY_LIBS="${LIBRARY_LIBS} ${ISC_RPATH_FLAG}${p}/lib"
fi
for i in ${list_of_libraries}; do for i in ${list_of_libraries}; do
i_found=false i_found=false
for l in lib lib64; do for l in lib lib64; do
@@ -129,11 +132,17 @@ AC_DEFUN([AX_FIND_LIBRARY], [
fi fi
fi fi
# Remove leading and trailing spaces.
if "${LIBRARY_FOUND}"; then if "${LIBRARY_FOUND}"; then
# Remove leading and trailing spaces.
LIBRARY_CPPFLAGS="$(printf '%s' "${LIBRARY_CPPFLAGS}" | sed 's/^ *//g;s/ *$//g')" LIBRARY_CPPFLAGS="$(printf '%s' "${LIBRARY_CPPFLAGS}" | sed 's/^ *//g;s/ *$//g')"
LIBRARY_INCLUDEDIR="$(printf '%s' "${LIBRARY_INCLUDEDIR}" | sed 's/^ *//g;s/ *$//g')" LIBRARY_INCLUDEDIR="$(printf '%s' "${LIBRARY_INCLUDEDIR}" | sed 's/^ *//g;s/ *$//g')"
LIBRARY_LIBS="$(printf '%s' "${LIBRARY_LIBS}" | sed 's/^ *//g;s/ *$//g')" LIBRARY_LIBS="$(printf '%s' "${LIBRARY_LIBS}" | sed 's/^ *//g;s/ *$//g')"
# Add to the runtime search path if the flag is not already added.
if test -n "${ISC_RPATH_FLAG}" && test "$(printf '%s\n' "${LIBRARY_LIBS}" | grep -Fc -e "${ISC_RPATH_FLAG}")" = 0; then
library_location=$(printf '%s\n' "${LIBRARY_LIBS}" | grep -Eo '\-L.*\b' | sed 's/-L//g')
LIBRARY_LIBS="${LIBRARY_LIBS} ${ISC_RPATH_FLAG}${library_location}"
fi
fi fi
]) ])