s3/torture: migrate SMB_VFS_FLISTXATTR calls to SMB_VFS_FLISTXATTR
[Samba.git] / lib / tevent / wscript
blob93af416f583c31dc6874f13ba4fb0667c00dddd5
1 #!/usr/bin/env python
3 APPNAME = 'tevent'
4 VERSION = '0.10.2'
6 import sys, os
8 # find the buildtools directory
9 top = '.'
10 while not os.path.exists(top+'/buildtools') and len(top.split('/')) < 5:
11 top = top + '/..'
12 sys.path.insert(0, top + '/buildtools/wafsamba')
14 out = 'bin'
16 import wafsamba
17 from wafsamba import samba_dist, samba_utils
18 from waflib import Options, Logs, Context
20 samba_dist.DIST_DIRS('lib/tevent:. lib/replace:lib/replace lib/talloc:lib/talloc buildtools:buildtools third_party/waf:third_party/waf')
22 def options(opt):
23 opt.BUILTIN_DEFAULT('replace')
24 opt.PRIVATE_EXTENSION_DEFAULT('tevent', noextension='tevent')
25 opt.RECURSE('lib/replace')
26 opt.RECURSE('lib/talloc')
29 def configure(conf):
30 conf.RECURSE('lib/replace')
31 conf.RECURSE('lib/talloc')
33 conf.env.standalone_tevent = conf.IN_LAUNCH_DIR()
35 if not conf.env.standalone_tevent:
36 if conf.CHECK_BUNDLED_SYSTEM_PKG('tevent', minversion=VERSION,
37 onlyif='talloc', implied_deps='replace talloc'):
38 conf.define('USING_SYSTEM_TEVENT', 1)
39 if not conf.env.disable_python and \
40 conf.CHECK_BUNDLED_SYSTEM_PYTHON('pytevent', 'tevent', minversion=VERSION):
41 conf.define('USING_SYSTEM_PYTEVENT', 1)
43 if conf.CHECK_FUNCS('epoll_create', headers='sys/epoll.h'):
44 conf.DEFINE('HAVE_EPOLL', 1)
46 tevent_num_signals = 64
47 v = conf.CHECK_VALUEOF('NSIG', headers='signal.h')
48 if v is not None:
49 tevent_num_signals = max(tevent_num_signals, v)
50 v = conf.CHECK_VALUEOF('_NSIG', headers='signal.h')
51 if v is not None:
52 tevent_num_signals = max(tevent_num_signals, v)
53 v = conf.CHECK_VALUEOF('SIGRTMAX', headers='signal.h')
54 if v is not None:
55 tevent_num_signals = max(tevent_num_signals, v)
56 v = conf.CHECK_VALUEOF('SIGRTMIN', headers='signal.h')
57 if v is not None:
58 tevent_num_signals = max(tevent_num_signals, v*2)
60 if not conf.CONFIG_SET('USING_SYSTEM_TEVENT'):
61 conf.DEFINE('TEVENT_NUM_SIGNALS', tevent_num_signals)
63 conf.SAMBA_CHECK_PYTHON()
64 conf.SAMBA_CHECK_PYTHON_HEADERS()
66 conf.SAMBA_CONFIG_H()
68 conf.SAMBA_CHECK_UNDEFINED_SYMBOL_FLAGS()
70 def build(bld):
71 bld.RECURSE('lib/replace')
72 bld.RECURSE('lib/talloc')
74 SRC = '''tevent.c tevent_debug.c tevent_fd.c tevent_immediate.c
75 tevent_queue.c tevent_req.c tevent_wrapper.c
76 tevent_poll.c tevent_threads.c
77 tevent_signal.c tevent_standard.c tevent_timed.c tevent_util.c tevent_wakeup.c'''
79 if bld.CONFIG_SET('HAVE_EPOLL'):
80 SRC += ' tevent_epoll.c'
82 if bld.CONFIG_SET('HAVE_SOLARIS_PORTS'):
83 SRC += ' tevent_port.c'
85 if bld.env.standalone_tevent:
86 bld.env.PKGCONFIGDIR = '${LIBDIR}/pkgconfig'
87 private_library = False
88 else:
89 private_library = True
91 if not bld.CONFIG_SET('USING_SYSTEM_TEVENT'):
92 tevent_deps = 'replace talloc'
93 if bld.CONFIG_SET('HAVE_PTHREAD'):
94 tevent_deps += ' pthread'
96 bld.SAMBA_LIBRARY('tevent',
97 SRC,
98 deps=tevent_deps,
99 enabled= not bld.CONFIG_SET('USING_SYSTEM_TEVENT'),
100 includes='.',
101 abi_directory='ABI',
102 abi_match='tevent_* _tevent_*',
103 vnum=VERSION,
104 public_headers=('' if private_library else 'tevent.h'),
105 public_headers_install=not private_library,
106 pc_files='tevent.pc',
107 private_library=private_library)
109 if not bld.CONFIG_SET('USING_SYSTEM_PYTEVENT') and not bld.env.disable_python:
110 bld.SAMBA_PYTHON('_tevent',
111 'pytevent.c',
112 deps='tevent',
113 realname='_tevent.so',
114 cflags='-DPACKAGE_VERSION=\"%s\"' % VERSION)
117 bld.INSTALL_WILDCARD('${PYTHONARCHDIR}', 'tevent.py', flat=False)
119 # install out various python scripts for use by make test
120 bld.SAMBA_SCRIPT('tevent_python',
121 pattern='tevent.py',
122 installdir='python')
125 def test(ctx):
126 '''test tevent'''
127 print("The tevent testsuite is part of smbtorture in samba4")
129 samba_utils.ADD_LD_LIBRARY_PATH('bin/shared')
130 samba_utils.ADD_LD_LIBRARY_PATH('bin/shared/private')
132 pyret = samba_utils.RUN_PYTHON_TESTS(['bindings.py'])
133 sys.exit(pyret)
136 def dist():
137 '''makes a tarball for distribution'''
138 samba_dist.dist()
140 def reconfigure(ctx):
141 '''reconfigure if config scripts have changed'''
142 samba_utils.reconfigure(ctx)