my %defines = ();
my %depends = ();
my %generate = ();
+ my %htmldocs = ();
+ my %mandocs = ();
# Support for $variablename in build.info files.
# Embedded perl code is the ultimate master, still. If its output
# don't use it if the build tree is different.
my $src_configdata = cleanfile($srcdir, "configdata.pm", $blddir);
+
+ if ($buildinfo_debug) {
+ print STDERR "DEBUG: Reading ",catfile($sourced, $f),"\n";
+ }
push @{$config{build_infos}}, catfile(abs2rel($sourced, $blddir), $f);
my $template =
Text::Template->new(TYPE => 'FILE',
@s);
}
},
-
+ qr/^\s* HTMLDOCS ${index_re} = ${value_re} $/x
+ => sub { push @{$htmldocs{$expand_variables->($+{INDEX})}},
+ tokenize($expand_variables->($+{VALUE}))
+ if !@skip || $skip[$#skip] > 0 },
+ qr/^\s* MANDOCS ${index_re} = ${value_re} $/x
+ => sub { push @{$mandocs{$expand_variables->($+{INDEX})}},
+ tokenize($expand_variables->($+{VALUE}))
+ if !@skip || $skip[$#skip] > 0 },
qr/^\s* ORDINALS ${index_re} = ${value_re} $/x
=> sub { push @{$ordinals{$expand_variables->($+{INDEX})}},
tokenize($expand_variables->($+{VALUE}))
my $dest = $_;
my $ddest = cleanfile($buildd, $_, $blddir);
die "more than one generator for $dest: "
- ,join(" ", @{$generate{$_}}),"\n"
- if scalar @{$generate{$_}} > 1;
+ ,join(" ", @{$generate{$_}}),"\n"
+ if scalar @{$generate{$_}} > 1;
my @generator = split /\s+/, $generate{$dest}->[0];
- $generator[0] = cleanfile($sourced, $generator[0], $blddir),
+ my $gen = $generator[0];
+ $generator[0] = cleanfile($sourced, $gen, $blddir);
+
+ # If the generator isn't in the source tree, we assume it's
+ # generated in the build tree
+ if ($generate{$gen}) {
+ $generator[0] = cleanfile($buildd, $gen, $blddir);
+ }
+
$unified_info{generate}->{$ddest} = [ @generator ];
}
}
}
}
+
+ foreach my $section (keys %htmldocs) {
+ foreach (@{$htmldocs{$section}}) {
+ my $htmldocs = cleanfile($buildd, $_, $blddir);
+ $unified_info{htmldocs}->{$section}->{$htmldocs} = 1;
+ }
+ }
+
+ foreach my $section (keys %mandocs) {
+ foreach (@{$mandocs{$section}}) {
+ my $mandocs = cleanfile($buildd, $_, $blddir);
+ $unified_info{mandocs}->{$section}->{$mandocs} = 1;
+ }
+ }
}
my $ordinals_text = join(', ', sort keys %ordinals);
$unified_info{$_} = [ sort keys %{$unified_info{$_}} ];
}
# Two level structures
- foreach my $l1 (("sources", "shared_sources", "ldadd", "depends")) {
+ foreach my $l1 (("sources", "shared_sources", "ldadd", "depends",
+ "htmldocs", "mandocs")) {
foreach my $l2 (sort keys %{$unified_info{$l1}}) {
my @items =
sort
my %loopinfo = ( "lib" => [ @{$unified_info{libraries}} ],
"dso" => [ @{$unified_info{modules}} ],
"bin" => [ @{$unified_info{programs}} ],
- "script" => [ @{$unified_info{scripts}} ] );
+ "script" => [ @{$unified_info{scripts}} ],
+ "docs" => [ (map { @{$unified_info{htmldocs}->{$_} // []} }
+ keys %{$unified_info{htmldocs} // {}}),
+ (map { @{$unified_info{mandocs}->{$_} // []} }
+ keys %{$unified_info{mandocs} // {}}) ] );
foreach my $type (keys %loopinfo) {
foreach my $product (@{$loopinfo{$type}}) {
my %dirs = ();