blob: 156e8dbf96b58f5462e225835a607928a2d4e7de [file] [log] [blame]
H. Peter Anvincae5d062017-11-08 10:22:10 -08001dnl Process this file with autoconf 2.69 or later to produce
H. Peter Anvin1170eb62002-05-19 02:26:38 +00002dnl a configure script.
H. Peter Anvincae5d062017-11-08 10:22:10 -08003AC_PREREQ(2.69)
H. Peter Anvineaef8512019-08-27 15:12:00 -07004AC_INIT([config/unconfig.h])
H. Peter Anvin (Intel)8b6e6bf2019-08-16 00:08:27 -07005AC_CONFIG_HEADERS([config/config.h:config/unconfig.h])
H. Peter Anvin87bc6192002-04-30 20:53:16 +00006AC_PREFIX_PROGRAM(nasm)
H. Peter Anvin0bddd0f2019-02-22 01:13:52 -08007AC_CONFIG_AUX_DIR(autoconf/helpers)
H. Peter Anvin87bc6192002-04-30 20:53:16 +00008
H. Peter Anvin2d894772017-03-01 12:57:46 -08009dnl Save initial CFLAGS, to see if -g -O2 came from configure or not
10pa_init_cflags="$CFLAGS"
11
H. Peter Anvin0da15492017-04-06 15:24:58 -070012dnl This prevents us from running Wine and thinking we are not
13dnl cross-compiling when in fact we are; running Wine here is at
14dnl the best very slow and doesn't buy us a single thing at all.
15WINELOADER=/dev/null
16export WINELOADER
17
H. Peter Anvin2d894772017-03-01 12:57:46 -080018dnl Checks for programs and enable necessary CC extensions
H. Peter Anvin2f0f9ea2008-06-08 20:53:29 -070019AC_USE_SYSTEM_EXTENSIONS
H. Peter Anvinb423c022016-02-18 11:57:53 -080020AC_SYS_LARGEFILE
H. Peter Anvin87bc6192002-04-30 20:53:16 +000021AC_PROG_CC
H. Peter Anvind338b372016-02-18 00:54:30 -080022AC_PROG_CC_STDC
H. Peter Anvin87bc6192002-04-30 20:53:16 +000023AC_PROG_LN_S
24AC_PROG_MAKE_SET
H. Peter Anvin87bc6192002-04-30 20:53:16 +000025AC_PROG_INSTALL
26
H. Peter Anvin48fd1542018-06-14 19:19:09 -070027pa_no_optimize=false
28
29dnl If the user did not specify a CFLAGS default, change default
30dnl to -O0 for debugging
H. Peter Anvin0da15492017-04-06 15:24:58 -070031PA_ARG_DISABLED([optimization],
32 [compile without optimization (-O0) to help debugging],
H. Peter Anvin48fd1542018-06-14 19:19:09 -070033 [pa_no_optimize=true])
H. Peter Anvin9b935a02017-02-28 19:02:51 -080034
Cyrill Gorcunovfdbf7012017-07-29 16:05:36 +030035dnl Compile and link with dwarf debug
36PA_ARG_ENABLED([gdb],
37 [disable optimization and compile with extra debug information for GDB debugger],
H. Peter Anvin48fd1542018-06-14 19:19:09 -070038 [PA_ADD_CFLAGS([-ggdb3])
39 pa_no_optimize=true])
H. Peter Anvin53259e82017-10-11 16:47:59 -070040
H. Peter Anvin48fd1542018-06-14 19:19:09 -070041AS_IF([$pa_no_optimize],
42 [PA_ADD_CFLAGS([-O0])
43 PA_ADD_CFLAGS([-fno-omit-frame-pointer])])
Cyrill Gorcunovfdbf7012017-07-29 16:05:36 +030044
H. Peter Anvinefee3ea2019-02-25 21:00:43 -080045dnl Profiling
46PA_ARG_ENABLED([profiling],
47 [compile with profiling (-pg option)],
48 [PA_ADD_CFLAGS([-pg])])
49
H. Peter Anvindcbaf672017-12-20 12:06:54 -080050dnl Abort on panic
51PA_ARG_ENABLED([panic-abort],
52 [call abort() on panic to trap in the debugger],
53 [AC_DEFINE(ABORT_ON_PANIC)])
54AH_TEMPLATE(ABORT_ON_PANIC,
55[Define to 1 to call abort() on panics (internal errors), for debugging.])
56
H. Peter Anvin89c17702016-03-09 14:11:40 -080057dnl Check for library extension
58PA_LIBEXT
59
Cyrill Gorcunov7729edf2014-12-20 11:35:51 +030060dnl Checks for typedefs, structures, and compiler characteristics.
61AC_C_CONST
H. Peter Anvin03f229c2015-11-04 11:29:09 -080062AC_C_INLINE
Cyrill Gorcunov7729edf2014-12-20 11:35:51 +030063AC_C_RESTRICT
64AC_TYPE_SIZE_T
H. Peter Anvinef635882016-03-01 21:53:09 -080065AC_C_BIGENDIAN(AC_DEFINE(WORDS_BIGENDIAN),AC_DEFINE(WORDS_LITTLEENDIAN),,)
Cyrill Gorcunov7729edf2014-12-20 11:35:51 +030066AH_TEMPLATE(WORDS_BIGENDIAN,
67[Define to 1 if your processor stores words with the most significant
68byte first (like Motorola and SPARC, unlike Intel and VAX).])
69AH_TEMPLATE(WORDS_LITTLEENDIAN,
70[Define to 1 if your processor stores words with the least significant
71byte first (like Intel and VAX, unlike Motorola and SPARC).])
72
H. Peter Anvinb9c1ca72016-03-01 21:51:40 -080073dnl Force gcc and gcc-compatible compilers treat signed integers
74dnl as 2's complement
H. Peter Anvin8d9f5912016-02-27 00:15:13 -080075PA_ADD_CFLAGS([-fwrapv])
H. Peter Anvin87bc6192002-04-30 20:53:16 +000076
H. Peter Anvin8b190832016-11-15 14:01:37 -080077dnl Some environments abuse __STRICT_ANSI__ to disable some
78dnl function declarations
79PA_ADD_CFLAGS([-U__STRICT_ANSI__])
80
H. Peter Anvin43e02622016-08-02 09:28:22 -070081dnl Don't put things in common if we can avoid it. We don't want to
82dnl assume all compilers support common, and this will help find those
83dnl problems. This also works around an OSX linker problem.
84PA_ADD_CFLAGS([-fno-common])
85
H. Peter Anvineec3b522008-06-19 11:39:23 -070086dnl Look for programs...
H. Peter Anvina9397832013-05-17 12:02:49 -070087AC_CHECK_PROGS(NROFF, nroff, false)
H. Peter Anvind089c222013-10-24 13:22:19 +010088AC_CHECK_PROGS(ASCIIDOC, asciidoc, false)
89AC_CHECK_PROGS(XMLTO, xmlto, false)
H. Peter Anvin620515a2002-04-30 20:57:38 +000090
H. Peter Anvind089c222013-10-24 13:22:19 +010091dnl Check for progs needed for manpage generation
H. Peter Anvin0da15492017-04-06 15:24:58 -070092AS_IF([test $ASCIIDOC = false],
93 [AC_MSG_WARN([No asciidoc package found])]
94)
95AS_IF([test $XMLTO = false],
96 [AC_MSG_WARN([No xmlto package found])]
97)
H. Peter Anvind089c222013-10-24 13:22:19 +010098
H. Peter Anvincc147f72016-03-08 02:06:39 -080099dnl Check for host compiler tools
100AC_CHECK_TOOL(AR, ar)
101AC_CHECK_TOOL(RANLIB, ranlib, :)
102AC_CHECK_TOOL(STRIP, strip)
103
H. Peter Anvin87bc6192002-04-30 20:53:16 +0000104dnl Checks for header files.
105AC_HEADER_STDC
H. Peter Anvin3ef4f002016-03-08 12:14:55 -0800106AC_CHECK_HEADERS(inttypes.h)
H. Peter Anvinfe501952007-10-02 21:53:51 -0700107AC_CHECK_HEADERS(strings.h)
H. Peter Anvind338b372016-02-18 00:54:30 -0800108AC_HEADER_STDBOOL
H. Peter Anvinabd28c92016-12-20 02:29:58 -0800109AC_CHECK_HEADERS(stdnoreturn.h)
H. Peter Anvine65e81b2016-02-18 14:24:40 -0800110AC_CHECK_HEADERS(io.h)
H. Peter Anvind81a2352016-09-21 14:03:18 -0700111AC_CHECK_HEADERS(fcntl.h)
H. Peter Anvin4627e692016-01-26 12:01:34 -0800112AC_CHECK_HEADERS(unistd.h)
H. Peter Anvind81a2352016-09-21 14:03:18 -0700113AC_CHECK_HEADERS(sys/mman.h)
H. Peter Anvin4c9132e2016-10-19 13:13:38 -0700114AC_CHECK_HEADERS(sys/types.h)
H. Peter Anvin675e7b72017-04-05 21:19:03 -0700115AC_CHECK_HEADERS(sys/stat.h)
H. Peter Anvin4627e692016-01-26 12:01:34 -0800116
H. Peter Anvin87bc6192002-04-30 20:53:16 +0000117dnl Checks for library functions.
H. Peter Anvinfe501952007-10-02 21:53:51 -0700118AC_CHECK_FUNCS(strcasecmp stricmp)
119AC_CHECK_FUNCS(strncasecmp strnicmp)
H. Peter Anvin73b22f52016-02-18 14:40:37 -0800120AC_CHECK_FUNCS(strsep)
H. Peter Anvin22538e22016-05-25 05:42:47 -0700121AC_CHECK_FUNCS(strnlen)
H. Peter Anvin81b62b92017-12-20 13:33:49 -0800122AC_CHECK_FUNCS(strrchrnul)
H. Peter Anvin13506202018-11-28 14:55:58 -0800123AC_CHECK_FUNCS(iscntrl)
124AC_CHECK_FUNCS(isascii)
H. Peter Anvin06f72bb2018-12-26 06:22:47 -0800125AC_CHECK_FUNCS(mempcpy)
H. Peter Anvinfe501952007-10-02 21:53:51 -0700126
H. Peter Anvin038d8612007-04-12 16:54:50 +0000127AC_CHECK_FUNCS(getuid)
128AC_CHECK_FUNCS(getgid)
129
H. Peter Anvin4627e692016-01-26 12:01:34 -0800130AC_CHECK_FUNCS(realpath)
131AC_CHECK_FUNCS(canonicalize_file_name)
132AC_CHECK_FUNCS(_fullpath)
133AC_CHECK_FUNCS(pathconf)
134
H. Peter Anvine65e81b2016-02-18 14:24:40 -0800135AC_FUNC_FSEEKO
H. Peter Anvinec82d7a2016-02-21 21:20:45 -0800136AC_CHECK_FUNCS([_fseeki64])
H. Peter Anvine65e81b2016-02-18 14:24:40 -0800137AC_CHECK_FUNCS([ftruncate _chsize _chsize_s])
H. Peter Anvin397c1692016-10-04 17:01:59 -0700138AC_CHECK_FUNCS([fileno _fileno])
H. Peter Anvine65e81b2016-02-18 14:24:40 -0800139
H. Peter Anvin895a66c2017-02-23 20:34:38 -0800140AC_FUNC_MMAP
H. Peter Anvind81a2352016-09-21 14:03:18 -0700141AC_CHECK_FUNCS(getpagesize)
142AC_CHECK_FUNCS(sysconf)
143
H. Peter Anvin397c1692016-10-04 17:01:59 -0700144AC_CHECK_FUNCS([access _access faccessat])
H. Peter Anvind81a2352016-09-21 14:03:18 -0700145
H. Peter Anvine558dfd2017-04-18 16:05:22 -0700146PA_HAVE_FUNC(__builtin_expect, (1,1))
147
148dnl ilog2() building blocks
149PA_ADD_HEADERS(intrin.h)
H. Peter Anvin8d4fb262016-11-15 14:23:54 -0800150PA_HAVE_FUNC(__builtin_clz, (0U))
151PA_HAVE_FUNC(__builtin_clzl, (0UL))
152PA_HAVE_FUNC(__builtin_clzll, (0ULL))
H. Peter Anvine558dfd2017-04-18 16:05:22 -0700153PA_HAVE_FUNC(_BitScanReverse, (0))
154PA_HAVE_FUNC(_BitScanReverse64, (0))
H. Peter Anvind338b372016-02-18 00:54:30 -0800155
H. Peter Anvin81b62b92017-12-20 13:33:49 -0800156dnl Functions for which we have replacements available in stdlib/
H. Peter Anvincc147f72016-03-08 02:06:39 -0800157AC_CHECK_FUNCS([vsnprintf _vsnprintf])
158AC_CHECK_FUNCS([snprintf _snprintf])
159AC_CHECK_FUNCS([strlcpy])
H. Peter Anvin81b62b92017-12-20 13:33:49 -0800160AC_CHECK_FUNCS([strrchrnul])
H. Peter Anvind338b372016-02-18 00:54:30 -0800161
H. Peter Anvin31184292017-04-06 15:30:56 -0700162dnl These types are POSIX-specific, and Windows does it differently...
163AC_CHECK_TYPES([struct _stati64])
164AC_CHECK_TYPES([struct stat])
165AC_CHECK_FUNCS([stat _stati64])
166AC_CHECK_FUNCS([fstat _fstati64])
H. Peter Anvin (Intel)471120f2019-05-15 13:07:21 -0700167AC_CHECK_FUNCS([S_ISREG])
H. Peter Anvin31184292017-04-06 15:30:56 -0700168
H. Peter Anvinc13d31a2007-10-26 18:49:29 -0700169dnl Check for functions that might not be declared in the headers for
170dnl various idiotic reasons (mostly because of library authors
171dnl abusing the meaning of __STRICT_ANSI__)
172AC_CHECK_DECLS(strcasecmp)
173AC_CHECK_DECLS(stricmp)
174AC_CHECK_DECLS(strncasecmp)
175AC_CHECK_DECLS(strnicmp)
176AC_CHECK_DECLS(strsep)
H. Peter Anvineaa68f12009-08-10 15:56:52 -0700177AC_CHECK_DECLS(strlcpy)
H. Peter Anvin22538e22016-05-25 05:42:47 -0700178AC_CHECK_DECLS(strnlen)
H. Peter Anvin81b62b92017-12-20 13:33:49 -0800179AC_CHECK_DECLS(strrchrnul)
H. Peter Anvinc13d31a2007-10-26 18:49:29 -0700180
H. Peter Anvind81a2352016-09-21 14:03:18 -0700181dnl Check for missing types
182AC_TYPE_UINTPTR_T
183
H. Peter Anvinf13effe2017-04-10 16:10:28 -0700184dnl Documentation: should we generate an uncompressed PDF? It is
185dnl about twice as big, but it can be externally compressed (e.g. with xz)
186dnl and becomes significantly smaller than the original.
187PA_ARG_DISABLED([pdf-compression],
188 [generate an uncompressed documentation PDF],
189 [PDFOPT='-nocompress'])
190AC_SUBST([PDFOPT])
191
H. Peter Anvin8b190832016-11-15 14:01:37 -0800192dnl
H. Peter Anvin5eb528b2017-04-18 15:49:25 -0700193dnl Look for byte-swapping support...
194dnl
H. Peter Anvine5033df2017-11-29 16:04:05 -0800195PA_ADD_HEADERS(endian.h sys/endian.h machine/endian.h)
H. Peter Anvin5eb528b2017-04-18 15:49:25 -0700196PA_HAVE_FUNC(cpu_to_le16, (0))
197PA_HAVE_FUNC(cpu_to_le32, (0))
198PA_HAVE_FUNC(cpu_to_le64, (0))
199PA_HAVE_FUNC(__cpu_to_le16, (0))
200PA_HAVE_FUNC(__cpu_to_le32, (0))
201PA_HAVE_FUNC(__cpu_to_le64, (0))
202PA_HAVE_FUNC(htole16, (0))
203PA_HAVE_FUNC(htole32, (0))
204PA_HAVE_FUNC(htole64, (0))
205PA_HAVE_FUNC(__bswap_16, (0))
206PA_HAVE_FUNC(__bswap_32, (0))
207PA_HAVE_FUNC(__bswap_64, (0))
208PA_HAVE_FUNC(__builtin_bswap16, (0))
209PA_HAVE_FUNC(__builtin_bswap32, (0))
210PA_HAVE_FUNC(__builtin_bswap64, (0))
H. Peter Anvine558dfd2017-04-18 16:05:22 -0700211PA_HAVE_FUNC(_byteswap_ushort, (0))
212PA_HAVE_FUNC(_byteswap_ulong, (0))
213PA_HAVE_FUNC(_byteswap_uint64, (0))
H. Peter Anvin5eb528b2017-04-18 15:49:25 -0700214
215dnl
H. Peter Anvin (Intel)b7f24e72018-12-14 14:21:16 -0800216dnl Some rather useful gcc extensions...
H. Peter Anvine5033df2017-11-29 16:04:05 -0800217dnl
218PA_HAVE_FUNC(__builtin_constant_p, (0))
H. Peter Anvin (Intel)b7f24e72018-12-14 14:21:16 -0800219PA_HAVE_FUNC(__builtin_choose_expr, (0,1,2))
H. Peter Anvine5033df2017-11-29 16:04:05 -0800220
221dnl
H. Peter Anvin8b190832016-11-15 14:01:37 -0800222dnl Check for supported gcc attributes; some compilers (e.g. Sun CC)
223dnl support these, but don't define __GNUC__ as they don't support
224dnl some other features of gcc.
225dnl
H. Peter Anvinbc18af12017-02-23 19:22:27 -0800226PA_ADD_CFLAGS([-Werror=attributes])
H. Peter Anvin8b190832016-11-15 14:01:37 -0800227PA_FUNC_ATTRIBUTE(noreturn)
H. Peter Anvin (Intel)8b6e6bf2019-08-16 00:08:27 -0700228PA_FUNC_ATTRIBUTE(returns_nonnull,,,,,never_null)
H. Peter Anvin8b190832016-11-15 14:01:37 -0800229PA_FUNC_ATTRIBUTE(malloc)
H. Peter Anvin (Intel)8b6e6bf2019-08-16 00:08:27 -0700230PA_FUNC_ATTRIBUTE(alloc_size,[1])
231PA_FUNC_ATTRIBUTE(alloc_size,[1,2])
232PA_FUNC_ATTRIBUTE(sentinel,,, [const char *, ...], ["a","b",NULL],end_with_null)
233PA_FUNC_ATTRIBUTE(format, [printf,1,2], int, [const char *, ...], ["%d",1])
H. Peter Anvin8b190832016-11-15 14:01:37 -0800234PA_FUNC_ATTRIBUTE(const)
235PA_FUNC_ATTRIBUTE(pure)
H. Peter Anvin (Intel)8b6e6bf2019-08-16 00:08:27 -0700236PA_FUNC_ATTRIBUTE(cold,,,,,unlikely_func)
H. Peter Anvinabd28c92016-12-20 02:29:58 -0800237PA_FUNC_ATTRIBUTE_ERROR
H. Peter Anvin87bc6192002-04-30 20:53:16 +0000238
Cyrill Gorcunov325768e2010-11-11 11:18:44 +0300239dnl
H. Peter Anvin53259e82017-10-11 16:47:59 -0700240dnl support function sections (if available)
Cyrill Gorcunov325768e2010-11-11 11:18:44 +0300241dnl
H. Peter Anvin (Intel)7dc5b232018-12-13 22:51:22 -0800242PA_ARG_DISABLED([sections],
Cyrill Gorcunov82746232018-12-23 17:15:41 +0300243 [do not try to compile with function/data section support],
H. Peter Anvin (Intel)7dc5b232018-12-13 22:51:22 -0800244 [],
H. Peter Anvinb0121dc2018-12-22 18:17:16 -0800245 [PA_ADD_CFLAGS([-ffunction-sections])
246 PA_ADD_CFLAGS([-fdata-sections])
247 PA_ADD_LDFLAGS([-Wl,--gc-sections])]
H. Peter Anvin (Intel)7dc5b232018-12-13 22:51:22 -0800248 )
H. Peter Anvin53259e82017-10-11 16:47:59 -0700249
H. Peter Anvin5fe847e2017-02-28 18:48:01 -0800250dnl
251dnl support LTO
252dnl
H. Peter Anvin0da15492017-04-06 15:24:58 -0700253PA_ARG_ENABLED([lto],
254 [compile with gcc-style link time optimization],
H. Peter Anvinb0121dc2018-12-22 18:17:16 -0800255 [PA_ADD_CFLAGS([-flto])
H. Peter Anvin0da15492017-04-06 15:24:58 -0700256 dnl Note: we use _PROG rather than _TOOL since we are prepending the full
257 dnl CC name which ought to already contain the host triplet if needed
258 ccbase=`echo "$CC" | awk '{ print $1; }'`
259 AC_CHECK_PROGS(CC_AR, [${ccbase}-ar], [$ac_cv_prog_AR])
260 AR="$CC_AR"
261 AC_CHECK_PROGS(CC_RANLIB, [${ccbase}-ranlib], [$ac_cv_prog_RANLIB])
262 RANLIB="$CC_RANLIB"], [])
H. Peter Anvin5fe847e2017-02-28 18:48:01 -0800263
H. Peter Anvin53259e82017-10-11 16:47:59 -0700264dnl
265dnl support sanitizers (if available)
266dnl
267PA_ARG_ENABLED([sanitizer],
268 [compile with sanitizers enabled],
269 [PA_ADD_CFLAGS([-fno-omit-frame-pointer])
H. Peter Anvinb0121dc2018-12-22 18:17:16 -0800270 PA_ADD_CFLAGS([-fsanitize=address])
271 PA_ADD_CFLAGS([-fsanitize=undefined])])
H. Peter Anvin53259e82017-10-11 16:47:59 -0700272
H. Peter Anvin7310d0b2018-05-30 11:48:00 -0700273dnl
274dnl Don't make symbols visible, there is no point and it just
275dnl makes the code slower.
276dnl
H. Peter Anvinb0121dc2018-12-22 18:17:16 -0800277PA_ADD_CFLAGS([-fvisibility=hidden])
H. Peter Anvin7310d0b2018-05-30 11:48:00 -0700278
H. Peter Anvinb9c1ca72016-03-01 21:51:40 -0800279dnl If we have gcc, add appropriate code cleanliness options
H. Peter Anvind338b372016-02-18 00:54:30 -0800280PA_ADD_CFLAGS([-Wall])
H. Peter Anvin (Intel)480d5e22019-08-16 00:52:26 -0700281PA_ARG_DISABLED([pedantic],
282[disable some extra paranoid compiler warnings],
283[],
284[PA_ADD_CFLAGS([-W])
285 PA_ADD_CFLAGS([-pedantic])
286 PA_ADD_CFLAGS([-Wc90-c99-compat])])
H. Peter Anvinc9fd7b22016-05-16 21:35:48 -0700287dnl LLVM doesn't error out on invalid -W options unless this option is
288dnl specified first. Enable this so this script can actually discover
289dnl which -W options are possible for this compiler.
290PA_ADD_CFLAGS([-Werror=unknown-warning-option])
H. Peter Anvin25da6ea2016-03-01 22:20:10 -0800291dnl Suppress format warning on Windows targets due to their <inttypes.h>
292PA_ADD_CFLAGS([-Wpedantic-ms-format],[-Wno-pedantic-ms-format])
H. Peter Anvin25da6ea2016-03-01 22:20:10 -0800293PA_ADD_CFLAGS([-Wlong-long],[-Wno-long-long])
H. Peter Anvinc4e16f72018-06-02 23:46:21 -0700294dnl This is needed because we intentionally expect strncpy() to fill
295dnl in a zero-padded (not zero-terminated) buffer in several backends
296PA_ADD_CFLAGS([-Wstringop-truncation],[-Wno-stringop-truncation])
H. Peter Anvin (Intel)64b56ea2018-12-12 15:56:28 -0800297dnl This is needed because we assume 2's-completement signed arithmetic;
298dnl on compilers with gcc-like command line syntax we pass the -fwrapv
299dnl option for exactly that reason.
300PA_ADD_CFLAGS([-Wshift-negative-value],[-Wno-shift-negative-value])
301
H. Peter Anvincfd56eb2016-03-06 21:44:14 -0800302dnl PA_ADD_CFLAGS([-Wwrite-strings])
H. Peter Anvin0da15492017-04-06 15:24:58 -0700303PA_ARG_ENABLED([werror],
304 [compile with -Werror to error out on any warning],
305 [PA_ADD_CFLAGS([-Werror])],
306 [PA_ADD_CFLAGS([-Werror=implicit])
307 PA_ADD_CFLAGS([-Werror=missing-braces])
308 PA_ADD_CFLAGS([-Werror=return-type])
309 PA_ADD_CFLAGS([-Werror=trigraphs])
310 PA_ADD_CFLAGS([-Werror=pointer-arith])
311 PA_ADD_CFLAGS([-Werror=strict-prototypes])
312 PA_ADD_CFLAGS([-Werror=missing-prototypes])
313 PA_ADD_CFLAGS([-Werror=missing-declarations])
314 PA_ADD_CFLAGS([-Werror=comment])
315 PA_ADD_CFLAGS([-Werror=vla])]
316)
Ozkan Sezerec3d4262016-02-12 23:49:49 -0800317
H. Peter Anvin0c369652017-02-28 19:34:36 -0800318dnl
H. Peter Anvin99d45c82018-02-20 12:34:17 -0800319dnl On some versions of gcc, -Werror=missing-prototypes causes problems
320dnl with C99-style external inlines. Test this *after* adding the -Werror
321dnl options.
322dnl
323PA_CHECK_BAD_STDC_INLINE
324
325dnl
H. Peter Anvin0c369652017-02-28 19:34:36 -0800326dnl support ccache
327dnl
H. Peter Anvin0da15492017-04-06 15:24:58 -0700328PA_ARG_ENABLED([ccache], [compile with ccache], [CC="ccache $CC"], [])
H. Peter Anvin0c369652017-02-28 19:34:36 -0800329
Ed Beroset74fa0a72017-04-14 17:08:15 -0400330AC_OUTPUT_COMMANDS([mkdir -p config nasmlib nsis output stdlib x86 asm disasm rdoff macros common])
H. Peter Anvin9a714c92017-04-06 17:24:03 -0700331AC_OUTPUT(Makefile doc/Makefile)