build: do not redefine _FORTIFY_SOURCE

When _FORTIFY_SOURCE is defined by the compiler or via flags, as
it is on Gentoo, do not override it.  Otherwise we get many
redefinition warnings.

* configure.ac (FORTIFY_SOURCE): Check if _FORTIFY_SOURCE is defined.
This addresses http://bugs.gnu.org/12714
This commit is contained in:
Mike Frysinger 2012-10-23 15:20:07 -04:00 committed by Jim Meyering
parent 7ab9b4e443
commit 9517680ed3

View File

@ -170,7 +170,7 @@ if test "$gl_gcc_warnings" = yes; then
AH_VERBATIM([FORTIFY_SOURCE], AH_VERBATIM([FORTIFY_SOURCE],
[/* Enable compile-time and run-time bounds-checking, and some warnings, [/* Enable compile-time and run-time bounds-checking, and some warnings,
without upsetting glibc 2.15+. */ without upsetting glibc 2.15+. */
#if defined __OPTIMIZE__ && __OPTIMIZE__ #if !defined _FORTIFY_SOURCE && defined __OPTIMIZE__ && __OPTIMIZE__
# define _FORTIFY_SOURCE 2 # define _FORTIFY_SOURCE 2
#endif #endif
]) ])