Split maintainer-flags from the compiler flags

The maintainer compiler flags we use trigger warnings and errors
in the autogenerated code that gtk-doc creates to scan the header
and source files. Since we cannot control that, and we must run
a distcheck with both --enable-gtk-doc and --enable-maintainer-flags
turned on, we need to use less-strict compiler flags when inside
the doc/reference subdirectories.

The way to do this is to split the maintainer compiler flags into
their own Makefile variable, called MAINTAINER_CFLAGS. The we
can use $(MAINTAINER_CFLAGS) in the INCLUDES or _CFLAGS sections
of each part of the source directories we wish to check with the
anal retentiveness suited for maintainers.
This commit is contained in:
Emmanuele Bassi 2009-01-23 13:09:51 +00:00
parent 20973bd29f
commit 915d9ec7ca
9 changed files with 24 additions and 10 deletions

View File

@ -32,6 +32,7 @@ INCLUDES = \
$(GCC_FLAGS) \
$(CLUTTER_CFLAGS) \
$(CLUTTER_DEBUG_CFLAGS) \
$(MAINTAINER_CFLAGS) \
$(NULL)
LDADD = \

View File

@ -9,6 +9,7 @@ INCLUDES = \
-DCLUTTER_COMPILATION \
$(CLUTTER_CFLAGS) \
$(CLUTTER_DEBUG_CFLAGS) \
$(MAINTAINER_CFLAGS) \
$(GCC_FLAGS)
LDADD = $(CLUTTER_LIBS)

View File

@ -24,6 +24,7 @@ INCLUDES = \
-DCLUTTER_COMPILATION \
$(CLUTTER_CFLAGS) \
$(CLUTTER_DEBUG_CFLAGS) \
$(MAINTAINER_CFLAGS) \
$(GCC_FLAGS)
LDADD = $(CLUTTER_LIBS)

View File

@ -24,6 +24,7 @@ INCLUDES = \
-DCLUTTER_COMPILATION \
$(CLUTTER_CFLAGS) \
$(CLUTTER_DEBUG_CFLAGS) \
$(MAINTAINER_CFLAGS) \
$(GCC_FLAGS)
LDADD = $(CLUTTER_LIBS)

View File

@ -19,6 +19,7 @@ libcoglpango_la_SOURCES = \
INCLUDES = \
@GCC_FLAGS@ @CLUTTER_CFLAGS@ \
$(CLUTTER_DEBUG_CFLAGS) \
$(MAINTAINER_CFLAGS) \
-DCLUTTER_COMPILATION \
-I$(top_srcdir) \
-I$(top_srcdir)/clutter \

View File

@ -580,8 +580,9 @@ AC_ARG_ENABLE([maintainer-flags],
enable_maintainer_flags=maintainer_flags_default)
if test "x$enable_maintainer_flags" = "xyes"; then
CPPFLAGS="$CPPFLAGS -Werror -Wall -Wshadow -Wcast-align -Wno-uninitialized -Wempty-body -Wformat-security -Winit-self"
MAINTAINER_CFLAGS="-Werror -Wall -Wshadow -Wcast-align -Wno-uninitialized -Wempty-body -Wformat-security -Winit-self"
fi
AC_SUBST(MAINTAINER_CFLAGS)
dnl = GTK Doc check ========================================================
@ -699,7 +700,7 @@ echo " GL Headers: ${CLUTTER_GL_HEADER}"
echo " Image backend: ${imagebackend}"
echo " Target library: ${clutterbackendlib}"
echo " Debug level: ${enable_debug}"
echo " Compiler flags: ${CPPFLAGS}"
echo " Compiler flags: ${CPPFLAGS} ${MAINTAINER_CFLAGS}"
echo " Build API Documentation: ${enable_gtk_doc}"
echo " Build Manual Documentation: ${enable_manual}"
echo ""

View File

@ -60,7 +60,9 @@ test_conformance_CFLAGS = \
-I$(top_srcdir)/ \
-I$(top_srcdir)/clutter \
-I$(top_builddir)/clutter \
$(CLUTTER_CFLAGS)
$(CLUTTER_CFLAGS) \
$(MAINTAINER_CFLAGS)
test_conformance_LDADD = $(top_builddir)/clutter/libclutter-@CLUTTER_FLAVOUR@-@CLUTTER_MAJORMINOR@.la
.PHONY: test
@ -101,11 +103,12 @@ full-report-disable-npots:
| sed 's/>GTester Unit Test Report</>GTester Unit Test Report (no NPOTs)</' \
> test-conformance-results-dn.html )
REPORTS = test-conformance-results.html
XML_REPORTS = test-conformance-results.xml
HTML_REPORTS = test-conformance-results.html
if HAVE_LIBDL
REPORTS += test-conformance-results-dn.html
XML_REPORTS += test-conformance-results-dn.xml
HTML_REPORTS += test-conformance-results-dn.html
full-report-generate: full-report-normal full-report-disable-npots
else
@ -114,8 +117,10 @@ full-report-generate: full-report-normal
endif
full-report: full-report-generate
@for x in $(REPORTS); do \
@for x in $(HTML_REPORTS); do \
gnome-open "$$x"; \
done
EXTRA_DIST = ADDING_NEW_TESTS test-wrapper.sh
EXTRA_DIST = ADDING_NEW_TESTS test-launcher.sh
CLEANFILES = $(XML_REPORTS) $(HTML_REPORTS)

View File

@ -66,7 +66,7 @@ BUILT_SOURCES = wrappers redhand.png test-script.json
INCLUDES = -I$(top_srcdir)/ -I$(top_srcdir)/clutter -I$(top_builddir)/clutter
LDADD = $(top_builddir)/clutter/libclutter-@CLUTTER_FLAVOUR@-@CLUTTER_MAJORMINOR@.la
AM_CFLAGS = $(CLUTTER_CFLAGS)
AM_CFLAGS = $(CLUTTER_CFLAGS) $(MAINTAINER_CFLAGS)
AM_LDFLAGS = $(CLUTTER_LIBS)
noinst_PROGRAMS = test-interactive

View File

@ -3,7 +3,10 @@ noinst_PROGRAMS = \
INCLUDES = -I$(top_srcdir)/ -I$(top_srcdir)/clutter -I$(top_builddir)/clutter
LDADD = $(top_builddir)/clutter/libclutter-@CLUTTER_FLAVOUR@-@CLUTTER_MAJORMINOR@.la
AM_CFLAGS = $(CLUTTER_CFLAGS) -DTESTS_DATA_DIR=$(top_srcdir)/tests/data/
AM_CFLAGS = \
$(CLUTTER_CFLAGS) \
$(MAINTAINER_CFLAGS) \
-DTESTS_DATA_DIR=\""$(top_srcdir)/tests/data/"\"
AM_LDFLAGS = $(CLUTTER_LIBS)
test_text_SOURCES = test-text.c