BR3392226 preproc: Rework line readin procedure
[nasm.git] / aclocal.m4
blob895127870f7ed8c1b7181da12472acaf5e1bd528
1 dnl --------------------------------------------------------------------------
2 dnl PA_ADD_CFLAGS()
3 dnl
4 dnl Attempt to add the given option to CFLAGS, if it doesn't break compilation
5 dnl --------------------------------------------------------------------------
6 AC_DEFUN(PA_ADD_CFLAGS,
7 [AC_MSG_CHECKING([if $CC accepts $1])
8  pa_add_cflags__old_cflags="$CFLAGS"
9  CFLAGS="$CFLAGS $1"
10  AC_TRY_LINK([#include <stdio.h>],
11  [printf("Hello, World!\n");],
12  AC_MSG_RESULT([yes]),
13  AC_MSG_RESULT([no])
14  CFLAGS="$pa_add_cflags__old_cflags")])
16 dnl --------------------------------------------------------------------------
17 dnl PA_WORKING_STDBOOL
18 dnl
19 dnl See if we have a working <stdbool.h> and bool support; in particular,
20 dnl OpenWatcom 1.8 has a broken _Bool type that we don't want to use.
21 dnl --------------------------------------------------------------------------
22 AC_DEFUN(PA_WORKING_BOOL,
23 [AC_MSG_CHECKING([if $CC has a working bool type])
24  AC_COMPILE_IFELSE([AC_LANG_SOURCE([
25 #ifndef __cplusplus
26 #include <stdbool.h>
27 #endif
28 int foo(bool x, int y)
30         return x+y;
32  ])],
33  [AC_MSG_RESULT([yes])
34   AC_DEFINE(HAVE_WORKING_BOOL, 1,
35     [Define to 1 if your compiler has a correct implementation of bool])],
36  [AC_MSG_RESULT([no])])