summaryrefslogtreecommitdiff
path: root/lib/talloc
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2010-10-24 12:37:08 -0700
committerJelmer Vernooij <jelmer@samba.org>2010-10-26 10:17:19 -0700
commitd44e3bf747f9812036f4b6ecf3ccb2fad1d25882 (patch)
tree7a456a7a60f0c7bd2a06c542329658c345e54f45 /lib/talloc
parent0ceb5018f3a75f272faa4d7a7b5c79ca100f5ef0 (diff)
downloadsamba-d44e3bf747f9812036f4b6ecf3ccb2fad1d25882.tar.gz
samba-d44e3bf747f9812036f4b6ecf3ccb2fad1d25882.tar.bz2
samba-d44e3bf747f9812036f4b6ecf3ccb2fad1d25882.zip
talloc: Install pytalloc-util as system library.
Diffstat (limited to 'lib/talloc')
-rw-r--r--lib/talloc/pytalloc-util.pc.in11
-rw-r--r--lib/talloc/wscript28
2 files changed, 36 insertions, 3 deletions
diff --git a/lib/talloc/pytalloc-util.pc.in b/lib/talloc/pytalloc-util.pc.in
new file mode 100644
index 0000000000..b17b373755
--- /dev/null
+++ b/lib/talloc/pytalloc-util.pc.in
@@ -0,0 +1,11 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: pytalloc-util
+Description: Utility functions for using talloc objects with Python
+Version: @TALLOC_VERSION@
+Libs: -L${libdir} -lpytalloc-util
+Cflags: -I${includedir}
+URL: http://talloc.samba.org/
diff --git a/lib/talloc/wscript b/lib/talloc/wscript
index f89947dcb2..3a40d77688 100644
--- a/lib/talloc/wscript
+++ b/lib/talloc/wscript
@@ -6,6 +6,7 @@ VERSION = '2.0.3'
blddir = 'bin'
+import Logs
import os, sys
# find the buildtools directory
@@ -29,24 +30,42 @@ def set_options(opt):
opt.add_option('--enable-talloc-compat1',
help=("Build talloc 1.x.x compat library [False]"),
action="store_true", dest='TALLOC_COMPAT1', default=False)
+ if opt.IN_LAUNCH_DIR():
+ opt.add_option('--disable-python',
+ help=("disable the pytevent module"),
+ action="store_true", dest='disable_python', default=False)
+
def configure(conf):
conf.RECURSE('lib/replace')
conf.env.standalone_talloc = conf.IN_LAUNCH_DIR()
+ conf.env.disable_python = getattr(Options.options, 'disable_python', False)
+
if not conf.env.standalone_talloc:
if conf.CHECK_BUNDLED_SYSTEM('talloc', minversion=VERSION,
implied_deps='replace'):
conf.define('USING_SYSTEM_TALLOC', 1)
+ if conf.CHECK_BUNDLED_SYSTEM('pytalloc-util', minversion=VERSION,
+ implied_deps='talloc replace'):
+ conf.define('USING_SYSTEM_PYTALLOC_UTIL', 1)
conf.env.TALLOC_COMPAT1 = Options.options.TALLOC_COMPAT1
if conf.env.standalone_talloc:
conf.find_program('xsltproc', var='XSLTPROC')
- conf.SAMBA_CONFIG_H()
+ if not conf.env.disable_python:
+ # also disable if we don't have the python libs installed
+ conf.check_tool('python')
+ conf.check_python_version((2,4,2))
+ conf.check_python_headers(mandatory=False)
+ if not conf.env.HAVE_PYTHON_H:
+ Logs.warn('Disabling pytalloc-util as python devel libs not found')
+ conf.env.disable_python = True
+ conf.SAMBA_CONFIG_H()
def build(bld):
@@ -64,8 +83,11 @@ def build(bld):
bld.SAMBA_LIBRARY('talloc-compat1',
'compat/talloc_compat1.c',
deps='talloc',
- enabled = bld.env.TALLOC_COMPAT1,
+ enabled=bld.env.TALLOC_COMPAT1,
vnum=VERSION)
+
+ if not bld.env.disable_python:
+ bld.PKG_CONFIG_FILES('pytalloc-util.pc', vnum=VERSION)
else:
private_library = True
vnum = None
@@ -82,7 +104,7 @@ def build(bld):
private_library=private_library,
manpages='talloc.3')
- if not bld.CONFIG_SET('USING_SYSTEM_PYTALLOC_UTIL'):
+ if not bld.CONFIG_SET('USING_SYSTEM_PYTALLOC_UTIL') and not bld.env.disable_python:
bld.SAMBA_SUBSYSTEM('PYTALLOC',
source='pytalloc.c',