2010-03-17 14:07:11 +03:00
# waf build tool for building IDL files with pidl
2010-03-17 12:12:16 +03:00
import Build
2010-03-17 14:07:11 +03:00
from samba_utils import *
from samba_autoconf import *
def SAMBA_PYTHON ( bld , name ,
source = ' ' ,
deps = ' ' ,
public_deps = ' ' ,
realname = None ,
cflags = ' ' ,
includes = ' ' ,
init_function_sentinal = None ,
local_include = True ,
2010-03-25 01:23:10 +03:00
vars = None ,
2010-03-17 14:07:11 +03:00
enabled = True ) :
''' build a python extension for Samba '''
2010-03-17 12:12:16 +03:00
# when we support static python modules we'll need to gather
# the list from all the SAMBA_PYTHON() targets
if init_function_sentinal is not None :
2010-03-17 07:22:18 +03:00
cflags + = ' -DSTATIC_LIBPYTHON_MODULES= %s ' % init_function_sentinal
2010-03-17 12:12:16 +03:00
2010-03-25 01:23:10 +03:00
source = bld . EXPAND_VARIABLES ( source , vars = vars )
2010-03-17 12:12:16 +03:00
if realname is None :
# a SAMBA_PYTHON target without a realname is just a
2010-04-01 05:30:56 +04:00
# library with needs_python=True
bld . SAMBA_LIBRARY ( name ,
source = source ,
deps = deps ,
public_deps = public_deps ,
includes = includes ,
cflags = cflags ,
local_include = local_include ,
vars = vars ,
needs_python = True ,
enabled = enabled )
return
2010-03-17 12:12:16 +03:00
2010-03-18 15:48:09 +03:00
link_name = ' python/ %s ' % realname
2010-03-17 14:07:11 +03:00
2010-03-29 08:19:13 +04:00
bld . SAMBA_LIBRARY ( name ,
source = source ,
deps = deps ,
public_deps = public_deps ,
includes = includes ,
cflags = cflags ,
realname = realname ,
local_include = local_include ,
vars = vars ,
link_name = link_name ,
needs_python = True ,
target_type = ' PYTHON ' ,
install_path = ' $ {PYTHONDIR} ' ,
enabled = enabled )
2010-03-27 06:50:43 +03:00
2010-03-17 14:07:11 +03:00
Build . BuildContext . SAMBA_PYTHON = SAMBA_PYTHON