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_sentinal
=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_sentinal
is not None:
33 cflags
+= '-DSTATIC_LIBPYTHON_MODULES=%s' % init_function_sentinal
35 source
= bld
.EXPAND_VARIABLES(source
, vars=vars)
38 # a SAMBA_PYTHON target without a realname is just a
39 # library with pyembed=True
40 bld
.SAMBA_LIBRARY(name
,
43 public_deps
=public_deps
,
46 local_include
=local_include
,
52 link_name
= 'python/%s' % realname
54 bld
.SAMBA_LIBRARY(name
,
57 public_deps
=public_deps
,
61 local_include
=local_include
,
66 install_path
='${PYTHONARCHDIR}',
69 Build
.BuildContext
.SAMBA_PYTHON
= SAMBA_PYTHON