We should import m5config *after* we do the CPPDEFINES stuff,

otherwise m5config and the object descriptions cannot take
advantage of them.

sim/pyconfig/SConscript:
    We should import m5config *after* we do the CPPDEFINES stuff,
    otherwise m5config and the object descriptions cannot take
    advantage of them.  This means that we can't use the env dict
    alias.  We should instead use os.environ.

--HG--
extra : convert_revision : 392f99a3c15cfba74a5cde79a709ecfad3820e63
This commit is contained in:
Nathan Binkert 2005-03-09 14:39:35 -05:00
parent 21946f0710
commit 4a3ad218e1

View file

@ -147,6 +147,7 @@ def MakeEmbeddedPyFile(target, source, env):
def MakeDefinesPyFile(target, source, env):
target = file(str(target[0]), 'w')
print >>target, "import os"
defines = env['CPPDEFINES']
if isinstance(defines, list):
for var in defines:
@ -158,11 +159,11 @@ def MakeDefinesPyFile(target, source, env):
if not isinstance(key, basestring):
panic("invalid type for define: %s" % type(key))
print >>target, "env['%s'] = '%s'" % (key, val)
print >>target, "os.environ['%s'] = '%s'" % (key, val)
elif isinstance(defines, dict):
for key,val in defines.iteritems():
print >>target, "env['%s'] = '%s'" % (key, val)
print >>target, "os.environ['%s'] = '%s'" % (key, val)
else:
panic("invalid type for defines: %s" % type(defines))