chiark / gitweb /
New option: movres.ignore_transience.
[e16] / m4 / ac_warnflags.m4
1 dnl Copyright (C) 2008 Kim Woelders
2 dnl This code is public domain and can be freely used or copied.
3
4 dnl Macro to set compiler warning flags
5
6 dnl Provides configure argument --enable-werror to stop compilation on warnings
7
8 dnl Usage: AC_C_WARNFLAGS([LANG])
9 dnl Set LANG to 'cpp' when compiling for C++
10
11 AC_DEFUN([AC_C_WARNFLAGS], [
12   define(ac_c_compile_cpp, ifelse([$1], [cpp], [yes], [no]))
13
14   AC_ARG_ENABLE(werror,
15     [  --enable-werror         treat compiler warnings as errors @<:@default=no@:>@],,
16     enable_werror=no)
17
18   if test "x$GCC" = "xyes"; then
19     CWARNFLAGS="-W -Wall -Waggregate-return -Wcast-align -Wpointer-arith -Wshadow -Wwrite-strings"
20     ifelse(ac_c_compile_cpp, no, [
21       CWARNFLAGS="$CWARNFLAGS -Wmissing-prototypes -Wmissing-declarations -Wstrict-prototypes"
22     ],)
23
24     if test "x$enable_werror" = "xyes"; then
25       CWARNFLAGS="$CWARNFLAGS -Werror"
26     fi
27   fi
28   AC_SUBST(CWARNFLAGS)
29 ])