From 9129c3b3b6d8a1cdfb7a6500ef4eb20075aa2d53 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 17 Mar 2010 21:46:38 +1100 Subject: build: fixes from ita --- buildtools/wafsamba/samba_utils.py | 44 +++++++++++++++++++++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-) (limited to 'buildtools/wafsamba/samba_utils.py') diff --git a/buildtools/wafsamba/samba_utils.py b/buildtools/wafsamba/samba_utils.py index 0c8a832c70..bdbd3c7b93 100644 --- a/buildtools/wafsamba/samba_utils.py +++ b/buildtools/wafsamba/samba_utils.py @@ -157,7 +157,7 @@ def ADD_COMMAND(opt, name, function): Options.Handler.ADD_COMMAND = ADD_COMMAND -@feature('cprogram cc') +@feature('cprogram','cc','cshlib') @before('apply_core') def process_depends_on(self): '''The new depends_on attribute for build rules @@ -169,6 +169,27 @@ def process_depends_on(self): y = self.bld.name_to_obj(x, self.env) y.post() + if getattr(y, 'more_includes', None): + self.includes += " " + y.more_includes + + +#@feature('cprogram cc cshlib') +#@before('apply_core') +#def process_generated_dependencies(self): +# '''Ensure that any dependent source generation happens +# before any task that requires the output''' +# if getattr(self , 'depends_on', None): +# lst = self.to_list(self.depends_on) +# for x in lst: +# y = self.bld.name_to_obj(x, self.env) +# y.post() + + +def FIND_TASKGEN(bld, name): + '''find a waf task generator given a target name''' + return bld.name_to_obj(name) +Build.BuildContext.FIND_TASKGEN = FIND_TASKGEN + #import TaskGen, Task # @@ -179,3 +200,24 @@ def process_depends_on(self): # #for y in ['cc', 'cxx']: # TaskGen.classes[y].post_run = new_post_run + +def ENABLE_MAGIC_ORDERING(bld): + '''enable automatic build order constraint calculation + see page 35 of the waf book''' + print "Enabling magic ordering" + bld.use_the_magic() +Build.BuildContext.ENABLE_MAGIC_ORDERING = ENABLE_MAGIC_ORDERING + + +def BUILD_PATH(bld, relpath): + '''return a relative build path, given a relative path + for example, if called in the source4/librpc directory, with the path + gen_ndr/tables.c, then it will return default/source4/gen_ndr/tables.c + ''' + + ret = os.path.normpath(os.path.join(os.path.relpath(bld.curdir, bld.env.TOPDIR), relpath)) + ret = 'default/%s' % ret + return ret +Build.BuildContext.BUILD_PATH = BUILD_PATH + + -- cgit