зеркало из https://github.com/mozilla/pjs.git
Bug 285627 mddepend.pl processes Windows depend files inefficiently r=bsmedberg
This commit is contained in:
Родитель
e07e75cd23
Коммит
3b158ac968
|
@ -51,9 +51,9 @@
|
||||||
$outfile = shift @ARGV;
|
$outfile = shift @ARGV;
|
||||||
my $silent = $ENV{MAKEFLAGS} =~ /^\w*s|\s-s/;
|
my $silent = $ENV{MAKEFLAGS} =~ /^\w*s|\s-s/;
|
||||||
|
|
||||||
@alldeps=();
|
%alldeps={};
|
||||||
# Parse dependency files
|
# Parse dependency files
|
||||||
while ($line = <STDIN>) {
|
while ($line = <>) {
|
||||||
chomp $line;
|
chomp $line;
|
||||||
# Remove extra ^M caused by using dos-mode line-endings
|
# Remove extra ^M caused by using dos-mode line-endings
|
||||||
chop $line if (substr($line, -1, 1) eq "\r");
|
chop $line if (substr($line, -1, 1) eq "\r");
|
||||||
|
@ -66,9 +66,10 @@ while ($line = <STDIN>) {
|
||||||
} else {
|
} else {
|
||||||
$hasSlash = 0;
|
$hasSlash = 0;
|
||||||
}
|
}
|
||||||
$deps = [ $obj, split /\s+/, $rest ];
|
push @{$alldeps{$obj}}, split /\s+/, $rest;
|
||||||
|
print "add $obj $rest\n" if $debug;
|
||||||
|
|
||||||
while ($hasSlash and $line = <STDIN>) {
|
while ($hasSlash and $line = <>) {
|
||||||
chomp $line;
|
chomp $line;
|
||||||
if ($line =~ /\\$/) {
|
if ($line =~ /\\$/) {
|
||||||
chop $line;
|
chop $line;
|
||||||
|
@ -76,15 +77,14 @@ while ($line = <STDIN>) {
|
||||||
$hasSlash = 0;
|
$hasSlash = 0;
|
||||||
}
|
}
|
||||||
$line =~ s/^\s+//;
|
$line =~ s/^\s+//;
|
||||||
push @{$deps}, split /\s+/, $line;
|
push @{$alldeps{$obj}}, split /\s+/, $line;
|
||||||
|
print "add $obj $line\n" if $debug;
|
||||||
}
|
}
|
||||||
warn "add @{$deps}\n" if $debug;
|
|
||||||
push @alldeps, $deps;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Test dependencies
|
# Test dependencies
|
||||||
foreach $deps (@alldeps) {
|
foreach $obj (keys %alldeps) {
|
||||||
$obj = shift @{$deps};
|
$deps = $alldeps{$obj};
|
||||||
|
|
||||||
$mtime = (stat $obj)[9] or next;
|
$mtime = (stat $obj)[9] or next;
|
||||||
|
|
||||||
|
@ -113,7 +113,7 @@ if (@objs) {
|
||||||
|
|
||||||
# Only write out the dependencies if they are different.
|
# Only write out the dependencies if they are different.
|
||||||
if ($new_output ne $old_output) {
|
if ($new_output ne $old_output) {
|
||||||
open(OUT, ">$outfile") and binmode(OUT) and print OUT "$new_output";
|
open(OUT, ">$outfile") and print OUT "$new_output";
|
||||||
print "Updating dependencies file, $outfile\n" unless $silent;
|
print "Updating dependencies file, $outfile\n" unless $silent;
|
||||||
if ($debug) {
|
if ($debug) {
|
||||||
print "new: $new_output\n";
|
print "new: $new_output\n";
|
||||||
|
|
|
@ -1768,7 +1768,7 @@ ifdef PERL
|
||||||
# because it handles the case when header files are removed from the build.
|
# because it handles the case when header files are removed from the build.
|
||||||
# 'make' would complain that there is no way to build missing headers.
|
# 'make' would complain that there is no way to build missing headers.
|
||||||
$(MDDEPDIR)/.all.pp: FORCE
|
$(MDDEPDIR)/.all.pp: FORCE
|
||||||
@cat $(MDDEPEND_FILES) | $(PERL) $(BUILD_TOOLS)/mddepend.pl $@
|
$(PERL) $(BUILD_TOOLS)/mddepend.pl $@ $(MDDEPEND_FILES)
|
||||||
-include $(MDDEPDIR)/.all.pp
|
-include $(MDDEPDIR)/.all.pp
|
||||||
else
|
else
|
||||||
include $(MDDEPEND_FILES)
|
include $(MDDEPEND_FILES)
|
||||||
|
|
Загрузка…
Ссылка в новой задаче