Backport ISA scanner fix from newmem to work with
scons 0.96.9* versions. arch/SConscript: Backport ISA scanner fix from newmem. --HG-- extra : convert_revision : 96be75660f85900fd26badef36fb4109b36d8394
This commit is contained in:
parent
aaf1969c78
commit
343bff3b7d
1 changed files with 6 additions and 13 deletions
|
@ -96,18 +96,12 @@ for hdr in isa_switch_hdrs:
|
||||||
#
|
#
|
||||||
import SCons.Scanner
|
import SCons.Scanner
|
||||||
|
|
||||||
def ISAScan():
|
isa_scanner = SCons.Scanner.Classic("ISAScan",
|
||||||
return SCons.Scanner.Classic("ISAScan",
|
[".isa", ".ISA"],
|
||||||
"$ISASUFFIXES",
|
"SRCDIR",
|
||||||
"SRCDIR",
|
r'^\s*##include\s+"([\w/.-]*)"')
|
||||||
'^[ \t]*##[ \t]*include[ \t]*"([^>"]+)"')
|
|
||||||
|
|
||||||
def ISAPath(env, dir, target=None, source=None, a=None):
|
env.Append(SCANNERS = isa_scanner)
|
||||||
return (Dir(env['SRCDIR']), Dir('.'))
|
|
||||||
|
|
||||||
iscan = Scanner(function = ISAScan().scan, skeys = [".isa", ".ISA"],
|
|
||||||
path_function = ISAPath)
|
|
||||||
env.Append(SCANNERS = iscan)
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Now create a Builder object that uses isa_parser.py to generate C++
|
# Now create a Builder object that uses isa_parser.py to generate C++
|
||||||
|
@ -134,8 +128,7 @@ def isa_desc_emitter(target, source, env):
|
||||||
return (isa_desc_gen_files, [isa_parser, cpu_models_file] + source)
|
return (isa_desc_gen_files, [isa_parser, cpu_models_file] + source)
|
||||||
|
|
||||||
# Pieces are in place, so create the builder.
|
# Pieces are in place, so create the builder.
|
||||||
isa_desc_builder = Builder(action='$SOURCES $TARGET.dir $CPU_MODELS',
|
isa_desc_builder = Builder(action='python $SOURCES $TARGET.dir $CPU_MODELS',
|
||||||
source_scanner = iscan,
|
|
||||||
emitter = isa_desc_emitter)
|
emitter = isa_desc_emitter)
|
||||||
|
|
||||||
env.Append(BUILDERS = { 'ISADesc' : isa_desc_builder })
|
env.Append(BUILDERS = { 'ISADesc' : isa_desc_builder })
|
||||||
|
|
Loading…
Reference in a new issue