From 42bcbdf4ffb7fe16d98ff264e11fd0d1b5e8d013 Mon Sep 17 00:00:00 2001 From: Toshio Kuratomi Date: Mon, 15 Nov 2010 08:42:50 -0800 Subject: [PATCH] Olly Bett's patch to use ldconfig so that multilib boxes properly pick up /lib64 and /usr/lib64 as being in the default search path with the following changes suggested by Ralf Wildenhues: * Make sed invokation portable to non-GNU sed * Don't hardcode /sbin/ldconfig * Use old detection code as a fallback Additionally: don't hardcode sed use $SED --- libltdl/m4/libtool.m4 | 14 ++++++++++---- 1 files changed, 10 insertions(+), 4 deletions(-) diff --git a/libltdl/m4/libtool.m4 b/libltdl/m4/libtool.m4 index d8b3a4d..4365b68 100644 --- a/libltdl/m4/libtool.m4 +++ b/libltdl/m4/libtool.m4 @@ -2612,10 +2612,16 @@ linux* | k*bsd*-gnu | kopensolaris*-gnu) # before this can be enabled. hardcode_into_libs=yes - # Append ld.so.conf contents to the search path - if test -f /etc/ld.so.conf; then - lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` - sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" + # Try to extract search path from ldconfig + ldconfig_search_path=`PATH="\$PATH:/sbin" ldconfig -N -X -v 2>/dev/null | $SED -e 's|^\(/.*\):\( (.*)\)\{0,1\}$|\1|p;d'` + + if test 0 -ne $? -o -z "$ldconfig_search_path" ; then + # Append ld.so.conf contents to the search path + if test -f /etc/ld.so.conf; then + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" + elif test -n "$ldconfig_search_path"; then + sys_lib_dlsearch_path_spec=$ldconfig_search_path fi # We used to test for /lib/ld.so.1 and disable shared libraries on -- 1.7.2.3