10 # find the buildtools directory
11 buildtools = 'buildtools ../../buildtools'
12 for d in buildtools.split():
14 srcdir = os.path.dirname(d) or '.'
17 sys.path.insert(0, srcdir+"/buildtools/wafsamba")
20 LIBREPLACE_DIR= srcdir + '/lib/replace'
21 LIBTALLOC_DIR= srcdir + '/lib/talloc'
24 opt.BUILTIN_DEFAULT('replace')
25 opt.BUNDLED_EXTENSION_DEFAULT('tevent', noextenion='tevent')
26 opt.recurse(LIBREPLACE_DIR)
27 opt.recurse(LIBTALLOC_DIR)
30 conf.DIST_DIRS('lib/tevent:. lib/replace:lib/replace lib/talloc:lib/talloc buildtools:buildtools')
31 conf.sub_config(LIBREPLACE_DIR)
32 conf.sub_config(LIBTALLOC_DIR)
34 if conf.CHECK_BUNDLED_SYSTEM('tevent', minversion=VERSION,
35 onlyif='talloc', implied_deps='replace talloc'):
36 conf.define('USING_SYSTEM_TEVENT', 1)
38 if conf.CHECK_FUNCS('epoll_create', headers='sys/epoll.h'):
39 conf.DEFINE('HAVE_EPOLL', 1)
44 bld.BUILD_SUBDIR(LIBREPLACE_DIR)
45 bld.BUILD_SUBDIR(LIBTALLOC_DIR)
47 SRC = '''tevent.c tevent_debug.c tevent_fd.c tevent_immediate.c
48 tevent_queue.c tevent_req.c tevent_select.c
49 tevent_signal.c tevent_standard.c tevent_timed.c tevent_util.c tevent_wakeup.c'''
51 if bld.CONFIG_SET('HAVE_EPOLL'):
52 SRC += ' tevent_epoll.c'
54 if not bld.CONFIG_SET('USING_SYSTEM_TEVENT'):
55 bld.SAMBA_LIBRARY('tevent',
57 deps='replace talloc',
58 enabled= not bld.CONFIG_SET('USING_SYSTEM_TEVENT'),