From 1beb6318ba644982a2cebd68148f4d70a514cf9d Mon Sep 17 00:00:00 2001 From: Sebastian Harl Date: Sun, 23 Feb 2014 17:43:58 -0800 Subject: [PATCH] configure: Make "standards" and "hardening" flags part of STRICT_CFLAGS. Most importantly, don't assign them to CFLAGS which might be overwritten when running make, thus leaving out the flags which were originally requested to be used. --- configure.ac | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/configure.ac b/configure.ac index de18e15..e64e094 100644 --- a/configure.ac +++ b/configure.ac @@ -79,6 +79,8 @@ test_cc_flags() { return $ret } +STRICT_CFLAGS="" + m4_divert_once([HELP_ENABLE], [ Build options:]) @@ -110,7 +112,7 @@ if test "x$enable_standards" = "xyes"; then AC_MSG_CHECKING([whether $CC accepts $flag]) if test_cc_flags $flag; then - CFLAGS="$CFLAGS $flag" + STRICT_CFLAGS="$STRICT_CFLAGS $flag" AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) @@ -135,7 +137,7 @@ if test "x$enable_hardening" = "xyes"; then AC_MSG_CHECKING([whether $CC accepts $flag]) if test_cc_flags $flag; then - CFLAGS="$CFLAGS $flag" + STRICT_CFLAGS="$STRICT_CFLAGS $flag" hardening=$(($hardening + 1)) AC_MSG_RESULT([yes]) else @@ -155,7 +157,6 @@ AC_ARG_ENABLE([strict-checks], [enable_strict_checks="$enableval"], [enable_strict_checks="yes"]) -STRICT_CFLAGS="" for flag in -Wall -Werror; do AC_MSG_CHECKING([whether $CC accepts $flag]) -- 2.30.2