summaryrefslogtreecommitdiff
path: root/source4/build/scons/proto.py
blob: b3255fc7e8c5a5bbe839bb3c1ec1f27075833284 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
"""SCons.Tool.proto

Tool-specific initialization for mkproto (C Proto File generator)

"""

import SCons.Defaults
import SCons.Util

proto_builder = SCons.Builder.Builder(action='$PROTOCOM',
                                     src_suffix = '.c',
                                     suffix='.h')

def generate(env):
	env['MKPROTO']          = './script/mkproto.sh'
	env['PROTOCOM']       = '$MKPROTO "$PERL" -h _PROTO_H_ ${TARGETS[0]} $SOURCE'
	env['BUILDERS']['CProtoHeader'] = proto_builder

def exists(env):
	return env.Detect('./script/mkproto.sh')