[cairo-commit] configure.in

Behdad Esfahbod behdad at kemper.freedesktop.org
Sat Sep 2 16:53:57 PDT 2006


 configure.in |   34 ++++++++++++++++++++++++----------
 1 files changed, 24 insertions(+), 10 deletions(-)

New commits:
diff-tree e5a9c2330867ae11befa8a966aa0a50c31c82a32 (from 7c97a787ebce4880d6b9fe47a13ad018ff2ecd31)
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Sat Sep 2 19:51:54 2006 -0400

    [configure] Invalidate cached warning flags if list of flags changes
    
    such that one doesn't need to remove config.cache when when we add
    new warning flags to be checked.

diff --git a/configure.in b/configure.in
index f151ca3..2489879 100644
--- a/configure.in
+++ b/configure.in
@@ -92,7 +92,8 @@ dnl ====================================
 dnl
 dnl cairo_cache_version should be increased every time that the backend
 dnl detection stuff changes in a way that removing the config.cache file may be
-dnl needed for correct operation.
+dnl needed for correct operation. (this is only for the backend detection
+dnl changes;  it doesn't have any effect on any other cached thing.)
 dnl
 m4_define(cairo_cache_version, 4)
 
@@ -560,7 +561,28 @@ AC_DEFUN([CAIRO_CC_TRY_FLAG], [
   AC_MSG_RESULT([$cairo_cc_flag])
 ])
 
+
 dnl Use lots of warning flags with with gcc and compatible compilers
+
+dnl Note: if you change the following variable, the cache is automatically
+dnl skipped and all flags rechecked.  So there's no need to do anything
+dnl else.  If for any reason you need to force a recheck, just change
+dnl MAYBE_WARN in an ignorable way (like adding whitespace
+
+MAYBE_WARN="-Wall -Wextra \
+-Wsign-compare -Werror-implicit-function-declaration \
+-Wpointer-arith -Wwrite-strings -Wstrict-prototypes \
+-Wmissing-prototypes -Wmissing-declarations -Wnested-externs \
+-Wpacked -Wswitch-enum -Wmissing-format-attribute \
+-Wstrict-aliasing=2 -Winit-self -Wunsafe-loop-optimizations \
+-Wdeclaration-after-statement -Wold-style-definition \
+-Wno-missing-field-initializers -Wno-unused-parameter"
+
+
+# invalidate cached value if MAYBE_WARN has changed
+if test "x$cairo_cv_warn_maybe" != "x$MAYBE_WARN"; then
+	unset cairo_cv_warn_cflags
+fi
 AC_CACHE_CHECK([for supported warning flags], cairo_cv_warn_cflags, [
 	echo
 	WARN_CFLAGS=""
@@ -576,20 +598,12 @@ AC_CACHE_CHECK([for supported warning fl
 	# options (-Wall and -Wextra) up front and the -Wno options
 	# last.
 
-	MAYBE_WARN="-Wall -Wextra \
-	-Wsign-compare -Werror-implicit-function-declaration \
-	-Wpointer-arith -Wwrite-strings -Wstrict-prototypes \
-	-Wmissing-prototypes -Wmissing-declarations -Wnested-externs \
-	-Wpacked -Wswitch-enum -Wmissing-format-attribute \
-	-Wstrict-aliasing=2 -Winit-self -Wunsafe-loop-optimizations \
-	-Wdeclaration-after-statement -Wold-style-definition \
-	-Wno-missing-field-initializers -Wno-unused-parameter"
-
 	for W in $MAYBE_WARN; do
 		CAIRO_CC_TRY_FLAG([$W], [WARN_CFLAGS="$WARN_CFLAGS $W"])
 	done
 
 	cairo_cv_warn_cflags=$WARN_CFLAGS
+	cairo_cv_warn_maybe=$MAYBE_WARN
 
 	AC_MSG_CHECKING([which warning flags were supported])])
 WARN_CFLAGS=$cairo_cv_warn_cflags


More information about the cairo-commit mailing list