summaryrefslogtreecommitdiff
path: root/config.lib
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2014-08-16 10:17:18 +0000
committerrubidium <rubidium@openttd.org>2014-08-16 10:17:18 +0000
commitf4a381f9919e127715956dd80ba6949b991e0d36 (patch)
tree754bd795796a1b5a0f86c26db4dfb4c52668a10f /config.lib
parentc25b0a0ad4e3dedf2b1c8652536ad1a1e07a8e0e (diff)
downloadopenttd-f4a381f9919e127715956dd80ba6949b991e0d36.tar.xz
(svn r26735) -Fix (rmakefilerewrite): for profiling CFLAGS got a -p (for prof) and LDFLAGS got -pg (for gprof), but in the end gprof would be used (via make run-prof). Furthermore -pg isn't compatible with -fomit-frame-pointer on certain architectures (most importantly x86(_64)), so simply don't enable that flag when profiling is enabled
Diffstat (limited to 'config.lib')
-rw-r--r--config.lib8
1 files changed, 6 insertions, 2 deletions
diff --git a/config.lib b/config.lib
index 0b355cdd3..36fd6a384 100644
--- a/config.lib
+++ b/config.lib
@@ -1450,7 +1450,11 @@ make_cflags_and_ldflags() {
LDFLAGS="$LDFLAGS -noixemul"
fi
- CFLAGS="-O2 -fomit-frame-pointer $CFLAGS"
+ if [ "$enable_profiling" == "0" ]; then
+ # -fomit-frame-pointer and -pg do not go well together (gcc errors they are incompatible)
+ CFLAGS="-fomit-frame-pointer $CFLAGS"
+ fi
+ CFLAGS="-O2 $CFLAGS"
else
OBJS_SUBDIR="debug"
@@ -1494,7 +1498,7 @@ make_cflags_and_ldflags() {
fi
if [ "$enable_profiling" != "0" ]; then
- CFLAGS="$CFLAGS -p"
+ CFLAGS="$CFLAGS -pg"
LDFLAGS="$LDFLAGS -pg"
fi