diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2005-09-20 22:10:40 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:38:32 -0500 |
commit | 8db177b652cdede2f509d6c96d1c99e875c2d284 (patch) | |
tree | 1226f1b334f60088a164d985bfc0f72942bb496e /source4/build/scons/asn1.py | |
parent | 0e2c62451d4463aecc5ff01d56b48521e9f59ffb (diff) | |
download | samba-8db177b652cdede2f509d6c96d1c99e875c2d284.tar.gz samba-8db177b652cdede2f509d6c96d1c99e875c2d284.tar.bz2 samba-8db177b652cdede2f509d6c96d1c99e875c2d284.zip |
r10366: More scons fixes. Building et, asn1, lex and yacc files sort-of works now
(This used to be commit 22f18a84242e5e68a2d57b6d7ff77c089ee7434a)
Diffstat (limited to 'source4/build/scons/asn1.py')
-rw-r--r-- | source4/build/scons/asn1.py | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/source4/build/scons/asn1.py b/source4/build/scons/asn1.py index 078ac74a55..f0068e20dd 100644 --- a/source4/build/scons/asn1.py +++ b/source4/build/scons/asn1.py @@ -5,22 +5,29 @@ Tool-specific initialization for ASN1 """ import SCons.Defaults -import SCons.Scanner.ASN1 import SCons.Util +import re -asn1_scanner = SCons.Scanner.ASN1.ASN1Scan() +output_re = re.compile(r'^([A-Za-z0-9_-]+)[ \t]*::=', re.M) + +def asn1_emitter(target,source,env): + targets = [] + for s in source: + node = env.File(s) + contents = node.get_contents() + for j in output_re.findall(contents): + targets.append(str(node.get_dir()) + '/asn1_' + j + '.c') + return targets, source asn1_builder = SCons.Builder.Builder(action='$ASN1COM', src_suffix = '.asn1', suffix='.c', - scanner = asn1_scanner) + emitter = asn1_emitter) def generate(env): - env['ASN1'] = 'FIXME' - env['PROTOCOM'] = '$ASN1 $SOURCE' + env['ASN1'] = './bin/asn1_compile' + env['ASN1COM'] = '$ASN1 $SOURCE' env['BUILDERS']['ASN1'] = asn1_builder def exists(env): - return env.Detect('FIXME') - - + return env.Detect('asn1_compile') |