diff options
author | Simon Josefsson <simon@josefsson.org> | 2009-05-18 15:13:50 +0200 |
---|---|---|
committer | Simon Josefsson <simon@josefsson.org> | 2009-05-18 15:13:50 +0200 |
commit | 166b66760c8cab9e697279a0a25f9bbd457f1692 (patch) | |
tree | 291252c5e52e973aae5f93e7236207c3ca1c45b7 /configure.ac | |
parent | df351273d408ecc142394ae587021551c28ae42e (diff) | |
download | gnutls-166b66760c8cab9e697279a0a25f9bbd457f1692.tar.gz |
Don't build with warnings all the time. Use a WERROR_CFLAGS.
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/configure.ac b/configure.ac index 4bfe58a7dd..365173361e 100644 --- a/configure.ac +++ b/configure.ac @@ -183,8 +183,20 @@ AC_PROG_LIBTOOL gl_INIT -# Add many warnings, except some... -if test "$GCC" = "yes"; then +AC_ARG_ENABLE([gcc-warnings], + [AS_HELP_STRING([--enable-gcc-warnings], + [turn on lots of GCC warnings (for developers)])], + [case $enableval in + yes|no) ;; + *) AC_MSG_ERROR([bad value $enableval for gcc-warnings option]) ;; + esac + gl_gcc_warnings=$enableval], + [gl_gcc_warnings=no] +) + +if test "$gl_gcc_warnings" = yes; then + gl_WARN_ADD([-Werror], [WERROR_CFLAGS]) + nw="$nw -Wsystem-headers" # Don't let system headers trigger warnings nw="$nw -Wc++-compat" # We don't care about C++ compilers nw="$nw -Wundef" # Warns on '#if GNULIB_FOO' etc in gnulib @@ -205,11 +217,13 @@ if test "$GCC" = "yes"; then nw="$nw -Wformat-nonliteral" # Incompatible with gettext _() nw="$nw -Wunsafe-loop-optimizations" nw="$nw -Wstrict-overflow" + gl_MANYWARN_ALL_GCC([ws]) gl_MANYWARN_COMPLEMENT(ws, [$ws], [$nw]) for w in $ws; do gl_WARN_ADD([$w]) done + gl_WARN_ADD([-Wno-missing-field-initializers]) # We need this one gl_WARN_ADD([-Wno-sign-compare]) # Too many warnings for now gl_WARN_ADD([-Wno-pointer-sign]) # Too many warnings for now @@ -220,6 +234,7 @@ if test "$GCC" = "yes"; then fi # Export things for */configure.ac. +export WERROR_CFLAGS export WARN_CFLAGS export use_cxx @@ -269,7 +284,7 @@ AC_MSG_NOTICE([summary of build options: Host type: ${host} Install prefix: ${prefix} Compiler: ${CC} - Warning flags: ${WARN_CFLAGS} + Warning flags: errors: ${WERROR_CFLAGS} warnings: ${WARN_CFLAGS} Library types: Shared=${enable_shared}, Static=${enable_static} Valgrind: ${VALGRIND} Guile wrappers: $opt_guile_bindings |