From ae892bb955b8be40414f71a392c9d4f1b01a5974 Mon Sep 17 00:00:00 2001 From: des Date: Mon, 4 Jun 2007 14:42:55 +0000 Subject: [PATCH] Add configure options for extra-strict warnings + stack protection (both require gcc 4), tune autogen.des accordingly. git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@1489 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- varnish-cache/autogen.des | 8 ++++++-- varnish-cache/configure.ac | 10 ++++++++-- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/varnish-cache/autogen.des b/varnish-cache/autogen.des index 7a1ae2a9..c2cceff6 100755 --- a/varnish-cache/autogen.des +++ b/varnish-cache/autogen.des @@ -5,12 +5,16 @@ set -ex -./autogen.sh +. ./autogen.sh + +# autoconf prior to 2.62 has issues with zsh 4.2 and newer +export CONFIG_SHELL=/bin/sh -CONFIG_SHELL=/bin/sh \ ./configure \ --enable-developer-warnings \ --enable-debugging-symbols \ --enable-dependency-tracking \ + --enable-extra-developer-warnings \ + --enable-stack-protector \ --enable-werror \ --prefix=/opt/varnish diff --git a/varnish-cache/configure.ac b/varnish-cache/configure.ac index ef7cca94..dbf6d9c6 100644 --- a/varnish-cache/configure.ac +++ b/varnish-cache/configure.ac @@ -108,8 +108,8 @@ AC_CHECK_FUNCS([poll]) # This corresponds to FreeBSD's WARNS level 6 DEVELOPER_CFLAGS="-Wall -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wcast-align -Wunused-parameter -Wchar-subscripts -Winline -Wnested-externs -Wredundant-decls -Wformat" -# Turn off warnings for two issues which occur frequently in our code -#DEVELOPER_CFLAGS="${DEVELOPER_CFLAGS} -Wextra -Wno-missing-field-initializers -Wno-sign-compare" +# Additional flags for GCC 4 +EXTRA_DEVELOPER_CFLAGS="-Wextra -Wno-missing-field-initializers -Wno-sign-compare" AC_ARG_ENABLE(developer-warnings, AS_HELP_STRING([--enable-developer-warnings],[enable strict warnings (default is NO)]), @@ -117,6 +117,12 @@ AC_ARG_ENABLE(developer-warnings, AC_ARG_ENABLE(debugging-symbols, AS_HELP_STRING([--enable-debugging-symbols],[enable debugging symbols (default is NO)]), CFLAGS="${CFLAGS} -O0 -g -fno-inline") +AC_ARG_ENABLE(extra-developer-warnings, + AS_HELP_STRING([--enable-extra-developer-warnings],[enable even stricter warnings (default is NO)]), + CFLAGS="${CFLAGS} ${EXTRA_DEVELOPER_CFLAGS}") +AC_ARG_ENABLE(stack-protector, + AS_HELP_STRING([--enable-stack-protector],[enable stack protector (default is NO)]), + CFLAGS="${CFLAGS} -fstack-protector-all") AC_ARG_ENABLE(werror, AS_HELP_STRING([--enable-werror],[use -Werror (default is NO)]), CFLAGS="${CFLAGS} -Werror") -- 2.39.5