]>
Commit | Line | Data |
---|---|---|
5801cd92 | 1 | dnl |
9145fc8e | 2 | dnl Check for support D_FORTIFY_SOURCE |
5801cd92 AT |
3 | dnl |
4 | dnl Copyright (C) 2013 Red Hat, Inc. | |
5 | dnl | |
6 | dnl This library is free software; you can redistribute it and/or | |
7 | dnl modify it under the terms of the GNU Lesser General Public | |
8 | dnl License as published by the Free Software Foundation; either | |
9 | dnl version 2.1 of the License, or (at your option) any later version. | |
10 | dnl | |
11 | dnl This library is distributed in the hope that it will be useful, | |
12 | dnl but WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 | dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
14 | dnl Lesser General Public License for more details. | |
15 | dnl | |
16 | dnl You should have received a copy of the GNU Lesser General Public | |
17 | dnl License along with this library. If not, see | |
18 | dnl <http://www.gnu.org/licenses/>. | |
19 | dnl | |
20 | ||
21 | AC_DEFUN([AC_CC_D_FORTIFY_SOURCE],[ | |
9145fc8e AT |
22 | OLD_CXXFLAGS="$CXXFLAGS" |
23 | CXXFLAGS="-Wall -W -Werror $CXXFLAGS" | |
5801cd92 | 24 | gl_COMPILER_OPTION_IF([-D_FORTIFY_SOURCE=2], [ |
d1840ef2 CH |
25 | CFLAGS="-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 $CFLAGS" |
26 | CXXFLAGS="-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 $OLD_CXXFLAGS" | |
9145fc8e | 27 | ], [CXXFLAGS="$OLD_CXXFLAGS"], [AC_LANG_PROGRAM([[#include <stdio.h>]],[])]) |
5801cd92 | 28 | ]) |