s4-waf: set the bundled library extension for some libs
[nivanova/samba-autobuild/.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     opt.recurse('../pidl')
22
23 def configure(conf):
24     conf.DEFINE('PACKAGE_NAME', 'samba', quote=True)
25     conf.DEFINE('PACKAGE_STRING', 'samba 4', quote=True)
26     conf.DEFINE('PACKAGE_TARNAME',  'samba', quote=True)
27     conf.DEFINE('PACKAGE_URL', "http://www.samba.org/", quote=True)
28     conf.DEFINE('PACKAGE_VERSION', "4", quote=True)
29     conf.DEFINE('PACKAGE_BUGREPORT', 'http://bugzilla.samba.org/', quote=True)
30
31     conf.DEFINE('CONFIG_H_IS_FROM_SAMBA', 1)
32     conf.DEFINE('_SAMBA_BUILD_', 4, add_to_cflags=True)
33     conf.DEFINE('HAVE_CONFIG_H', 1, add_to_cflags=True)
34
35     conf.BUNDLED_LIBRARY_EXTENSION('s4')
36
37     if Options.options.developer:
38         conf.ADD_CFLAGS('-DDEVELOPER -DDEBUG_PASSWORD')
39
40     # set a lower limit on recursing in waf preprocessor
41     conf.env.preprocessor_recursion_limit = 10
42
43     conf.ADD_EXTRA_INCLUDES('#source4 #lib #source4/lib #source4/include #lib/replace #lib/talloc #lib/tevent')
44
45     conf.sub_config('../lib/replace')
46
47     conf.find_program('python', var='PYTHON', mandatory=True)
48     conf.find_program('perl', var='PERL', mandatory=True)
49
50     # enable tool to build python extensions
51     conf.check_tool('python')
52     conf.check_python_version((2,4,2))
53     conf.check_python_headers()
54
55     conf.sub_config('dynconfig')
56     conf.sub_config('scripting/python')
57     conf.sub_config('lib/ldb')
58     conf.sub_config('heimdal_build')
59     conf.sub_config('lib/tls')
60     conf.sub_config('ntvfs/sysdep')
61     conf.sub_config('../lib/util')
62     conf.sub_config('../lib/zlib')
63     conf.sub_config('../lib/util/charset')
64     conf.sub_config('auth')
65     conf.sub_config('../lib/nss_wrapper')
66     conf.sub_config('../nsswitch')
67     conf.sub_config('../lib/socket_wrapper')
68     conf.sub_config('../lib/uid_wrapper')
69     conf.sub_config('../lib/popt')
70     conf.sub_config('lib/smbreadline')
71     conf.sub_config('../pidl')
72
73     conf.SAMBA_CONFIG_H('include/config.h')
74
75
76 def etags(ctx):
77     '''build TAGS file using etags'''
78     import Utils
79     source_root = os.path.dirname(Utils.g_module.root_path)
80     cmd = 'etags $(find %s/.. -name "*.[ch]")' % source_root
81     print "Running: %s" % cmd
82     os.system(cmd)
83
84 def ctags(ctx):
85     "build 'tags' file using ctags"
86     import Utils
87     source_root = os.path.dirname(Utils.g_module.root_path)
88     cmd = 'ctags $(find %s/.. -name "*.[ch]" | grep -v "*_proto\.h")' % source_root
89     print "Running: %s" % cmd
90     os.system(cmd)
91
92 # putting this here enabled build in the list
93 # of commands in --help
94 def build(bld):
95     '''build all targets'''
96     pass