From d2669b47812aebfe3ada7df4c7d7525790ef9c33 Mon Sep 17 00:00:00 2001 From: Allan McRae Date: Mon, 16 Jul 2012 14:24:29 +1000 Subject: Do not enable _FORTIFY_SOURCE without optimization With glibc-2.16, using -D_FORTIFY_SOURCE requires that optimization (-O) be used or it will prodice a warning message. Enable -Werror in our test for _FORTIFY_SOURCE support to catch when a users specifies CFLAGS without optimization. The line to set CFLAGS="" when no CFLAGS are specified (either due to being unset or geniunely empty) is required as autoconf will use "-O2 -g" for its tests by defult when CFLAGS is unset, but will not add them to the CFLAGS used... Signed-off-by: Allan McRae --- configure.ac | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 5483ee15..7fe696a9 100644 --- a/configure.ac +++ b/configure.ac @@ -66,6 +66,11 @@ LT_INIT LIB_VERSION=`expr lib_current - lib_age`.lib_age.lib_revision LIB_VERSION_INFO="lib_current:lib_revision:lib_age" +# Respect empty CFLAGS during compiler tests +if test "x$CFLAGS" != "x"; then + CFLAGS="" +fi + # Set subsitution values for version stuff in Makefiles and anywhere else, # and put LIB_VERSION in config.h AC_SUBST(LIB_VERSION) -- cgit v1.2.3-24-g4f1b