10 # find the buildtools directory
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')
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)
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_PKG('tevent', minversion=VERSION,
39 onlyif='talloc', implied_deps='replace talloc'):
40 conf.define('USING_SYSTEM_TEVENT', 1)
41 if conf.CHECK_BUNDLED_SYSTEM_PYTHON('pytevent', 'tevent', minversion=VERSION):
42 conf.define('USING_SYSTEM_PYTEVENT', 1)
44 if conf.CHECK_FUNCS('epoll_create', headers='sys/epoll.h'):
45 conf.DEFINE('HAVE_EPOLL', 1)
47 conf.env.disable_python = getattr(Options.options, 'disable_python', False)
49 if not conf.env.disable_python:
50 # also disable if we don't have the python libs installed
51 conf.find_program('python', var='PYTHON')
52 conf.check_tool('python')
53 conf.check_python_version((2,4,2))
54 conf.SAMBA_CHECK_PYTHON_HEADERS(mandatory=False)
55 if not conf.env.HAVE_PYTHON_H:
56 Logs.warn('Disabling pytevent as python devel libs not found')
57 conf.env.disable_python = True
61 conf.SAMBA_CHECK_UNDEFINED_SYMBOL_FLAGS()
64 bld.RECURSE('lib/replace')
65 bld.RECURSE('lib/talloc')
67 SRC = '''tevent.c tevent_debug.c tevent_fd.c tevent_immediate.c
68 tevent_queue.c tevent_req.c tevent_select.c
70 tevent_signal.c tevent_standard.c tevent_timed.c tevent_util.c tevent_wakeup.c'''
72 if bld.CONFIG_SET('HAVE_EPOLL'):
73 SRC += ' tevent_epoll.c'
75 if bld.env.standalone_tevent:
76 bld.env.PKGCONFIGDIR = '${LIBDIR}/pkgconfig'
77 private_library = False
79 private_library = True
81 if not bld.CONFIG_SET('USING_SYSTEM_TEVENT'):
82 bld.SAMBA_LIBRARY('tevent',
84 deps='replace talloc',
85 enabled= not bld.CONFIG_SET('USING_SYSTEM_TEVENT'),
88 abi_match='tevent_* _tevent_*',
90 public_headers='tevent.h',
91 public_headers_install=not private_library,
93 private_library=private_library)
95 if not bld.CONFIG_SET('USING_SYSTEM_PYTEVENT'):
96 bld.SAMBA_PYTHON('pytevent',
99 realname='_tevent.so')
100 # install out various python scripts for use by make test
101 bld.SAMBA_SCRIPT('tevent_python',
105 bld.INSTALL_WILDCARD('${PYTHONDIR}', 'tevent.py', flat=False)
110 print("The tevent testsuite is part of smbtorture in samba4")
114 '''makes a tarball for distribution'''
117 def reconfigure(ctx):
118 '''reconfigure if config scripts have changed'''
120 samba_utils.reconfigure(ctx)