]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
With help from Michael Matz <matz@kde.org>:
authorRobert Boehne <rboehne@ricardo-us.com>
Wed, 28 Nov 2001 21:50:32 +0000 (21:50 +0000)
committerRobert Boehne <rboehne@gnu.org>
Wed, 28 Nov 2001 21:50:32 +0000 (21:50 +0000)
* ltmain.in:  Add a new command line argument
--preserve-dup-deps for preserving duplicate
dependent libraries.
* libtool.texi: Document it.

ChangeLog
doc/libtool.texi
ltmain.in

index f393de3c57e37d2e21f2e763168a6ef4536ea63a..4c5b7e261f5d236fff238adbbd8e3b8a0978f0c2 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2001-11-28  Robert Boehne  <rboehne@ricardo-us.com>
+
+       With help from Michael Matz <matz@kde.org>:
+       * ltmain.in:  Add a new command line argument
+       --preserve-dup-deps for preserving duplicate
+       dependent libraries.
+       * libtool.texi: Document it.
+
 2001-11-28  Gary V. Vaughan  <gary@gnu.org>
 
        * libtoolize.in: The test for whether AC_PROG_LIBTOOL is defined
index 28921aba3c26b0bd8a4e08509562f7d2faef04ef..0e2101ded92df606c9e81e609f7a7c5a95f63430 100644 (file)
@@ -1063,6 +1063,15 @@ be executed by libtool.
 Display basic configuration options.  This provides a way for packages
 to determine whether shared or static libraries will be built.
 
+@item --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}.
 
@@ -4106,10 +4115,10 @@ they are bundled with:
 @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
-@code{rs6000-*-*}) 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.}
@@ -4148,15 +4157,9 @@ Particularly, if a pair of static archives each resolve some of the
 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:
-
-@example
-$ libtool ... -lfoo -lbar -Wl,-lfoo
-@end example
+the link line by default.  Libtool provides the command line option
+@samp{--preserve-dup-deps} to preserve all duplicate dependencies
+in cases where it is necessary.
 
 @node Archivers
 @subsection Archivers
index 34d96f3b03ca62d6a04d679cdba283be07cfb5d9..b9656746b86eba001e0e9e83c4d995a933766a97 100644 (file)
--- a/ltmain.in
+++ b/ltmain.in
@@ -177,6 +177,8 @@ do
   --mode) prevopt="--mode" prev=mode ;;
   --mode=*) mode="$optarg" ;;
 
+  --preserve-dup-deps) duplicate_deps="yes" ;;
+
   --quiet | --silent)
     show=:
     ;;
@@ -1330,9 +1332,11 @@ compiler."
     # 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
     deplibs=
@@ -1557,9 +1561,11 @@ compiler."
            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
@@ -1682,9 +1688,11 @@ compiler."
              # 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
@@ -1984,9 +1992,11 @@ compiler."
          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