aboutsummaryrefslogtreecommitdiffstats
path: root/doc/genps.pl
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@linux.intel.com>2016-05-16 20:30:09 -0700
committerH. Peter Anvin <hpa@linux.intel.com>2016-05-16 20:30:09 -0700
commit407166001c2df8ef32aae708ff797b069a0d398b (patch)
treebb576fc34a9bb01296a5c88311661a9c27645817 /doc/genps.pl
parentb06736ae7ee2af15c2d7176ca9cf241661b7cb49 (diff)
downloadnasm-daily-407166001c2df8ef32aae708ff797b069a0d398b.tar.gz
nasm-daily-407166001c2df8ef32aae708ff797b069a0d398b.tar.xz
nasm-daily-407166001c2df8ef32aae708ff797b069a0d398b.zip
Fix building in a separate directory from the source code
The code to handle building in a separate directory had seriously bitrotted. This contains a number of fixes to make it possible, including bits like the documentation which never worked in the past. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Diffstat (limited to 'doc/genps.pl')
-rwxr-xr-xdoc/genps.pl13
1 files changed, 8 insertions, 5 deletions
diff --git a/doc/genps.pl b/doc/genps.pl
index 67e0f366..86d10007 100755
--- a/doc/genps.pl
+++ b/doc/genps.pl
@@ -1,7 +1,7 @@
#!/usr/bin/perl
## --------------------------------------------------------------------------
##
-## Copyright 1996-2012 The NASM Authors - All Rights Reserved
+## Copyright 1996-2016 The NASM Authors - All Rights Reserved
## See the file AUTHORS included with the NASM distribution for
## the specific copyright holders.
##
@@ -36,9 +36,6 @@
# Format the documentation as PostScript
#
-use Env;
-use lib $srcdir;
-
require 'psfonts.ph'; # The fonts we want to use
require 'pswidth.ph'; # PostScript string width
@@ -87,6 +84,9 @@ use Fcntl;
'11x17' => [792,1224], # US double paper size
);
+# Canned header file
+$headps = 'head.ps';
+
#
# Parse the command line
#
@@ -104,6 +104,8 @@ while ( $arg = shift(@ARGV) ) {
$psconf{$parm} = shift(@ARGV);
} elsif ( $parm =~ /^(title|subtitle|year|author|license)$/ ) {
$metadata{$parm} = shift(@ARGV);
+ } elsif ( $parm eq 'headps' ) {
+ $headps = shift(@ARGV);
} else {
die "$0: Unknown option: $arg\n";
}
@@ -1028,7 +1030,8 @@ foreach $fset ( @AllFonts ) {
print "/bullet [",ps_string($charcode{'bullet'}),"] def\n";
# Emit the canned PostScript prologue
-open(PSHEAD, "< head.ps");
+open(PSHEAD, '<', $headps)
+ or die "$0: cannot open: $headps: $!\n";
while ( defined($line = <PSHEAD>) ) {
print $line;
}