]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
Allow the use of a listing file if the archiver supports it.
authorPeter Rosin <peda@lysator.liu.se>
Fri, 13 Aug 2010 11:11:54 +0000 (13:11 +0200)
committerPeter Rosin <peda@lysator.liu.se>
Fri, 13 Aug 2010 11:11:54 +0000 (13:11 +0200)
* libltdl/m4/libtool.m4 (_LT_CMD_OLD_ARCHIVE): Move detection
of a suitable archiver...
(_LT_PROG_AR): ...to here. New macro, also detect if the
archiver supports a listing file with the new variable
archiver_list_spec.
* libltdl/config/ltmain.m4sh: If the archiver supports a listing
file, use it when max_cmd_len is exceeded.  This is needed for
tool chains such as MSVC which do not support piece by piece
linking (-r -o).
* doc/libtool.texi (libtool script contents): Update with
archiver_list_spec description.

Signed-off-by: Peter Rosin <peda@lysator.liu.se>
ChangeLog
doc/libtool.texi
libltdl/config/ltmain.m4sh
libltdl/m4/libtool.m4

index ce4c9dbfb3291642aca562bed5dbac27f745a5c1..59e94e4f0878a6dd44de4c2a7ce58de5657e3130 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,18 @@
+2010-08-13  Peter Rosin  <peda@lysator.liu.se>
+
+       Allow the use of a listing file if the archiver supports it.
+       * libltdl/m4/libtool.m4 (_LT_CMD_OLD_ARCHIVE): Move detection
+       of a suitable archiver...
+       (_LT_PROG_AR): ...to here. New macro, also detect if the
+       archiver supports a listing file with the new variable
+       archiver_list_spec.
+       * libltdl/config/ltmain.m4sh: If the archiver supports a listing
+       file, use it when max_cmd_len is exceeded.  This is needed for
+       tool chains such as MSVC which do not support piece by piece
+       linking (-r -o).
+       * doc/libtool.texi (libtool script contents): Update with
+       archiver_list_spec description.
+
 2010-08-10  Gary V. Vaughan  <gary@gnu.org>  (tiny change)
 
        Make testsuite compatible with Autoconf 2.62 again.
index 914bd1d8222e51246d267401d3b801af085e6d80..606b232ed8a7712dce670447a8bdb6092892c59e 100644 (file)
@@ -5875,6 +5875,10 @@ Commands used to create shared libraries, shared libraries with
 @option{-export-symbols} and static libraries, respectively.
 @end defvar
 
+@defvar archiver_list_spec
+Specify filename containing input files for @code{AR}.
+@end defvar
+
 @defvar old_archive_from_new_cmds
 If the shared library depends on a static library,
 @samp{old_archive_from_new_cmds} contains the commands used to create that
index d67752956b0933a46e0d0f1420457e4f512ee2a0..d334b65346ae0862146144c843f95a76aae2320b 100644 (file)
@@ -7900,6 +7900,14 @@ EOF
        len=$func_len_result
        if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
          cmds=$old_archive_cmds
+       elif test -n "$archiver_list_spec"; then
+         func_verbose "using command file archive linking..."
+         for obj in $oldobjs
+         do
+           $ECHO "$obj"
+         done > $output_objdir/$libname.libcmd
+         oldobjs=" $archiver_list_spec$output_objdir/$libname.libcmd"
+         cmds=$old_archive_cmds
        else
          # the command line is too long to link in one step, link in parts
          func_verbose "using piecewise archive linking..."
index c36a6b4c60f7b7f1d9227202e98cf4dba8eb87c4..891a9f8f9fd2ea90375c5717a0925a5b4a09d3a7 100644 (file)
@@ -1312,14 +1312,42 @@ need_locks="$enable_libtool_lock"
 ])# _LT_ENABLE_LOCK
 
 
+# _LT_PROG_AR
+# -----------
+m4_defun([_LT_PROG_AR],
+[AC_CHECK_TOOLS(AR, [ar], false)
+: ${AR=ar}
+: ${AR_FLAGS=cru}
+_LT_DECL([], [AR], [1], [The archiver])
+_LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive])
+
+AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file],
+  [lt_cv_ar_at_file=no
+   AC_COMPILE_IFELSE([[int some_variable = 0;]],
+     [echo conftest.$ac_objext > conftest.lst
+      am_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst'
+      AC_TRY_EVAL([am_ar_try])
+      if test "$ac_status" -eq 0; then
+        lt_cv_ar_at_file=@
+      fi
+      rm -f conftest.* libconftest.a
+     ])
+  ])
+
+if test "x$lt_cv_ar_at_file" = xno; then
+  archiver_list_spec=
+else
+  archiver_list_spec=$lt_cv_ar_at_file
+fi
+_LT_DECL([], [archiver_list_spec], [1],
+  [How to feed a file listing to the archiver])
+])# _LT_PROG_AR
+
+
 # _LT_CMD_OLD_ARCHIVE
 # -------------------
 m4_defun([_LT_CMD_OLD_ARCHIVE],
-[AC_CHECK_TOOL(AR, ar, false)
-test -z "$AR" && AR=ar
-test -z "$AR_FLAGS" && AR_FLAGS=cru
-_LT_DECL([], [AR], [1], [The archiver])
-_LT_DECL([], [AR_FLAGS], [1])
+[_LT_PROG_AR
 
 AC_CHECK_TOOL(STRIP, strip, :)
 test -z "$STRIP" && STRIP=: