10 # find the buildtools directory
11 buildtools = 'buildtools'
12 while not os.path.exists(buildtools) and len(buildtools.split('/')) < 5:
13 buildtools = '../' + buildtools
14 srcdir = os.path.dirname(buildtools) or '.'
16 sys.path.insert(0, 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= '../replace'
23 LIBTALLOC_DIR= '../talloc'
26 opt.BUILTIN_DEFAULT('replace')
27 opt.BUNDLED_EXTENSION_DEFAULT('tevent', noextenion='tevent')
28 opt.recurse(LIBREPLACE_DIR)
29 opt.recurse(LIBTALLOC_DIR)
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)
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',
58 deps='replace talloc',
59 enabled= not bld.CONFIG_SET('USING_SYSTEM_TEVENT'),