1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-25 23:21:54 +03:00
samba-mirror/buildtools/wafsamba/samba_python.py
Andrew Tridgell d87b77e649 build: reuse SAMBA_LIBRARY() to build python modules
This allows the rpath logic to be shared, and simplifies the install
logic
2010-04-06 20:27:15 +10:00

60 lines
2.1 KiB
Python

# waf build tool for building IDL files with pidl
import Build
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,
vars=None,
enabled=True):
'''build a python extension for Samba'''
# 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:
cflags += '-DSTATIC_LIBPYTHON_MODULES=%s' % init_function_sentinal
source = bld.EXPAND_VARIABLES(source, vars=vars)
if realname is None:
# a SAMBA_PYTHON target without a realname is just a
# subsystem with needs_python=True
return bld.SAMBA_SUBSYSTEM(name,
source=source,
deps=deps,
public_deps=public_deps,
cflags=cflags,
includes=includes,
init_function_sentinal=init_function_sentinal,
local_include=local_include,
needs_python=True,
enabled=enabled)
link_name = 'python/%s' % realname
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)
Build.BuildContext.SAMBA_PYTHON = SAMBA_PYTHON