diff --git a/Mkfiles/msvc.mak b/Mkfiles/msvc.mak index a718348d..8ddafdf0 100644 --- a/Mkfiles/msvc.mak +++ b/Mkfiles/msvc.mak @@ -344,7 +344,8 @@ strip: # Abuse doc/Makefile.in to build nasmdoc.pdf only docs: - cd doc && $(MAKE) /f Makefile.in srcdir=. top_srcdir=.. PERL=$(PERL) nasmdoc.pdf + cd doc && $(MAKE) /f Makefile.in srcdir=. top_srcdir=.. \ + PERL=$(PERL) PDFOPT= nasmdoc.pdf everything: all docs nsis diff --git a/configure.ac b/configure.ac index a426c727..c5b317e2 100644 --- a/configure.ac +++ b/configure.ac @@ -149,6 +149,14 @@ AC_CHECK_DECLS(strnlen) dnl Check for missing types AC_TYPE_UINTPTR_T +dnl Documentation: should we generate an uncompressed PDF? It is +dnl about twice as big, but it can be externally compressed (e.g. with xz) +dnl and becomes significantly smaller than the original. +PA_ARG_DISABLED([pdf-compression], + [generate an uncompressed documentation PDF], + [PDFOPT='-nocompress']) +AC_SUBST([PDFOPT]) + dnl dnl Check for supported gcc attributes; some compilers (e.g. Sun CC) dnl support these, but don't define __GNUC__ as they don't support diff --git a/doc/Makefile.in b/doc/Makefile.in index 0e142d37..6a2d5a7e 100644 --- a/doc/Makefile.in +++ b/doc/Makefile.in @@ -23,15 +23,13 @@ TEXI2DVI = texi2dvi TEXI2IPF = texi2ipf IPFC = ipfc -ACRODIST = acrodist # Acrobat Distiller -PSTOPDF = pstopdf # BSD/MacOS X utility -PS2PDF = ps2pdf # Part of GhostScript +PDFOPT = @PDFOPT@ RM_F = rm -f RM_RF = rm -rf SRCS = nasmdoc.src inslist.src changes.src version.src -OUT = info html nasmdoc.txt nasmdoc.ps nasmdoc.pdf +OUT = info html nasmdoc.txt nasmdoc.pdf .SUFFIXES: .pfa .ph @@ -68,8 +66,8 @@ nasmdoc.ps: nasmdoc.dip genps.pl afmmetrics.ph ttfmetrics.ph \ $(PERL) $(srcdir)/genps.pl -headps $(srcdir)/head.ps nasmdoc.dip \ > nasmdoc.ps -nasmdoc.pdf: nasmdoc.ps - $(PERL) pspdf.pl nasmdoc.ps nasmdoc.pdf +nasmdoc.pdf: nasmdoc.ps pspdf.pl + $(PERL) pspdf.pl $(PDFOPT) nasmdoc.ps nasmdoc.pdf .PHONY: info info: info/nasm.info diff --git a/doc/pspdf.pl b/doc/pspdf.pl index 454c031c..961a8ae1 100755 --- a/doc/pspdf.pl +++ b/doc/pspdf.pl @@ -5,10 +5,21 @@ use strict; +my $compress = 1; + +while ($ARGV[0] =~ /^-(.*)$/) { + my $opt = $1; + shift @ARGV; + + if ($opt eq '-nocompress') { + $compress = 0; + } +} + my ($in, $out) = @ARGV; if (!defined($out)) { - die "Usage: $0 infile outfile\n"; + die "Usage: $0 [-nocompress] infile outfile\n"; } # Remove output file @@ -20,8 +31,8 @@ exit 0 if ( !$r && -f $out ); # 2. ps2pdf (from Ghostscript) my $r = system('ps2pdf', '-dOptimize=true', '-dEmbedAllFonts=true', - '-dUseFlateCompression=true', - $in, $out); + '-dCompressPages=' . ($compress ? 'true' : 'false'), + '-dUseFlateCompression=true', $in, $out); exit 0 if ( !$r && -f $out ); # 3. pstopdf (BSD/MacOS X utility) diff --git a/nasm.spec.in b/nasm.spec.in index 10d5a3f3..9cdb3001 100644 --- a/nasm.spec.in +++ b/nasm.spec.in @@ -44,7 +44,7 @@ include linker, library manager, loader, and information dump. %setup -q -n nasm-%{nasm_version} %build -%configure +%configure --disable-pdf-compression make %{?_smp_mflags} everything %install