diff --git a/m4/spice-compile-warnings.m4 b/m4/spice-compile-warnings.m4 index 1ecae2a..3c7e0d3 100644 --- a/m4/spice-compile-warnings.m4 +++ b/m4/spice-compile-warnings.m4 @@ -104,8 +104,12 @@ AC_DEFUN([SPICE_COMPILE_WARNINGS],[ gl_WARN_ADD([-Wframe-larger-than=9216]) # Use improved glibc headers - 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. */ + #if defined __OPTIMIZE__ && __OPTIMIZE__ + # define _FORTIFY_SOURCE 2 + #endif + ]) # Extra special flags dnl -fstack-protector stuff passes gl_WARN_ADD with gcc