diff options
author | Kai Blin <kai@samba.org> | 2010-03-26 16:52:32 -0600 |
---|---|---|
committer | Kai Blin <kai@samba.org> | 2010-05-20 22:16:12 +0200 |
commit | 5f87d5a3d0390eb6c9139f78125d223f3a70b7ef (patch) | |
tree | f6e15698158963c2ac3264b58415d3d9b41f49ff /source3/build | |
parent | a8a4fe0605e6149efb5f9051181d794572edbf27 (diff) | |
download | samba-5f87d5a3d0390eb6c9139f78125d223f3a70b7ef.tar.gz samba-5f87d5a3d0390eb6c9139f78125d223f3a70b7ef.tar.bz2 samba-5f87d5a3d0390eb6c9139f78125d223f3a70b7ef.zip |
s3-waf: Added support dynconfig cflags
Pair-Programmed-With: Andrew Tridgell <tridge@samba.org>
Diffstat (limited to 'source3/build')
-rw-r--r-- | source3/build/dynconfig.py | 1 | ||||
-rw-r--r-- | source3/build/wscript | 22 |
2 files changed, 22 insertions, 1 deletions
diff --git a/source3/build/dynconfig.py b/source3/build/dynconfig.py index 179af10ecf..f267fecfe6 100644 --- a/source3/build/dynconfig.py +++ b/source3/build/dynconfig.py @@ -26,6 +26,7 @@ dyn_cflags = { 'DATADIR' : '${DATADIR}', 'LOGFILEBASE' : '${LOCALSTATEDIR}', 'CONFIGDIR' : '${SYSCONFDIR}', + 'CONFIGFILE' : '${CONFIGDIR}/smb.conf', 'NCALRPCDIR' : '${LOCALSTATEDIR}/ncalrpc', 'SWATDIR' : '${DATADIR}/swat', 'PRIVATE_DIR' : '${PRIVATEDIR}', diff --git a/source3/build/wscript b/source3/build/wscript index a4df794f3a..2940dd569d 100644 --- a/source3/build/wscript +++ b/source3/build/wscript @@ -1,6 +1,6 @@ #!/usr/bin/env python -import Options +import string, Utils, Options from dynconfig import * def set_options(opt): @@ -24,9 +24,29 @@ def configure(conf): conf.ASSERT(varname not in conf.env, "Variable %s already defined" % varname) conf.env[varname] = value + for f in dyn_cflags.keys(): + # substitute twice, as we could have substitutions containing variables + v = Utils.subst_vars(dyn_cflags[f], conf.env) + v = Utils.subst_vars(v, conf.env) + conf.ASSERT(v != '', "Empty dynconfig value for %s" % f) + conf.ASSERT(v.find('${') == -1, "Unsubstituted variable in %s : %s : %s" % (f, dyn_cflags[f], v)) + conf.env[f] = v + def build(bld): cflags = dynconfig_cflags(bld) bld.SAMBA_SUBSYSTEM('DYNCONFIG', '../dynconfig.c', deps='replace talloc tdb', cflags=cflags) + +def dynconfig_cflags(bld): + '''work out the extra CFLAGS for dynconfig.c''' + cflags = [] + for f in dyn_cflags.keys(): + # substitute twice, as we could have substitutions containing variables + v = Utils.subst_vars(dyn_cflags[f], bld.env) + v = Utils.subst_vars(v, bld.env) + bld.ASSERT(v != '', "Empty dynconfig value for %s" % f) + bld.ASSERT(v.find('${') == -1, "Unsubstituted variable in %s : %s : %s" % (f, dyn_cflags[f], v)) + cflags.append('-D%s="%s"' % (f, v)) + return cflags |