summaryrefslogtreecommitdiffstats
path: root/pidl
diff options
context:
space:
mode:
authorAndreas Schneider <asn@samba.org>2014-02-28 15:59:41 +0100
committerStefan Metzmacher <metze@samba.org>2014-03-06 09:59:45 +0100
commit410ada45b7041be6976fcfefadccbb99212a15a3 (patch)
tree4d2c8b0340f870cf835c13e92fefaec567f6311b /pidl
parentb7b0ca1ba9067362bb8a4b901f3a7f2f3bcbd6a1 (diff)
downloadsamba-410ada45b7041be6976fcfefadccbb99212a15a3.tar.gz
samba-410ada45b7041be6976fcfefadccbb99212a15a3.tar.xz
samba-410ada45b7041be6976fcfefadccbb99212a15a3.zip
pidl-waf: Add a function to check for a system perl module.
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
Diffstat (limited to 'pidl')
-rw-r--r--pidl/wscript22
1 files changed, 22 insertions, 0 deletions
diff --git a/pidl/wscript b/pidl/wscript
index 77abb019de9..236439153ec 100644
--- a/pidl/wscript
+++ b/pidl/wscript
@@ -3,6 +3,28 @@
import os, sys, Logs
from samba_utils import MODE_755
+# This function checks if a perl module is installed on the system.
+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
+
def set_options(opt):
opt.tool_options('perl')