Enable strict compiler flags with a configure flag
When making a distcheck it's usually a good idea to enable very strict compiler flags, like -Werror, to catch stuff that slipped through the development phase. This patch adds a --enable-maintainer-flags command line switch to the configure script, which enables a set of strict compiler flags. The default is not to use them unless explicitly activated. In case of distcheck, this switch is activated when launching the configure script from within the distcheck build directory.
This commit is contained in:
parent
73ff6900d0
commit
e77a6f0af3
@ -1,4 +1,4 @@
|
|||||||
SUBDIRS=clutter doc tests
|
SUBDIRS = clutter doc tests
|
||||||
|
|
||||||
pcfiles = clutter-@CLUTTER_FLAVOUR@-@CLUTTER_MAJORMINOR@.pc
|
pcfiles = clutter-@CLUTTER_FLAVOUR@-@CLUTTER_MAJORMINOR@.pc
|
||||||
|
|
||||||
@ -8,7 +8,7 @@ pcfiles = clutter-@CLUTTER_FLAVOUR@-@CLUTTER_MAJORMINOR@.pc
|
|||||||
pkgconfig_DATA = $(pcfiles)
|
pkgconfig_DATA = $(pcfiles)
|
||||||
pkgconfigdir = $(libdir)/pkgconfig
|
pkgconfigdir = $(libdir)/pkgconfig
|
||||||
|
|
||||||
DEFAULT_FLAVOUR=@CLUTTER_FLAVOUR@
|
DEFAULT_FLAVOUR = @CLUTTER_FLAVOUR@
|
||||||
install-data-hook:
|
install-data-hook:
|
||||||
(cd $(DESTDIR)$(pkgconfigdir) && \
|
(cd $(DESTDIR)$(pkgconfigdir) && \
|
||||||
test -f clutter-$(DEFAULT_FLAVOUR)-@CLUTTER_MAJORMINOR@.pc && \
|
test -f clutter-$(DEFAULT_FLAVOUR)-@CLUTTER_MAJORMINOR@.pc && \
|
||||||
@ -22,7 +22,7 @@ EXTRA_DIST = clutter.pc.in HACKING
|
|||||||
|
|
||||||
CLEANFILES = $(pcfiles)
|
CLEANFILES = $(pcfiles)
|
||||||
|
|
||||||
DISTCHECK_CONFIGURE_FLAGS = --enable-gtk-doc
|
DISTCHECK_CONFIGURE_FLAGS = --enable-gtk-doc --enable-maintainer-flags
|
||||||
|
|
||||||
# Extra clean files so that maintainer-clean removes *everything*
|
# Extra clean files so that maintainer-clean removes *everything*
|
||||||
MAINTAINERCLEANFILES = aclocal.m4 compile config.guess config.sub \
|
MAINTAINERCLEANFILES = aclocal.m4 compile config.guess config.sub \
|
||||||
|
24
configure.ac
24
configure.ac
@ -315,6 +315,22 @@ fi
|
|||||||
|
|
||||||
AC_SUBST(FIXED_POINT_CFLAGS)
|
AC_SUBST(FIXED_POINT_CFLAGS)
|
||||||
|
|
||||||
|
dnl = Enable strict compiler flags =========================================
|
||||||
|
|
||||||
|
# use strict compiler flags only on development releases
|
||||||
|
#m4_define([maintainer_flags_default],
|
||||||
|
# m4_if(m4_eval(clutter_minor_version % 2), [1], [yes], [no]))
|
||||||
|
m4_define([maintainer_flags_default], [no])
|
||||||
|
AC_ARG_ENABLE([maintainer-flags],
|
||||||
|
AC_HELP_STRING([--enable-maintainer-flags=@<:@no/yes@:>@],
|
||||||
|
[Use strict compiler flags @<:@default=maintainer_flags_default@:>@]),,
|
||||||
|
enable_maintainer_flags=maintainer_flags_default)
|
||||||
|
|
||||||
|
if test "x$enable_maintainer_flags" = "xyes"; then
|
||||||
|
CPPFLAGS="$CPPFLAGS -Werror -Wall -Wshadow -Wcast-align -Wno-uninitialized"
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
dnl = GTK Doc check ========================================================
|
dnl = GTK Doc check ========================================================
|
||||||
|
|
||||||
GTK_DOC_CHECK([1.6])
|
GTK_DOC_CHECK([1.6])
|
||||||
@ -383,11 +399,15 @@ echo " ==================="
|
|||||||
echo ""
|
echo ""
|
||||||
echo " prefix: ${prefix}"
|
echo " prefix: ${prefix}"
|
||||||
echo ""
|
echo ""
|
||||||
echo " Flavour: ${clutterbackend}"
|
echo " Flavour: ${clutterbackend}/${CLUTTER_COGL}"
|
||||||
echo " Target library: ${clutterbackendlib}"
|
echo " Target library: ${clutterbackendlib}"
|
||||||
echo " Debug level: ${enable_debug}"
|
echo " Debug level: ${enable_debug}"
|
||||||
|
<<<<<<< HEAD:configure.ac
|
||||||
echo " Fast FP conversions: ${enable_fast_fp_conversions}"
|
echo " Fast FP conversions: ${enable_fast_fp_conversions}"
|
||||||
|
=======
|
||||||
|
echo " Compiler flags: ${CPPFLAGS}"
|
||||||
|
>>>>>>> Enable strict compiler flags with a configure flag:configure.ac
|
||||||
echo " API Documentation: ${enable_gtk_doc}"
|
echo " API Documentation: ${enable_gtk_doc}"
|
||||||
echo " Manual Documentation: ${enable_manual}"
|
echo " Manual Documentation: ${enable_manual}"
|
||||||
echo " FPU: ${with_fpu}"
|
echo " FPU Support: ${with_fpu}"
|
||||||
echo ""
|
echo ""
|
||||||
|
Loading…
Reference in New Issue
Block a user