libtool-patches
[Top][All Lists]
Advanced

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

Revised documentation in duplicate depencencies patch.


From: Robert Boehne
Subject: Revised documentation in duplicate depencencies patch.
Date: Tue, 27 Nov 2001 13:30:51 -0600

Hello,

Here is a slightly revised patch for adding --preserve-dup-deps as an
option to Libtool.  This patch causes libtool to strip out all
duplicates
in library dependencies by default, but allows for their preservation
when necessary.  The code for this patch is identical to the previous
but a few fixups to the documentation were added.  I'm invoking the
72-hour
rule and checking this in the HEAD.

Thanks!

Robert

-- 
Robert Boehne             Software Engineer
Ricardo Software   Chicago Technical Center
TEL: (630)789-0003 x. 238
FAX: (630)789-0127
email:  address@hidden
Index: ChangeLog
===================================================================
RCS file: /cvsroot/libtool/libtool/ChangeLog,v
retrieving revision 1.1080
diff -u -r1.1080 ChangeLog
--- ChangeLog   2001/11/27 18:49:47     1.1080
+++ ChangeLog   2001/11/27 19:26:47
@@ -1,3 +1,11 @@
+2001-11-27  Robert Boehne  <address@hidden>
+
+       With help from Michael Matz <address@hidden>:
+       * ltmain.in:  Add a new command line argument
+       --preserve-dup-deps for preserving duplicate
+       dependent libraries.
+       * libtool.texi: Document it.
+
 2001-11-27  Kevin Ryde  <address@hidden>
        * libtool.m4 (AC_LIBTOOL_SYS_MAX_CMD_LEN): Send "test"
        warnings to /dev/null, helps FreeBSD and maybe others.
Index: ltmain.in
===================================================================
RCS file: /cvsroot/libtool/libtool/ltmain.in,v
retrieving revision 1.282
diff -u -r1.282 ltmain.in
--- ltmain.in   2001/11/15 01:01:13     1.282
+++ ltmain.in   2001/11/27 19:26:47
@@ -213,6 +213,8 @@
   --mode) prevopt="--mode" prev=mode ;;
   --mode=*) mode="$optarg" ;;
 
+  --preserve-dup-deps) duplicate_deps="yes" ;;
+
   --quiet | --silent)
     show=:
     ;;
@@ -1638,9 +1640,11 @@
     # Find all interdependent deplibs by searching for libraries
     # that are linked more than once (e.g. -la -lb -la)
     for deplib in $deplibs; do
-      case "$libs " in
-      *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
-      esac
+      if test "X$duplicate_deps" = "Xyes" ; then
+       case "$libs " in
+       *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
+       esac
+      fi
       libs="$libs $deplib"
     done
 
@@ -1651,12 +1655,14 @@
       # $postdeps and mark them as special (i.e., whose duplicates are
       # not to be eliminated).
       pre_post_deps=
-      for pre_post_dep in $predeps $postdeps; do
-       case "$pre_post_deps " in
-       *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;;
-       esac
-       pre_post_deps="$pre_post_deps $pre_post_dep"
-      done
+      if test "X$duplicate_deps" = "Xyes" ; then
+       for pre_post_dep in $predeps $postdeps; do
+         case "$pre_post_deps " in
+         *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" 
;;
+         esac
+         pre_post_deps="$pre_post_deps $pre_post_dep"
+       done
+      fi
       pre_post_deps=
     fi
 
@@ -1890,9 +1896,11 @@
            tmp_libs=
            for deplib in $dependency_libs; do
              deplibs="$deplib $deplibs"
-             case "$tmp_libs " in
-             *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
-             esac
+              if test "X$duplicate_deps" = "Xyes" ; then
+               case "$tmp_libs " in
+               *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
+               esac
+              fi
              tmp_libs="$tmp_libs $deplib"
            done
          elif test "$linkmode" != prog && test "$linkmode" != lib; then
@@ -2017,9 +2025,11 @@
              # or/and link against static libraries
              newdependency_libs="$deplib $newdependency_libs"
            fi
-           case "$tmp_libs " in
-           *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
-           esac
+           if test "X$duplicate_deps" = "Xyes" ; then
+             case "$tmp_libs " in
+             *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
+             esac
+           fi
            tmp_libs="$tmp_libs $deplib"
          done # for deplib
          continue
@@ -2334,9 +2344,11 @@
          tmp_libs=
          for deplib in $dependency_libs; do
            newdependency_libs="$deplib $newdependency_libs"
-           case "$tmp_libs " in
-           *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
-           esac
+           if test "X$duplicate_deps" = "Xyes" ; then
+             case "$tmp_libs " in
+             *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
+             esac
+           fi
            tmp_libs="$tmp_libs $deplib"
          done
 
Index: doc/libtool.texi
===================================================================
RCS file: /cvsroot/libtool/libtool/doc/libtool.texi,v
retrieving revision 1.122
diff -u -r1.122 libtool.texi
--- doc/libtool.texi    2001/09/30 10:20:29     1.122
+++ doc/libtool.texi    2001/11/27 19:26:48
@@ -1063,6 +1063,15 @@
 Display basic configuration options.  This provides a way for packages
 to determine whether shared or static libraries will be built.
 
address@hidden --preserve-dup-deps
+Do not remove duplicate dependencies in libraries.  When building packages
+with static libraries, the libraries may depend circularly on each other
+(shared libs can too, but for those it doesn't matter), so there are
+situations, where -la -lb -la is required, and the second -la may not be
+stripped or the link will fail.  In cases where these duplications are
+required, this option will preserve them, only stripping the libraries
+that libtool knows it can safely.
+
 @item --finish
 Same as @samp{--mode=finish}.
 
@@ -4133,10 +4142,10 @@
 @table @code
 @item aix3*
 @itemx aix4*
-AIX compilers have no PIC flags, since AIX has been ported only to
-PowerPC and RS/6000 chips. @footnote{All code compiled for the PowerPC
-and RS/6000 chips (@code{powerpc-*-*}, @code{powerpcle-*-*}, and
address@hidden) is position-independent, regardless of the operating
+Most AIX compilers have no PIC flags, since AIX (with the exception of
+AIX for IA-64) runs on PowerPC and RS/6000 chips. @footnote{All code compiled
+for the PowerPC and RS/6000 chips (@code{powerpc-*-*}, @code{powerpcle-*-*},
+and @code{rs6000-*-*}) is position-independent, regardless of the operating
 system or compiler suite.  So, ``regular objects'' can be used to build
 shared libraries on these systems and no special PIC compiler flags are
 required.}
@@ -4175,15 +4184,9 @@
 other's symbols, it might be necessary to list one of those archives
 both before and after the other one.  Libtool does not currently cope
 with this situation well, since dupicate libraries are removed from
-thr link line.
-
-If you find yourself developing on a host that requires you to list
-libraries multiple times in order for it to generate correctly linked
-objects, you can defeat libtool's removal algorithm like this:
-
address@hidden
-$ libtool ... -lfoo -lbar -Wl,-lfoo
address@hidden example
+the link line by default.  Libtool provides the command line option
address@hidden to preserve all duplicate dependencies
+in cases where it is necessary.
 
 @node Archivers
 @subsection Archivers

reply via email to

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