1# -*- mode:python -*- 2 3# Copyright (c) 2004-2005 The Regents of The University of Michigan 4# All rights reserved. 5# 6# Redistribution and use in source and binary forms, with or without 7# modification, are permitted provided that the following conditions are 8# met: redistributions of source code must retain the above copyright --- 34 unchanged lines hidden (view full) --- 43# This file defines how to build a particular configuration of M5 44# based on variable settings in the 'env' build environment. 45 46Import('*') 47 48# Children need to see the environment 49Export('env') 50 |
51build_env = dict([(opt, env[opt]) for opt in env.ExportVariables]) |
52 53def sort_list(_list): 54 """return a sorted copy of '_list'""" 55 if isinstance(_list, list): 56 _list = _list[:] 57 else: 58 _list = list(_list) 59 _list.sort() --- 177 unchanged lines hidden (view full) --- 237 238for extra_dir in extras_dir_list: 239 prefix_len = len(dirname(extra_dir)) + 1 240 for root, dirs, files in os.walk(extra_dir, topdown=True): 241 if 'SConscript' in files: 242 build_dir = joinpath(env['BUILDDIR'], root[prefix_len:]) 243 SConscript(joinpath(root, 'SConscript'), build_dir=build_dir) 244 |
245for opt in env.ExportVariables: |
246 env.ConfigFile(opt) 247 248######################################################################## 249# 250# Prevent any SimObjects from being added after this point, they 251# should all have been added in the SConscripts above 252# 253class DictImporter(object): --- 94 unchanged lines hidden (view full) --- 348module_depends = ["m5", "m5.SimObject", "m5.params"] 349depends = [ File(py_modules[dep]) for dep in module_depends ] 350 351######################################################################## 352# 353# Commands for the basic automatically generated python files 354# 355 |
356# Generate Python file containing a dict specifying the current 357# build_env flags. 358def makeDefinesPyFile(target, source, env): 359 f = file(str(target[0]), 'w') 360 build_env, hg_info = [ x.get_contents() for x in source ] 361 print >>f, "buildEnv = %s" % build_env 362 print >>f, "hgRev = '%s'" % hg_info 363 f.close() 364 |
365defines_info = [ Value(build_env), Value(env['HG_INFO']) ] |
366# Generate a file with all of the compile options in it 367env.Command('python/m5/defines.py', defines_info, makeDefinesPyFile) 368PySource('m5', 'python/m5/defines.py') 369 370# Generate python file containing info about the M5 source code 371def makeInfoPyFile(target, source, env): 372 f = file(str(target[0]), 'w') 373 for src in source: --- 572 unchanged lines hidden (view full) --- 946# binary. Additional keyword arguments are appended to corresponding 947# build environment vars. 948def makeEnv(label, objsfx, strip = False, **kwargs): 949 # SCons doesn't know to append a library suffix when there is a '.' in the 950 # name. Use '_' instead. 951 libname = 'm5_' + label 952 exename = 'm5.' + label 953 |
954 new_env = env.Clone(OBJSUFFIX=objsfx, SHOBJSUFFIX=objsfx + 's') |
955 new_env.Label = label 956 new_env.Append(**kwargs) 957 |
958 swig_env = new_env.Clone() |
959 if env['GCC']: 960 swig_env.Append(CCFLAGS='-Wno-uninitialized') 961 swig_env.Append(CCFLAGS='-Wno-sign-compare') 962 swig_env.Append(CCFLAGS='-Wno-parentheses') 963 964 static_objs = make_objs(cc_lib_sources, new_env, static=True) 965 shared_objs = make_objs(cc_lib_sources, new_env, static=False) 966 static_objs += [ swig_env.StaticObject(s) for s in cc_swig_sources ] --- 72 unchanged lines hidden --- |