s4-waf: added implied_deps for system libraries
[samba.git] / lib / tevent / wscript
1 #!/usr/bin/env python
2
3 VERSION = '0.9.8'
4
5 srcdir = '../..'
6 blddir = 'bin'
7
8 import sys
9 sys.path.insert(0, srcdir+"/buildtools/wafsamba")
10 import wafsamba
11
12 LIBREPLACE_DIR= srcdir + '/lib/replace'
13 LIBTALLOC_DIR=  srcdir + '/lib/talloc'
14
15 def set_options(opt):
16     opt.BUILTIN_DEFAULT('replace')
17     opt.BUNDLED_EXTENSION_DEFAULT('tevent', noextenion='tevent')
18     opt.recurse(LIBREPLACE_DIR)
19     opt.recurse(LIBTALLOC_DIR)
20
21 def configure(conf):
22     conf.sub_config(LIBREPLACE_DIR)
23     conf.sub_config(LIBTALLOC_DIR)
24
25     if conf.CHECK_BUNDLED_SYSTEM('tevent', minversion=VERSION,
26                                  onlyif='talloc', implied_deps='replace talloc'):
27         conf.define('USING_SYSTEM_TEVENT', 1)
28
29     if conf.CHECK_FUNCS('epoll_create', headers='sys/epoll.h'):
30         conf.DEFINE('HAVE_EPOLL', 1)
31
32     conf.SAMBA_CONFIG_H()
33
34 def build(bld):
35     bld.BUILD_SUBDIR(LIBREPLACE_DIR)
36     bld.BUILD_SUBDIR(LIBTALLOC_DIR)
37
38     SRC = '''tevent.c tevent_debug.c tevent_fd.c tevent_immediate.c
39              tevent_queue.c tevent_req.c tevent_select.c
40              tevent_signal.c tevent_standard.c tevent_timed.c tevent_util.c tevent_wakeup.c'''
41
42     if bld.CONFIG_SET('HAVE_EPOLL'):
43         SRC += ' tevent_epoll.c'
44
45     if not bld.CONFIG_SET('USING_SYSTEM_TEVENT'):
46         bld.SAMBA_LIBRARY('tevent',
47                           SRC,
48                           deps='replace talloc',
49                           enabled= not bld.CONFIG_SET('USING_SYSTEM_TEVENT'),
50                           vnum=VERSION)