build.info.in 2.8 KB

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