summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2013-01-11 10:03:04 -0500
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2013-01-11 10:03:16 -0500
commit6a17986542912ed80d9fdc1b6eaa6d48fdd5d02d (patch)
treef7a0d07cdecaec2dac9dbe46a6a2a0d5ba9464a0 /configure.ac
parentb37844d3d72af3afbcb801476cf07c085519f392 (diff)
build-sys: use _FORTIFY_SOURCE only if optimizing
Rather then force the user to undefine _FORTIFY_SOURCE, don't define it in the first place if it cannot be used. I'm assuming that -O* can only be sensibly specified in $CFLAGS.
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac6
1 files changed, 4 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac
index 7a3cd87511..3566dac830 100644
--- a/configure.ac
+++ b/configure.ac
@@ -167,8 +167,10 @@ CC_CHECK_FLAGS_APPEND([with_cflags], [CFLAGS], [\
--param=ssp-buffer-size=4])
AC_SUBST([OUR_CFLAGS], $with_cflags)
-CC_CHECK_FLAGS_APPEND([with_cppflags], [CPPFLAGS], [\
- -Wp,-D_FORTIFY_SOURCE=2])
+AS_CASE([$CFLAGS], [*-O[[12345\ ]]*], [
+ CC_CHECK_FLAGS_APPEND([with_cppflags], [CPPFLAGS], [\
+ -Wp,-D_FORTIFY_SOURCE=2])], [
+ AC_MSG_RESULT([skipping -D_FORTIFY_SOURCE, optimization not enabled])])
AC_SUBST([OUR_CPPFLAGS], $with_cppflags)
CC_CHECK_FLAGS_APPEND([with_ldflags], [LDFLAGS], [\