summaryrefslogtreecommitdiff
path: root/source3/build
diff options
context:
space:
mode:
Diffstat (limited to 'source3/build')
-rw-r--r--source3/build/dynconfig.py1
-rw-r--r--source3/build/wscript22
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