* config/ltmain.m4sh (OUTPUT_LONG_LIST): New macro to output lists which may exceed the command line length. (func_mode_link): Use OUTPUT_LONG_LIST. Index: config/ltmain.m4sh =================================================================== RCS file: /cvsroot/libtool/libtool/config/ltmain.m4sh,v retrieving revision 1.66 diff -u -r1.66 ltmain.m4sh --- config/ltmain.m4sh 27 Apr 2005 20:30:38 -0000 1.66 +++ config/ltmain.m4sh 19 May 2005 20:18:50 -0000 @@ -2143,6 +2139,30 @@ } +dnl OUTPUT_LONG_LIST(LIST, TEMPFILE, [SEDSCRIPT]) +dnl --------------------------------------------- +dnl Output LIST, which may be longer than the command line length, +dnl one item per line. LIST should be a whitespace-separates list. +dnl Leading, trailing, and multiple spaces will be removed. +dnl Optional post-processing may be done with SEDSCRIPT. +dnl This macro may need to use TEMPFILE as a temporary scratch space. +dnl The output is on STDOUT by default and may be redirected. +dnl May be used within backquotes, but not double-quoted backquotes. +dnl This macro is fast with a builtin $ECHO and/or a short list. +dnl +m4_define([OUTPUT_LONG_LIST], +[if $ECHO "X$1" >$2 2>/dev/null +then + $SP2NL <$2 | $Xsed -e '/^$/d' m4_if([$3],,, [-e $3]) +else +dnl You will appreciate the minutes spent in this loop.. + for tmp_elem in $1 + do + $ECHO "X$tmp_elem" + done | $SED -e 's/^X//' m4_if([$3],,, [-e $3]) +fi])dnl + + # func_mode_link arg... func_mode_link () { @@ -4484,7 +4538,8 @@ oldlibs="$oldlibs $output_objdir/$libname.$libext" # Transform .lo files to .o files. - oldobjs="$objs "`$ECHO "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP` + oldobjs="$objs "`OUTPUT_LONG_LIST([$libobjs], ["$always_gentop/scratch1"], + ["/\\.${libext}\$/d;$lo2o"]) | $NL2SP` fi # Eliminate all temporary directories. @@ -4977,7 +5032,10 @@ done # Use standard objects if they are pic - test -z "$pic_flag" && libobjs=`$ECHO "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` + test -z "$pic_flag" && { + libobjs=`OUTPUT_LONG_LIST([$libobjs], ["$always_gentop/scratch2"], + ["$lo2o"]) | $NL2SP` + } # Prepare the list of exported symbols if test -z "$export_symbols"; then @@ -5346,8 +5397,10 @@ fi # Create the old-style object. - reload_objs="$objs$old_deplibs "`$ECHO "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test - + reload_objs="$objs$old_deplibs "`OUTPUT_LONG_LIST( + [$libobjs], + ["$always_gentop/scratch4"], + ["/\\.${libext}\$/d;/\\.lib\$/d;$lo2o"]) | $NL2SP`" $reload_conv_objs" output="$obj" cmds=$reload_cmds save_ifs="$IFS"; IFS='~'