scons: Put all config variables in an env['CONF'] sub-dict.

This makes what are configuration and what are internal SCons variables
explicit and separate, and makes it unnecessary to call out what
variables to export to C++.

These variables will also be plumbed into and out of kconfiglib in later
changes.

Change-Id: Iaf5e098d7404af06285c421dbdf8ef4171b3f001
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/56892
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
This commit is contained in:
Gabe Black
2022-02-15 22:23:43 -08:00
parent caa5f12e21
commit e6c0ba97db
87 changed files with 211 additions and 233 deletions

View File

@@ -36,7 +36,7 @@ from gem5_scons import Transform
Import('*')
if env['PROTOCOL'] == 'None':
if env['CONF']['PROTOCOL'] == 'None':
Return()
output_dir = Dir('.')
@@ -69,7 +69,7 @@ def slicc_emitter(target, source, env):
slicc = SLICC(filepath, protocol_base.abspath, verbose=False)
slicc.process()
slicc.writeCodeFiles(output_dir.abspath, slicc_includes)
if env['SLICC_HTML']:
if env['CONF']['SLICC_HTML']:
slicc.writeHTMLFiles(html_dir.abspath)
target.extend([output_dir.File(f) for f in sorted(slicc.files())])
@@ -82,13 +82,13 @@ def slicc_action(target, source, env):
slicc = SLICC(filepath, protocol_base.abspath, verbose=True)
slicc.process()
slicc.writeCodeFiles(output_dir.abspath, slicc_includes)
if env['SLICC_HTML']:
if env['CONF']['SLICC_HTML']:
slicc.writeHTMLFiles(html_dir.abspath)
slicc_builder = Builder(action=MakeAction(slicc_action, Transform("SLICC")),
emitter=slicc_emitter)
protocol = env['PROTOCOL']
protocol = env['CONF']['PROTOCOL']
protocol_dir = None
for path in env['PROTOCOL_DIRS']:
if os.path.exists(path.File("%s.slicc" % protocol).abspath):