build: remove hacks from top level wscript
[nivanova/samba-autobuild/.git] / source4 / wscript
1 #! /usr/bin/env python
2
3 srcdir = '..'
4 blddir = 'bin'
5
6 import sys
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
21 def configure(conf):
22     conf.define('PACKAGE_NAME', 'samba')
23     conf.define('PACKAGE_STRING', 'samba 4')
24     conf.define('PACKAGE_TARNAME',  'samba')
25     conf.define('PACKAGE_URL', "")
26     conf.define('PACKAGE_VERSION', "4")
27     conf.define('PACKAGE_BUGREPORT', 'samba-technical@samba.org')
28
29     conf.DEFINE('CONFIG_H_IS_FROM_SAMBA', 1)
30     conf.DEFINE('_SAMBA_BUILD_', 4, add_to_cflags=True)
31     conf.DEFINE('HAVE_CONFIG_H', 1, add_to_cflags=True)
32     if Options.options.developer:
33         conf.ADD_CFLAGS('-DDEVELOPER -DDEBUG_PASSWORD')
34
35     # set a lower limit on recursing in waf preprocessor
36     conf.env.preprocessor_recursion_limit = 10
37
38     conf.ADD_EXTRA_INCLUDES('#source4 #lib #source4/lib #source4/include #lib/replace #lib/talloc #lib/tevent')
39
40     conf.sub_config('../lib/replace')
41
42     conf.find_program('python', var='PYTHON', mandatory=True)
43     conf.find_program('perl', var='PERL', mandatory=True)
44
45     # enable tool to build python extensions
46     conf.check_tool('python')
47     conf.check_python_version((2,4,2))
48     conf.check_python_headers()
49
50     conf.sub_config('dynconfig')
51     conf.sub_config('scripting/python')
52     conf.sub_config('lib/ldb')
53     conf.sub_config('heimdal_build')
54     conf.sub_config('lib/tls')
55     conf.sub_config('ntvfs/sysdep')
56     conf.sub_config('../lib/util')
57     conf.sub_config('../lib/zlib')
58     conf.sub_config('../lib/util/charset')
59     conf.sub_config('auth')
60     conf.sub_config('../lib/nss_wrapper')
61     conf.sub_config('../lib/socket_wrapper')
62     conf.sub_config('../lib/uid_wrapper')
63     conf.sub_config('lib/smbreadline')
64
65     conf.SAMBA_CONFIG_H('include/config.h')
66
67