When the ABI is 64-bit on Linux ELF, add /lib64 and /usr/lib64 to the
system library path so that an RPATH is not added when using libraries
from these directories.

Signed-off-by: Dan Nicholson <dbn.li...@gmail.com>
---
 libltdl/m4/libtool.m4 |   16 +++++++++++++++-
 1 files changed, 15 insertions(+), 1 deletions(-)

diff --git a/libltdl/m4/libtool.m4 b/libltdl/m4/libtool.m4
index b75a55a..b6a2435 100644
--- a/libltdl/m4/libtool.m4
+++ b/libltdl/m4/libtool.m4
@@ -2410,10 +2410,24 @@ linux* | k*bsd*-gnu | kopensolaris*-gnu)
   # before this can be enabled.
   hardcode_into_libs=yes
 
+  # Find out the system library path by ABI.
+  echo 'int i;' > conftest.$ac_ext
+  if AC_TRY_EVAL(ac_compile); then
+    case `/usr/bin/file conftest.o` in
+      *64-bit*)
+       sys_lib_dlsearch_path_spec="/lib /lib64 /usr/lib /usr/lib64"
+       ;;
+      *)
+       sys_lib_dlsearch_path_spec="/lib /usr/lib"
+       ;;
+    esac
+  fi
+  rm -rf conftest*
+
   # 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;/^$/d' | tr '\n' ' '`
-    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
+    sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra"
   fi
 
   # We used to test for /lib/ld.so.1 and disable shared libraries on
-- 
1.5.6.6



_______________________________________________
http://lists.gnu.org/mailman/listinfo/libtool

Reply via email to