In the MakeMaker pm_to_blib target don't copy all
authorJarkko Hietaniemi <jhi@iki.fi>
Sun, 25 Nov 2001 02:48:04 +0000 (02:48 +0000)
committerJarkko Hietaniemi <jhi@iki.fi>
Sun, 25 Nov 2001 02:48:04 +0000 (02:48 +0000)
the files in one fell swoop, deal with them hunkwise,
helps for CLIs with limited line lengths.
(This seems to help for DJGPP building Encode,
where there are dozens of files to copy.)

p4raw-id: //depot/perl@13251

lib/ExtUtils/MM_Unix.pm

index 8370f21..16c6e6f 100644 (file)
@@ -3072,12 +3072,31 @@ destination and autosplits them. See L<ExtUtils::Install/DESCRIPTION>
 sub pm_to_blib {
     my $self = shift;
     my($autodir) = $self->catdir('$(INST_LIB)','auto');
-    return q{
+    my $r = q{
 pm_to_blib: $(TO_INST_PM)
-       }.$self->{NOECHO}.q{$(PERLRUNINST) -MExtUtils::Install \
-        -e "pm_to_blib({qw{$(PM_TO_BLIB)}},'}.$autodir.q{','$(PM_FILTER)')"
-       }.$self->{NOECHO}.q{$(TOUCH) $@
 };
+    my %pm_to_blib = %{$self->{PM}};
+    my @a;
+    my $l;
+    sub _pm_to_blib_flush {
+       $r .= 
+q{     }.$self->{NOECHO}.q[$(PERLRUNINST) -MExtUtils::Install \
+       -e "pm_to_blib({qw{].qq[@a].q[}},'].$autodir.q{','$(PM_FILTER)')"
+};
+        @a = ();
+        $l = 0;
+    }
+    while (my ($pm, $blib) = each %pm_to_blib) {
+       my $la = length $pm;
+       my $lb = length $blib;
+       if ($l + $la + $lb + @a / 2 > 200) {
+           _pm_to_blib_flush();
+        }
+        push @a, $pm, $blib;
+       $l += $la + $lb;
+    }
+    _pm_to_blib_flush();
+    return $r.q{       }.$self->{NOECHO}.q{$(TOUCH) $@};
 }
 
 =item post_constants (o)