summaryrefslogtreecommitdiff
path: root/buildtools/wafsamba/samba_python.py
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2010-03-17 20:12:16 +1100
committerAndrew Tridgell <tridge@samba.org>2010-04-06 20:26:48 +1000
commit844acb226086e55de9a2442396a4e002471295e8 (patch)
treef84eef86a64b5f1c34f44999bea6b1913d47e864 /buildtools/wafsamba/samba_python.py
parent845e0cbe6f43e2762796c644035ac6bc2b07cf17 (diff)
downloadsamba-844acb226086e55de9a2442396a4e002471295e8.tar.gz
samba-844acb226086e55de9a2442396a4e002471295e8.tar.bz2
samba-844acb226086e55de9a2442396a4e002471295e8.zip
build: waf quicktest nearly works
Rewrote wafsamba using a new dependency handling system, and started adding the waf test code
Diffstat (limited to 'buildtools/wafsamba/samba_python.py')
-rw-r--r--buildtools/wafsamba/samba_python.py37
1 files changed, 28 insertions, 9 deletions
diff --git a/buildtools/wafsamba/samba_python.py b/buildtools/wafsamba/samba_python.py
index 0845a7e61c..4073dcf9bb 100644
--- a/buildtools/wafsamba/samba_python.py
+++ b/buildtools/wafsamba/samba_python.py
@@ -1,7 +1,6 @@
# waf build tool for building IDL files with pidl
-from TaskGen import taskgen, before
-import Build, os, string, Utils
+import Build
from samba_utils import *
from samba_autoconf import *
@@ -18,6 +17,25 @@ def SAMBA_PYTHON(bld, name,
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
+
+ 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)
+
if not enabled:
SET_TARGET_TYPE(bld, name, 'DISABLED')
return
@@ -27,18 +45,19 @@ def SAMBA_PYTHON(bld, name,
deps += ' ' + public_deps
- # 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
+ if realname is None:
+ link_name = 'python/%s.so' % name
+ else:
+ link_name = 'python/%s' % realname
t = bld(
- features = 'cc cshlib pyext',
+ features = 'cc cshlib pyext symlink_lib',
source = source,
target = name,
- ccflags = CURRENT_CFLAGS(bld, name, cflags),
+ samba_cflags = CURRENT_CFLAGS(bld, name, cflags),
samba_includes = includes,
local_include = local_include,
- samba_deps = TO_LIST(deps)
+ samba_deps = TO_LIST(deps),
+ link_name = link_name
)
Build.BuildContext.SAMBA_PYTHON = SAMBA_PYTHON