summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2014-11-11 20:21:48 -0800
committerPaul Eggert <eggert@cs.ucla.edu>2014-11-11 20:23:00 -0800
commitcae0ef2fcd4786583cda8e0c283cad79a5d33918 (patch)
treeb61d9fa240c5eccc52308d339b34fd46359d6696 /configure.ac
parent2f3efcdf47b8442fdb31a3c9f08def2d04c80dec (diff)
downloadgrep-cae0ef2fcd4786583cda8e0c283cad79a5d33918.tar.gz
build: port to GCC 4.6.4 + glibc 2.5
On platforms this old, building with _FORTIFY_SOURCE equal to 2 results in duplicate definitions of standard library functions. Problem reported by Nelson H. F. Beebe. * configure.ac (_FORTIFY_SOURCE): Sort after GNULIB_PORTCHECK. By default, do not enable this unless GNULIB_PORTCHECK is defined. This better matches the original intent, which as I recall was to enable these extra checks only with --enable-gcc-warnings.
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac7
1 files changed, 4 insertions, 3 deletions
diff --git a/configure.ac b/configure.ac
index 4d069b87..0b548bd4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -144,14 +144,15 @@ if test "$gl_gcc_warnings" = yes; then
AC_SUBST([WARN_CFLAGS])
AC_DEFINE([lint], [1], [Define to 1 if the compiler is checking for lint.])
- AH_VERBATIM([FORTIFY_SOURCE],
+ AC_DEFINE([GNULIB_PORTCHECK], [1], [enable some gnulib portability checks])
+ AH_VERBATIM([GNULIB_PORTCHECK_FORTIFY_SOURCE],
[/* Enable compile-time and run-time bounds-checking, and some warnings,
without upsetting glibc 2.15+. */
- #if !defined _FORTIFY_SOURCE && defined __OPTIMIZE__ && __OPTIMIZE__
+ #if (defined GNULIB_PORTCHECK && !defined _FORTIFY_SOURCE \
+ && 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/.
# Remove the following and save the result in GNULIB_WARN_CFLAGS.