Add additional CFLAGS when running maintainer mode.
authorJulien Lavergne <gilir@ubuntu.com>
Sun, 8 May 2011 21:02:24 +0000 (23:02 +0200)
committerJulien Lavergne <gilir@ubuntu.com>
Sun, 8 May 2011 21:02:24 +0000 (23:02 +0200)
configure.in
src/Makefile.am

index dfff2dc..523bbf2 100644 (file)
@@ -18,6 +18,13 @@ AC_HEADER_STDC
 # to configure or passing V=1 to make
 AM_SILENT_RULES([yes])
 
+# Pass --enable-maintainer-mode to enable more CFLAGS
+if test "$USE_MAINTAINER_MODE" = "yes"; then
+  ADDITIONAL_FLAGS="-Wall -Werror=all -Werror=format -Werror=implicit-function-declaration -Werror=implicit-int -Werror=missing-braces -Werror=parentheses -Werror=return-type -Werror=strict-aliasing -Werror=switch -Wuninitialized -Werror=unused-label -Werror=unused-value -Wextra -Wno-missing-field-initializers -Wno-unused-parameter -Werror=missing-declarations -Wredundant-decls -Wmissing-noreturn -Wpointer-arith -Wcast-align -Wwrite-strings -Werror=inline -Werror=format-nonliteral -Wformat-nonliteral -Werror=format-security -Wformat-security -Winit-self -Werror=missing-include-dirs -Werror=undef -Werror=aggregate-return -Wmissing-format-attribute -Werror=nested-externs -fno-strict-aliasing -fmessage-length=0 -Wp,-D_FORTIFY_SOURCE=2 -DG_DISABLE_DEPRECATED -DG_DISABLE_SINGLE_INCLUDES -DGDK_DISABLE_DEPRECATED -DGDK_PIXBUF_DISABLE_DEPRECATED -DGDK_PIXBUF_DISABLE_SINGLE_INCLUDES -DGTK_DISABLE_DEPRECATED -DGTK_DISABLE_SINGLE_INCLUDES"
+fi
+AC_SUBST(ADDITIONAL_FLAGS)
+
+
 AM_GLIB_GNU_GETTEXT
 IT_PROG_INTLTOOL([0.40.0])
 
index 15929e6..74056e3 100644 (file)
@@ -3,6 +3,7 @@
 # set the include path found by configure
 INCLUDES = $(all_includes) \
        @PACKAGE_CFLAGS@ \
+        $(ADDITIONAL_FLAGS) \
        -I$(top_srcdir) \
        -DPACKAGE_DATA_DIR=\""$(datadir)"\" \
        -DPACKAGE_LOCALE_DIR=\""$(prefix)/$(DATADIRNAME)/locale"\"