]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
Search the compiler path too.
authorPeter O'Gorman <peter@pogma.com>
Mon, 28 Jan 2008 15:49:42 +0000 (15:49 +0000)
committerPeter O'Gorman <peter@pogma.com>
Mon, 28 Jan 2008 15:49:42 +0000 (15:49 +0000)
* libtool.m4 (compiler_lib_search_dirs): New variable.
* ltmain.in: Use it.
Reported by Maynard Johnson

ChangeLog
libtool.m4
ltmain.in

index 07997244285424d4ac6337b2004e11ef2a33dcec..70a55be4a73e7cb07cc878c728209802b8ebda17 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2008-01-29  Peter O'Gorman  <peter@pogma.com>
+
+       Search the compiler path too.
+       * libtool.m4 (compiler_lib_search_dirs): New variable.
+       * ltmain.in: Use it.
+       Reported by Maynard Johnson
+
 2008-01-24  Peter O'Gorman  <peter@pogma.com>
 
        * doc/libtool.texi: Fixup Notes.
index 50abc8f3ebb7e780088d307719e5ef4a0f738a12..f83daa5c2420f451f4f14074dda54fcef887cf5f 100644 (file)
@@ -2820,6 +2820,7 @@ _LT_AC_TAGVAR(postdep_objects, $1)=
 _LT_AC_TAGVAR(predeps, $1)=
 _LT_AC_TAGVAR(postdeps, $1)=
 _LT_AC_TAGVAR(compiler_lib_search_path, $1)=
+_LT_AC_TAGVAR(compiler_lib_search_dirs, $1)=
 
 # Source file extension for C++ test sources.
 ac_ext=cpp
@@ -3822,7 +3823,8 @@ lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
 # compiler output when linking a shared library.
 # Parse the compiler output and extract the necessary
 # objects, libraries and library flags.
-AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP],[
+AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP],
+[AC_REQUIRE([LT_AC_PROG_SED])dnl
 dnl we can't use the lt_simple_compile_test_code here,
 dnl because it contains code intended for an executable,
 dnl not a library.  It's possible we should let each
@@ -3947,6 +3949,11 @@ fi
 
 $rm -f confest.$objext
 
+_LT_AC_TAGVAR(compiler_lib_search_dirs, $1)=
+if test -n "$_LT_AC_TAGVAR(compiler_lib_search_path, $1)"; then
+  _LT_AC_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_AC_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'`
+fi
+
 # PORTME: override above test on systems where it is broken
 ifelse([$1],[CXX],
 [case $host_os in
@@ -4003,7 +4010,6 @@ solaris*)
   ;;
 esac
 ])
-
 case " $_LT_AC_TAGVAR(postdeps, $1) " in
 *" -lc "*) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no ;;
 esac
@@ -4269,6 +4275,7 @@ if test -f "$ltmain"; then
     _LT_AC_TAGVAR(predeps, $1) \
     _LT_AC_TAGVAR(postdeps, $1) \
     _LT_AC_TAGVAR(compiler_lib_search_path, $1) \
+    _LT_AC_TAGVAR(compiler_lib_search_dirs, $1) \
     _LT_AC_TAGVAR(archive_cmds, $1) \
     _LT_AC_TAGVAR(archive_expsym_cmds, $1) \
     _LT_AC_TAGVAR(postinstall_cmds, $1) \
@@ -4568,6 +4575,10 @@ predeps=$lt_[]_LT_AC_TAGVAR(predeps, $1)
 # shared library.
 postdeps=$lt_[]_LT_AC_TAGVAR(postdeps, $1)
 
+# The directories searched by this compiler when creating a shared
+# library
+compiler_lib_search_dirs=$lt_[]_LT_AC_TAGVAR(compiler_lib_search_dirs, $1)
+
 # The library search path used internally by the compiler when linking
 # a shared library.
 compiler_lib_search_path=$lt_[]_LT_AC_TAGVAR(compiler_lib_search_path, $1)
index 3dee0baa2477cf8fcb04629320b25a01ff589b29..68320f402590f3cf6310e216a9ae021479e2c518 100644 (file)
--- a/ltmain.in
+++ b/ltmain.in
@@ -2156,7 +2156,12 @@ EOF
            continue
          fi
          name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
-         for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
+         if test "$linkmode" = lib; then
+           searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path"
+         else
+           searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path"
+         fi
+         for searchdir in $searchdirs; do
            for search_ext in .la $std_shrext .so .a; do
              # Search the libtool library
              lib="$searchdir/lib${name}${search_ext}"