Commit Graph

28 Commits

Author SHA1 Message Date
Cyrill Gorcunov
d7a5473368 configure: Add --enable-gdb option
When one needs to run nasm under GDB

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2017-08-16 14:59:25 -07:00
H. Peter Anvin
26fad144de configure.ac: fix --enable-sections
The --enable-sections option isn't too useful without
-Wl,--gc-sections.  It's unclear if gcc will provide that option by
default.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2017-04-23 21:42:31 -07:00
Ed Beroset
74fa0a736a configure.ac, doc/Makefile.in: fix out-of-directory build
Missed some necessary updates.

Signed-off-by: Ed Beroset <beroset@ieee.org>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2017-04-14 15:28:18 -07:00
Ed Beroset
d219c55643 configure, doc/Makefile.in: fix out-of-directory build
Fix bit rot for out of directory builds.

Signed-off-by: Ed Beroset <beroset@mindspring.com>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2017-04-14 09:54:17 -07:00
H. Peter Anvin
f13effec22 doc: add the option to generate an uncompressed PDF
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>
2017-04-10 16:10:28 -07:00
H. Peter Anvin
d31a86e5b1 doc: don't bother using autoconf to search for pdf tools
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>
2017-04-06 19:38:38 -07:00
H. Peter Anvin
9a714c98a2 rdoff: move rdoff build into main Makefile to make it build on Windows
NSIS packages rdoff, and we really want to be able to build the full
NSIS package on an MSVC platform.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2017-04-06 17:24:03 -07:00
H. Peter Anvin
3118429089 Windows: clean up the handling of stat on Windows
[f]stat on Windows is messy: we need to use _stati64 for maximum
compatibility, but because there is a bunch of stuff wrapped in
macros, autoconf sometimes gets the wrong answers.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2017-04-06 15:48:51 -07:00
H. Peter Anvin
0da1549b73 autoconf: fix handling of --enable/--disable options, WINE fix
AC_ARG_ENABLE() doesn't really work the way you expect: one argument
is called on *any* invocation.  Create simple helper wrappers to get
the effect we really want for boolean options.

Define WINELOADER=/dev/null to prevent autoconf from inadvertently
running Wine and think we are not cross-compiling even if we are.  It
is at the very best slow and buys us absolutely nothing.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2017-04-06 15:48:45 -07:00
H. Peter Anvin
675e7b7d79 MSVC compatibility: clean up the handling of _stati64/_fstati64
On Windows we need to use _stati64/_fstati64 in order to handle large
file sizes, but the handling was broken in the canned MSVC++
configuration.  Clean it up and fix it.

This addresses BR 3392398.

Reported-by: Nikolai Saoukh <nms@otdel-1.org>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2017-04-05 21:19:03 -07:00
H. Peter Anvin
2d89477ef4 configure.ac: smarter way to handle -O2 -> -O3 default change
We don't want to tack on -O3 if the user has specified, say,
CFLAGS='-g -O1' for debugging.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2017-03-01 12:57:46 -08:00
H. Peter Anvin
0c36965335 configure.ac: make possible to compile with -ffunction/data-sections
The -ffunction-sections and -fdata-sections, if supported, can enable
the linker to do some amount of dead code elimination.  Basically a
very basic form of LTO.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2017-02-28 19:34:36 -08:00
H. Peter Anvin
9b935a0ea8 configure.ac: default to -O3
Default to -O3 instead of -O2.  The code gets somewhat bigger, but
nasm is full of tiny functions called from all over the place.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2017-02-28 19:02:51 -08:00
H. Peter Anvin
5fe847e590 Makefile: make it possible to compile with gcc link-time optimization
Put in the necessary machinery to compile with gcc link-time
optimization.  This means compiling and linking with -flto, as well as
using gcc-ar and gcc-ranlib instead of the normal tools.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2017-02-28 18:48:01 -08:00
H. Peter Anvin
895a66cbcb configure.ac: use AC_FUNC_MMAP instead of AC_CHECK_FUNCS(mmap)
There are a couple of extra checks in autoconf for mmap, supposedly.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2017-02-23 20:34:38 -08:00
H. Peter Anvin
bc18af18f0 configure: make sure we flag invalid attributes
Use -Werror=attributes so we can actually test for non-supported
attributes without spewing warnings.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2017-02-23 19:22:27 -08:00
H. Peter Anvin
abd28c9ab9 If we have new features introduced by C11, use them
Instead of using hacks or compiler-specific features, if we have
standard features as defined in ISO C11, use them.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2016-12-20 02:29:58 -08:00
H. Peter Anvin
8d4fb26ad4 Various fixes to the ilog2 functions
Fix several bugs in the ilog2 functions.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2016-11-15 14:23:54 -08:00
H. Peter Anvin
8b19083483 Better support for function attributes, autoconf cleanups
Use autoconf to detect function attributes; some compilers like Sun CC
do support some gcc-style attributes, but don't define __GNUC__.  Also
-U__STRICT_ANSI__ already in configure.ac so our tests match what we
might eventually encounter.

Add const_func and pure_func attributes.

Decorate functions in nasmlib.h with const_func and pure_func.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2016-11-15 14:01:37 -08:00
H. Peter Anvin
4c9132e3a0 compiler.h: include <sys/types.h>
Apparently, at least on some OS/2 compilers, <sys/types.h> needs to be
included for off_t to be defined.  This seems like a generically good
idea to include this header whenever it is available.

Remove reference to <types.h>.  This was supposedly for MSVC, but
there is no actual evidence that it is useful beyond <sys/types.h>.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2016-10-19 13:13:38 -07:00
H. Peter Anvin
397c169736 Move config.h to a subdirectory, add MSVC-specific config file
Instead of trying to do hacks in the Makefiles, define header files
for specific compilers if they can't use autoconf.  Currently defined
for Microsoft Visual Studio, based on MSDN documentation.  It is
currently untested.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2016-10-04 17:01:59 -07:00
H. Peter Anvin
d81a235f33 file: improve the file access interface
A number of fairly common operations are invoked way too many times,
especially when using incbin.  Drastically reduce the number of system
calls that need to be executed, and use memory mapping to reduce
unnecessary double buffering.

We could improve this further by leaving files open once used;
however, that might run into file count problems on some systems.

Still unclear is why we seem to invoke nasm_file_size() twice per pass
for incbin.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2016-09-21 14:07:17 -07:00
H. Peter Anvin
43e026277b configure.ac: disable common data to avoid problems with some linkers
Disable common data to:

a) discover problems with common data as quickly as possible (we
   should not use common data as some compilers may not handle it);
b) work around a problem with the OSX linker causing it to not find
   zero_buffer even though it is defined in nasmlib/zerobuf.c.

Reported-by: anonymous coward <nasm64developer@users.sf.net>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2016-08-02 09:28:22 -07:00
H. Peter Anvin
e1f985c167 Reorganize the source code into subdirectories
Make the source code easier to understand and keep track of by
organizing it into subdirectories depending on the function.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2016-05-25 12:06:29 -07:00
H. Peter Anvin
22538e2b67 nasmlib: break up nasmlib.c into logical components
nasmlib.c had basically turned into a garbage bin of various functions
with very little in common.  Break it up into logical components for
isolation and manageability.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2016-05-25 05:43:49 -07:00
H. Peter Anvin
7baac1e7f8 Merge remote-tracking branch 'origin/nasm-2.12.xx' 2016-05-16 21:36:53 -07:00
H. Peter Anvin
a87c5e4c87 Merge remote-tracking branch 'origin/nasm-2.12.xx'
Resolved Conflicts:
	.gitignore
	Makefile.in
	Mkfiles/msvc.mak
	Mkfiles/netware.mak
	Mkfiles/openwcom.mak
	Mkfiles/owlinux.mak
	preproc-nop.c
	preproc.c
	version

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2016-05-16 21:27:33 -07:00
H. Peter Anvin
b156bc8c61 autoconf: rename configure.in to configure.ac
In accordance with current practice, rename configure.in to configure.ac.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2016-03-16 02:13:43 -07:00