From: Nathan Binkert Date: Wed, 9 Mar 2005 19:39:35 +0000 (-0500) Subject: We should import m5config *after* we do the CPPDEFINES stuff, X-Git-Tag: m5_1.0_tutorial~76^2^2~1 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=4a3ad218e1a41a9fa655471b999e2540e4e78448;p=gem5.git 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 --- diff --git a/sim/pyconfig/SConscript b/sim/pyconfig/SConscript index 95785d372..2799ef64f 100644 --- a/sim/pyconfig/SConscript +++ b/sim/pyconfig/SConscript @@ -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))