2009-10-30 00:29:32 +03:00
|
|
|
dnl @synopsis MC_CHECK_CFLAGS
|
|
|
|
dnl
|
|
|
|
dnl Check flags supported by compilator
|
|
|
|
dnl
|
|
|
|
dnl @author Slava Zanko <slavazanko@gmail.com>
|
|
|
|
dnl @version 2009-10-29
|
|
|
|
dnl @license GPL
|
|
|
|
dnl @copyright Free Software Foundation, Inc.
|
|
|
|
|
|
|
|
AC_DEFUN([MC_CHECK_ONE_CFLAG],[
|
|
|
|
|
|
|
|
AC_MSG_CHECKING([if gcc accepts $1])
|
|
|
|
|
|
|
|
safe_CFLAGS=$CFLAGS
|
|
|
|
CFLAGS="$1"
|
|
|
|
|
|
|
|
AC_TRY_COMPILE(, [
|
|
|
|
return 0;
|
|
|
|
],
|
|
|
|
[
|
|
|
|
mc_check_one_cflag=yes
|
|
|
|
],
|
|
|
|
[
|
|
|
|
mc_check_one_cflag=no
|
|
|
|
])
|
|
|
|
|
|
|
|
CFLAGS=$safe_CFLAGS
|
|
|
|
AC_MSG_RESULT([$mc_check_one_cflag])
|
|
|
|
|
|
|
|
if test x$mc_check_one_cflag = xyes; then
|
|
|
|
mc_configured_cflags="$mc_configured_cflags $1"
|
|
|
|
fi
|
|
|
|
|
|
|
|
])
|
|
|
|
|
|
|
|
AC_DEFUN([MC_CHECK_CFLAGS],[
|
|
|
|
mc_configured_cflags=""
|
|
|
|
|
2009-12-06 19:22:33 +03:00
|
|
|
dnl Sorted -f options:
|
2009-12-06 20:13:09 +03:00
|
|
|
MC_CHECK_ONE_CFLAG([-fdiagnostics-show-option])
|
2009-12-06 19:22:33 +03:00
|
|
|
dnl MC_CHECK_ONE_CFLAG([-fno-stack-protector])
|
|
|
|
|
|
|
|
dnl Sorted -W options:
|
|
|
|
MC_CHECK_ONE_CFLAG([-Wcomment])
|
|
|
|
MC_CHECK_ONE_CFLAG([-Wdeclaration-after-statement])
|
|
|
|
MC_CHECK_ONE_CFLAG([-Wformat])
|
2009-10-30 00:29:32 +03:00
|
|
|
MC_CHECK_ONE_CFLAG([-Wimplicit-function-declaration])
|
2009-12-06 19:22:33 +03:00
|
|
|
MC_CHECK_ONE_CFLAG([-Wimplicit-int])
|
2009-10-30 00:29:32 +03:00
|
|
|
MC_CHECK_ONE_CFLAG([-Wmissing-braces])
|
2009-12-06 19:22:33 +03:00
|
|
|
MC_CHECK_ONE_CFLAG([-Wmissing-declarations])
|
|
|
|
MC_CHECK_ONE_CFLAG([-Wmissing-parameter-type])
|
|
|
|
MC_CHECK_ONE_CFLAG([-Wmissing-prototypes])
|
|
|
|
MC_CHECK_ONE_CFLAG([-Wnested-externs])
|
|
|
|
MC_CHECK_ONE_CFLAG([-Wno-long-long])
|
|
|
|
MC_CHECK_ONE_CFLAG([-Wno-unreachable-code])
|
2009-10-30 00:29:32 +03:00
|
|
|
MC_CHECK_ONE_CFLAG([-Wparentheses])
|
2009-12-06 19:22:33 +03:00
|
|
|
MC_CHECK_ONE_CFLAG([-Wpointer-sign])
|
2009-10-30 00:29:32 +03:00
|
|
|
MC_CHECK_ONE_CFLAG([-Wreturn-type])
|
2009-12-06 19:22:33 +03:00
|
|
|
dnl MC_CHECK_ONE_CFLAG([-Wsequence-point])
|
|
|
|
MC_CHECK_ONE_CFLAG([-Wshadow])
|
|
|
|
MC_CHECK_ONE_CFLAG([-Wsign-compare])
|
|
|
|
dnl MC_CHECK_ONE_CFLAG([-Wstrict-aliasing])
|
2009-10-30 00:29:32 +03:00
|
|
|
MC_CHECK_ONE_CFLAG([-Wswitch])
|
2009-12-06 19:22:33 +03:00
|
|
|
MC_CHECK_ONE_CFLAG([-Wuninitialized])
|
2009-10-30 00:29:32 +03:00
|
|
|
MC_CHECK_ONE_CFLAG([-Wunused-function])
|
|
|
|
MC_CHECK_ONE_CFLAG([-Wunused-label])
|
|
|
|
MC_CHECK_ONE_CFLAG([-Wunused-parameter])
|
2009-12-06 19:22:33 +03:00
|
|
|
MC_CHECK_ONE_CFLAG([-Wunused-result])
|
2009-10-30 00:29:32 +03:00
|
|
|
MC_CHECK_ONE_CFLAG([-Wunused-value])
|
|
|
|
MC_CHECK_ONE_CFLAG([-Wunused-variable])
|
|
|
|
MC_CHECK_ONE_CFLAG([-Wwrite-strings])
|
|
|
|
])
|