s4-waf: added simple 'waf test' support for tdb, talloc and ldb
[amitay/samba.git] / lib / tevent / wscript
1 #!/usr/bin/env python
2
3 APPNAME = 'tevent'
4 VERSION = '0.9.8'
5
6 blddir = 'bin'
7
8 import sys, os
9
10 # find the buildtools directory
11 srcdir = '.'
12 while not os.path.exists(srcdir+'/buildtools') and len(srcdir.split('/')) < 5:
13     srcdir = '../' + srcdir
14 sys.path.insert(0, srcdir + '/buildtools/wafsamba')
15
16 import wafsamba, samba_dist
17
18 samba_dist.DIST_DIRS('lib/tevent:. lib/replace:lib/replace lib/talloc:lib/talloc buildtools:buildtools')
19
20 def set_options(opt):
21     opt.BUILTIN_DEFAULT('replace')
22     opt.BUNDLED_EXTENSION_DEFAULT('tevent', noextenion='tevent')
23     opt.RECURSE('lib/replace')
24     opt.RECURSE('lib/talloc')
25
26 def configure(conf):
27     conf.RECURSE('lib/replace')
28     conf.RECURSE('lib/talloc')
29
30     if conf.CHECK_BUNDLED_SYSTEM('tevent', minversion=VERSION,
31                                  onlyif='talloc', implied_deps='replace talloc'):
32         conf.define('USING_SYSTEM_TEVENT', 1)
33
34     if conf.CHECK_FUNCS('epoll_create', headers='sys/epoll.h'):
35         conf.DEFINE('HAVE_EPOLL', 1)
36
37     conf.SAMBA_CONFIG_H()
38
39 def build(bld):
40     bld.RECURSE('lib/replace')
41     bld.RECURSE('lib/talloc')
42
43     SRC = '''tevent.c tevent_debug.c tevent_fd.c tevent_immediate.c
44              tevent_queue.c tevent_req.c tevent_select.c
45              tevent_signal.c tevent_standard.c tevent_timed.c tevent_util.c tevent_wakeup.c'''
46
47     if bld.CONFIG_SET('HAVE_EPOLL'):
48         SRC += ' tevent_epoll.c'
49
50     if not bld.CONFIG_SET('USING_SYSTEM_TEVENT'):
51         bld.SAMBA_LIBRARY('tevent',
52                           SRC,
53                           deps='replace talloc',
54                           enabled= not bld.CONFIG_SET('USING_SYSTEM_TEVENT'),
55                           vnum=VERSION)
56
57 def test(ctx):
58     '''test tevent'''
59     print("The tevent testsuite is part of smbtorture in samba4")
60