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')
37 conf
.find_program('pod2man', var
='POD2MAN')
41 # we want to prefer the git version of the parsers if we can.
42 # Only if the source has changed do we want to re-run yapp
43 # But we force the developer to use the pidl standalone build
44 # to regenerate the files.
45 # TODO: only warn in developer mode and if 'git diff HEAD'
47 warn_about_grammar_changes
= ('PIDL_BUILD_WARNINGS' in bld
.env
and (
48 bld
.IS_NEWER('idl.yp', 'lib/Parse/Pidl/IDL.pm') or
49 bld
.IS_NEWER('expr.yp', 'lib/Parse/Pidl/Expr.pm')))
51 if warn_about_grammar_changes
:
53 Pidl grammar files have changed. Please use the pidl standalone build
54 to regenerate them with yapp.
58 $ make lib/Parse/Pidl/IDL.pm lib/Parse/Pidl/Expr.pm
59 $ git add lib/Parse/Pidl/IDL.pm lib/Parse/Pidl/Expr.pm
63 If your 100% sure you haven't changed idl.yp and expr.yp
64 try this to avoid this message:
66 $ touch ../pidl/lib/Parse/Pidl/IDL.pm ../pidl/lib/Parse/Pidl/Expr.pm