summaryrefslogtreecommitdiff
path: root/Configure
diff options
context:
space:
mode:
Diffstat (limited to 'Configure')
-rwxr-xr-xConfigure15
1 files changed, 10 insertions, 5 deletions
diff --git a/Configure b/Configure
index 2e404d7d52..8cb09bdbf9 100755
--- a/Configure
+++ b/Configure
@@ -22221,12 +22221,17 @@ fi
: add -D_FORTIFY_SOURCE if feasible and not already there
case "$gccversion" in
-4.*) case "$ccflags$cppsymbols" in
- *_FORTIFY_SOURCE=*) # Don't add it again.
- echo "You seem to have -D_FORTIFY_SOURCE already..." >&4
+4.*) case "$optimize$ccflags" in
+ *-O*) case "$ccflags$cppsymbols" in
+ *_FORTIFY_SOURCE=*) # Don't add it again.
+ echo "You seem to have -D_FORTIFY_SOURCE already, not adding it." >&4
+ ;;
+ *) echo "Adding -D_FORTIFY_SOURCE=2 to ccflags..." >&4
+ ccflags="$ccflags -D_FORTIFY_SOURCE=2"
+ ;;
+ esac
;;
- *) ccflags="$ccflags -D_FORTIFY_SOURCE=2"
- echo "Adding -D_FORTIFY_SOURCE=2 to ccflags..." >&4
+ *) echo "You have gcc 4.* but not optimizing, not adding -D_FORTIFY_SOURCE." >&4
;;
esac
;;