summaryrefslogtreecommitdiff
path: root/configure.in
diff options
context:
space:
mode:
authorBehdad Esfahbod <behdad@behdad.org>2006-09-02 19:51:54 -0400
committerBehdad Esfahbod <behdad@behdad.org>2006-10-31 20:55:23 -0500
commitab1c334c7ea6c93cb9f998c499c2e160346c042f (patch)
tree95a7a5dfe35668714f9112ec12ee9ed7d3f9aadd /configure.in
parent80d8e695ff6f6ae0a282d720009d1ec6a982865b (diff)
[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. (cherry picked from e5a9c2330867ae11befa8a966aa0a50c31c82a32 commit)
Diffstat (limited to 'configure.in')
-rw-r--r--configure.in34
1 files changed, 24 insertions, 10 deletions
diff --git a/configure.in b/configure.in
index a5ec54bce..6d231a090 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 flags], cairo_cv_warn_cflags, [
# 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