Added --enable-maintainer-mode configure option

If it is enabled, turn on extra compiler warnings.
This commit is contained in:
Tatsuhiro Tsujikawa 2012-06-11 23:08:18 +09:00
parent d8637958dd
commit 03ee1e327f
1 changed files with 18 additions and 0 deletions

View File

@ -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