[master] 17d7143 Validate EXTRA_DEVELOPER_CFLAGS and -fstack-protector

Tollef Fog Heen tfheen at varnish-cache.org
Mon Mar 14 14:33:06 CET 2011


commit 17d7143cd1b00f092edc8787eb26261d1c27af02
Author: Tollef Fog Heen <tfheen at varnish-software.com>
Date:   Mon Mar 14 14:21:20 2011 +0100

    Validate EXTRA_DEVELOPER_CFLAGS and -fstack-protector
    
    This fixes buildbot problems on Solaris, since the solaris buildbot
    runs an ancient gcc.

diff --git a/configure.ac b/configure.ac
index 9849783..1f19044 100644
--- a/configure.ac
+++ b/configure.ac
@@ -466,12 +466,34 @@ AC_ARG_ENABLE(diagnostics,
 # --enable-extra-developer-warnings
 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}")
+	[],
+	[enable_extra_developer_warnings=no])
+
+if test "x$enable_stack_protector" != "xno"; then
+	save_CFLAGS="$CFLAGS"
+	CFLAGS="${CFLAGS} ${EXTRA_DEVELOPER_CFLAGS}"
+	AC_COMPILE_IFELSE(
+		[AC_LANG_PROGRAM([],[],[])],
+		[],
+		[AC_MSG_WARN([All of ${EXTRA_DEVELOPER_CFLAGS} not supported, disabling])
+		    CFLAGS="$save_CFLAGS"])
+fi
 
 # --enable-stack-protector
 AC_ARG_ENABLE(stack-protector,
 	AS_HELP_STRING([--enable-stack-protector],[enable stack protector (default is NO)]),
-	CFLAGS="${CFLAGS} -fstack-protector-all")
+	[],
+	[enable_stack_protector=no])
+
+if test "x$enable_stack_protector" != "xno"; then
+	save_CFLAGS="$CFLAGS"
+	CFLAGS="${CFLAGS} -fstack-protector-all"
+	AC_COMPILE_IFELSE(
+		[AC_LANG_PROGRAM([],[],[])],
+		[],
+		[AC_MSG_WARN([-fstack-protector not supported, disabling])
+		    CFLAGS="$save_CFLAGS"])
+fi
 
 # --enable-tests
 AC_ARG_ENABLE(tests,



More information about the varnish-commit mailing list