2010-03-28 09:48:49 +11:00
#!/usr/bin/env python
2010-04-04 10:06:34 +10:00
APPNAME = 'tevent'
2010-03-17 20:31:46 +11:00
VERSION = '0.9.8'
2010-03-17 20:32:15 +11:00
blddir = 'bin'
2010-03-17 20:31:46 +11:00
2010-04-04 10:18:39 +10:00
import sys, os
# find the buildtools directory
2010-04-04 13:16:49 +10:00
srcdir = '.'
while not os.path.exists(srcdir+'/buildtools') and len(srcdir.split('/')) < 5:
srcdir = '../' + srcdir
sys.path.insert(0, srcdir + '/buildtools/wafsamba')
2010-04-04 10:18:39 +10:00
2010-04-04 11:00:42 +10:00
import wafsamba, samba_dist
samba_dist.DIST_DIRS('lib/tevent:. lib/replace:lib/replace lib/talloc:lib/talloc buildtools:buildtools')
2010-02-26 22:21:50 +11:00
2010-03-17 20:31:46 +11:00
def set_options(opt):
2010-03-28 15:42:28 +11:00
opt.BUILTIN_DEFAULT('replace')
opt.BUNDLED_EXTENSION_DEFAULT('tevent', noextenion='tevent')
2010-04-04 13:16:49 +10:00
opt.RECURSE('lib/replace')
opt.RECURSE('lib/talloc')
2010-03-17 20:31:46 +11:00
def configure(conf):
2010-04-04 13:16:49 +10:00
conf.RECURSE('lib/replace')
conf.RECURSE('lib/talloc')
2010-03-17 20:31:46 +11:00
2010-03-29 22:27:17 +11:00
if conf.CHECK_BUNDLED_SYSTEM('tevent', minversion=VERSION,
onlyif='talloc', implied_deps='replace talloc'):
2010-03-28 16:38:27 +11:00
conf.define('USING_SYSTEM_TEVENT', 1)
2010-03-23 09:29:51 +11:00
if conf.CHECK_FUNCS('epoll_create', headers='sys/epoll.h'):
conf.DEFINE('HAVE_EPOLL', 1)
2010-03-17 20:31:46 +11:00
conf.SAMBA_CONFIG_H()
def build(bld):
2010-04-04 13:16:49 +10:00
bld.RECURSE('lib/replace')
bld.RECURSE('lib/talloc')
2010-03-17 20:31:46 +11:00
2010-03-20 22:14:24 -04:00
SRC = '''tevent.c tevent_debug.c tevent_fd.c tevent_immediate.c
2010-03-17 20:31:46 +11:00
tevent_queue.c tevent_req.c tevent_select.c
tevent_signal.c tevent_standard.c tevent_timed.c tevent_util.c tevent_wakeup.c'''
2010-03-20 22:14:24 -04:00
if bld.CONFIG_SET('HAVE_EPOLL'):
SRC += ' tevent_epoll.c'
2010-03-17 20:31:46 +11:00
2010-03-28 16:38:27 +11:00
if not bld.CONFIG_SET('USING_SYSTEM_TEVENT'):
bld.SAMBA_LIBRARY('tevent',
SRC,
deps='replace talloc',
enabled= not bld.CONFIG_SET('USING_SYSTEM_TEVENT'),
vnum=VERSION)