aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2009-05-25 19:14:59 +0800
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2009-10-23 19:03:35 +0800
commitc5abfdfed55676136808fea854d9ad3ed7bd458e (patch)
tree19e1ee4cb831a817f71bb6ab724b4901a15b3e77
parentbe027f7002d11677cf32601acd1370c45f2d2c57 (diff)
downloadgsoc2013-empathy-c5abfdfed55676136808fea854d9ad3ed7bd458e.tar
gsoc2013-empathy-c5abfdfed55676136808fea854d9ad3ed7bd458e.tar.gz
gsoc2013-empathy-c5abfdfed55676136808fea854d9ad3ed7bd458e.tar.bz2
gsoc2013-empathy-c5abfdfed55676136808fea854d9ad3ed7bd458e.tar.lz
gsoc2013-empathy-c5abfdfed55676136808fea854d9ad3ed7bd458e.tar.xz
gsoc2013-empathy-c5abfdfed55676136808fea854d9ad3ed7bd458e.tar.zst
gsoc2013-empathy-c5abfdfed55676136808fea854d9ad3ed7bd458e.zip
copy error flags from Gabble
-rw-r--r--configure.ac41
1 files changed, 40 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac
index 17f58aecd..e578e57c5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -84,6 +84,45 @@ AM_PATH_PYTHON([2.3])
EMPATHY_ARG_VALGRIND
+
+# -----------------------------------------------------------
+# Error flags
+# -----------------------------------------------------------
+AS_COMPILER_FLAG(-Wall, ERROR_CFLAGS="-Wall", ERROR_CFLAGS="")
+AS_COMPILER_FLAG(-Werror, werror=yes, werror=no)
+
+AC_ARG_ENABLE(Werror,
+ AC_HELP_STRING([--disable-Werror],[compile without -Werror (normally enabled in development builds)]),
+ werror=$enableval, :)
+
+AS_COMPILER_FLAG(-Wextra, wextra=yes, wextra=no)
+AS_COMPILER_FLAG(-Wno-missing-field-initializers,
+ wno_missing_field_initializers=yes,
+ wno_missing_field_initializers=no)
+AS_COMPILER_FLAG(-Wno-unused-parameter,
+ wno_unused_parameter=yes,
+ wno_unused_parameter=no)
+
+ifelse(empathy_nano_version, 0, [],
+ [
+ if test x$werror = xyes; then
+ ERROR_CFLAGS="$ERROR_CFLAGS -Werror"
+ fi
+ if test x$wextra = xyes -a \
+ x$wno_missing_field_initializers = xyes -a \
+ x$wno_unused_parameter = xyes; then
+ ERROR_CFLAGS="$ERROR_CFLAGS -Wextra -Wno-missing-field-initializers -Wno-unused-parameter"
+ fi
+ ])
+
+AS_COMPILER_FLAG(-Wdeclaration-after-statement, ERROR_CFLAGS="$ERROR_CFLAGS -Wdeclaration-after-statement")
+AS_COMPILER_FLAG(-Wshadow, ERROR_CFLAGS="$ERROR_CFLAGS -Wshadow")
+AS_COMPILER_FLAG(-Wstrict-prototypes, ERROR_CFLAGS="$ERROR_CFLAGS -Wstrict-prototypes")
+AS_COMPILER_FLAG(-Wmissing-prototypes, ERROR_CFLAGS="$ERROR_CFLAGS -Wmissing-prototypes")
+AS_COMPILER_FLAG(-Wmissing-declarations, ERROR_CFLAGS="$ERROR_CFLAGS -Wmissing-declarations")
+
+AC_SUBST(ERROR_CFLAGS)
+
# -----------------------------------------------------------
# Pkg-Config dependency checks
# -----------------------------------------------------------
@@ -437,7 +476,7 @@ echo "
Configure summary:
Compiler....................: ${CC}
- Compiler Flags..............: ${CFLAGS}
+ Compiler Flags..............: ${CFLAGS} ${ERROR_CFLAGS}
Prefix......................: ${prefix}
Shaved build................: ${enable_shave}
Tests.......................: ${have_check}