1 # waf build tool for building IDL files with pidl
4 from samba_utils
import *
5 from samba_autoconf
import *
7 from Configure
import 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"
14 conf
.msg("python headers", "using cache")
17 def SAMBA_PYTHON(bld
, name
,
24 init_function_sentinel
=None,
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
42 bld
.SAMBA_LIBRARY(name
,
45 public_deps
=public_deps
,
48 local_include
=local_include
,
54 install_path
='${PYTHONARCHDIR}',
55 allow_undefined_symbols
=True,
58 Build
.BuildContext
.SAMBA_PYTHON
= SAMBA_PYTHON