From 9145fc8e0a43baae684f00a56714e228fc31f63d Mon Sep 17 00:00:00 2001 From: Aki Tuomi Date: Mon, 1 Sep 2014 13:13:06 +0300 Subject: [PATCH] Fix definition and test whether D_FORTIFY_SOURCE gives warning --- m4/pdns_d_fortify_source.m4 | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/m4/pdns_d_fortify_source.m4 b/m4/pdns_d_fortify_source.m4 index 721c9cce09..7f90329a99 100644 --- a/m4/pdns_d_fortify_source.m4 +++ b/m4/pdns_d_fortify_source.m4 @@ -1,5 +1,5 @@ dnl -dnl Check for support for position independent executables +dnl Check for support D_FORTIFY_SOURCE dnl dnl Copyright (C) 2013 Red Hat, Inc. dnl @@ -19,8 +19,10 @@ dnl . dnl AC_DEFUN([AC_CC_D_FORTIFY_SOURCE],[ + OLD_CXXFLAGS="$CXXFLAGS" + CXXFLAGS="-Wall -W -Werror $CXXFLAGS" gl_COMPILER_OPTION_IF([-D_FORTIFY_SOURCE=2], [ CFLAGS="$CFLAGS -D_FORTIFY_SOURCE=2" - CXXFLAGS="$CXXFLAGS -D_FORTIFY_SOURCE=2" - ]) + CXXFLAGS="$OLD_CXXFLAGS -D_FORTIFY_SOURCE=2" + ], [CXXFLAGS="$OLD_CXXFLAGS"], [AC_LANG_PROGRAM([[#include ]],[])]) ]) -- 2.47.2