codeview.c: register all filenames
[nasm.git] / aclocal.m4
blob50c1af887528a82d74811ff4c99dbdb19f791eff
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  CFLAGS="$pa_add_cflags__old_cflags ifelse([$2],[],[$1],[$2])",
14  AC_MSG_RESULT([no])
15  CFLAGS="$pa_add_cflags__old_cflags")])
17 dnl --------------------------------------------------------------------------
18 dnl PA_WORKING_STDBOOL
19 dnl
20 dnl See if we have a working <stdbool.h> and bool support; in particular,
21 dnl OpenWatcom 1.8 has a broken _Bool type that we don't want to use.
22 dnl --------------------------------------------------------------------------
23 AC_DEFUN(PA_WORKING_BOOL,
24 [AC_MSG_CHECKING([if $CC has a working bool type])
25  AC_COMPILE_IFELSE([AC_LANG_SOURCE([
26 #ifndef __cplusplus
27 #include <stdbool.h>
28 #endif
29 int foo(bool x, int y)
31         return x+y;
33  ])],
34  [AC_MSG_RESULT([yes])
35   AC_DEFINE(HAVE_WORKING_BOOL, 1,
36     [Define to 1 if your compiler has a correct implementation of bool])],
37  [AC_MSG_RESULT([no])])