summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2017-04-17 01:38:41 -0700
committerH. Peter Anvin <hpa@zytor.com>2017-04-17 01:38:41 -0700
commit984c6011ba642afb3c1e16d79135e830eba13aaa (patch)
tree1d5bf892a5e82c205c89475f13070ba620b2357c
parentd31a74e301ee6a09b29b610a83ff2c1580b9f998 (diff)
downloadnasm-984c6011ba642afb3c1e16d79135e830eba13aaa.tar.gz
doc/genps: make sure we pick up nasmlogo.eps when building cross-dir
When building in a different directory, we still want to make sure we pick up nasmlogo.eps. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
-rw-r--r--doc/Makefile.in3
-rwxr-xr-xdoc/genps.pl14
2 files changed, 12 insertions, 5 deletions
diff --git a/doc/Makefile.in b/doc/Makefile.in
index 4f957da7..2ddfd1ee 100644
--- a/doc/Makefile.in
+++ b/doc/Makefile.in
@@ -63,7 +63,8 @@ version.src: $(top_srcdir)/version.pl $(top_srcdir)/version
nasmdoc.ps: nasmdoc.dip genps.pl afmmetrics.ph ttfmetrics.ph \
pswidth.ph nasmlogo.eps psfonts.ph head.ps
- $(PERL) $(srcdir)/genps.pl -headps $(srcdir)/head.ps nasmdoc.dip \
+ $(PERL) $(srcdir)/genps.pl -epsdir "$(srcdir)" \
+ -headps $(srcdir)/head.ps nasmdoc.dip \
> nasmdoc.ps
nasmdoc.pdf: nasmdoc.ps pspdf.pl
diff --git a/doc/genps.pl b/doc/genps.pl
index e3b799b5..88e57388 100755
--- a/doc/genps.pl
+++ b/doc/genps.pl
@@ -92,6 +92,10 @@ require 'findfont.ph'; # Find fonts in the system
# Canned header file
$headps = 'head.ps';
+# Directories
+$fontsdir = 'fonts';
+$epsdir = File::Spec->curdir();
+
#
# Parse the command line
#
@@ -107,11 +111,13 @@ while ( $arg = shift(@ARGV) ) {
$psbool{$parm} = $true;
} elsif ( $true && defined($psconf{$parm}) ) {
$psconf{$parm} = shift(@ARGV);
- } elsif ( $parm =~ /^(title|subtitle|year|author|license)$/ ) {
+ } elsif ( $true && $parm =~ /^(title|subtitle|year|author|license)$/ ) {
$metadata{$parm} = shift(@ARGV);
- } elsif ( $parm =~ /^fontsdir$/ ) {
+ } elsif ( $true && $parm eq 'fontsdir' ) {
$fontsdir = shift(@ARGV);
- } elsif ( $parm eq 'headps' ) {
+ } elsif ( $true && $parm eq 'epsdir' ) {
+ $epsdir = shift(@ARGV);
+ } elsif ( $true && $parm eq 'headps' ) {
$headps = shift(@ARGV);
} else {
die "$0: Unknown option: $arg\n";
@@ -1161,7 +1167,7 @@ print "sti show\n";
# and DocumentFonts in the header of the EPSF and add those to the
# global header.
if ( defined($metadata{epslogo}) &&
- open(EPS, '<', $metadata{epslogo}) ) {
+ open(EPS, '<', File::Spec->catfile($epsdir, $metadata{epslogo})) ) {
my @eps = ();
my ($bbllx,$bblly,$bburx,$bbury) = (undef,undef,undef,undef);
my $line;