s3-waf: added build subdir for dynconfig generation
[nivanova/samba-autobuild/.git] / source3 / build / wscript
1 import Options
2 from dynconfig import *
3
4 def set_options(opt):
5     # get all the basic GNU options from the gnu_dirs tool
6     opt.tool_options('gnu_dirs')
7     for option in dir_options.keys():
8         default = dir_options[option][0]
9         help    = dir_options[option][1]
10         varname = get_varname(option)
11         opt.add_option('--%s' % option,
12                        help=(help + ' [%s]' % default),
13                        action="store", dest=varname, default=default)
14
15 def configure(conf):
16     # get all the basic GNU options from the gnu_dirs tool
17     conf.check_tool('gnu_dirs')
18     for option in dir_options.keys():
19         varname = get_varname(option)
20         value = getattr(Options.options, varname, None)
21         conf.ASSERT(value is not None, "Missing configure option %s" % varname)
22         conf.ASSERT(varname not in conf.env, "Variable %s already defined" % varname)
23         conf.env[varname] = value
24
25 def build(bld):
26     cflags = dynconfig_cflags(bld)
27     bld.SAMBA_SUBSYSTEM('DYNCONFIG',
28                         '../dynconfig.c',
29                         deps='replace talloc tdb',
30                         cflags=cflags)