summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 379e19a)
raw | patch | inline | side by side (parent: 379e19a)
author | Sebastian Harl <sh@tokkee.org> | |
Thu, 15 Oct 2009 22:01:14 +0000 (00:01 +0200) | ||
committer | Sebastian Harl <sh@tokkee.org> | |
Thu, 15 Oct 2009 22:01:14 +0000 (00:01 +0200) |
This option may be used to disable strict compiler checks (enabled by
default).
default).
configure.ac | patch | blob | history |
diff --git a/configure.ac b/configure.ac
index d3f05aa19de3257758a82d1e5d2a76f497069da9..47c9c092b62db4b33ab6ba39f9876f0b3d6a4609 100644 (file)
--- a/configure.ac
+++ b/configure.ac
fi
fi
-for flag in -Wall -Wextra -Werror; do
+dnl Strict checking for potential problems.
+AC_ARG_ENABLE([strict-checks],
+ AS_HELP_STRING([--disable-strict-checks],
+ [Disable strict compiler checks]),
+ [enable_strict_checks="$enableval"],
+ [enable_strict_checks="yes"])
+
+STRICT_CFLAGS=""
+for flag in -Wall -Werror; do
AC_MSG_CHECKING([whether $CC accepts $flag])
if test_cc_flags $flag; then
AC_MSG_RESULT([no])
fi
done
+
+if test "x$enable_strict_checks" = "xyes"; then
+ for flag in -Wextra \
+ -Wbad-function-cast \
+ -Wcast-align \
+ -Wcast-qual \
+ -Wconversion \
+ -Wdeclaration-after-statement \
+ -Wmissing-prototypes \
+ -Wpointer-arith \
+ -Wshadow \
+ -Wstrict-prototypes \
+ -Wunreachable-code \
+ -Wvla; do
+ AC_MSG_CHECKING([whether $CC accepts $flag])
+
+ if test_cc_flags $flag; then
+ STRICT_CFLAGS="$STRICT_CFLAGS $flag"
+ AC_MSG_RESULT([yes])
+ else
+ AC_MSG_RESULT([no])
+ fi
+ done
+fi
AC_SUBST([STRICT_CFLAGS])
build_date="`date --utc '+%F %T'` (UTC)"