From 03ee1e327fdb1175ab74b2caf62d75a517b68c86 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Mon, 11 Jun 2012 23:08:18 +0900 Subject: [PATCH] Added --enable-maintainer-mode configure option If it is enabled, turn on extra compiler warnings. --- configure.ac | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/configure.ac b/configure.ac index 37ee633d..761e6fcd 100644 --- a/configure.ac +++ b/configure.ac @@ -39,6 +39,12 @@ AC_CONFIG_MACRO_DIR([m4]) AM_INIT_AUTOMAKE() AC_CONFIG_HEADERS([config.h]) +dnl Checks for command-line options +AC_ARG_ENABLE([maintainer-mode], + [AS_HELP_STRING([--enable-maintainer-mode], + [Turn on compile time warnings])], + [maintainer_mode=$withval], [maintainer_mode=no]) + dnl Checks for programs AC_PROG_CC AC_PROG_CXX @@ -157,6 +163,18 @@ AM_CONDITIONAL([HAVE_EPOLL], [ test "x${have_epoll}" = "xyes" ]) AC_CHECK_FUNCS([kqueue], [have_kqueue=yes]) AM_CONDITIONAL([HAVE_KQUEUE], [test "x${have_kqueue}" = "xyes"]) +if test "x$maintainer_mode" != "xno"; then + CFLAGS="$CFLAGS -Wall -Wextra -Werror" + CFLAGS="$CFLAGS -Wmissing-prototypes -Wstrict-prototypes" + CFLAGS="$CFLAGS -Wmissing-declarations -Wpointer-arith" + CFLAGS="$CFLAGS -Wdeclaration-after-statement" + CFLAGS="$CFLAGS -Wformat-security" + CFLAGS="$CFLAGS -Wwrite-strings -Wshadow -Winline -Wnested-externs" + CFLAGS="$CFLAGS -Wfloat-equal -Wundef -Wendif-labels -Wempty-body" + CFLAGS="$CFLAGS -Wcast-align -Wclobbered -Wvla" + CFLAGS="$CFLAGS -Wno-unused-parameter" +fi + AC_CONFIG_FILES([ Makefile lib/Makefile