Change all uses of uint32 to uint32_t in vfs.h. This is part of a general cleanup...
[Samba.git] / buildtools / wafsamba / samba_python.py
bloba371b434a78808664b3f8bb700c34a30a9e18214
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
9 @conf
10 def SAMBA_CHECK_PYTHON(conf, mandatory=True, version=(2,4,2)):
11 # enable tool to build python extensions
12 conf.find_program('python', var='PYTHON', mandatory=mandatory)
13 conf.check_tool('python')
14 path_python = conf.find_program('python')
15 conf.env.PYTHON_SPECIFIED = (conf.env.PYTHON != path_python)
16 conf.check_python_version(version)
18 @conf
19 def SAMBA_CHECK_PYTHON_HEADERS(conf, mandatory=True):
20 if conf.env["python_headers_checked"] == []:
21 conf.check_python_headers(mandatory)
22 conf.env["python_headers_checked"] = "yes"
23 else:
24 conf.msg("python headers", "using cache")
27 def SAMBA_PYTHON(bld, name,
28 source='',
29 deps='',
30 public_deps='',
31 realname=None,
32 cflags='',
33 includes='',
34 init_function_sentinel=None,
35 local_include=True,
36 vars=None,
37 install=True,
38 enabled=True):
39 '''build a python extension for Samba'''
41 # when we support static python modules we'll need to gather
42 # the list from all the SAMBA_PYTHON() targets
43 if init_function_sentinel is not None:
44 cflags += '-DSTATIC_LIBPYTHON_MODULES=%s' % init_function_sentinel
46 source = bld.EXPAND_VARIABLES(source, vars=vars)
48 if realname is not None:
49 link_name = 'python_modules/%s' % realname
50 else:
51 link_name = None
53 bld.SAMBA_LIBRARY(name,
54 source=source,
55 deps=deps,
56 public_deps=public_deps,
57 includes=includes,
58 cflags=cflags,
59 local_include=local_include,
60 vars=vars,
61 realname=realname,
62 link_name=link_name,
63 pyext=True,
64 target_type='PYTHON',
65 install_path='${PYTHONARCHDIR}',
66 allow_undefined_symbols=True,
67 allow_warnings=True,
68 install=install,
69 enabled=enabled)
71 Build.BuildContext.SAMBA_PYTHON = SAMBA_PYTHON