source: scripts_home/scripts/untested/blfs-patches/esound-0.2.35-libtool_skip_max_cmd_len-1.patch@ 1c9c5c3

clfs-1.2 clfs-2.1 clfs-3.0.0-systemd clfs-3.0.0-sysvinit systemd sysvinit
Last change on this file since 1c9c5c3 was 1c9c5c3, checked in by Jim Gifford <clfs@…>, 19 years ago

r624@server (orig r622): jim | 2005-10-31 12:40:28 -0800
Rearranging Archive

  • Property mode set to 100644
File size: 6.2 KB
  • esound-0.2.

    old new  
    40574057          fi
    40584058        fi
    40594059
    4060         if test "X$skipped_export" != "X:" && len=`expr "X$test_cmds" : ".*"` &&
    4061            test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
    4062           :
    4063         else
    4064           # The command line is too long to link in one step, link piecewise.
    4065           $echo "creating reloadable object files..."
    4066 
    4067           # Save the value of $output and $libobjs because we want to
    4068           # use them later.  If we have whole_archive_flag_spec, we
    4069           # want to use save_libobjs as it was before
    4070           # whole_archive_flag_spec was expanded, because we can't
    4071           # assume the linker understands whole_archive_flag_spec.
    4072           # This may have to be revisited, in case too many
    4073           # convenience libraries get linked in and end up exceeding
    4074           # the spec.
    4075           if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
    4076             save_libobjs=$libobjs
    4077           fi
    4078           save_output=$output
    4079 
    4080           # Clear the reloadable object creation command queue and
    4081           # initialize k to one.
    4082           test_cmds=
    4083           concat_cmds=
    4084           objlist=
    4085           delfiles=
    4086           last_robj=
    4087           k=1
    4088           output=$output_objdir/$save_output-${k}.$objext
    4089           # Loop over the list of objects to be linked.
    4090           for obj in $save_libobjs
    4091           do
    4092             eval test_cmds=\"$reload_cmds $objlist $last_robj\"
    4093             if test "X$objlist" = X ||
    4094                { len=`expr "X$test_cmds" : ".*"` &&
    4095                  test "$len" -le "$max_cmd_len"; }; then
    4096               objlist="$objlist $obj"
    4097             else
    4098               # The command $test_cmds is almost too long, add a
    4099               # command to the queue.
    4100               if test "$k" -eq 1 ; then
    4101                 # The first file doesn't have a previous command to add.
    4102                 eval concat_cmds=\"$reload_cmds $objlist $last_robj\"
    4103               else
    4104                 # All subsequent reloadable object files will link in
    4105                 # the last one created.
    4106                 eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\"
    4107               fi
    4108               last_robj=$output_objdir/$save_output-${k}.$objext
    4109               k=`expr $k + 1`
    4110               output=$output_objdir/$save_output-${k}.$objext
    4111               objlist=$obj
    4112               len=1
    4113             fi
    4114           done
    4115           # Handle the remaining objects by creating one last
    4116           # reloadable object file.  All subsequent reloadable object
    4117           # files will link in the last one created.
    4118           test -z "$concat_cmds" || concat_cmds=$concat_cmds~
    4119           eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\"
    4120 
    4121           if ${skipped_export-false}; then
    4122             $show "generating symbol list for \`$libname.la'"
    4123             export_symbols="$output_objdir/$libname.exp"
    4124             $run $rm $export_symbols
    4125             libobjs=$output
    4126             # Append the command to create the export file.
    4127             eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\"
    4128           fi
    4129 
    4130           # Set up a command to remove the reloadale object files
    4131           # after they are used.
    4132           i=0
    4133           while test "$i" -lt "$k"
    4134           do
    4135             i=`expr $i + 1`
    4136             delfiles="$delfiles $output_objdir/$save_output-${i}.$objext"
    4137           done
    4138 
    4139           $echo "creating a temporary reloadable object file: $output"
    4140 
    4141           # Loop through the commands generated above and execute them.
    4142           save_ifs="$IFS"; IFS='~'
    4143           for cmd in $concat_cmds; do
    4144             IFS="$save_ifs"
    4145             $show "$cmd"
    4146             $run eval "$cmd" || exit $?
    4147           done
    4148           IFS="$save_ifs"
    4149 
    4150           libobjs=$output
    4151           # Restore the value of output.
    4152           output=$save_output
    4153 
    4154           if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
    4155             eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
    4156           fi
    4157           # Expand the library linking commands again to reset the
    4158           # value of $libobjs for piecewise linking.
    4159 
    4160           # Do each of the archive commands.
    4161           if test "$module" = yes && test -n "$module_cmds" ; then
    4162             if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
    4163               cmds=$module_expsym_cmds
    4164             else
    4165               cmds=$module_cmds
    4166             fi
    4167           else
    4168           if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
    4169             cmds=$archive_expsym_cmds
    4170           else
    4171             cmds=$archive_cmds
    4172             fi
    4173           fi
    4174 
    4175           # Append the command to remove the reloadable object files
    4176           # to the just-reset $cmds.
    4177           eval cmds=\"\$cmds~\$rm $delfiles\"
    4178         fi
    41794060        save_ifs="$IFS"; IFS='~'
    41804061        for cmd in $cmds; do
    41814062          IFS="$save_ifs"
     
    53475228      else
    53485229        eval cmds=\"$old_archive_cmds\"
    53495230
    5350         if len=`expr "X$cmds" : ".*"` &&
    5351              test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
    5352           cmds=$old_archive_cmds
    5353         else
    5354           # the command line is too long to link in one step, link in parts
    5355           $echo "using piecewise archive linking..."
    5356           save_RANLIB=$RANLIB
    5357           RANLIB=:
    5358           objlist=
    5359           concat_cmds=
    5360           save_oldobjs=$oldobjs
    5361           # GNU ar 2.10+ was changed to match POSIX; thus no paths are
    5362           # encoded into archives.  This makes 'ar r' malfunction in
    5363           # this piecewise linking case whenever conflicting object
    5364           # names appear in distinct ar calls; check, warn and compensate.
    5365             if (for obj in $save_oldobjs
    5366             do
    5367               $echo "X$obj" | $Xsed -e 's%^.*/%%'
    5368             done | sort | sort -uc >/dev/null 2>&1); then
    5369             :
    5370           else
    5371             $echo "$modename: warning: object name conflicts; overriding AR_FLAGS to 'cq'" 1>&2
    5372             $echo "$modename: warning: to ensure that POSIX-compatible ar will work" 1>&2
    5373             AR_FLAGS=cq
    5374           fi
    5375           # Is there a better way of finding the last object in the list?
    5376           for obj in $save_oldobjs
    5377           do
    5378             last_oldobj=$obj
    5379           done
    5380           for obj in $save_oldobjs
    5381           do
    5382             oldobjs="$objlist $obj"
    5383             objlist="$objlist $obj"
    5384             eval test_cmds=\"$old_archive_cmds\"
    5385             if len=`expr "X$test_cmds" : ".*"` &&
    5386                test "$len" -le "$max_cmd_len"; then
    5387               :
    5388             else
    5389               # the above command should be used before it gets too long
    5390               oldobjs=$objlist
    5391               if test "$obj" = "$last_oldobj" ; then
    5392                 RANLIB=$save_RANLIB
    5393               fi
    5394               test -z "$concat_cmds" || concat_cmds=$concat_cmds~
    5395               eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
    5396               objlist=
    5397             fi
    5398           done
    5399           RANLIB=$save_RANLIB
    5400           oldobjs=$objlist
    5401           if test "X$oldobjs" = "X" ; then
    5402             eval cmds=\"\$concat_cmds\"
    5403           else
    5404             eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
    5405           fi
    5406         fi
     5231        cmds=$old_archive_cmds
    54075232      fi
    54085233      save_ifs="$IFS"; IFS='~'
    54095234      for cmd in $cmds; do
Note: See TracBrowser for help on using the repository browser.