summaryrefslogtreecommitdiff
path: root/config.lib
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2013-11-09 07:15:01 +0000
committerrubidium <rubidium@openttd.org>2013-11-09 07:15:01 +0000
commit015d2b13b26332d14395a9bda32d626806cec2d7 (patch)
treef3802702e431a307122d6a5b4e34fa32572fa188 /config.lib
parent85d4f8d65c891b162405b66b0949cf9c5998078f (diff)
downloadopenttd-015d2b13b26332d14395a9bda32d626806cec2d7.tar.xz
(svn r25960) -Fix-ish: make it less likely to trigger clang's hang with -D_FORTIFY_SOURCE=2 -O1
Diffstat (limited to 'config.lib')
-rw-r--r--config.lib6
1 files changed, 5 insertions, 1 deletions
diff --git a/config.lib b/config.lib
index 145d6c6f5..b9618f9bf 100644
--- a/config.lib
+++ b/config.lib
@@ -1455,12 +1455,16 @@ make_cflags_and_ldflags() {
fi
if [ $enable_debug -le 2 ]; then
- if basename "$cc_host" | grep "gcc" &>/dev/null; then
+ cc_host_is_gcc=`basename "$cc_host" | grep "gcc" &>/dev/null`
+ if [ -n "$cc_host_is_gcc" ]; then
# Define only when compiling with GCC. Some GLIBC versions use GNU
# extensions in a way that breaks build with at least ICC.
# This requires -O1 or more, so debug level 3 (-O0) is excluded.
CFLAGS="$CFLAGS -D_FORTIFY_SOURCE=2"
+ fi
+ cc_build_is_gcc=`basename "$cc_build" | grep "gcc" &>/dev/null`
+ if [ -n "$cc_build_is_gcc" ]; then
# Just add -O1 to the tools needed for building.
CFLAGS_BUILD="$CFLAGS_BUILD -D_FORTIFY_SOURCE=2 -O1"
fi