1 # waf build tool for building IDL files with pidl
4 from samba_utils import *
5 from samba_autoconf import *
8 def SAMBA_PYTHON(bld, name,
15 init_function_sentinal=None,
18 '''build a python extension for Samba'''
20 # when we support static python modules we'll need to gather
21 # the list from all the SAMBA_PYTHON() targets
22 if init_function_sentinal is not None:
23 cflags += '-DSTATIC_LIBPYTHON_MODULES="%s"' % init_function_sentinal
26 # a SAMBA_PYTHON target without a realname is just a
27 # subsystem with needs_python=True
28 return bld.SAMBA_SUBSYSTEM(name,
31 public_deps=public_deps,
34 init_function_sentinal=init_function_sentinal,
35 local_include=local_include,
40 SET_TARGET_TYPE(bld, name, 'DISABLED')
43 if not SET_TARGET_TYPE(bld, name, 'PYTHON'):
46 deps += ' ' + public_deps
49 link_name = 'python/%s.so' % name
51 link_name = 'python/%s' % realname
54 features = 'cc cshlib pyext symlink_lib',
57 samba_cflags = CURRENT_CFLAGS(bld, name, cflags),
58 samba_includes = includes,
59 local_include = local_include,
60 samba_deps = TO_LIST(deps),
63 Build.BuildContext.SAMBA_PYTHON = SAMBA_PYTHON