libtool-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Libtool incorrectly adds dependency libs to $deplibs


From: Albert Chin
Subject: Libtool incorrectly adds dependency libs to $deplibs
Date: Sun, 8 Feb 2004 13:31:44 -0600
User-agent: Mutt/1.4i

When libtool adds a .la file to $deplibs, it first adds the library
name to $deplibs and if $link_all_deplibs=yes, each dependency library
is added to the library search path with -L. However, when libtool
does this, it places non-duplicated -L paths *before* other $deplibs
entries. Why doesn't libtool add the new -L paths *before* the
library name entry from the .la file? If we agree this is the correct
behavior, patch below.

-- 
albert chin (address@hidden)

-- snip snip
2004-02-08  Albert Chin-A-Young  <address@hidden>

        * ltmain.in: If $link_all_deplibs=yes and a .la library
        has been added to $deplibs, add $dependency_libs immediately
        after the library name in $deplibs, not first.

Index: ltmain.in
===================================================================
RCS file: /cvsroot/libtool/libtool/ltmain.in,v
retrieving revision 1.334.2.23
diff -u -3 -p -r1.334.2.23 ltmain.in
--- ltmain.in   5 Feb 2004 14:50:29 -0000       1.334.2.23
+++ ltmain.in   8 Feb 2004 19:28:53 -0000
@@ -2246,6 +2295,7 @@ EOF
        fi
 
        link_static=no # Whether the deplib will be linked statically
+       add_deplib_after_libname=no # Add deplibs after libname in $deplibs
        if test -n "$library_names" &&
           { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
          if test "$installed" = no; then
@@ -2426,6 +2477,8 @@ EOF
              test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
              test -n "$add" && compile_deplibs="$add $compile_deplibs"
            else
+             add_deplib_after_libname=yes
+
              test -n "$add_dir" && deplibs="$add_dir $deplibs"
              test -n "$add" && deplibs="$add $deplibs"
              if test "$hardcode_direct" != yes && \
@@ -2479,6 +2536,8 @@ EOF
              test -n "$add_dir" && finalize_deplibs="$add_dir 
$finalize_deplibs"
              test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
            else
+             add_deplib_after_libname=yes
+
              test -n "$add_dir" && deplibs="$add_dir $deplibs"
              test -n "$add" && deplibs="$add $deplibs"
            fi
@@ -2646,11 +2706,27 @@ EOF
              esac
              case " $deplibs " in
              *" $depdepl "*) ;;
-             *) deplibs="$deplibs $depdepl" ;;
+              *)
+               if test "$add_deplib_after_libname" = yes; then
+                 set dummy $deplibs
+                 shift; deplibs="$1"
+                 shift; deplibs="$deplibs"" $depdepl $@"
+               else
+                 deplibs="$deplibs $depdepl"
+               fi
+               ;;
              esac            
              case " $deplibs " in
              *" $path "*) ;;
-             *) deplibs="$deplibs $path" ;;
+              *)
+               if test "$add_deplib_after_libname" = yes; then
+                 set dummy $deplibs
+                 shift; deplibs="$1"
+                 shift; deplibs="$deplibs"" $path $@"
+               else
+                 deplibs="$deplibs $path"
+               fi
+               ;;
              esac
            done
          fi # link_all_deplibs != no




reply via email to

[Prev in Thread] Current Thread [Next in Thread]