summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorglx <glx@openttd.org>2009-04-26 16:03:50 +0000
committerglx <glx@openttd.org>2009-04-26 16:03:50 +0000
commit779640b53a212091e929a2d7603474ab7b2710f8 (patch)
tree763b9f302f22da9fbc7c4f64d361df358983d3a3
parent85b653bafcee2a7687cbbebb7a0d65aa9ae8081b (diff)
downloadopenttd-779640b53a212091e929a2d7603474ab7b2710f8.tar.xz
(svn r16164) -Fix: make dependencies checking more accurate by using compiler's built-in defines
-rw-r--r--config.lib4
1 files changed, 3 insertions, 1 deletions
diff --git a/config.lib b/config.lib
index fda308f81..171f8ed3f 100644
--- a/config.lib
+++ b/config.lib
@@ -1400,8 +1400,10 @@ make_cflags_and_ldflags() {
# Lovely hackish, not?
# Btw, this almost always comes from outside the configure, so it is
# not something we can control.
+ # Also make makedepend aware of compiler's built-in defines.
if [ "$with_makedepend" != "0" ]; then
- cflags_makedep="` echo "$CFLAGS" | sed 's~ /~ -~g;s~-I[ ]*[^ ]*~~g'`"
+ cflags_makedep="`echo | $cxx_host -E -x c++ -dM - | sed 's~#define ~-D~g;s~ .*~ ~g;s~(.*)~~g' | tr -d '\r\n'`"
+ cflags_makedep="$cflags_makedep `echo "$CFLAGS" | sed 's~ /~ -~g;s~-I[ ]*[^ ]*~~g'`"
else
makedepend=""
fi