2010-03-17 22:07:11 +11:00
# waf build tool for building IDL files with pidl
2010-03-17 20:12:16 +11:00
import Build
2010-03-17 22:07:11 +11: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 22:07:11 +11:00
def SAMBA_PYTHON ( bld , name ,
source = ' ' ,
deps = ' ' ,
public_deps = ' ' ,
realname = None ,
cflags = ' ' ,
includes = ' ' ,
init_function_sentinal = None ,
local_include = True ,
2010-03-24 16:23:10 -06:00
vars = None ,
2010-03-17 22:07:11 +11:00
enabled = True ) :
''' build a python extension for Samba '''
2010-03-17 20:12:16 +11: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 15:22:18 +11:00
cflags + = ' -DSTATIC_LIBPYTHON_MODULES= %s ' % init_function_sentinal
2010-03-17 20:12:16 +11:00
2010-03-24 16:23:10 -06:00
source = bld . EXPAND_VARIABLES ( source , vars = vars )
2010-03-17 20:12:16 +11:00
if realname is None :
# a SAMBA_PYTHON target without a realname is just a
2010-10-10 04:25:50 +02:00
# library with pyembed=True
2010-04-01 12:30:56 +11:00
bld . SAMBA_LIBRARY ( name ,
source = source ,
deps = deps ,
public_deps = public_deps ,
includes = includes ,
cflags = cflags ,
local_include = local_include ,
vars = vars ,
2010-10-10 04:25:50 +02:00
pyembed = True ,
2010-04-01 12:30:56 +11:00
enabled = enabled )
return
2010-03-17 20:12:16 +11:00
2010-03-18 23:48:09 +11:00
link_name = ' python/ %s ' % realname
2010-03-17 22:07:11 +11:00
2010-03-29 15:19:13 +11: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 ,
2010-10-10 04:25:50 +02:00
pyembed = True ,
2010-03-29 15:19:13 +11:00
target_type = ' PYTHON ' ,
2011-01-14 17:20:01 +11:00
install_path = ' $ {PYTHONARCHDIR} ' ,
2010-03-29 15:19:13 +11:00
enabled = enabled )
2010-03-27 14:50:43 +11:00
2010-03-17 22:07:11 +11:00
Build . BuildContext . SAMBA_PYTHON = SAMBA_PYTHON