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 --- 25 unchanged lines hidden (view full) --- 34# 35# While in this directory ('m5'), just type 'scons' to build the default 36# configuration (see below), or type 'scons build/<CONFIG>/<binary>' 37# to build some other configuration (e.g., 'build/ALPHA_FS/m5.opt' for 38# the optimized full-system version). 39# 40# You can build M5 in a different directory as long as there is a 41# 'build/<CONFIG>' somewhere along the target path. The build system |
42# expects that all configs under the same build directory are being |
43# built for the same host system. 44# 45# Examples: |
46# 47# The following two commands are equivalent. The '-u' option tells 48# scons to search up the directory tree for this SConstruct file. |
49# % cd <path-to-src>/m5 ; scons build/ALPHA_FS/m5.debug 50# % cd <path-to-src>/m5/build/ALPHA_FS; scons -u m5.debug |
51# 52# The following two commands are equivalent and demonstrate building 53# in a directory outside of the source tree. The '-C' option tells 54# scons to chdir to the specified directory to find this SConstruct 55# file. |
56# % cd <path-to-src>/m5 ; scons /local/foo/build/ALPHA_FS/m5.debug 57# % cd /local/foo/build/ALPHA_FS; scons -C <path-to-src>/m5 m5.debug 58# 59# You can use 'scons -H' to print scons options. If you're in this 60# 'm5' directory (or use -u or -C to tell scons where to find this 61# file), you can use 'scons -h' to print all the M5-specific build 62# options as well. 63# --- 90 unchanged lines hidden (view full) --- 154# and modified according to each selected configuration. 155# 156################################################### 157 158env = Environment(ENV = os.environ, # inherit user's environment vars 159 ROOT = ROOT, 160 SRCDIR = SRCDIR) 161 |
162env.SConsignFile(os.path.join(build_root,"sconsign")) |
163 164# Default duplicate option is to use hard links, but this messes up 165# when you use emacs to edit a file in the target dir, as emacs moves 166# file to file~ then copies to file, breaking the link. Symbolic 167# (soft) links work better. 168env.SetOption('duplicate', 'soft-copy') 169 170# I waffle on this setting... it does avoid a few painful but --- 129 unchanged lines hidden (view full) --- 300 ) 301 302# Non-sticky options only apply to the current build. 303nonsticky_opts = Options(args=ARGUMENTS) 304nonsticky_opts.AddOptions( 305 BoolOption('update_ref', 'Update test reference outputs', False) 306 ) 307 |
308# These options get exported to #defines in config/*.hh (see src/SConscript). |
309env.ExportOptions = ['FULL_SYSTEM', 'ALPHA_TLASER', 'USE_FENV', \ 310 'USE_MYSQL', 'NO_FAST_ALLOC', 'SS_COMPATIBLE_FP', \ 311 'USE_CHECKER'] 312 313# Define a handy 'no-op' action 314def no_action(target, source, env): 315 return 0 316 --- 153 unchanged lines hidden (view full) --- 470 print "Warning: MySQL not available; " \ 471 "forcing USE_MYSQL to False in", build_dir + "." 472 env['USE_MYSQL'] = False 473 else: 474 print "Compiling in", build_dir, "with MySQL support." 475 env.ParseConfig(mysql_config_libs) 476 env.ParseConfig(mysql_config_include) 477 |
478 # Check if the Checker is being used. If so append it to env['CPU_MODELS'] 479 if env['USE_CHECKER']: 480 env['CPU_MODELS'].append('CheckerCPU') 481 |
482 # Save sticky option settings back to current options file 483 sticky_opts.Save(current_opts_file, env) 484 485 # Do this after we save setting back, or else we'll tack on an 486 # extra 'qdo' every time we run scons. 487 if env['BATCH']: 488 env['CC'] = env['BATCH_CMD'] + ' ' + env['CC'] 489 env['CXX'] = env['BATCH_CMD'] + ' ' + env['CXX'] 490 491 if env['USE_SSE2']: 492 env.Append(CCFLAGS='-msse2') 493 |
494 # The src/SConscript file sets up the build rules in 'env' according |
495 # to the configured options. It returns a list of environments, 496 # one for each variant build (debug, opt, etc.) 497 envList = SConscript('src/SConscript', build_dir = build_path, 498 exports = 'env') 499 500 # Set up the regression tests for each build. 501# for e in envList: 502# SConscript('m5-test/SConscript', --- 12 unchanged lines hidden --- |