diff options
author | Ondrej Zajicek (work) <santiago@crfreenet.org> | 2021-04-25 01:07:14 +0200 |
---|---|---|
committer | Ondrej Zajicek (work) <santiago@crfreenet.org> | 2021-04-25 02:21:05 +0200 |
commit | 58510024bead8df9cba6e316f8275423a38fd51b (patch) | |
tree | bc61b5c01359b0b7ef62624f9ed7c21e129a9e5c /tools/linuxdoc | |
parent | b646c0098120bbb10ec91fa2fbf1df416c5849bd (diff) |
Doc: Include full LinuxDocTools code
BIRD uses hacked LinuxDocTools for building documentation, keeping some
parts locally and using remaining parts from system-installed one. This
setup breaks when LinuxDocTools makes some internal changes and is hard
to keep consistent.
Just include full LinuxDocTools code (both hacked and unmodified parts)
to avoid consistency issues. Note that we still need some binaries from
LinuxDocTools, so it still needs to be installed to build documentation.
Diffstat (limited to 'tools/linuxdoc')
-rwxr-xr-x | tools/linuxdoc | 75 |
1 files changed, 75 insertions, 0 deletions
diff --git a/tools/linuxdoc b/tools/linuxdoc new file mode 100755 index 00000000..51110e79 --- /dev/null +++ b/tools/linuxdoc @@ -0,0 +1,75 @@ +#!/usr/bin/perl +# +# linuxdoc.in +# +# LinuxDoc-Tools driver. Calls all other LinuxDoc-Tools components, +# contains configuration information, etcetera. +# ------------------------------------------------------------------- + +package main; + +sub BEGIN { + require 5.004; +} + +use strict; + +use vars qw($prefix + $isoentities_prefix + $DataDir + $AuxBinDir + $progs); + +use FindBin; + +$prefix = "/usr"; +$isoentities_prefix = "/usr"; +$DataDir = "$FindBin::Bin/../doc/sbase"; +$AuxBinDir = "/usr/lib/linuxdoc-tools"; + +use lib "$FindBin::Bin/linuxdoc-tools"; + +# --------------------------------------------------------------------- +sub ldt_which { +# --------------------------------------------------------------------- +# --------------------------------------------------------------------- + die "ldt_which: No filename(s) array given. Aborting ...\n" unless scalar @_; + + foreach my $file ( @_ ){ + if ( $file =~ m/\// ) { + return $file if -x $file; + } else { + foreach my $path ( split(':',$ENV{'PATH'}) ){ + $path =~ s/\/+$//; + return $file if -x "$path/$file"; + } + } + } + die "No executable found in path for (", join(' ',@_) ,"). Aborting ...\n"; +} + +$progs = { + "SGMLSASP" => ldt_which("sgmlsasp"), + "NSGMLS" => ldt_which("nsgmls","onsgmls"), + "GROFF" => ldt_which("groff"), + "GROFFMACRO" => "-ms", +# "NKF" => "@NKF@" +}; + +$ENV{"SGML_CATALOG_FILES"} = "$DataDir/dtd/catalog" . + (defined $ENV{SGML_CATALOG_FILES} ? ":$ENV{SGML_CATALOG_FILES}" : ""); + +require LinuxDocTools; +&LinuxDocTools::init; + +my @FileList = LinuxDocTools::process_options ($0, @ARGV); + +foreach my $curfile (@FileList) { + &LinuxDocTools::process_file ($curfile); +} + +exit 0; + +# Local Variables: +# mode: perl +# End: |