diff options
author | Steve Reinhardt <stever@gmail.com> | 2007-11-01 14:28:59 -0700 |
---|---|---|
committer | Steve Reinhardt <stever@gmail.com> | 2007-11-01 14:28:59 -0700 |
commit | 67b46d02d4bdeee3e63542582453c8f86fec2446 (patch) | |
tree | 6fb4fe49e9f05f97a9d325982c9deeb6868d2462 /SConstruct | |
parent | 333ac6cc3221d449801ecd75a3f846b98acd5786 (diff) | |
download | gem5-67b46d02d4bdeee3e63542582453c8f86fec2446.tar.xz |
SConstruct: fix scons null conf object problem
so that "scons --help" works again.
--HG--
extra : convert_revision : 317d52480a44339d8a77ce61f1c5e58cd9d1dd01
Diffstat (limited to 'SConstruct')
-rw-r--r-- | SConstruct | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/SConstruct b/SConstruct index 9394fa61b..4bd787b1d 100644 --- a/SConstruct +++ b/SConstruct @@ -329,6 +329,25 @@ conf = Configure(env, conf_dir = joinpath(build_root, '.scons_config'), log_file = joinpath(build_root, 'scons_config.log')) +# Recent versions of scons substitute a "Null" object for Configure() +# when configuration isn't necessary, e.g., if the "--help" option is +# present. Unfortuantely this Null object always returns false, +# breaking all our configuration checks. We replace it with our own +# more optimistic null object that returns True instead. +if not conf: + def NullCheck(*args, **kwargs): + return True + + class NullConf: + def __init__(self, env): + self.env = env + def Finish(self): + return self.env + def __getattr__(self, mname): + return NullCheck + + conf = NullConf(env) + # Find Python include and library directories for embedding the # interpreter. For consistency, we will use the same Python # installation used to run scons (and thus this script). If you want |