Allow NASM to generate Watcom-style Makefile dependencies, in addition
to the default POSIX-style Makefile dependencies.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* CPPFLAGS is a user variable and should be respected
when compiling .c files. Think of -D_FORTIFY_SOURCE=2.
* Pass ALL_CFLAGS when linking too. This is recommended
for certain edge cases (-flto)
* Use DESTDIR instead of INSTALLROOT for staging dir
Every other build system (Automake, CMake, Meson) uses
DESTDIR. This integrates better into distro and other
build systems that have standard hooks for DESTDIR.
* $(MAKE) -C <dir> is better than cd'ing into a <dir>
* Use Autoconf's ${docdir} and ${htmldir} for installing
the documentation. This makes handling documentation
easier and respects user choice.
Signed-off-by: David Seifert <soap@gentoo.org>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Win32::Registry is obsolete, we need to use Win32::TieRegistry on
current platforms.
GhostScript uses # rather than = on Windows, it seems.
Try to find GhostScript in the registry and add it to the PATH.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Fix a construct in doc/findfont.ph which crashes Perl on Windows
unconditionally.
Improve the README for building the full package with MSVC.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
If we open in a very wide window, split the text into columns so it
can actually be conveniently read.
Also, change the body margin to 8px, as that seems to be the more
common browser default.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Formatting and language consistency cleanups to the sections about
disabling and enabling warning classes.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
If we want to print the document, we really want each chapter to start
on an odd (right-facing) page; otherwise it gets rather strange.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Add a file local.css which is referenced *after* nasmdoc.css, thus
overriding the latter. This file intentionally has no actual content,
which means it can be overridden locally for any desired content,
e.g. indexing into web fonts or overriding any of the style.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Make the yellow highlight for the link target a little bit less
bright, so that it is still instantly visible but less immediately
demanding of attention.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Move information about the bug reporting to the appendix. Split
building from source and website/community info into separate
appendices.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Using ems breaks because the header font sizes aren't the same as the
navbar font size. We could work around that by explicitly specifying
sizes for all of them, but for now, just specify that the link target
should end up 10% below the top of the window.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
The table of contents and index needed rework to be valid (X)HTML.
The TOC in particular needed some fairly significant rework - it is
supposed to be an ordered list, after all.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Remove some highly obsolete and, quite frankly, condecending
introductory content. For most users, downloading and especially
compiling is no longer an immediate issue, so move that information to
an appendix.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
The way links are done in the NASM documentation it makes more sense
not to underline them. Also inhibit coloring for printing.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Add indented paragraphs, which can be used to continue an item in a
bulleted list.
Produce valid strict XHTML, and include a style sheet with a navbar
and other fancy things.
Remove archaic output formats. Now only text, XHTML, and PDF are
supported.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
An uncompressed PDF is about twice as big, but if one is using an
external compression program (e.g. .pdf.xz) it compresses far better.
Use it for the RPM specfile.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
There is no sane reason to use nasmdoc.ps over nasmdoc.pdf since, oh,
about 20 years. nasmdoc.ps doesn't embed the fonts (and if it did, it
would be very large, whereas nasmdoc.pdf only contains the characters
we explicitly need), and support for PDF is generally much better than
support for PostScript.
It also makes the distribution file smaller to not have two redundant
files.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
AFM metrics always have 1000 font units to a scaled PostScript point,
but TTF/OTF doesn't have to. The easiest way (and the one which
best avoids unnecessary rounding) is to store the scale in the
metrics, and change pswidth.ph to return the width in PostScript
points instead of font units.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Use the Adobe Source Sans/Code Pro fonts by default. They are Open
Source fonts by Adobe. However, since these fonts are quite large,
let them be an external dependency and do our best to try to find them
with whatever mechanism is available on the system for finding
standard fonts.
Also have a list of substitution fonts if necessary.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Compactify the instruction list in the documentation to have fewer
margin violations, and fix some of the headings (;#).
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Make the tool write the output (especially HTML) in a specified
subdirectory directly, and make the tool create the subdirectory if it
doesn't already exists.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
We have separate invocations for the various PDF tools anyway. It
generates a slightly annoying error message, but makes some other
things a little easier.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
The 2-operand form was inherently unsafe. Use the 3-operand form
instead, which guarantees that arbitrary filenames are supported.
This also means we can remove a few instances of sysopen() which was
used for exactly this reason, however, at least in theory sysopen()
isn't portable.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
A raw data dump can potentially be very large, especially when
incbin is used. Allow a %pragma for setting the maximum dump
size (defaults to 128 bytes.)
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Make -Werror possible to control on a per-warning-class basis. While
I was fixing up that code anyway, merge the handling of the -w, -W and
[warning] argument and directives.
Furthermore, make *all* warnings suppressible; any warning that isn't
categorized now belong to category "other". However, for cleanliness
sake an "other" option does not get listed in the warning messages.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
It is kind of sad and impressive at the same time how little of the
2.13 changes are actually user-visible at this point.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
In future versions of NASM we will presumably have "real" pragmas; add
dummy support for the %pragma directive for forward compatibility.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
There is no reason why the warning-generating ilog2 has to be only the
floor variant. However, I am pretty sure we can simply implement the
ilog2cw() as a macro only; we can always fix that if that turns out to
be incorrect.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Output the kerning tables in the metrics headers. This will hopefully
make it possible to support kerning later (e.g. using the PostScript kshow
operator with some kind of kerning function.)
Note: the previous ordering of the metrics output was sensitive to the
particular hashing algorithm used in that version of Perl. This
version sorts them in order to keep them stable, but which obviously
completely changes the (otherwise unmodified) widths part of the output.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
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>
Document the label fix; although a global error, it was user-visible
in the Codeview backend so document it as such.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Cc: Jim Kukunas <james.t.kukunas@linux.intel.com>
We probably ought to release 2.12.01 in the short term. So far the
changes that have accumulated have all been build fixes.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Instead of completely useless sequential line numbers, emit line
numbers corresponding to the line numbers in the source code.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Remove the --allow-64-bits relocation, and instead make it a
suppressible warning in the case of a zero-extended relocation, and an
error in the case of a sign-extended relocation.
Relocations which can be losslessly represented in the output format
do not issue any diagnostic at all, as there is no problem in that
case.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Add the option --allow-64-bit to permit the generation of 64-bit code
even for a 16/32-bit output format.
Using NASM to do some boot strapping code and ran into trouble when
trying to emit a few 64-bit instructions in the OMF object file doing
the mode switching. While I can see how the "error: obj output format
does not support 64-bit code" message can be a useful reality check
for application programmers, it prevents low-level programmers from
doing what they want. It if was just a harmless warning, it wouldn't
be so bad, but it turns BITS 64 into BITS 16. The main trick to mixing
64-bit code into OMF and other 32-bit output formats is to avoid
64-bit sized fixups, which normally isn't too hard.
[hpa: shortened the option name to --allow-64-bit, minor code cleanups]
Signed-off-by: Knut St. Osmundsen <bird-nasm@anduin.net>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>