s4-waf: avoid having to run waf configure before waf dist
[Samba/gebeck_regimport.git] / lib / tevent / wscript
blob976048d0163c1da93fa3909fcb8a37da92b3ce4f
1 #!/usr/bin/env python
3 APPNAME = 'tevent'
4 VERSION = '0.9.8'
6 blddir = 'bin'
8 import sys, os
10 # find the buildtools directory
11 buildtools = 'buildtools ../../buildtools'
12 for d in buildtools.split():
13 if os.path.exists(d):
14 srcdir = os.path.dirname(d) or '.'
15 break
17 sys.path.insert(0, srcdir+"/buildtools/wafsamba")
18 import wafsamba, samba_dist
20 samba_dist.DIST_DIRS('lib/tevent:. lib/replace:lib/replace lib/talloc:lib/talloc buildtools:buildtools')
22 LIBREPLACE_DIR= srcdir + '/lib/replace'
23 LIBTALLOC_DIR= srcdir + '/lib/talloc'
25 def set_options(opt):
26 opt.BUILTIN_DEFAULT('replace')
27 opt.BUNDLED_EXTENSION_DEFAULT('tevent', noextenion='tevent')
28 opt.recurse(LIBREPLACE_DIR)
29 opt.recurse(LIBTALLOC_DIR)
31 def configure(conf):
32 conf.sub_config(LIBREPLACE_DIR)
33 conf.sub_config(LIBTALLOC_DIR)
35 if conf.CHECK_BUNDLED_SYSTEM('tevent', minversion=VERSION,
36 onlyif='talloc', implied_deps='replace talloc'):
37 conf.define('USING_SYSTEM_TEVENT', 1)
39 if conf.CHECK_FUNCS('epoll_create', headers='sys/epoll.h'):
40 conf.DEFINE('HAVE_EPOLL', 1)
42 conf.SAMBA_CONFIG_H()
44 def build(bld):
45 bld.BUILD_SUBDIR(LIBREPLACE_DIR)
46 bld.BUILD_SUBDIR(LIBTALLOC_DIR)
48 SRC = '''tevent.c tevent_debug.c tevent_fd.c tevent_immediate.c
49 tevent_queue.c tevent_req.c tevent_select.c
50 tevent_signal.c tevent_standard.c tevent_timed.c tevent_util.c tevent_wakeup.c'''
52 if bld.CONFIG_SET('HAVE_EPOLL'):
53 SRC += ' tevent_epoll.c'
55 if not bld.CONFIG_SET('USING_SYSTEM_TEVENT'):
56 bld.SAMBA_LIBRARY('tevent',
57 SRC,
58 deps='replace talloc',
59 enabled= not bld.CONFIG_SET('USING_SYSTEM_TEVENT'),
60 vnum=VERSION)