s3: add functions to flush the idmap memcache
[Samba.git] / lib / tevent / wscript
blob8f8820f5a11a9191eecc99f528c5d105618d1bb2
1 #!/usr/bin/env python
3 APPNAME = 'tevent'
4 VERSION = '0.9.9'
6 blddir = 'bin'
8 import sys, os
10 # find the buildtools directory
11 srcdir = '.'
12 while not os.path.exists(srcdir+'/buildtools') and len(srcdir.split('/')) < 5:
13 srcdir = '../' + srcdir
14 sys.path.insert(0, srcdir + '/buildtools/wafsamba')
16 import wafsamba, samba_dist, Options, Logs
18 samba_dist.DIST_DIRS('lib/tevent:. lib/replace:lib/replace lib/talloc:lib/talloc buildtools:buildtools')
20 def set_options(opt):
21 opt.BUILTIN_DEFAULT('replace')
22 opt.PRIVATE_EXTENSION_DEFAULT('tevent', noextension='tevent')
23 opt.RECURSE('lib/replace')
24 opt.RECURSE('lib/talloc')
25 if opt.IN_LAUNCH_DIR():
26 opt.add_option('--disable-python',
27 help=("disable the pytevent module"),
28 action="store_true", dest='disable_python', default=False)
31 def configure(conf):
32 conf.RECURSE('lib/replace')
33 conf.RECURSE('lib/talloc')
35 conf.env.standalone_tevent = conf.IN_LAUNCH_DIR()
37 if not conf.env.standalone_tevent:
38 if conf.CHECK_BUNDLED_SYSTEM('tevent', minversion=VERSION,
39 onlyif='talloc', implied_deps='replace talloc'):
40 conf.define('USING_SYSTEM_TEVENT', 1)
42 if conf.CHECK_FUNCS('epoll_create', headers='sys/epoll.h'):
43 conf.DEFINE('HAVE_EPOLL', 1)
45 conf.env.disable_python = getattr(Options.options, 'disable_python', False)
47 if not conf.env.disable_python:
48 # also disable if we don't have the python libs installed
49 conf.check_tool('python')
50 conf.check_python_version((2,4,2))
51 conf.check_python_headers(mandatory=False)
52 if not conf.env.HAVE_PYTHON_H:
53 Logs.warn('Disabling pytevent as python devel libs not found')
54 conf.env.disable_python = True
56 conf.SAMBA_CONFIG_H()
58 def build(bld):
59 bld.RECURSE('lib/replace')
60 bld.RECURSE('lib/talloc')
62 SRC = '''tevent.c tevent_debug.c tevent_fd.c tevent_immediate.c
63 tevent_queue.c tevent_req.c tevent_select.c
64 tevent_signal.c tevent_standard.c tevent_timed.c tevent_util.c tevent_wakeup.c'''
66 if bld.CONFIG_SET('HAVE_EPOLL'):
67 SRC += ' tevent_epoll.c'
69 if bld.env.standalone_tevent:
70 bld.env.PKGCONFIGDIR = '${LIBDIR}/pkgconfig'
71 bld.PKG_CONFIG_FILES('tevent.pc', vnum=VERSION)
72 bld.INSTALL_FILES('${INCLUDEDIR}', 'tevent.h')
73 private_library = False
74 vnum = VERSION
75 else:
76 private_library = True
77 vnum = None
79 if not bld.CONFIG_SET('USING_SYSTEM_TEVENT'):
80 bld.SAMBA_LIBRARY('tevent',
81 SRC,
82 deps='replace talloc',
83 enabled= not bld.CONFIG_SET('USING_SYSTEM_TEVENT'),
84 abi_file='ABI/tevent-%s.sigs' % VERSION,
85 abi_match='tevent_* _tevent_*',
86 vnum=vnum,
87 private_library=private_library)
89 bld.SAMBA_PYTHON('pytevent',
90 'pytevent.c',
91 deps='tevent',
92 enabled=True,
93 realname='_tevent.so')
96 def test(ctx):
97 '''test tevent'''
98 print("The tevent testsuite is part of smbtorture in samba4")
101 def dist():
102 '''makes a tarball for distribution'''
103 samba_dist.dist()
105 def reconfigure(ctx):
106 '''reconfigure if config scripts have changed'''
107 import samba_utils
108 samba_utils.reconfigure(ctx)