diff options
author | Andreas Schneider <asn@samba.org> | 2014-02-27 13:14:56 +0100 |
---|---|---|
committer | Andreas Schneider <asn@cryptomilk.org> | 2014-02-27 18:47:03 +0100 |
commit | f0030c619bcf22dbe9eed54b2c0dc9c61f564838 (patch) | |
tree | 845fb92b6e6ab05ca136ce1a355d77d763133c12 /pidl | |
parent | 562ade624a78a11a5af0f26b04df93d76d6166bd (diff) | |
download | samba-f0030c619bcf22dbe9eed54b2c0dc9c61f564838.tar.gz |
pidl: Make perl(Parse:Yapp:Driver) installation optional.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=10472
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jelmer Vernooij <jelmer@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Thu Feb 27 18:47:03 CET 2014 on sn-devel-104
Diffstat (limited to 'pidl')
-rw-r--r-- | pidl/lib/wscript_build | 6 | ||||
-rw-r--r-- | pidl/wscript | 25 |
2 files changed, 29 insertions, 2 deletions
diff --git a/pidl/lib/wscript_build b/pidl/lib/wscript_build index 29632d4d99b..09d26ebd6d8 100644 --- a/pidl/lib/wscript_build +++ b/pidl/lib/wscript_build @@ -28,6 +28,10 @@ bld.INSTALL_FILES(bld.env.VENDORDIR_PERL, Parse/Pidl/Samba3/ServerNDR.pm Parse/Pidl/Compat.pm Parse/Pidl/NDR.pm - Parse/Yapp/Driver.pm ''', flat=False) + +if not bld.CONFIG_SET('USING_SYSTEM_PARSE_YAPP_DRIVER'): + bld.INSTALL_FILES(bld.env.VENDORDIR_PERL, + 'Parse/Yapp/Driver.pm', + flat=False) diff --git a/pidl/wscript b/pidl/wscript index 77abb019de9..c7b72c400ff 100644 --- a/pidl/wscript +++ b/pidl/wscript @@ -1,6 +1,6 @@ #!/usr/bin/env python -import os, sys, Logs +import os, sys, Logs, Options from samba_utils import MODE_755 def set_options(opt): @@ -20,6 +20,9 @@ def configure(conf): conf.find_program('yapp', var='YAPP') conf.find_program('pod2man', var='POD2MAN') + # Check for perl(Parse::Yapp::Driver) + check_system_perl_module(conf, "Parse::Yapp::Driver", 1.05) + def build(bld): bld.INSTALL_FILES('${BINDIR}', 'pidl', chmod=MODE_755) @@ -82,3 +85,23 @@ try this to avoid this message: $ touch ../pidl/lib/Parse/Pidl/IDL.pm ../pidl/lib/Parse/Pidl/Expr.pm ''') +def check_system_perl_module(conf, module, version=None): + bundle_name = module.replace('::', '_') + module_check = module + found = False + + # Create module string with version + if version: + module_check = module + ' ' + str(version) + + # Check if we have to bundle it. + if conf.LIB_MUST_BE_BUNDLED(bundle_name.lower()): + return False + + # Check for system perl module + if not conf.check_perl_module(module_check): + return False + + conf.define('USING_SYSTEM_%s' % bundle_name.upper(), 1) + + return True |