]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
* ltmain.sh: Detect and handle object name conflicts while
authorLoren James Rittle <rittle@latour.rsch.comm.mot.com>
Mon, 6 May 2002 13:38:13 +0000 (13:38 +0000)
committerRobert Boehne <rboehne@gnu.org>
Mon, 6 May 2002 13:38:13 +0000 (13:38 +0000)
piecewise linking a static library.

ChangeLog
ltmain.in

index ebc04e985e110465a8c3d06861307f465bf2d00c..2d1ff7c55c6a4fd145765cc6b58f2db0f8e8e40f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2002-05-06  Loren James Rittle  <rittle@latour.rsch.comm.mot.com>
+
+       * ltmain.sh: Detect and handle object name conflicts while
+       piecewise linking a static library.
+
 2002-05-02  Dave Vasilevsky  <thevas@mac.com>
 
        * ltmain.in: Remove convenience libraries from deplibs for Darwin.
index c6865f442028f1f240cd074d01080a51b39099f9..4487ab72d7420ffea8f2efdbbdccdb42b3f6b598 100644 (file)
--- a/ltmain.in
+++ b/ltmain.in
@@ -4326,6 +4326,20 @@ fi\
          objlist=
          concat_cmds=
          save_oldobjs=$oldobjs
+         # GNU ar 2.10+ was changed to match POSIX; thus no paths are
+         # encoded into archives.  This makes 'ar r' malfunction in
+         # this piecewise linking case whenever conflicting object
+         # names appear in distinct ar calls; check, warn and compensate.
+           if (for obj in $save_oldobjs
+           do
+             $echo "X$obj" | $Xsed -e 's%^.*/%%'
+           done | sort | sort -uc >/dev/null 2>&1); then
+           :
+         else
+           $echo "$modename: warning: object name conflicts; overriding AR_FLAGS to 'cq'" 1>&2
+           $echo "$modename: warning: to ensure that POSIX-compatible ar will work" 1>&2
+           AR_FLAGS=cq
+         fi
          for obj in $save_oldobjs
          do
            oldobjs="$objlist $obj"