summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2010-03-19 22:33:43 +1100
committerAndrew Tridgell <tridge@samba.org>2010-04-06 20:26:55 +1000
commit86cfbbafcdc42acd1d37fb152ab123453bd985fa (patch)
tree7e0db507472e5307d4242f62dfe5c125e2967321
parenta602a98b495d8b20cf1a1456cf53710ab55d408c (diff)
downloadsamba-86cfbbafcdc42acd1d37fb152ab123453bd985fa.tar.gz
samba-86cfbbafcdc42acd1d37fb152ab123453bd985fa.tar.bz2
samba-86cfbbafcdc42acd1d37fb152ab123453bd985fa.zip
build: gccdeps fixes from ita
-rw-r--r--buildtools/wafsamba/gccdeps.py26
1 files changed, 23 insertions, 3 deletions
diff --git a/buildtools/wafsamba/gccdeps.py b/buildtools/wafsamba/gccdeps.py
index bd03da4f8b..6600c9ca3b 100644
--- a/buildtools/wafsamba/gccdeps.py
+++ b/buildtools/wafsamba/gccdeps.py
@@ -9,12 +9,23 @@ and prepare the dependency calculation for the next run
import os, re, threading
import Task, Logs, Utils, preproc
+from TaskGen import before, after, feature
lock = threading.Lock()
+preprocessor_flag = '-MD'
-def detect(conf):
- conf.env.append_unique('CCFLAGS', '-MD')
+@feature('cc')
+@before('apply_core')
+def add_mmd_cc(self):
+ if self.env.get_flat('CCFLAGS').find(preprocessor_flag) < 0:
+ self.env.append_value('CCFLAGS', preprocessor_flag)
+
+@feature('cxx')
+@before('apply_core')
+def add_mmd_cxx(self):
+ if self.env.get_flat('CXXFLAGS').find(preprocessor_flag) < 0:
+ self.env.append_value('CXXFLAGS', preprocessor_flag)
def scan(self):
"the scanner does not do anything initially"
@@ -22,6 +33,7 @@ def scan(self):
names = []
return (nodes, names)
+re_o = re.compile("\.o$")
re_src = re.compile("^(\.\.)[\\/](.*)$")
def post_run(self):
@@ -31,7 +43,7 @@ def post_run(self):
return Task.Task.post_run(self)
name = self.outputs[0].abspath(self.env)
- name = name.rstrip('.o') + '.d'
+ name = re_o.sub('.d', name)
txt = Utils.readf(name)
#os.unlink(name)
@@ -97,6 +109,13 @@ def post_run(self):
Task.Task.post_run(self)
+import Constants, Utils
+def sig_implicit_deps(self):
+ try:
+ return Task.Task.sig_implicit_deps(self)
+ except Utils.WafError:
+ return Constants.SIG_NIL
+
for name in 'cc cxx'.split():
try:
cls = Task.TaskBase.classes[name]
@@ -105,4 +124,5 @@ for name in 'cc cxx'.split():
else:
cls.post_run = post_run
cls.scan = scan
+ cls.sig_implicit_deps = sig_implicit_deps