--- embedaddon/bird/doc/sgml2latex 2017/08/22 12:33:54 1.1 +++ embedaddon/bird/doc/sgml2latex 2021/03/17 19:50:23 1.1.1.2 @@ -2,7 +2,7 @@ # # sgmltools.in # -# $Id: sgml2latex,v 1.1 2017/08/22 12:33:54 misho Exp $ +# $Id: sgml2latex,v 1.1.1.2 2021/03/17 19:50:23 misho Exp $ # # SGML-Tools driver. Calls all other SGML-Tools components, contains # configuration information, etcetera. @@ -17,8 +17,10 @@ use strict; use vars qw($prefix $DataDir $BinDir $progs); +use FindBin; + $prefix = "/usr"; -$DataDir = "sbase"; +$DataDir = "$FindBin::Bin/sbase"; $BinDir = "/usr/bin"; use lib "/usr/share/linuxdoc-tools"; @@ -32,9 +34,14 @@ $progs = { "GROFFMACRO" => "-ms", "AWK" => "/usr/share/linuxdoc-tools/awkwhich" }; -$ENV{"SGML_CATALOG_FILES"} = "sbase/dtd/catalog"; -require "./LinuxDocTools.pm"; +if (! -x $progs->{"NSGMLS"}) + { $progs->{"NSGMLS"} = "/usr/bin/onsgmls"; } + +$ENV{"SGML_CATALOG_FILES"} = "$DataDir/dtd/catalog" . + (defined $ENV{SGML_CATALOG_FILES} ? ":$ENV{SGML_CATALOG_FILES}" : ""); + +require "$FindBin::Bin/LinuxDocTools.pm"; &LinuxDocTools::init; my @FileList = LinuxDocTools::process_options ("latex", @ARGV);