4 from samba_utils import MODE_755
5 from waflib import Logs
7 # This function checks if a perl module is installed on the system.
8 def check_system_perl_module(conf, module, version=None):
9 bundle_name = module.replace('::', '_')
12 # Create module string with version
14 module_check = module + ' ' + str(version)
16 # Check if we have to bundle it.
17 if conf.LIB_MUST_BE_BUNDLED(bundle_name.lower()):
20 # Check for system perl module
21 if conf.check_perl_module(module_check) is None:
24 conf.define('USING_SYSTEM_%s' % bundle_name.upper(), 1)
32 # Check if perl(Parse::Yapp::Driver) is available.
33 check_system_perl_module(conf, "Parse::Yapp::Driver", 1.05)
35 # yapp is used for building the parser
36 conf.find_program('yapp', var='YAPP')
40 # we want to prefer the git version of the parsers if we can.
41 # Only if the source has changed do we want to re-run yapp
42 # But we force the developer to use the pidl standalone build
43 # to regenerate the files.
44 # TODO: only warn in developer mode and if 'git diff HEAD'
46 warn_about_grammar_changes = ('PIDL_BUILD_WARNINGS' in bld.env and (
47 bld.IS_NEWER('idl.yp', 'lib/Parse/Pidl/IDL.pm') or
48 bld.IS_NEWER('expr.yp', 'lib/Parse/Pidl/Expr.pm')))
50 if warn_about_grammar_changes:
52 Pidl grammar files have changed. Please use the pidl standalone build
53 to regenerate them with yapp.
57 $ make lib/Parse/Pidl/IDL.pm lib/Parse/Pidl/Expr.pm
58 $ git add lib/Parse/Pidl/IDL.pm lib/Parse/Pidl/Expr.pm
62 If your 100% sure you haven't changed idl.yp and expr.yp
63 try this to avoid this message:
65 $ touch ../pidl/lib/Parse/Pidl/IDL.pm ../pidl/lib/Parse/Pidl/Expr.pm