summaryrefslogtreecommitdiff
path: root/buildtools/wafsamba/samba_python.py
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2010-03-17 22:07:11 +1100
committerAndrew Tridgell <tridge@samba.org>2010-04-06 20:26:47 +1000
commitfffa6a5b488058d984d61b0cd1fe1fb550a196b4 (patch)
tree1c4ba4b9914bae1375f5052b961ca3b2d7f6d1c0 /buildtools/wafsamba/samba_python.py
parent8f1b809d2ccb083cb84532e98b04a12fb1039e22 (diff)
downloadsamba-fffa6a5b488058d984d61b0cd1fe1fb550a196b4.tar.gz
samba-fffa6a5b488058d984d61b0cd1fe1fb550a196b4.tar.bz2
samba-fffa6a5b488058d984d61b0cd1fe1fb550a196b4.zip
build: separate out dependencies and python rules
Diffstat (limited to 'buildtools/wafsamba/samba_python.py')
-rw-r--r--buildtools/wafsamba/samba_python.py44
1 files changed, 44 insertions, 0 deletions
diff --git a/buildtools/wafsamba/samba_python.py b/buildtools/wafsamba/samba_python.py
new file mode 100644
index 0000000000..0845a7e61c
--- /dev/null
+++ b/buildtools/wafsamba/samba_python.py
@@ -0,0 +1,44 @@
+# waf build tool for building IDL files with pidl
+
+from TaskGen import taskgen, before
+import Build, os, string, Utils
+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,
+ enabled=True):
+ '''build a python extension for Samba'''
+
+ if not enabled:
+ SET_TARGET_TYPE(bld, name, 'DISABLED')
+ return
+
+ if not SET_TARGET_TYPE(bld, name, 'PYTHON'):
+ return
+
+ 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
+
+ t = bld(
+ features = 'cc cshlib pyext',
+ source = source,
+ target = name,
+ ccflags = CURRENT_CFLAGS(bld, name, cflags),
+ samba_includes = includes,
+ local_include = local_include,
+ samba_deps = TO_LIST(deps)
+ )
+Build.BuildContext.SAMBA_PYTHON = SAMBA_PYTHON