#
########################################################################
-main = Environment()
+main = Environment(tools=['default', 'git'])
from gem5_scons.util import get_termcap
termcap = get_termcap()
# Parse EXTRAS variable to build list of all directories where we're
# look for sources etc. This list is exported as extras_dir_list.
-base_dir = main.srcdir.abspath
+base_dir = Dir('#src').abspath
if main['EXTRAS']:
extras_dir_list = makePathListAbsolute(main['EXTRAS'].split(':'))
else:
# value of the variable.
def build_config_file(target, source, env):
(variable, value) = [s.get_contents().decode('utf-8') for s in source]
- with open(str(target[0]), 'w') as f:
+ with open(str(target[0].abspath), 'w') as f:
print('#define', variable, value, file=f)
return None
# extract variable name from Builder arg
variable = str(target[0])
# True target is config header file
- target = joinpath('config', variable.lower() + '.hh')
+ target = Dir('config').File(variable.lower() + '.hh')
val = env[variable]
if isinstance(val, bool):
# Force value to 0/1
val = '"' + val + '"'
# Sources are variable name & value (packaged in SCons Value nodes)
- return ([target], [Value(variable), Value(val)])
+ return [target], [Value(variable), Value(val)]
-config_builder = Builder(emitter = config_emitter, action = config_action)
+config_builder = Builder(emitter=config_emitter, action=config_action)
main.Append(BUILDERS = { 'ConfigFile' : config_builder })
main.AddMethod(add_local_rpath, 'AddLocalRPATH')
# builds in ext are shared across all configs in the build root.
-ext_dir = abspath(joinpath(str(main.root), 'ext'))
+ext_dir = Dir('#ext').abspath
ext_build_dirs = []
for root, dirs, files in os.walk(ext_dir):
if 'SConscript' in files:
# normally determined by name of $VARIANT_DIR, but can be
# overridden by '--default=' arg on command line.
default = GetOption('default')
- opts_dir = joinpath(main.root.abspath, 'build_opts')
+ opts_dir = Dir('#build_opts').abspath
if default:
default_vars_files = [joinpath(build_root, 'variables', default),
joinpath(opts_dir, default)]
# https://github.com/SCons/scons/issues/2811
env['IMPLICIT_COMMAND_DEPENDENCIES'] = 0
env.Decider('MD5-timestamp')
- env.root = env.Dir('#')
- env.srcdir = env.root.Dir('src')
# add useful python code PYTHONPATH so it can be used by subprocesses
# as well
env.AppendENVPath('PYTHONPATH', extra_python_paths)
-gem5_tool_list = [
- 'git',
-]
-
def generate(env):
common_config(env)
SCons.Tool.default.generate(env)
- for tool in gem5_tool_list:
- SCons.Tool.Tool(tool)(env)
def exists(env):
return 1