e8aa1774e4e48b8650bc2ce5bc227b0720ec38b9
[samba.git] / lib / talloc / wscript
1 #!/usr/bin/env python
2
3 VERSION = '2.0.1'
4
5 srcdir = '../..'
6 blddir = 'bin'
7
8 LIBREPLACE_DIR= srcdir + '/lib/replace'
9
10 import sys
11 sys.path.insert(0, srcdir+"/buildtools/wafsamba")
12 import wafsamba
13
14 def set_options(opt):
15     opt.BUILTIN_DEFAULT('replace')
16     opt.BUNDLED_EXTENSION_DEFAULT('talloc', noextenion='talloc')
17     opt.recurse(LIBREPLACE_DIR)
18
19 def configure(conf):
20     conf.sub_config(LIBREPLACE_DIR)
21
22     if conf.CHECK_BUNDLED_SYSTEM('talloc', minversion=VERSION):
23         conf.define('USING_SYSTEM_TALLOC', 1)
24
25     conf.SAMBA_CONFIG_H()
26
27
28
29 def build(bld):
30     bld.BUILD_SUBDIR(LIBREPLACE_DIR)
31
32     if not bld.CONFIG_SET('USING_SYSTEM_TALLOC'):
33         bld.SAMBA_LIBRARY('talloc',
34                           'talloc.c',
35                           deps='replace',
36                           vnum=VERSION)
37
38     if not getattr(bld.env, '_SAMBA_BUILD_', 0) == 4:
39         # s4 already has the talloc testsuite builtin to smbtorture
40         bld.SAMBA_BINARY('talloc_testsuite',
41                          'testsuite_main.c testsuite.c',
42                          deps='talloc',
43                          install=False)