summaryrefslogtreecommitdiff
path: root/dynconfig
diff options
context:
space:
mode:
authorGarming Sam <garming@catalyst.net.nz>2014-01-09 12:01:18 +1300
committerMichael Adam <obnox@samba.org>2014-01-31 21:07:05 +0100
commit57ba012c10fb21f261a3ab9136be05a694278df9 (patch)
tree3b23f10ea62b3e648fbdfbb31cac0b88e7ffcb4e /dynconfig
parent0e552e03aec56db4ab4a3615386830fd11541ef8 (diff)
downloadsamba-57ba012c10fb21f261a3ab9136be05a694278df9.tar.gz
docs: define and include entities for the docs
This allows for dynamic default settings to be generated. Change-Id: If8b93d233fb941bc7e3073ccf4b5ec0b0a231bd9 Pair-programmed-with: Andrew Bartlett <abartlet@samba.org> Signed-off-by: Garming Sam <garming@catalyst.net.nz> Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
Diffstat (limited to 'dynconfig')
-rwxr-xr-xdynconfig/wscript35
1 files changed, 27 insertions, 8 deletions
diff --git a/dynconfig/wscript b/dynconfig/wscript
index aa4e66e9d8c..a7cfa0a2d59 100755
--- a/dynconfig/wscript
+++ b/dynconfig/wscript
@@ -345,29 +345,48 @@ def configure(conf):
conf.start_msg("Dynconfig[%s]: " % (varname))
conf.end_msg("'%s'" % (value), 'GREEN')
-def dynconfig_cflags(bld, list=None):
- '''work out the extra CFLAGS for dynconfig.c'''
- cflags = []
- # override some paths when running from the build directory
+def get_override(bld):
override = { 'MODULESDIR' : 'bin/modules',
'PYTHONDIR' : 'bin/python',
'PYTHONARCHDIR' : 'bin/python',
'BINDIR' : 'bin',
'SBINDIR' : 'bin',
- 'CODEPAGEDIR' : os.path.join(bld.env.srcdir, 'codepages'),
- 'SCRIPTSBINDIR' : os.path.join(bld.env.srcdir, 'source4/scripting/bin'),
- 'SETUPDIR' : os.path.join(bld.env.srcdir, 'source4/setup') }
+ 'CODEPAGEDIR' : 'codepages',
+ 'SCRIPTSBINDIR' : 'source4/scripting/bin',
+ 'SETUPDIR' : 'source4/setup'
+ }
+ return override
+
+def dynconfig_cflags(bld, list=None):
+ '''work out the extra CFLAGS for dynconfig.c'''
+ cflags = []
for varname in dynconfig.keys():
if list and not varname in list:
continue
value = bld.env[varname]
if not Options.is_install:
+ override = get_override(bld)
if varname in override:
- value = os.path.join(os.getcwd(), override[varname])
+ value = os.path.join(bld.env.srcdir, override[varname])
cflags.append('-D%s="%s"' % (varname, value))
return cflags
Build.BuildContext.dynconfig_cflags = dynconfig_cflags
+def pathconfig_entities(bld, list=None):
+ '''work out the extra entities for the docs'''
+ entities = []
+ for varname in dynconfig.keys():
+ if list and not varname in list:
+ continue
+ value = bld.env[varname]
+ if not Options.is_install:
+ override = get_override(bld)
+ if varname in override:
+ value = os.path.join(bld.env.srcdir, override[varname])
+ entities.append("<!ENTITY pathconfig.%s '%s'>" % (varname, value))
+ return entities
+Build.BuildContext.pathconfig_entities = pathconfig_entities
+
def build(bld):
cflags = bld.dynconfig_cflags()
version_header = 'version.h'