Added --enable-maintainer-mode configure option
If it is enabled, turn on extra compiler warnings.
This commit is contained in:
parent
d8637958dd
commit
03ee1e327f
18
configure.ac
18
configure.ac
|
@ -39,6 +39,12 @@ AC_CONFIG_MACRO_DIR([m4])
|
||||||
AM_INIT_AUTOMAKE()
|
AM_INIT_AUTOMAKE()
|
||||||
AC_CONFIG_HEADERS([config.h])
|
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
|
dnl Checks for programs
|
||||||
AC_PROG_CC
|
AC_PROG_CC
|
||||||
AC_PROG_CXX
|
AC_PROG_CXX
|
||||||
|
@ -157,6 +163,18 @@ AM_CONDITIONAL([HAVE_EPOLL], [ test "x${have_epoll}" = "xyes" ])
|
||||||
AC_CHECK_FUNCS([kqueue], [have_kqueue=yes])
|
AC_CHECK_FUNCS([kqueue], [have_kqueue=yes])
|
||||||
AM_CONDITIONAL([HAVE_KQUEUE], [test "x${have_kqueue}" = "xyes"])
|
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([
|
AC_CONFIG_FILES([
|
||||||
Makefile
|
Makefile
|
||||||
lib/Makefile
|
lib/Makefile
|
||||||
|
|
Loading…
Reference in New Issue