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 *
2010-12-10 01:42:32 +03:00
from Configure import conf
@conf
def SAMBA_CHECK_PYTHON_HEADERS ( conf , mandatory = True ) :
if conf . env [ " python_headers_checked " ] == [ ] :
conf . check_python_headers ( mandatory )
conf . env [ " python_headers_checked " ] = " yes "
else :
conf . msg ( " python headers " , " using cache " )
2010-03-17 14:07:11 +03:00
def SAMBA_PYTHON ( bld , name ,
source = ' ' ,
deps = ' ' ,
public_deps = ' ' ,
realname = None ,
cflags = ' ' ,
includes = ' ' ,
2012-04-09 16:33:37 +04:00
init_function_sentinel = None ,
2010-03-17 14:07:11 +03:00
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
2012-04-09 16:33:37 +04:00
if init_function_sentinel is not None :
cflags + = ' -DSTATIC_LIBPYTHON_MODULES= %s ' % init_function_sentinel
2010-03-17 12:12:16 +03:00
2010-03-25 01:23:10 +03:00
source = bld . EXPAND_VARIABLES ( source , vars = vars )
2011-11-13 20:50:52 +04:00
if realname is not None :
link_name = ' python/ %s ' % realname
else :
link_name = None
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 ,
local_include = local_include ,
vars = vars ,
2011-11-13 20:50:52 +04:00
realname = realname ,
2010-03-29 08:19:13 +04:00
link_name = link_name ,
2011-11-12 08:20:10 +04:00
pyext = True ,
2010-03-29 08:19:13 +04:00
target_type = ' PYTHON ' ,
2011-01-14 09:20:01 +03:00
install_path = ' $ {PYTHONARCHDIR} ' ,
2011-11-13 20:50:52 +04:00
allow_undefined_symbols = True ,
2010-03-29 08:19:13 +04:00
enabled = enabled )
2010-03-27 06:50:43 +03:00
2010-03-17 14:07:11 +03:00
Build . BuildContext . SAMBA_PYTHON = SAMBA_PYTHON