]> git.ipfire.org Git - thirdparty/openssl.git/blame - doc/build.info.in
Generate doc/build.info with 'make update' rather than on the fly
[thirdparty/openssl.git] / doc / build.info.in
CommitLineData
df8f116e
RL
1SUBDIRS = man1
2
3{-
4 use File::Spec::Functions qw(:DEFAULT abs2rel rel2abs);
5 use File::Basename;
6
7b9f8995
RL
7 my $sourcedir = catdir($config{sourcedir}, 'doc');
8
df8f116e
RL
9 foreach my $section ((1, 3, 5, 7)) {
10 my @htmlfiles = ();
11 my @manfiles = ();
12 my %podfiles =
13 map { $_ => 1 } glob catfile($sourcedir, "man$section", "*.pod");
14 my %podinfiles =
15 map { $_ => 1 } glob catfile($sourcedir, "man$section", "*.pod.in");
16
17 foreach (keys %podinfiles) {
18 (my $p = $_) =~ s|\.in$||i;
19 $podfiles{$p} = 1;
20 }
21
22 foreach my $p (sort keys %podfiles) {
23 my $podfile = abs2rel($p, $sourcedir);
24 my $podname = basename($podfile, '.pod');
25 my $podinfile = $podinfiles{"$p.in"} ? "$podfile.in" : undef;
26
27 my $podname = basename($podfile, ".pod");
28
29 my $htmlfile = abs2rel(catfile($buildtop, "doc", "html", "man$section",
30 "$podname.html"),
31 catdir($buildtop, "doc"));
32 my $manfile = abs2rel(catfile($buildtop, "doc", "man", "man$section",
33 "$podname.$section"),
34 catdir($buildtop, "doc"));
35
36 # The build.info format requires file specs to be in Unix format.
37 # Especially, since VMS file specs use [ and ], the build.info parser
38 # will otherwise get terribly confused.
39 if ($^O eq 'VMS') {
40 $htmlfile = VMS::Filespec::unixify($htmlfile);
41 $manfile = VMS::Filespec::unixify($manfile);
42 $podfile = VMS::Filespec::unixify($podfile);
43 $podinfile = VMS::Filespec::unixify($podinfile)
44 if defined $podinfile;
45 } elsif ($^O eq 'MSWin32') {
46 $htmlfile =~ s|\\|/|g;
47 $manfile =~ s|\\|/|g;
48 $podfile =~ s|\\|/|g;
49 $podinfile =~ s|\\|/|g
50 if defined $podinfile;
51 }
52 push @htmlfiles, $htmlfile;
53 push @manfiles, $manfile;
54 $OUT .= << "_____";
55DEPEND[$htmlfile]=$podfile
56GENERATE[$htmlfile]=$podfile
57DEPEND[$manfile]=$podfile
58GENERATE[$manfile]=$podfile
59_____
60 $OUT .= << "_____" if $podinfile;
9ca08f91 61DEPEND[$podfile]{pod}=$podinfile
df8f116e
RL
62GENERATE[$podfile]=$podinfile
63_____
64 }
65 $OUT .= "HTMLDOCS[man$section]=" . join(" \\\n", @htmlfiles) . "\n";
66 $OUT .= "MANDOCS[man$section]=" . join(" \\\n", @manfiles) . "\n";
67 }
68 -}