summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2019-10-21 17:28:02 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2019-10-21 17:33:18 -0700
commit3716921c012d7b21a9b0d593a7ea0ddd1e860cfd (patch)
tree7d2fa61ff9520896c5c02ad3aed1c905c8906823 /configure.ac
parentb087a5f3e4a7fff586245c117f153ae50a35537c (diff)
downloademacs-3716921c012d7b21a9b0d593a7ea0ddd1e860cfd.tar.gz
Portcheck only if --enable-gcc-warnings
Problem reported by Richard Copley (Bug#37852). This patch causes the problem to not occur if one uses plain ‘configure’. The problem can still occur if with ‘configure --enable-gcc-warnings’, so a further fix may be needed. * configure.ac (GNULIB_PORTCHECK, _FORTIFY_SOURCE): Define these only with an explicit --enable-gcc-warnings.
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac19
1 files changed, 10 insertions, 9 deletions
diff --git a/configure.ac b/configure.ac
index 33d725c8046..3b6a2a6d167 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1114,15 +1114,16 @@ AS_IF([test $gl_gcc_warnings = no],
fi
AC_DEFINE([GCC_LINT], [1], [Define to 1 if --enable-gcc-warnings.])
- 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 GNULIB_PORTCHECK && !defined _FORTIFY_SOURCE \
- && defined __OPTIMIZE__ && __OPTIMIZE__)
- # define _FORTIFY_SOURCE 2
- #endif
- ])
+ AS_IF([test $gl_gcc_warnings = yes],
+ [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 GNULIB_PORTCHECK && !defined _FORTIFY_SOURCE \
+ && defined __OPTIMIZE__ && __OPTIMIZE__)
+ # define _FORTIFY_SOURCE 2
+ #endif
+ ])])
])
# clang is picky about these regardless of whether