Allow the use of a file listing file if the archiver supports it. Add hint so that the Microsoft lib archiver uses the file listing feature. This patch is against Libtool 2.2 * libltdl/m4/libtool.m4 (_LT_PROG_AR): Indicate 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. Index: libtool/libltdl/config/ltmain.m4sh =================================================================== --- libtool.orig/libltdl/config/ltmain.m4sh +++ libtool/libltdl/config/ltmain.m4sh @@ -7026,6 +7026,15 @@ EOF if len=`expr "X$cmds" : ".*" 2>/dev/null` && test "$len" -le "$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 + save_oldobjs="$oldobjs" + oldobjs=" $archiver_list_spec$output_objdir/$libname.libcmd" + eval cmds=\"\$old_archive_cmds\" + oldobjs="$save_oldobjs" else # the command line is too long to link in one step, link in parts func_verbose "using piecewise archive linking..." Index: libtool/libltdl/m4/libtool.m4 =================================================================== --- libtool.orig/libltdl/m4/libtool.m4 +++ libtool/libltdl/m4/libtool.m4 @@ -1364,6 +1364,7 @@ ar) : ${AR_XFLAGS=x} test -z "$AR_SEP" && AR_SEP=' ' _LT_TAGVAR(ar_extract_one_by_one, $1)=no + _LT_TAGVAR(archiver_list_spec, $1)= ;; lib) : ${AR_FLAGS="-NOLOGO -OUT:"} @@ -1371,6 +1372,7 @@ lib) : ${AR_XFLAGS="-NOLOGO -EXTRACT:"} test -z "$AR_SEP" && AR_SEP='' _LT_TAGVAR(ar_extract_one_by_one, $1)=yes + _LT_TAGVAR(archiver_list_spec, $1)='@' # Don't use ranlib : ${RANLIB=:} ;; @@ -1378,6 +1380,8 @@ esac _LT_DECL([], [ar_extract_one_by_one], [1], [Extract archive members one by one]) +_LT_DECL([], [archiver_list_spec], [1], + [How to feed a file listing to the archiver]) _LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive]) _LT_DECL([], [AR_TFLAGS], [1], [Flags to list archive content])