s3:smbd: s/EVENT_FD/TEVENT_FD
[Samba/gebeck_regimport.git] / buildtools / wafsamba / samba_python.py
blob6bc32f00b65a6e6443494cffcb232f8ea4fd6270
1 # waf build tool for building IDL files with pidl
3 import Build
4 from samba_utils import *
5 from samba_autoconf import *
7 from Configure import conf
8 @conf
9 def SAMBA_CHECK_PYTHON_HEADERS(conf, mandatory=True):
10 if conf.env["python_headers_checked"] == []:
11 conf.check_python_headers(mandatory)
12 conf.env["python_headers_checked"] = "yes"
13 else:
14 conf.msg("python headers", "using cache")
17 def SAMBA_PYTHON(bld, name,
18 source='',
19 deps='',
20 public_deps='',
21 realname=None,
22 cflags='',
23 includes='',
24 init_function_sentinel=None,
25 local_include=True,
26 vars=None,
27 enabled=True):
28 '''build a python extension for Samba'''
30 # when we support static python modules we'll need to gather
31 # the list from all the SAMBA_PYTHON() targets
32 if init_function_sentinel is not None:
33 cflags += '-DSTATIC_LIBPYTHON_MODULES=%s' % init_function_sentinel
35 source = bld.EXPAND_VARIABLES(source, vars=vars)
37 if realname is not None:
38 link_name = 'python/%s' % realname
39 else:
40 link_name = None
42 bld.SAMBA_LIBRARY(name,
43 source=source,
44 deps=deps,
45 public_deps=public_deps,
46 includes=includes,
47 cflags=cflags,
48 local_include=local_include,
49 vars=vars,
50 realname=realname,
51 link_name=link_name,
52 pyext=True,
53 target_type='PYTHON',
54 install_path='${PYTHONARCHDIR}',
55 allow_undefined_symbols=True,
56 enabled=enabled)
58 Build.BuildContext.SAMBA_PYTHON = SAMBA_PYTHON