summaryrefslogtreecommitdiff
path: root/buildtools/wafsamba/wafsamba.py
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2010-03-24 16:23:10 -0600
committerAndrew Tridgell <tridge@samba.org>2010-04-06 20:27:06 +1000
commit239cdb53f4e994c8fd4afe1233e69b93ad632230 (patch)
tree5cd73c6fe5e79f34a9a37c12696ef492ba9b2894 /buildtools/wafsamba/wafsamba.py
parentb2f01b54d21a464fa7fadb784b58909748f80ab3 (diff)
downloadsamba-239cdb53f4e994c8fd4afe1233e69b93ad632230.tar.gz
samba-239cdb53f4e994c8fd4afe1233e69b93ad632230.tar.bz2
samba-239cdb53f4e994c8fd4afe1233e69b93ad632230.zip
build: support variable expansion in source= arguments to build rules
This makes it much easier to follow the s3 approach to lists of source files in the top level wscript Pair-Programmed-With: Kai Blin <kai@samba.org>
Diffstat (limited to 'buildtools/wafsamba/wafsamba.py')
-rw-r--r--buildtools/wafsamba/wafsamba.py17
1 files changed, 15 insertions, 2 deletions
diff --git a/buildtools/wafsamba/wafsamba.py b/buildtools/wafsamba/wafsamba.py
index 9e7c39581b..ad104a2e89 100644
--- a/buildtools/wafsamba/wafsamba.py
+++ b/buildtools/wafsamba/wafsamba.py
@@ -66,6 +66,7 @@ def SAMBA_LIBRARY(bld, libname, source,
group='main',
depends_on='',
local_include=True,
+ vars=None,
install_path=None,
install=True,
enabled=True):
@@ -74,6 +75,8 @@ def SAMBA_LIBRARY(bld, libname, source,
SET_TARGET_TYPE(bld, libname, 'DISABLED')
return
+ source = bld.EXPAND_VARIABLES(source, vars=vars)
+
# remember empty libraries, so we can strip the dependencies
if (source == '') or (source == []):
SET_TARGET_TYPE(bld, libname, 'EMPTY')
@@ -193,6 +196,7 @@ def SAMBA_BINARY(bld, binname, source,
local_include=True,
subsystem_name=None,
needs_python=False,
+ vars=None,
install=True,
install_path=None):
@@ -207,6 +211,8 @@ def SAMBA_BINARY(bld, binname, source,
obj_target = binname + '.objlist'
+ source = bld.EXPAND_VARIABLES(source, vars=vars)
+
# first create a target for building the object files for this binary
# by separating in this way, we avoid recompiling the C files
# separately for the install binary and the build binary
@@ -299,6 +305,7 @@ def SAMBA_MODULE(bld, modname, source,
cflags='',
internal_module=True,
local_include=True,
+ vars=None,
enabled=True):
# we add the init function regardless of whether the module
@@ -322,6 +329,8 @@ def SAMBA_MODULE(bld, modname, source,
SET_TARGET_TYPE(bld, modname, 'DISABLED')
return
+ source = bld.EXPAND_VARIABLES(source, vars=vars)
+
# remember empty modules, so we can strip the dependencies
if (source == '') or (source == []):
SET_TARGET_TYPE(bld, modname, 'EMPTY')
@@ -371,6 +380,7 @@ def SAMBA_SUBSYSTEM(bld, modname, source,
local_include_first=True,
subsystem_name=None,
enabled=True,
+ vars=None,
needs_python=False):
if not enabled:
@@ -385,6 +395,8 @@ def SAMBA_SUBSYSTEM(bld, modname, source,
if not SET_TARGET_TYPE(bld, modname, 'SUBSYSTEM'):
return
+ source = bld.EXPAND_VARIABLES(source, vars=vars)
+
deps += ' ' + public_deps
bld.SET_BUILD_GROUP(group)
@@ -421,7 +433,8 @@ Build.BuildContext.SAMBA_SUBSYSTEM = SAMBA_SUBSYSTEM
def SAMBA_GENERATOR(bld, name, rule, source, target,
- group='build_source', enabled=True):
+ group='build_source', enabled=True,
+ vars=None):
'''A generic source generator target'''
if not SET_TARGET_TYPE(bld, name, 'GENERATOR'):
@@ -433,7 +446,7 @@ def SAMBA_GENERATOR(bld, name, rule, source, target,
bld.SET_BUILD_GROUP(group)
bld(
rule=rule,
- source=source,
+ source=bld.EXPAND_VARIABLES(source, vars=vars),
target=target,
shell=True,
on_results=True,