Bug 524139 - Eval .all.pp instead of including it. This means that in the normal case we avoid any make restarts and the associated I/O that goes with them, which could possibly be slowing Windows builds down considerably r=ted

--HG--
extra : rebase_source : 9671d212954595ef76b1870957e09ec6bc018e83
This commit is contained in:
Benjamin Smedberg 2009-10-23 13:00:19 -04:00
Родитель 6acffec3ee
Коммит 1b015e4cd1
4 изменённых файлов: 34 добавлений и 40 удалений

Просмотреть файл

@ -73,7 +73,7 @@ while (<>) {
my @deps = split /\s+/, $rest;
push @{$alldeps{$obj}}, @deps;
if (DEBUG >= 2) {
foreach my $dep (@deps) { print "add $obj $dep\n"; }
foreach my $dep (@deps) { print STDERR "add $obj $dep\n"; }
}
}
@ -88,21 +88,21 @@ OBJ_LOOP: foreach my $obj (keys %alldeps) {
foreach my $dep_file (@{$deps}) {
my $dep_mtime = $modtimes{$dep_file};
if (not defined $dep_mtime) {
print "Skipping $dep_file for $obj, will stat() later\n" if DEBUG >= 2;
print STDERR "Skipping $dep_file for $obj, will stat() later\n" if DEBUG >= 2;
$not_in_cache{$dep_file} = 1;
next;
}
print "Found $dep_file in cache\n" if DEBUG >= 2;
print STDERR "Found $dep_file in cache\n" if DEBUG >= 2;
if ($dep_mtime > $mtime) {
print "$dep_file($dep_mtime) newer than $obj($mtime)\n" if DEBUG;
print STDERR "$dep_file($dep_mtime) newer than $obj($mtime)\n" if DEBUG;
}
elsif ($dep_mtime == -1) {
print "Couldn't stat $dep_file for $obj\n" if DEBUG;
print STDERR "Couldn't stat $dep_file for $obj\n" if DEBUG;
}
else {
print "$dep_file($dep_mtime) older than $obj($mtime)\n" if DEBUG >= 2;
print STDERR "$dep_file($dep_mtime) older than $obj($mtime)\n" if DEBUG >= 2;
next;
}
@ -111,17 +111,17 @@ OBJ_LOOP: foreach my $obj (keys %alldeps) {
}
foreach my $dep_file (keys %not_in_cache) {
print "STAT $dep_file for $obj\n" if DEBUG >= 2;
print STDERR "STAT $dep_file for $obj\n" if DEBUG >= 2;
my $dep_mtime = $modtimes{$dep_file} = (stat $dep_file)[9] || -1;
if ($dep_mtime > $mtime) {
print "$dep_file($dep_mtime) newer than $obj($mtime)\n" if DEBUG;
print STDERR "$dep_file($dep_mtime) newer than $obj($mtime)\n" if DEBUG;
}
elsif ($dep_mtime == -1) {
print "Couldn't stat $dep_file for $obj\n" if DEBUG;
print STDERR "Couldn't stat $dep_file for $obj\n" if DEBUG;
}
else {
print "$dep_file($dep_mtime) older than $obj($mtime)\n" if DEBUG >= 2;
print STDERR "$dep_file($dep_mtime) older than $obj($mtime)\n" if DEBUG >= 2;
next;
}
@ -133,7 +133,11 @@ OBJ_LOOP: foreach my $obj (keys %alldeps) {
}
# Output objects to rebuild (if needed).
if (@objs) {
if ($outfile eq '-') {
if (@objs) {
print "@objs: FORCE\n";
}
} elsif (@objs) {
my $old_output;
my $new_output = "@objs: FORCE\n";

Просмотреть файл

@ -2068,21 +2068,14 @@ ifneq (,$(OBJS)$(XPIDLSRCS)$(SIMPLE_PROGRAMS))
MDDEPEND_FILES := $(strip $(wildcard $(MDDEPDIR)/*.pp))
ifneq (,$(MDDEPEND_FILES))
ifdef PERL
# The script mddepend.pl checks the dependencies and writes to stdout
# one rule to force out-of-date objects. For example,
# foo.o boo.o: FORCE
# The script has an advantage over including the *.pp files directly
# 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.
ifeq (,$(MAKE_RESTARTS))
$(MDDEPDIR)/.all.pp: FORCE
@$(PERL) $(BUILD_TOOLS)/mddepend.pl $@ $(MDDEPEND_FILES)
endif
-include $(MDDEPDIR)/.all.pp
else
include $(MDDEPEND_FILES)
endif
ALL_PP_RESULTS = $(shell $(PERL) $(BUILD_TOOLS)/mddepend.pl - $(MDDEPEND_FILES))
$(eval $(ALL_PP_RESULTS))
endif
endif

Просмотреть файл

@ -73,7 +73,7 @@ while (<>) {
my @deps = split /\s+/, $rest;
push @{$alldeps{$obj}}, @deps;
if (DEBUG >= 2) {
foreach my $dep (@deps) { print "add $obj $dep\n"; }
foreach my $dep (@deps) { print STDERR "add $obj $dep\n"; }
}
}
@ -88,21 +88,21 @@ OBJ_LOOP: foreach my $obj (keys %alldeps) {
foreach my $dep_file (@{$deps}) {
my $dep_mtime = $modtimes{$dep_file};
if (not defined $dep_mtime) {
print "Skipping $dep_file for $obj, will stat() later\n" if DEBUG >= 2;
print STDERR "Skipping $dep_file for $obj, will stat() later\n" if DEBUG >= 2;
$not_in_cache{$dep_file} = 1;
next;
}
print "Found $dep_file in cache\n" if DEBUG >= 2;
print STDERR "Found $dep_file in cache\n" if DEBUG >= 2;
if ($dep_mtime > $mtime) {
print "$dep_file($dep_mtime) newer than $obj($mtime)\n" if DEBUG;
print STDERR "$dep_file($dep_mtime) newer than $obj($mtime)\n" if DEBUG;
}
elsif ($dep_mtime == -1) {
print "Couldn't stat $dep_file for $obj\n" if DEBUG;
print STDERR "Couldn't stat $dep_file for $obj\n" if DEBUG;
}
else {
print "$dep_file($dep_mtime) older than $obj($mtime)\n" if DEBUG >= 2;
print STDERR "$dep_file($dep_mtime) older than $obj($mtime)\n" if DEBUG >= 2;
next;
}
@ -111,17 +111,17 @@ OBJ_LOOP: foreach my $obj (keys %alldeps) {
}
foreach my $dep_file (keys %not_in_cache) {
print "STAT $dep_file for $obj\n" if DEBUG >= 2;
print STDERR "STAT $dep_file for $obj\n" if DEBUG >= 2;
my $dep_mtime = $modtimes{$dep_file} = (stat $dep_file)[9] || -1;
if ($dep_mtime > $mtime) {
print "$dep_file($dep_mtime) newer than $obj($mtime)\n" if DEBUG;
print STDERR "$dep_file($dep_mtime) newer than $obj($mtime)\n" if DEBUG;
}
elsif ($dep_mtime == -1) {
print "Couldn't stat $dep_file for $obj\n" if DEBUG;
print STDERR "Couldn't stat $dep_file for $obj\n" if DEBUG;
}
else {
print "$dep_file($dep_mtime) older than $obj($mtime)\n" if DEBUG >= 2;
print STDERR "$dep_file($dep_mtime) older than $obj($mtime)\n" if DEBUG >= 2;
next;
}
@ -133,7 +133,11 @@ OBJ_LOOP: foreach my $obj (keys %alldeps) {
}
# Output objects to rebuild (if needed).
if (@objs) {
if ($outfile eq '-') {
if (@objs) {
print "@objs: FORCE\n";
}
} elsif (@objs) {
my $old_output;
my $new_output = "@objs: FORCE\n";

Просмотреть файл

@ -2068,21 +2068,14 @@ ifneq (,$(OBJS)$(XPIDLSRCS)$(SIMPLE_PROGRAMS))
MDDEPEND_FILES := $(strip $(wildcard $(MDDEPDIR)/*.pp))
ifneq (,$(MDDEPEND_FILES))
ifdef PERL
# The script mddepend.pl checks the dependencies and writes to stdout
# one rule to force out-of-date objects. For example,
# foo.o boo.o: FORCE
# The script has an advantage over including the *.pp files directly
# 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.
ifeq (,$(MAKE_RESTARTS))
$(MDDEPDIR)/.all.pp: FORCE
@$(PERL) $(BUILD_TOOLS)/mddepend.pl $@ $(MDDEPEND_FILES)
endif
-include $(MDDEPDIR)/.all.pp
else
include $(MDDEPEND_FILES)
endif
ALL_PP_RESULTS = $(shell $(PERL) $(BUILD_TOOLS)/mddepend.pl - $(MDDEPEND_FILES))
$(eval $(ALL_PP_RESULTS))
endif
endif