2010-03-28 01:48:49 +03:00
#!/usr/bin/env python
2010-04-04 04:06:34 +04:00
APPNAME = 'tevent'
2010-04-13 05:45:38 +04:00
VERSION = '0.9.9'
2010-03-17 12:31:46 +03:00
2010-03-17 12:32:15 +03:00
blddir = 'bin'
2010-03-17 12:31:46 +03:00
2010-04-04 04:18:39 +04:00
import sys, os
# find the buildtools directory
2010-04-04 07:16:49 +04: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 04:18:39 +04:00
2010-09-24 01:28:02 +04:00
import wafsamba, samba_dist, Options, Logs
2010-04-04 05:00:42 +04:00
samba_dist.DIST_DIRS('lib/tevent:. lib/replace:lib/replace lib/talloc:lib/talloc buildtools:buildtools')
2010-02-26 14:21:50 +03:00
2010-03-17 12:31:46 +03:00
def set_options(opt):
2010-03-28 08:42:28 +04:00
opt.BUILTIN_DEFAULT('replace')
2010-10-24 01:26:43 +04:00
opt.PRIVATE_EXTENSION_DEFAULT('tevent', noextension='tevent')
2010-04-04 07:16:49 +04:00
opt.RECURSE('lib/replace')
opt.RECURSE('lib/talloc')
2010-09-24 01:28:02 +04:00
if opt.IN_LAUNCH_DIR():
opt.add_option('--disable-python',
help=("disable the pytevent module"),
action="store_true", dest='disable_python', default=False)
2010-03-17 12:31:46 +03:00
def configure(conf):
2010-04-04 07:16:49 +04:00
conf.RECURSE('lib/replace')
conf.RECURSE('lib/talloc')
2010-03-17 12:31:46 +03:00
2010-04-13 15:20:52 +04:00
conf.env.standalone_tevent = conf.IN_LAUNCH_DIR()
if not conf.env.standalone_tevent:
if conf.CHECK_BUNDLED_SYSTEM('tevent', minversion=VERSION,
onlyif='talloc', implied_deps='replace talloc'):
conf.define('USING_SYSTEM_TEVENT', 1)
2010-03-28 09:38:27 +04:00
2010-03-23 01:29:51 +03:00
if conf.CHECK_FUNCS('epoll_create', headers='sys/epoll.h'):
conf.DEFINE('HAVE_EPOLL', 1)
2010-03-17 12:31:46 +03:00
2010-09-24 01:28:02 +04:00
conf.env.disable_python = getattr(Options.options, 'disable_python', False)
if not conf.env.disable_python:
# also disable if we don't have the python libs installed
conf.check_tool('python')
conf.check_python_version((2,4,2))
conf.check_python_headers(mandatory=False)
if not conf.env.HAVE_PYTHON_H:
Logs.warn('Disabling pytevent as python devel libs not found')
conf.env.disable_python = True
2010-03-17 12:31:46 +03:00
conf.SAMBA_CONFIG_H()
def build(bld):
2010-04-04 07:16:49 +04:00
bld.RECURSE('lib/replace')
bld.RECURSE('lib/talloc')
2010-03-17 12:31:46 +03:00
2010-03-21 05:14:24 +03:00
SRC = '''tevent.c tevent_debug.c tevent_fd.c tevent_immediate.c
2010-03-17 12:31:46 +03: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-21 05:14:24 +03:00
if bld.CONFIG_SET('HAVE_EPOLL'):
SRC += ' tevent_epoll.c'
2010-03-17 12:31:46 +03:00
2010-10-24 22:50:47 +04:00
if bld.env.standalone_tevent:
bld.env.PKGCONFIGDIR = '${LIBDIR}/pkgconfig'
bld.PKG_CONFIG_FILES('tevent.pc', vnum=VERSION)
bld.INSTALL_FILES('${INCLUDEDIR}', 'tevent.h')
private_library = False
vnum = VERSION
else:
private_library = True
vnum = None
2010-03-28 09:38:27 +04: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'),
2010-04-18 06:47:13 +04:00
abi_file='ABI/tevent-%s.sigs' % VERSION,
abi_match='tevent_* _tevent_*',
2010-10-24 22:50:47 +04:00
vnum=vnum,
private_library=private_library)
2010-04-13 15:20:52 +04:00
2010-09-24 01:28:02 +04:00
bld.SAMBA_PYTHON('pytevent',
'pytevent.c',
deps='tevent',
enabled=True,
realname='_tevent.so')
2010-04-04 16:11:30 +04:00
def test(ctx):
'''test tevent'''
print("The tevent testsuite is part of smbtorture in samba4")
2010-04-05 03:58:23 +04:00
def dist():
'''makes a tarball for distribution'''
samba_dist.dist()