diff options
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 36 |
1 files changed, 13 insertions, 23 deletions
diff --git a/configure.ac b/configure.ac index b33e56cf..29bddde3 100644 --- a/configure.ac +++ b/configure.ac @@ -59,29 +59,19 @@ if test "$YACC" = :; then AC_MSG_ERROR([bison not found but required]) fi - -changequote(,)dnl -ensureflag() { - flag="$1"; shift - result="$@" - - case " ${result} " in - *[\ \ ]${flag}[\ \ ]*) ;; - *) result="${flag} ${result}" ;; - esac - - echo ${result} -} -changequote([,])dnl - -if test "$GCC" = "yes"; then - for flag in -Wall -Wchar-subscripts -Wmissing-declarations \ - -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align \ - -Wsign-compare -fno-strict-aliasing; - do - CFLAGS="$(ensureflag $flag $CFLAGS)" - done -fi +# Default compiler warnings +m4_ifndef([AX_COMPILER_FLAGS], [AC_MSG_ERROR(['autoconf-archive' missing])]) +AX_COMPILER_FLAGS(,, [yes]) +# These get triggered a lot, not worth it imo, but feel free to fix them +AX_APPEND_COMPILE_FLAGS([-Wno-duplicated-branches -Wno-switch-enum]) + +WARN_CFLAGS_PYTHON="$WARN_CFLAGS" +AX_APPEND_COMPILE_FLAGS([-Wno-discarded-qualifiers], [WARN_CFLAGS_PYTHON]) +AC_SUBST(WARN_CFLAGS_PYTHON) + +WARN_CFLAGS_FLEX="$WARN_CFLAGS" +AX_APPEND_COMPILE_FLAGS([-Wno-sign-compare -Wno-switch-default -Wno-redundant-decls], [WARN_CFLAGS_FLEX]) +AC_SUBST(WARN_CFLAGS_FLEX) # Checks for libraries. AC_CHECK_LIB([dl], [dlopen]) |