summaryrefslogtreecommitdiff
path: root/config.lib
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2007-01-06 22:58:01 +0000
committerrubidium <rubidium@openttd.org>2007-01-06 22:58:01 +0000
commit8d41fe225e36b5172c43521ec03e7fce21b1a4c4 (patch)
treea542fc7075e2d49b935217cfc3c2d1dccf7e4f2c /config.lib
parenta05ab3028ad81f3144ff289fcf5a5dd31cbd41fd (diff)
downloadopenttd-8d41fe225e36b5172c43521ec03e7fce21b1a4c4.tar.xz
(svn r7931) -Fix (r7759): multiple (different) -O flags made compilations with the wrong optimisations.
Diffstat (limited to 'config.lib')
-rw-r--r--config.lib45
1 files changed, 21 insertions, 24 deletions
diff --git a/config.lib b/config.lib
index d4a570ffa..85c252b60 100644
--- a/config.lib
+++ b/config.lib
@@ -620,25 +620,10 @@ make_cflags_and_ldflags() {
# LDFLAGS used for HOST
LDFLAGS="$LDFLAGS"
- # Each debug level reduces the optimalization by a bit
- if [ $enable_debug -ge 1 ]
- then
- CFLAGS="$CFLAGS -g -D_DEBUG"
- OBJS_SUBDIR="debug"
- else
- OBJS_SUBDIR="release"
- fi
- if [ $enable_debug -ge 2 ]
- then
- CFLAGS="$CFLAGS -fno-inline"
- fi
- if [ $enable_debug -ge 3 ]
- then
- CFLAGS="$CFLAGS -O0"
- fi
if [ $enable_debug = 0 ]
then
# No debug, add default stuff
+ OBJS_SUBDIR="release"
if [ "$os" = "OSX" ]
then
# these compilerflags makes the app run as fast as possible without making the app unstable. It works on G3 or newer
@@ -652,18 +637,30 @@ make_cflags_and_ldflags() {
CFLAGS="$CFLAGS -O2 -fomit-frame-pointer"
fi
+ else
+ OBJS_SUBDIR="debug"
- if [ "$enable_profiling" != "0" ]
+ # Each debug level reduces the optimalization by a bit
+ if [ $enable_debug -ge 1 ]
then
- CFLAGS="$CFLAGS -pg"
- LDFLAGS="$LDFLAGS -pg"
+ CFLAGS="$CFLAGS -g -D_DEBUG"
fi
- else
- if [ "$enable_profiling" != "0" ]
+ if [ $enable_debug -ge 2 ]
then
- CFLAGS="$CFLAGS -p"
- LDFLAGS="$LDFLAGS -pg"
+ CFLAGS="$CFLAGS -fno-inline"
fi
+ if [ $enable_debug -ge 3 ]
+ then
+ CFLAGS="$CFLAGS -O0"
+ else
+ CFLAGS="$CFLAGS -O2"
+ fi
+ fi
+
+ if [ "$enable_profiling" != "0" ]
+ then
+ CFLAGS="$CFLAGS -p"
+ LDFLAGS="$LDFLAGS -pg"
fi
# Enable some things only for certain GCC versions
@@ -671,7 +668,7 @@ make_cflags_and_ldflags() {
if [ $cc_version -ge 29 ]
then
- CFLAGS="$CFLAGS -O -Wall -Wno-multichar -Wsign-compare -Wundef"
+ CFLAGS="$CFLAGS -Wall -Wno-multichar -Wsign-compare -Wundef"
CFLAGS="$CFLAGS -Wwrite-strings -Wpointer-arith"
CC_CFLAGS="$CC_CFLAGS -Wstrict-prototypes"