mirror of
https://github.com/samba-team/samba.git
synced 2025-02-22 05:57:43 +03:00
s3-waf: Added support dynconfig cflags
Pair-Programmed-With: Andrew Tridgell <tridge@samba.org>
This commit is contained in:
parent
a8a4fe0605
commit
5f87d5a3d0
@ -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}',
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user