diff options
author | Michael Meeks <michael.meeks@suse.com> | 2012-06-20 15:35:09 +0100 |
---|---|---|
committer | Michael Meeks <michael.meeks@suse.com> | 2012-06-21 13:11:04 +0100 |
commit | da6c3d4bdd069f8125277a54c93fa5cfdf87b70c (patch) | |
tree | 477d00d963117d53dffe3c4f1db2d83791aa2b50 /solenv | |
parent | 0f12c5de67869593cfbc36760957467a122bf81a (diff) |
re-work to test the effect of boost elision.
Change-Id: Idef032c08c097e04fcf0cae3d184ceb660b65949
Diffstat (limited to 'solenv')
-rwxr-xr-x | solenv/bin/concat-deps.pl | 68 |
1 files changed, 41 insertions, 27 deletions
diff --git a/solenv/bin/concat-deps.pl b/solenv/bin/concat-deps.pl index 935a50c68daa..e360dbc280cb 100755 --- a/solenv/bin/concat-deps.pl +++ b/solenv/bin/concat-deps.pl @@ -24,21 +24,9 @@ my @depfiles = read_depfiles (shift @ARGV); my %rules; print "# concatenated, reduced dependencies generated by solenv/bin/concat-deps.pl\n"; print "# generated with \$(SRCDIR) = $ENV{SRCDIR}\n"; +print "# generated with \$(OUTDIR) = $ENV{OUTDIR}\n"; -sub canonicalize_path($) -{ - my $line = shift; - $line =~ /^(\s*)([^\s\n:]*)(.*\n?)$/; - my $pre = $1; - my $path = $2; - my $post =$3; - if (length($path) > 0 && index($path,$ENV{SRCDIR}) == 0) { - $path = File::Spec->rel2abs($2); - $path = "\$(SRCDIR)" . substr($path, length($ENV{SRCDIR})); - } - #print "## $pre$path$post"; - return "$pre$path$post"; -} +my $boost_path = $ENV{OUTDIR} . '/inc/boost/'; for my $fname (@depfiles) { my $fileh; @@ -47,20 +35,46 @@ for my $fname (@depfiles) { open ($fileh, $fname) || die "Can't open $fname: $!\n"; my $last = ''; + my $rule_count = 0; + my $with_boost_count = 0; while (<$fileh>) { - my $line = canonicalize_path($_); -# print "# $line"; - if ($line eq "\n") { - if ($last =~ /^(.*):\s*$/) { - if (defined $rules{$1}) { - $last = ''; - next; - } - $rules{$1} = 1; - } - } - print $last; - $last = $line; + # canonicalise path + m/^(\s*)([^\s\n:]*)(.*\n?)$/; + my $pre = $1; + my $path = $2; + my $post = $3; + $rule_count++ if ($post =~ m/:/); + if (length($path) > 0 && index($path,$ENV{SRCDIR}) == 0) { + $path = File::Spec->rel2abs($2); + if (index($path,$ENV{OUTDIR}) == 0) { + my $solverpath = substr($path, length($ENV{OUTDIR})); + if ($solverpath =~ m|/inc/boost/|) { + if ($with_boost_count != $rule_count || !($post =~ m/\\/)) { + $path = '$(OUTDIR)/inc/boost/deliver.log'; + $with_boost_count = $rule_count; + } else { # elide it + $path = ''; $pre = ''; $post = ''; + } + } else { + $path = "\$(OUTDIR)" . $solverpath; + } + } else { + $path = "\$(SRCDIR)" . substr($path, length($ENV{SRCDIR})); + } + } + $line = "$pre$path$post"; + + if ($line eq "\n") { + if ($last =~ /^(.*):\s*$/) { + if (defined $rules{$1}) { + $last = ''; + next; + } + $rules{$1} = 1; + } + } + print $last; + $last = $line; } print "$last\n"; # in case of missing newline |