1 dnl @synopsis MC_CHECK_CFLAGS
3 dnl Check flags supported by compilator
5 dnl @author Slava Zanko <slavazanko@gmail.com>
6 dnl @version 2009-10-29
8 dnl @copyright Free Software Foundation, Inc.
10 AC_DEFUN([MC_CHECK_ONE_CFLAG],[
12 AC_MSG_CHECKING([if gcc accepts $1])
21 mc_check_one_cflag=yes
28 AC_MSG_RESULT([$mc_check_one_cflag])
30 if test x$mc_check_one_cflag = xyes; then
31 mc_configured_cflags="$mc_configured_cflags $1"
36 AC_DEFUN([MC_CHECK_CFLAGS],[
37 mc_configured_cflags=""
39 dnl Sorted -f options:
40 MC_CHECK_ONE_CFLAG([-fdiagnostics-show-option])
41 dnl MC_CHECK_ONE_CFLAG([-fno-stack-protector])
43 dnl Sorted -W options:
44 MC_CHECK_ONE_CFLAG([-Wcomment])
45 MC_CHECK_ONE_CFLAG([-Wdeclaration-after-statement])
46 MC_CHECK_ONE_CFLAG([-Wformat])
47 MC_CHECK_ONE_CFLAG([-Wimplicit-function-declaration])
48 MC_CHECK_ONE_CFLAG([-Wimplicit-int])
49 MC_CHECK_ONE_CFLAG([-Wmissing-braces])
50 MC_CHECK_ONE_CFLAG([-Wmissing-declarations])
51 MC_CHECK_ONE_CFLAG([-Wmissing-parameter-type])
52 MC_CHECK_ONE_CFLAG([-Wmissing-prototypes])
53 MC_CHECK_ONE_CFLAG([-Wnested-externs])
54 MC_CHECK_ONE_CFLAG([-Wno-long-long])
55 MC_CHECK_ONE_CFLAG([-Wno-unreachable-code])
56 MC_CHECK_ONE_CFLAG([-Wparentheses])
57 MC_CHECK_ONE_CFLAG([-Wpointer-sign])
58 MC_CHECK_ONE_CFLAG([-Wreturn-type])
59 dnl MC_CHECK_ONE_CFLAG([-Wsequence-point])
60 MC_CHECK_ONE_CFLAG([-Wshadow])
61 MC_CHECK_ONE_CFLAG([-Wsign-compare])
62 dnl MC_CHECK_ONE_CFLAG([-Wstrict-aliasing])
63 MC_CHECK_ONE_CFLAG([-Wswitch])
64 MC_CHECK_ONE_CFLAG([-Wuninitialized])
65 MC_CHECK_ONE_CFLAG([-Wunused-function])
66 MC_CHECK_ONE_CFLAG([-Wunused-label])
67 MC_CHECK_ONE_CFLAG([-Wunused-parameter])
68 MC_CHECK_ONE_CFLAG([-Wunused-result])
69 MC_CHECK_ONE_CFLAG([-Wunused-value])
70 MC_CHECK_ONE_CFLAG([-Wunused-variable])
71 MC_CHECK_ONE_CFLAG([-Wwrite-strings])