]> granicus.if.org Git - pdns/commitdiff
Fix definition and test whether D_FORTIFY_SOURCE gives warning
authorAki Tuomi <cmouse@desteem.org>
Mon, 1 Sep 2014 10:13:06 +0000 (13:13 +0300)
committerAki Tuomi <cmouse@desteem.org>
Mon, 1 Sep 2014 10:24:39 +0000 (13:24 +0300)
m4/pdns_d_fortify_source.m4

index 721c9cce09bfcdd5c7876d43177190b701d25efb..7f90329a9977547674f934d352ed3fc6e704e172 100644 (file)
@@ -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 <http://www.gnu.org/licenses/>.
 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 <stdio.h>]],[])])
 ])