r10366: More scons fixes. Building et, asn1, lex and yacc files sort-of works now
[bbaumbach/samba-autobuild/.git] / source4 / build / scons / pidl.py
1 """SCons.Tool.pidl
2
3 Tool-specific initialization for pidl (Perl-based IDL compiler)
4
5 """
6
7 import SCons.Defaults
8 import SCons.Util
9 import SCons.Scanner
10
11 idl_scanner = SCons.Scanner.ClassicCPP("PIDLScan", '.idl', 'CPPPATH', r'depends\(([^,]+),+\)', SCons.Node.FS.default_fs)
12
13 pidl_builder = SCons.Builder.Builder(action='$PIDLCOM',
14                                      src_suffix = '.idl',
15                                      suffix='.c',
16                                      scanner = idl_scanner)
17
18 def generate(env):
19         env['PIDL']          = env.Detect('pidl') or './pidl/pidl'
20         env['PIDLFLAGS']     = []
21         env['PIDLCOM']       = 'CPP=$CPP $PIDL $PIDLFLAGS -- $SOURCE'
22         env['BUILDERS']['NdrMarshaller'] = pidl_builder
23
24 def exists(env):
25         return env.Detect(['./pidl/pidl','pidl'])