summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2012-09-01 11:54:38 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2012-09-01 11:54:38 -0700
commit2d3800d2cf34188b0b3ee30012d09f3426b9ae01 (patch)
treec9a2790bfe06c2a952a1c0d4b791649b3dbe3783 /configure.ac
parent78dd6ab19818ddbd6995e58b6eccd3e19899aba1 (diff)
downloademacs-2d3800d2cf34188b0b3ee30012d09f3426b9ae01.tar.gz
* configure.ac (_FORTIFY_SOURCE): Define only when optimizing.
This ports to glibc 2.15 or later, when configured with --enable-gcc-warnings. See Eric Blake in <http://lists.gnu.org/archive/html/bug-grep/2012-09/msg00000.html>.
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac9
1 files changed, 7 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac
index d16113bf919..43686361d07 100644
--- a/configure.ac
+++ b/configure.ac
@@ -737,8 +737,13 @@ else
gl_WARN_ADD([-funit-at-a-time])
AC_DEFINE([lint], [1], [Define to 1 if the compiler is checking for lint.])
- AC_DEFINE([_FORTIFY_SOURCE], [2],
- [enable compile-time and run-time bounds-checking, and some warnings])
+ AH_VERBATIM([FORTIFY_SOURCE],
+ [/* Enable compile-time and run-time bounds-checking, and some warnings,
+ without upsetting glibc 2.15+. */
+ #if defined __OPTIMIZE__ && __OPTIMIZE__
+ # define _FORTIFY_SOURCE 2
+ #endif
+ ])
AC_DEFINE([GNULIB_PORTCHECK], [1], [enable some gnulib portability checks])
# We use a slightly smaller set of warning options for lib/.