Enable verbose compiler warnings in maintainer mode
authorMarcel Holtmann <marcel@holtmann.org>
Tue, 23 Dec 2008 05:06:09 +0000 (06:06 +0100)
committerMarcel Holtmann <marcel@holtmann.org>
Tue, 23 Dec 2008 05:06:09 +0000 (06:06 +0100)
acinclude.m4
configure.ac

index 9c51ddf..84086fd 100644 (file)
@@ -10,6 +10,21 @@ AC_DEFUN([AC_PROG_CC_PIE], [
        ])
 ])
 
+AC_DEFUN([COMPILER_FLAGS], [
+       if (test "${CFLAGS}" = ""); then
+               CFLAGS="-Wall -O2 -D_FORTIFY_SOURCE=2"
+       fi
+       if (test "$USE_MAINTAINER_MODE" = "yes"); then
+               CFLAGS+=" -Werror -Wextra"
+               CFLAGS+=" -Wno-unused-parameter"
+               CFLAGS+=" -Wno-missing-field-initializers"
+               CFLAGS+=" -Wdeclaration-after-statement"
+               CFLAGS+=" -Wmissing-declarations"
+               CFLAGS+=" -Wredundant-decls"
+               CFLAGS+=" -Wcast-align"
+       fi
+])
+
 AC_DEFUN([GTK_DOC_CHECK],
 [
   AC_BEFORE([AC_PROG_LIBTOOL],[$0])dnl setup libtool first
index 15acdbc..42789a7 100644 (file)
@@ -8,9 +8,7 @@ AM_MAINTAINER_MODE
 
 AC_PREFIX_DEFAULT(/usr/local)
 
-if (test "${CFLAGS}" = ""); then
-       CFLAGS="-Wall -O2 -D_FORTIFY_SOURCE=2"
-fi
+COMPILER_FLAGS
 
 AC_LANG_C
 
@@ -32,7 +30,7 @@ AC_ARG_ENABLE(debug, AC_HELP_STRING([--enable-debug],
                        [enable compiling with debugging information]), [
        if (test "${enableval}" = "yes" &&
                                test "${ac_cv_prog_cc_g}" = "yes"); then
-               CFLAGS="$CFLAGS -g -O0 -Werror"
+               CFLAGS="$CFLAGS -g -O0"
        fi
 ])