The macro _FORTIFY_SOURCE might be already defined by environment in
which case it shouldn't be overriden (might be if it has lower value).
Signed-off-by: Martin Kletzander <mkletzan(a)redhat.com>
---
configure.ac | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/configure.ac b/configure.ac
index 4940df3..47dc2b2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -196,7 +196,8 @@ if test "$gl_gcc_warnings" = yes; then
AC_DEFINE([GNULIB_PORTCHECK], [1], [Enable some gnulib portability checks.])
AH_VERBATIM([FORTIFY_SOURCE],[
/* Enable compile-time and run-time bounds-checking, and some warnings. */
-#if __OPTIMIZE__
+#if __OPTIMIZE__ && (! defined (_FORTIFY_SOURCE) || _FORTIFY_SOURCE < 2)
+# undef _FORTIFY_SOURCE
# define _FORTIFY_SOURCE 2
#endif])
fi
--
1.8.3.2