summaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
authorDaniel P. Berrange <berrange@redhat.com>2012-03-15 10:40:43 +0000
committerDaniel P. Berrange <berrange@redhat.com>2012-04-25 09:49:25 +0100
commitd986fb466bb60c5e6229086261b6b3ed0b383d92 (patch)
treeb309ef0a797a766cea504e2a2980f0dd2937f0a6 /configure.ac
parent39565707a9b9b6460ca18c5c9749ae565d583e2a (diff)
downloadspice-d986fb466bb60c5e6229086261b6b3ed0b383d92.tar.gz
spice-d986fb466bb60c5e6229086261b6b3ed0b383d92.tar.xz
spice-d986fb466bb60c5e6229086261b6b3ed0b383d92.zip
Enable many more compiler warnings
* m4/manywarnings.m4m, m4/warnings.m4: Import GNULIB warnings modules * m4/spice-compile-warnings.m4: Define SPICE_COMPILE_WARNINGS * configure.ac: Replace compile warning check with a call to SPICE_COMPILE_WARNINGS * client/Makefile.am: Use WARN_CXXFLAGS instead of WARN_CFLAGS Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac77
1 files changed, 1 insertions, 76 deletions
diff --git a/configure.ac b/configure.ac
index 1feb36db..f5b014f8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -394,82 +394,7 @@ fi
dnl ===========================================================================
dnl check compiler flags
-AC_DEFUN([SPICE_CC_TRY_FLAG], [
- AC_MSG_CHECKING([whether $CC supports $1])
-
- spice_save_CFLAGS="$CFLAGS"
- CFLAGS="$CFLAGS $1"
-
- AC_COMPILE_IFELSE([AC_LANG_SOURCE([ ])], [spice_cc_flag=yes], [spice_cc_flag=no])
- CFLAGS="$spice_save_CFLAGS"
-
- if test "x$spice_cc_flag" = "xyes"; then
- ifelse([$2], , :, [$2])
- else
- ifelse([$3], , :, [$3])
- fi
- AC_MSG_RESULT([$spice_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)
-
-dnl MAYBE_WARN="-Wall -Wno-sign-compare -Werror -Wno-deprecated-declarations"
-
-if test "$red_target" = "windows"; then
- MAYBE_WARN="-Wall -Wno-sign-compare -Wno-deprecated-declarations"
-else
- MAYBE_WARN="-Wall -Wno-sign-compare -Wno-deprecated-declarations"
-fi
-
-AC_ARG_ENABLE(werror,
-AC_HELP_STRING([--enable-werror], [Use -Werror (if supported)]),
-set_werror="$enableval",[
-if test -f $srcdir/GITVERSION; then
- is_git_version=true
- set_werror=yes
-else
- set_werror=no
-fi
-])
-
-# invalidate cached value if MAYBE_WARN has changed
-if test "x$spice_cv_warn_maybe" != "x$MAYBE_WARN"; then
- unset spice_cv_warn_cflags
-fi
-AC_CACHE_CHECK([for supported warning flags], spice_cv_warn_cflags, [
- echo
- WARN_CFLAGS=""
-
- # Some warning options are not supported by all versions of
- # gcc, so test all desired options against the current
- # compiler.
- #
- # Note that there are some order dependencies
- # here. Specifically, an option that disables a warning will
- # have no net effect if a later option then enables that
- # warnings, (perhaps implicitly). So we put some grouped
- # options (-Wall and -Wextra) up front and the -Wno options
- # last.
-
- for W in $MAYBE_WARN; do
- SPICE_CC_TRY_FLAG([$W], [WARN_CFLAGS="$WARN_CFLAGS $W"])
- done
- if test "$set_werror" != "no"; then
- SPICE_CC_TRY_FLAG(["-Werror"], [WARN_CFLAGS="$WARN_CFLAGS -Werror"])
- fi
-
- spice_cv_warn_cflags=$WARN_CFLAGS
- spice_cv_warn_maybe=$MAYBE_WARN
-
- AC_MSG_CHECKING([which warning flags were supported])])
-WARN_CFLAGS="$spice_cv_warn_cflags"
-SPICE_CFLAGS="$SPICE_CFLAGS $WARN_CFLAGS"
+SPICE_COMPILE_WARNINGS
# use ximage.h for win32 build if it is found (no package for mingw32 atm)
if test $os_win32 == "yes" ; then