Skip to content

Commit aa03a95

Browse files
author
H. Peter Anvin
committed
doc: improve the build from source documentation
Update and improve the build from source documentation, including add an auto-generated list of Perl build dependencies. Signed-off-by: H. Peter Anvin (Intel) <[email protected]>
1 parent 2e0212b commit aa03a95

File tree

5 files changed

+138
-39
lines changed

5 files changed

+138
-39
lines changed

Diff for: .gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ TAGS
7171
/doc/inslist.src
7272
/doc/version.src
7373
/doc/warnings.src
74+
/doc/perlbreq.src
7475
/doc/fontpath
7576
/doc/Fontmap
7677
/include/warnings.h

Diff for: Makefile.in

+6-1
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,7 @@ cscope:
442442
$(FIND) . -name '*.[hcS]' -print > cscope.files
443443
cscope -b -f cscope.out
444444

445-
doc: doc/warnings.src
445+
doc: doc/warnings.src doc/perlbreq.src
446446
$(MAKE) -C doc all
447447

448448
doc_install install_doc:
@@ -478,6 +478,11 @@ perlbreq.si: $(ALLPERLSRC)
478478
sed -r -e '/perl\((Win32.*)\)/d' | \
479479
sort | uniq > perlbreq.si
480480

481+
doc/perlbreq.src: perlbreq.si
482+
sed -n -r -e 's/^BuildRequires: perl\((.*)\)$$/\\c \1/p' \
483+
< perlbreq.si > doc/perlbreq.src
484+
echo '\c Win32 (if building on Windows only)' >> doc/perlbreq.src
485+
481486
nasm.spec: nasm.spec.in nasm.spec.sed version.sed perlbreq.si
482487
sed -f version.sed -f nasm.spec.sed \
483488
< nasm.spec.in > nasm.spec

Diff for: doc/Makefile.in

+11-9
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ INSTALL = @INSTALL@
2020
INSTALL_PROGRAM = @INSTALL_PROGRAM@
2121
INSTALL_DATA = @INSTALL_DATA@
2222

23-
PERL = perl -I$(top_srcdir)/perllib -I$(srcdir)
23+
PERL = perl
24+
RUNPERL = $(PERL) -I$(top_srcdir)/perllib -I$(srcdir)
2425

2526
PDFOPT = @PDFOPT@
2627

@@ -39,7 +40,8 @@ XZFILES = @XZFILES@
3940
# Auxiliary files referenced by the HTML files
4041
HTMLAUX = nasmdoc.css local.css nasmlogw.png
4142

42-
SRCS = nasmdoc.src inslist.src changes.src warnings.src version.src
43+
SRCS = nasmdoc.src inslist.src changes.src \
44+
warnings.src version.src perlbreq.src
4345
OUT = html nasmdoc.txt nasmdoc.pdf $(XZFILES)
4446
XZOUT = nasmdoc.pdf.xz
4547

@@ -59,14 +61,14 @@ all: $(OUT)
5961
xzfiles: $(XZOUT)
6062

6163
inslist.src: inslist.pl ../x86/insns.dat
62-
$(PERL) $(srcdir)/inslist.pl $(srcdir)/../x86/insns.dat
64+
$(RUNPERL) $^
6365

6466
html: $(HTMLAUX)
6567
$(MKDIR_P) html
6668
for f in $(HTMLAUX); do $(CP_UF) "$(srcdir)/$$f" html/; done
6769
$(MAKE) html/nasmdoc0.html
6870

69-
RDSRC = $(PERL) $(srcdir)/rdsrc.pl -I$(srcdir)/
71+
RDSRC = $(RUNPERL) $(srcdir)/rdsrc.pl -I$(srcdir)/
7072

7173
html/nasmdoc0.html: $(SRCS) rdsrc.pl
7274
$(RM_F) html/*.html
@@ -79,12 +81,12 @@ nasmdoc.txt: $(SRCS) rdsrc.pl
7981
$(RDSRC) txt nasmdoc.src
8082

8183
version.src: $(top_srcdir)/version.pl $(top_srcdir)/version
82-
$(PERL) $(top_srcdir)/version.pl docsrc \
84+
$(RUNPERL) $(top_srcdir)/version.pl docsrc \
8385
< $(top_srcdir)/version > version.src
8486

8587
nasmdoc.ps: nasmdoc.dip genps.pl afmmetrics.ph ttfmetrics.ph \
8688
pswidth.ph nasmlogo.eps psfonts.ph head.ps
87-
$(PERL) $(srcdir)/genps.pl -epsdir "$(srcdir)" \
89+
$(RUNPERL) $(srcdir)/genps.pl -epsdir "$(srcdir)" \
8890
-headps $(srcdir)/head.ps \
8991
-fontpath fontpath \
9092
-fontmap Fontmap \
@@ -97,11 +99,11 @@ Fontmap: nasmdoc.ps
9799
@: Generated by side effect
98100

99101
nasmdoc.pdf: nasmdoc.ps pspdf.pl fontpath
100-
$(PERL) $(srcdir)/pspdf.pl \
102+
$(RUNPERL) $(srcdir)/pspdf.pl \
101103
$(PDFOPT) $< $@ fontpath
102104

103105
nasmdoc-raw.pdf: nasmdoc.ps pspdf.pl fontpath
104-
$(PERL) $(srcdir)/pspdf.pl -nocompress \
106+
$(RUNPERL) $(srcdir)/pspdf.pl -nocompress \
105107
$(PDFOPT) $< $@ fontpath
106108

107109
nasmdoc.pdf.xz: nasmdoc-raw.pdf
@@ -111,7 +113,7 @@ nasmdoc.pdf.xz: nasmdoc-raw.pdf
111113
clean:
112114
-$(RM_F) *.rtf *.hpj *.texi *.gid *.ipf *.dip
113115
-$(RM_F) *.aux *.cp *.fn *.ky *.pg *.log *.toc *.tp *.vr
114-
-$(RM_F) inslist.src version.src fontpath Fontmap
116+
-$(RM_F) inslist.src version.src perlbreq.src fontpath Fontmap
115117
-$(RM_F) nasmdoc*.ps nasmdoc-raw.pdf
116118

117119
spotless: clean

Diff for: doc/changes.src

+1-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@ since 2007.
99

1010
\S{cl-2.17} Version 2.17
1111

12-
\b ... here goes release notes not intended to be included in the
13-
2.16.xx stable series ...
12+
\b Improve the documentation for building from source (\k{source}).
1413

1514
\S{cl-2.16.04} Version 2.16.04
1615

Diff for: doc/nasmdoc.src

+119-27
Original file line numberDiff line numberDiff line change
@@ -8946,7 +8946,7 @@ a zero-extended absolute displacement can access from 0 to 4 GB.
89468946
On Unix, the 64-bit ABI as well as the x32 ABI (32-bit ABI with the
89478947
CPU in 64-bit mode) is defined by the documents at:
89488948

8949-
\W{http://www.nasm.us/abi/unix64}\c{http://www.nasm.us/abi/unix64}
8949+
\W{https://www.nasm.us/abi/unix64}\c{https://www.nasm.us/abi/unix64}
89508950

89518951
Although written for AT&T-syntax assembly, the concepts apply equally
89528952
well for NASM-style assembly. What follows is a simplified summary.
@@ -8980,7 +8980,7 @@ Integer and SSE register arguments are counted separately, so for the case of
89808980

89818981
The Win64 ABI is described by the document at:
89828982

8983-
\W{http://www.nasm.us/abi/win64}\c{http://www.nasm.us/abi/win64}
8983+
\W{https://www.nasm.us/abi/win64}\c{https://www.nasm.us/abi/win64}
89848984

89858985
What follows is a simplified summary.
89868986

@@ -9294,32 +9294,109 @@ anyway.
92949294
\A{source} Building NASM from Source
92959295

92969296
The source code for NASM is available from our website,
9297-
\W{http://www.nasm.us/}{http://www.nasm.us/}, see \k{website}.
9297+
\w{https://www.nasm.us/}, see \k{website}.
92989298

92999299
\H{tarball} Building from a Source Archive
93009300

93019301
The source archives available on the web site should be capable of
93029302
building on a number of platforms. This is the recommended method for
93039303
building NASM to support platforms for which executables are not
9304-
available.
9304+
available, if you do not require changing the source code.
93059305

9306-
On a system which has Unix shell (\c{sh}), run:
9306+
The preferred build platforms are development environments which
9307+
support POSIX (Unix)-style tools (a "POSIX environment"). For Windows,
9308+
MSYS2 (\w{https://www.msys2.org/}) is such a development environment.
9309+
9310+
In a POSIX environment, run:
93079311

93089312
\c sh configure
9309-
\c make everything
9313+
\c make
93109314

93119315
A number of options can be passed to \c{configure}; see
9312-
\c{sh configure --help}.
9316+
\c{sh configure --help}. In particular, the \c{--host} option can be
9317+
used to cross-compile NASM to run on another host system.
9318+
9319+
For non-POSIX environments, a set of Makefiles for some other
9320+
environments are also available; please see the file
9321+
\c{Mkfiles/README}.
9322+
9323+
The \c{.zip} version of the source archive has DOS/Windows line
9324+
endings (\c{CR LF}), which many POSIX systems will not recognize. To
9325+
extract the \c{.zip} version on such a system, use \c{unzip
9326+
-a}. The \c{.tar} versions of the source archive has POSIX line
9327+
endings (\c{LF}).
9328+
9329+
9330+
\H{buildtools} Optional Build Tools
9331+
9332+
The following additional tools are required to build specific
9333+
subsystems, to build from the \c{git} repository, or if the sources
9334+
are modified.
9335+
9336+
Note that some of these tools will have their own dependencies.
9337+
9338+
Make sure all tools are available in your \c{PATH} (or equivalent.)
9339+
9340+
To build the installer for the Windows platform:
9341+
9342+
\b The \i{Nullsoft Scriptable Installer} (\i{NSIS},
9343+
\w{https://nsis-dev.github.io/}).
9344+
9345+
To modify the sources, \e{or} to build the documentation:
9346+
9347+
\b A Perl interpreter (\w{https://www.perl.org/}).
9348+
9349+
\b Modules from CPAN (\w{https://www.cpan.org/}). The following Perl
9350+
modules are currently required, some of which will be bundled with the
9351+
Perl interpreter or into larger CPAN packages:
9352+
9353+
\& perlbreq.src
9354+
9355+
To build the documentation:
9356+
9357+
\b Either Ghostscript (\w{https://www.ghostscript.com/}) or Adobe
9358+
Acrobat Distiller (untested.)
9359+
9360+
\b The Adobe \e{Source Sans} (or \e{Source Sans 3}) and \e{Source
9361+
Code} fonts, which are freely available under the SIL Open Font
9362+
License (\w{https://fonts.adobe.com/}).
9363+
9364+
To build the Unix man pages:
9365+
9366+
\b AsciiDoc (\w{https://asciidoc.org/}).
9367+
9368+
\b xmlto (\w{https://pagure.io/xmlto/}).
9369+
9370+
To build from the \c{git} repository on a POSIX platform:
93139371

9314-
A set of Makefiles for some other environments are also available;
9315-
please see the file \c{Mkfiles/README}.
9372+
\b GNU \c{m4}, \c{autoconf} and \c{autoheader}
9373+
(\w{https://www.gnu.org/}).
93169374

9317-
To build the installer for the Windows platform, you will need the
9318-
\i\e{Nullsoft Scriptable Installer}, \i{NSIS}, installed.
93199375

9320-
To build the documentation, you will need a set of additional tools.
9321-
The documentation is not likely to be able to build on non-Unix
9322-
systems.
9376+
9377+
\H{buildopt} Building Optional Components
9378+
9379+
Install the required tools for the subsystem in question as described
9380+
in \k{buildtools}.
9381+
9382+
To build the documentation:
9383+
9384+
\c make doc
9385+
9386+
Building the documentation may not work in a non-POSIX environment.
9387+
9388+
To build the Windows installer:
9389+
9390+
\c make nsis
9391+
9392+
To build the Unix man pages:
9393+
9394+
\c make manpages
9395+
9396+
To build everything available on the current platform:
9397+
9398+
\c make everything
9399+
93239400

93249401
\H{git} Building from the \i\c{git} Repository
93259402

@@ -9328,30 +9405,45 @@ the \c{git} distributed source control system. The link is available
93289405
on the website. This is recommended only to participate in the
93299406
development of NASM or to assist with testing the development code.
93309407

9331-
To build NASM from the \c{git} repository you will need a Perl
9332-
interpreter and, if building on a Unix system, GNU autoconf installed
9333-
on your system.
9408+
Install the required tools as described in section \k{buildtools}.
9409+
9410+
In a POSIX environment:
93349411

9335-
To build on a Unix system, run:
9412+
Run:
93369413

93379414
\c sh autogen.sh
93389415

9339-
to create the \c{configure} script and then build as listed above.
9416+
to create the \c{configure} script and then build as described in
9417+
\k{tarball}.
9418+
9419+
In a non-POSIX environment, use the tool-specific Makefiles
9420+
as described in \k{tarball}.
9421+
9422+
9423+
\H{modifysrc} Modifying the Sources
9424+
9425+
To build modified sources, you will need the tools described in
9426+
\k{buildtools}.
9427+
9428+
Some build system changes might not be possible without a POSIX
9429+
environment.
9430+
9431+
If you have modified the sources to change the embedded declarations
9432+
of warning classes, you may have to manually re-build the warning
9433+
catalog:
9434+
9435+
\c make warnings
93409436

9341-
\H{builddoc} Building the documentation
9437+
This is not done automatically, as the tools do not have the ability
9438+
to automatically detect when it is necessary to do so.
93429439

9343-
To build the documentation, you will need a Perl interpreter, a
9344-
Postscript to PDF converter such as Ghostscript, and suitable fonts
9345-
installed on your system. The recommended (and default) fonts are
9346-
Adobe's Source Sans and Source Code fonts, which are freely available
9347-
under the SIL Open Font License.
93489440

93499441
\A{contact} Contact Information
93509442

93519443
\H{website} Website
93529444

93539445
NASM has a \i{website} at
9354-
\W{http://www.nasm.us/}\c{http://www.nasm.us/}.
9446+
\w{https://www.nasm.us/}.
93559447

93569448
\i{New releases}, \i{release candidates}, and \I{snapshots, daily
93579449
development}\i{daily development snapshots} of NASM are available from
@@ -9374,7 +9466,7 @@ links and archives of past posts are available on the website.
93749466
\H{bugs} \i{Reporting Bugs}\I{bugs}
93759467

93769468
To report bugs in NASM, please use the \i{bug tracker} at
9377-
\W{http://www.nasm.us/}\c{http://www.nasm.us/} (click on "Bug
9469+
\w{https://www.nasm.us/} (click on "Bug
93789470
Tracker"), or if that fails then through one of the contacts in
93799471
\k{website}.
93809472

0 commit comments

Comments
 (0)