Hi Michael and Stephan,

On Fri, Jun 02, 2000 at 10:38:54PM +0200, Michael Matz wrote:
> On Fri, 2 Jun 2000, Stephan Kulow wrote:
> I only wanted to add, that $predeps are added before $libs if
> $linkmode==lib. This is also a problem, because e.g for me $predeps
> contains "-L/usr/local/lib/gcc-lib/i586-pc-linux-gnu/2.95.3
> -L/usr/local/lib". This also gets added in _front_ of the user specified
> -L* by libtool and may have undesired side effect. The problem is, that in
> the output of the compiler command which is parsed to get the libstdc++,
> these -L* are in front of the conftest.o.
> Now g++ itself of course would add any user specified -L* in front of
> them, and so should libtool too.

Thanks for pointing that out.  How does the following patch look to you?

Index: ltmain.in
===================================================================
RCS file: /cvs/libtool/ltmain.in,v
retrieving revision 1.200.2.19
diff -u -r1.200.2.19 ltmain.in
--- ltmain.in   2000/05/29 10:40:46     1.200.2.19
+++ ltmain.in   2000/06/03 21:23:09
@@ -1469,8 +1469,20 @@
       libs="$libs $deplib"
     done
 
-    if test $linkmode = lib; then
-      libs="$predeps $libs $postdeps"
+    if test $linkmode = lib; the
+      # Internal compiler library paths should come after those
+      # provided the user.  The postdeps already come after the user
+      # supplied libs so there is no need to process them.
+      old_predeps=$predeps
+      new_predeps=
+      predeps_lib_path=
+      for p in $old_predeps; do
+        case "$p" in
+       -L*|-R*) predeps_lib_path="$predeps_lib_path $p";;
+       *) new_predeps="$new_predeps $p";;
+       esac
+      done
+      libs="$new_predeps $libs $predeps_lib_path $postdeps"
     fi
 
     deplibs=

> Furthermore this wrong ordering is saved into the .la files and every
> other lib I want to link against them picks that up.

The above patch should fix the problem.

-Ossama
-- 
Ossama Othman <[EMAIL PROTECTED]>
Distributed Object Computing Laboratory, Univ. of California at Irvine
1024D/F7A394A8 - 84ED AA0B 1203 99E4 1068  70E6 5EB7 5E71 F7A3 94A8

Reply via email to