[Libreoffice-commits] .: solenv/bin solenv/gbuild
Michael Meeks
michael at kemper.freedesktop.org
Mon Sep 5 07:24:37 PDT 2011
solenv/bin/concat-deps.pl | 50 ++++++++++++++++++++++++++++++++++++++++++++
solenv/gbuild/LinkTarget.mk | 2 -
2 files changed, 51 insertions(+), 1 deletion(-)
New commits:
commit 66ec27f69123a308926583180a6f45db80e3d427
Author: Michael Meeks <michael.meeks at novell.com>
Date: Mon Sep 5 14:17:40 2011 +0100
elide duplicate dummy dependencies as we concatenate them to a library depfile
diff --git a/solenv/bin/concat-deps.pl b/solenv/bin/concat-deps.pl
new file mode 100755
index 0000000..a9788cb
--- /dev/null
+++ b/solenv/bin/concat-deps.pl
@@ -0,0 +1,50 @@
+#! /usr/bin/env perl
+
+# reads a list of dependency files from a file, opens and
+# concatenates them, while eliding duplicate nop rules.
+
+sub read_depfiles($)
+{
+ my $name = shift;
+ my $depfh;
+ my @files;
+ open ($depfh, $name) || die "Can't open list of dependencies: $name: $!";
+ while (<$depfh>) {
+ push @files, split(/\s+/, $_);
+ }
+ close ($depfh);
+
+# print STDERR "dep files: " . join ("'", @files) . "\n";
+ return @files;
+}
+
+my @depfiles = read_depfiles (shift @ARGV);
+
+my %rules;
+print "# concatenated, reduced dependencies generated by solenv/bin/concat-deps.pl\n";
+
+for my $fname (@depfiles) {
+ my $fileh;
+
+ next if ($fname eq '');
+ open ($fileh, $fname) || die "Can't open $fname: $!\n";
+
+ my $last = '';
+ while (<$fileh>) {
+ my $line = $_;
+ if ($line eq "\n") {
+ if ($last =~ /^(.*):\s*$/) {
+ if (defined $rules{$1}) {
+ $last = '';
+ next;
+ }
+ $rules{$1} = 1;
+ }
+ }
+ print $last;
+ $last = $line;
+ }
+ print $last;
+
+ close ($fileh);
+}
diff --git a/solenv/gbuild/LinkTarget.mk b/solenv/gbuild/LinkTarget.mk
index 69683c5..a3ff269 100644
--- a/solenv/gbuild/LinkTarget.mk
+++ b/solenv/gbuild/LinkTarget.mk
@@ -412,7 +412,7 @@ $(call gb_Helper_abbreviate_dirs,\
$(foreach object,$(8),$(call gb_GenCObject_get_dep_target,$(object))) \
$(foreach object,$(9),$(call gb_GenCxxObject_get_dep_target,$(object))) \
) && \
- cat $${RESPONSEFILE} /dev/null | xargs -n 200 cat > $(1)) && \
+ $(SOLARENV)/bin/concat-deps.pl $${RESPONSEFILE} > $(1)) && \
rm -f $${RESPONSEFILE}
endef
More information about the Libreoffice-commits
mailing list