build: ensure that the 'build' command appears in waf --help
[abartlet/samba.git/.git] / source4 / wscript
1 #! /usr/bin/env python
2
3 srcdir = '..'
4 blddir = 'bin'
5
6 import sys, os
7 sys.path.insert(0, srcdir+"/buildtools/wafsamba")
8 import wafsamba, Options
9
10 def set_options(opt):
11     opt.recurse('../lib/replace')
12     opt.recurse('dynconfig')
13     opt.recurse('scripting/python')
14     opt.recurse('lib/ldb')
15     opt.recurse('selftest')
16     opt.recurse('lib/tls')
17     opt.recurse('../lib/nss_wrapper')
18     opt.recurse('../lib/socket_wrapper')
19     opt.recurse('../lib/uid_wrapper')
20     opt.recurse('../lib/popt')
21
22 def configure(conf):
23     conf.define('PACKAGE_NAME', 'samba')
24     conf.define('PACKAGE_STRING', 'samba 4')
25     conf.define('PACKAGE_TARNAME',  'samba')
26     conf.define('PACKAGE_URL', "")
27     conf.define('PACKAGE_VERSION', "4")
28     conf.define('PACKAGE_BUGREPORT', 'samba-technical@samba.org')
29
30     conf.DEFINE('CONFIG_H_IS_FROM_SAMBA', 1)
31     conf.DEFINE('_SAMBA_BUILD_', 4, add_to_cflags=True)
32     conf.DEFINE('HAVE_CONFIG_H', 1, add_to_cflags=True)
33     if Options.options.developer:
34         conf.ADD_CFLAGS('-DDEVELOPER -DDEBUG_PASSWORD')
35
36     # set a lower limit on recursing in waf preprocessor
37     conf.env.preprocessor_recursion_limit = 10
38
39     conf.ADD_EXTRA_INCLUDES('#source4 #lib #source4/lib #source4/include #lib/replace #lib/talloc #lib/tevent')
40
41     conf.sub_config('../lib/replace')
42
43     conf.find_program('python', var='PYTHON', mandatory=True)
44     conf.find_program('perl', var='PERL', mandatory=True)
45
46     # enable tool to build python extensions
47     conf.check_tool('python')
48     conf.check_python_version((2,4,2))
49     conf.check_python_headers()
50
51     conf.sub_config('dynconfig')
52     conf.sub_config('scripting/python')
53     conf.sub_config('lib/ldb')
54     conf.sub_config('heimdal_build')
55     conf.sub_config('lib/tls')
56     conf.sub_config('ntvfs/sysdep')
57     conf.sub_config('../lib/util')
58     conf.sub_config('../lib/zlib')
59     conf.sub_config('../lib/util/charset')
60     conf.sub_config('auth')
61     conf.sub_config('../lib/nss_wrapper')
62     conf.sub_config('../lib/socket_wrapper')
63     conf.sub_config('../lib/uid_wrapper')
64     conf.sub_config('../lib/popt')
65     conf.sub_config('lib/smbreadline')
66
67     conf.SAMBA_CONFIG_H('include/config.h')
68
69
70 def etags(ctx):
71     '''build TAGS file using etags'''
72     import Utils
73     source_root = os.path.dirname(Utils.g_module.root_path)
74     cmd = 'etags $(find %s/.. -name "*.[ch]")' % source_root
75     print "Running: %s" % cmd
76     os.system(cmd)
77
78 # putting this here enabled build in the list
79 # of commands in --help
80 def build(bld):
81     '''build all targets'''
82     pass