The source code for NASM is available from our website,
https://www.nasm.us/
, see
section E.1.
The source archives available on the web site should be capable of building on a number of platforms. This is the recommended method for building NASM to support platforms for which executables are not available, if you do not require changing the source code.
The preferred build platforms are development environments which support
POSIX (Unix)-style tools (a "POSIX environment"). For Windows, MSYS2
(https://www.msys2.org/
)
is such a development environment.
In a POSIX environment, run:
sh configure make
A number of options can be passed to configure
; see
sh configure --help
. In particular, the --host
option can be used to cross-compile NASM to run on another host system.
For non-POSIX environments, a set of Makefiles for some other
environments are also available; please see the file
Mkfiles/README
.
The .zip
version of the source archive has DOS/Windows line
endings (CR LF
), which many POSIX systems will not recognize.
To extract the .zip
version on such a system, use
unzip -a
. The .tar
versions of the source archive
has POSIX line endings (LF
).
The following additional tools are required to build specific
subsystems, to build from the git
repository, or if the
sources are modified.
Note that some of these tools will have their own dependencies.
Make sure all tools are available in your PATH
(or
equivalent.)
To build the installer for the Windows platform:
The Nullsoft Scriptable Installer (NSIS,
https://nsis-dev.github.io/
).
To modify the sources, or to build the documentation:
A Perl interpreter
(https://www.perl.org/
).
Modules from CPAN
(https://www.cpan.org/
).
The following Perl modules are currently required, some of which will be
bundled with the Perl interpreter or into larger CPAN packages:
Fcntl File::Basename File::Compare File::Copy File::Find File::Path File::Spec File::Temp Font::TTF::Cmap Font::TTF::Font Font::TTF::Head Font::TTF::Hmtx Font::TTF::Maxp Font::TTF::Post Font::TTF::PSNames Getopt::Long Pod::Usage Sort::Versions Win32 (if building on Windows only)
To build the documentation:
Either Ghostscript
(https://www.ghostscript.com/
)
or Adobe Acrobat Distiller (untested.)
The Adobe Source Sans (or Source Sans 3) and
Source Code fonts, which are freely available under the SIL Open
Font License
(https://fonts.adobe.com/
).
To build the Unix man pages:
AsciiDoc
(https://asciidoc.org/
).
xmlto
(https://pagure.io/xmlto/
).
To build from the git
repository on a POSIX platform:
GNU m4
, autoconf
and autoheader
(https://www.gnu.org/
).
Install the required tools for the subsystem in question as described in section D.2.
To build the documentation:
make doc
Building the documentation may not work in a non-POSIX environment.
To build the Windows installer:
make nsis
To build the Unix man pages:
make manpages
To build everything available on the current platform:
make everything
git
RepositoryThe NASM development tree is kept in a source code repository using the
git
distributed source control system. The link is available
on the website. This is recommended only to participate in the development
of NASM or to assist with testing the development code.
Install the required tools as described in section section D.2.
In a POSIX environment:
Run:
sh autogen.sh
to create the configure
script and then build as described
in section D.1.
In a non-POSIX environment, use the tool-specific Makefiles as described in section D.1.
To build modified sources, you will need the tools described in section D.2.
Some build system changes might not be possible without a POSIX environment.
If you have modified the sources to change the embedded declarations of warning classes, you may have to manually re-build the warning catalog:
make warnings
This is not done automatically, as the tools do not have the ability to automatically detect when it is necessary to do so.