SConstruct revision 2508
1955SN/A# -*- mode:python -*-
2955SN/A
31762SN/A# Copyright (c) 2004-2005 The Regents of The University of Michigan
4955SN/A# All rights reserved.
5955SN/A#
6955SN/A# Redistribution and use in source and binary forms, with or without
7955SN/A# modification, are permitted provided that the following conditions are
8955SN/A# met: redistributions of source code must retain the above copyright
9955SN/A# notice, this list of conditions and the following disclaimer;
10955SN/A# redistributions in binary form must reproduce the above copyright
11955SN/A# notice, this list of conditions and the following disclaimer in the
12955SN/A# documentation and/or other materials provided with the distribution;
13955SN/A# neither the name of the copyright holders nor the names of its
14955SN/A# contributors may be used to endorse or promote products derived from
15955SN/A# this software without specific prior written permission.
16955SN/A#
17955SN/A# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18955SN/A# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19955SN/A# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
20955SN/A# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
21955SN/A# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
22955SN/A# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23955SN/A# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24955SN/A# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25955SN/A# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26955SN/A# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27955SN/A# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28955SN/A
29955SN/A###################################################
30955SN/A#
31955SN/A# SCons top-level build description (SConstruct) file.
32955SN/A#
332632Sstever@eecs.umich.edu# To build M5, you need a directory with three things:
342632Sstever@eecs.umich.edu# 1. A copy of this file (named SConstruct).
352632Sstever@eecs.umich.edu# 2. A link named 'm5' to the top of the M5 simulator source tree.
362632Sstever@eecs.umich.edu# 3. A link named 'ext' to the top of the M5 external source tree.
37955SN/A#
382632Sstever@eecs.umich.edu# Then type 'scons' to build the default configuration (see below), or
392632Sstever@eecs.umich.edu# 'scons <CONFIG>/<binary>' to build some other configuration (e.g.,
402632Sstever@eecs.umich.edu# 'ALPHA_FS/m5.opt' for the optimized full-system version).
412632Sstever@eecs.umich.edu#
422632Sstever@eecs.umich.edu###################################################
432632Sstever@eecs.umich.edu
442632Sstever@eecs.umich.edu# Python library imports
452632Sstever@eecs.umich.eduimport sys
462632Sstever@eecs.umich.eduimport os
472632Sstever@eecs.umich.edu
482632Sstever@eecs.umich.edu# Check for recent-enough Python and SCons versions
492632Sstever@eecs.umich.eduEnsurePythonVersion(2,3)
502632Sstever@eecs.umich.eduEnsureSConsVersion(0,96)
512632Sstever@eecs.umich.edu
522632Sstever@eecs.umich.edu# The absolute path to the current directory (where this file lives).
532632Sstever@eecs.umich.eduROOT = Dir('.').abspath
542632Sstever@eecs.umich.edu
552632Sstever@eecs.umich.edu# Paths to the M5 and external source trees (local symlinks).
562632Sstever@eecs.umich.eduSRCDIR = os.path.join(ROOT, 'm5')
572632Sstever@eecs.umich.eduEXT_SRCDIR = os.path.join(ROOT, 'ext')
58955SN/A
59955SN/A# Check for 'm5' and 'ext' links, die if they don't exist.
60955SN/Aif not os.path.isdir(SRCDIR):
61955SN/A    print "Error: '%s' must be a link to the M5 source tree." % SRCDIR
62955SN/A    Exit(1)
63955SN/A
64955SN/Aif not os.path.isdir('ext'):
651858SN/A    print "Error: '%s' must be a link to the M5 external source tree." \
661858SN/A          % EXT_SRCDIR
672632Sstever@eecs.umich.edu    Exit(1)
681852SN/A
69955SN/A# tell python where to find m5 python code
70955SN/Asys.path.append(os.path.join(SRCDIR, 'python'))
71955SN/A
722632Sstever@eecs.umich.edu###################################################
732632Sstever@eecs.umich.edu#
74955SN/A# Figure out which configurations to set up.
751533SN/A#
762632Sstever@eecs.umich.edu#
771533SN/A# It's prohibitive to do all the combinations of base configurations
78955SN/A# and options, so we have to infer which ones the user wants.
79955SN/A#
802632Sstever@eecs.umich.edu# 1. If there are command-line targets, the configuration(s) are inferred
812632Sstever@eecs.umich.edu#    from the directories of those targets.  If scons was invoked from a
82955SN/A#    subdirectory (using 'scons -u'), those targets have to be
83955SN/A#    interpreted relative to that subdirectory.
84955SN/A#
85955SN/A# 2. If there are no command-line targets, and scons was invoked from a
862632Sstever@eecs.umich.edu#    subdirectory (using 'scons -u'), the configuration is inferred from
87955SN/A#    the name of the subdirectory.
882632Sstever@eecs.umich.edu#
89955SN/A# 3. If there are no command-line targets and scons was invoked from
90955SN/A#    the root build directory, a default configuration is used.  The
912632Sstever@eecs.umich.edu#    built-in default is ALPHA_SE, but this can be overridden by setting the
922632Sstever@eecs.umich.edu#    M5_DEFAULT_CONFIG shell environment veriable.
932632Sstever@eecs.umich.edu#
942632Sstever@eecs.umich.edu# In cases 2 & 3, the specific file target defaults to 'm5.debug', but
952632Sstever@eecs.umich.edu# this can be overridden by setting the M5_DEFAULT_BINARY shell
962632Sstever@eecs.umich.edu# environment veriable.
972632Sstever@eecs.umich.edu#
982632Sstever@eecs.umich.edu###################################################
992632Sstever@eecs.umich.edu
1002632Sstever@eecs.umich.edu# Find default configuration & binary.
1012632Sstever@eecs.umich.edudefault_config = os.environ.get('M5_DEFAULT_CONFIG', 'ALPHA_SE')
1022632Sstever@eecs.umich.edudefault_binary = os.environ.get('M5_DEFAULT_BINARY', 'm5.debug')
1032632Sstever@eecs.umich.edu
1042632Sstever@eecs.umich.edu# Ask SCons which directory it was invoked from.  If you invoke SCons
1052632Sstever@eecs.umich.edu# from a subdirectory you must use the '-u' flag.
1062632Sstever@eecs.umich.edulaunch_dir = GetLaunchDir()
1072632Sstever@eecs.umich.edu
1082634Sstever@eecs.umich.edu# Build a list 'my_targets' of all the targets relative to ROOT.
1092634Sstever@eecs.umich.eduif launch_dir == ROOT:
1102632Sstever@eecs.umich.edu    # invoked from root build dir
1112634Sstever@eecs.umich.edu    if len(COMMAND_LINE_TARGETS) != 0:
1122632Sstever@eecs.umich.edu        # easy: use specified targets as is
1132632Sstever@eecs.umich.edu        my_targets = COMMAND_LINE_TARGETS
1142632Sstever@eecs.umich.edu    else:
1152632Sstever@eecs.umich.edu        # default target (ALPHA_SE/m5.debug, unless overridden)
1162632Sstever@eecs.umich.edu        target = os.path.join(default_config, default_binary)
1172632Sstever@eecs.umich.edu        my_targets = [target]
1181858SN/A        Default(target)
1192634Sstever@eecs.umich.eduelse:
1202634Sstever@eecs.umich.edu    # invoked from subdirectory
1212634Sstever@eecs.umich.edu    if not launch_dir.startswith(ROOT):
1222634Sstever@eecs.umich.edu        print "Error: launch dir (%s) not a subdirectory of ROOT (%s)!" \
1232634Sstever@eecs.umich.edu              (launch_dir, ROOT)
1242634Sstever@eecs.umich.edu        Exit(1)
125955SN/A    # make launch_dir relative to ROOT (strip ROOT plus slash off front)
126955SN/A    launch_dir = launch_dir[len(ROOT)+1:]
127955SN/A    if len(COMMAND_LINE_TARGETS) != 0:
128955SN/A        # make specified targets relative to ROOT
129955SN/A        my_targets = map(lambda x: os.path.join(launch_dir, x),
130955SN/A                         COMMAND_LINE_TARGETS)
131955SN/A    else:
132955SN/A        # build default binary (m5.debug, unless overridden) using the
1331858SN/A        # config inferred by the invocation directory (the first
1341858SN/A        # subdirectory after ROOT)
1352632Sstever@eecs.umich.edu        target = os.path.join(launch_dir.split('/')[0], default_binary)
136955SN/A        my_targets = [target]
1371858SN/A        Default(target)
1381105SN/A
1391869SN/A# Normalize target paths (gets rid of '..' in the middle, etc.)
1401869SN/Amy_targets = map(os.path.normpath, my_targets)
1411869SN/A
1421869SN/A# Generate a list of the unique configs that the collected targets reference.
1431869SN/Abuild_dirs = []
1441065SN/Afor t in my_targets:
1452632Sstever@eecs.umich.edu    dir = t.split('/')[0]
1462632Sstever@eecs.umich.edu    if dir not in build_dirs:
147955SN/A        build_dirs.append(dir)
1481858SN/A
1491858SN/A###################################################
1501858SN/A#
1511858SN/A# Set up the default build environment.  This environment is copied
1521851SN/A# and modified according to each selected configuration.
1531851SN/A#
1541858SN/A###################################################
1552632Sstever@eecs.umich.edu
156955SN/Aenv = Environment(ENV = os.environ,  # inherit user's environment vars
1571858SN/A                  ROOT = ROOT,
1581858SN/A                  SRCDIR = SRCDIR,
1591858SN/A                  EXT_SRCDIR = EXT_SRCDIR)
1601858SN/A
1611858SN/Aenv.SConsignFile("sconsign")
1621858SN/A
1631858SN/A# I waffle on this setting... it does avoid a few painful but
1641858SN/A# unnecessary builds, but it also seems to make trivial builds take
1651858SN/A# noticeably longer.
1661858SN/Aif False:
1671858SN/A    env.TargetSignatures('content')
1681858SN/A
1691859SN/A# M5_EXT is used by isa_parser.py to find the PLY package.
1701858SN/Aenv.Append(ENV = { 'M5_EXT' : EXT_SRCDIR })
1711858SN/A
1721858SN/A# Set up default C++ compiler flags
1731859SN/Aenv.Append(CCFLAGS='-pipe')
1741859SN/Aenv.Append(CCFLAGS='-fno-strict-aliasing')
1751862SN/Aenv.Append(CCFLAGS=Split('-Wall -Wno-sign-compare -Werror -Wundef'))
1761862SN/Aif sys.platform == 'cygwin':
1771862SN/A    # cygwin has some header file issues...
1781862SN/A    env.Append(CCFLAGS=Split("-Wno-uninitialized"))
1791859SN/Aenv.Append(CPPPATH=[os.path.join(EXT_SRCDIR + '/dnet')])
1801859SN/A
1811963SN/A# Default libraries
1821963SN/Aenv.Append(LIBS=['z'])
1831859SN/A
1841859SN/A# Platform-specific configuration
1851859SN/Aconf = Configure(env)
1861859SN/A
1871859SN/A# Check for <fenv.h> (C99 FP environment control)
1881859SN/Ahave_fenv = conf.CheckHeader('fenv.h', '<>')
1891859SN/Aif not have_fenv:
1901859SN/A    print "Warning: Header file <fenv.h> not found."
1911862SN/A    print "         This host has no IEEE FP rounding mode control."
1921859SN/A
1931859SN/A# Check for mysql.
1941859SN/Amysql_config = WhereIs('mysql_config')
1951858SN/Ahave_mysql = mysql_config != None
1961858SN/A
1972139SN/A# Check MySQL version.
1982139SN/Aif have_mysql:
1992139SN/A    mysql_version = os.popen(mysql_config + ' --version').read()
2002155SN/A    mysql_version = mysql_version.split('.')
2012623SN/A    mysql_major = int(mysql_version[0])
2022637Sstever@eecs.umich.edu    mysql_minor = int(mysql_version[1])
2032155SN/A    # This version check is probably overly conservative, but it deals
2041869SN/A    # with the versions we have installed.
2051869SN/A    if mysql_major < 4 or (mysql_major == 4 and mysql_minor < 1):
2061869SN/A        print "Warning: MySQL v4.1 or newer required."
2071869SN/A        have_mysql = False
2081869SN/A
2092139SN/A# Set up mysql_config commands.
2101869SN/Aif have_mysql:
2112508SN/A    mysql_config_include = mysql_config + ' --include'
2122508SN/A    if os.system(mysql_config_include + ' > /dev/null') != 0:
2132508SN/A        # older mysql_config versions don't support --include, use
2142508SN/A        # --cflags instead
2152635Sstever@eecs.umich.edu        mysql_config_include = mysql_config + ' --cflags | sed s/\\\'//g'
2162635Sstever@eecs.umich.edu    # This seems to work in all versions
2171869SN/A    mysql_config_libs = mysql_config + ' --libs'
2181869SN/A
2191869SN/Aenv = conf.Finish()
2201869SN/A
2211869SN/A# Define the universe of supported ISAs
2221869SN/Aenv['ALL_ISA_LIST'] = ['alpha', 'sparc', 'mips']
2231869SN/A
2241869SN/A# Define the universe of supported CPU models
2251965SN/Aenv['ALL_CPU_LIST'] = ['SimpleCPU', 'FastCPU', 'FullCPU', 'AlphaFullCPU']
2261965SN/A
2271965SN/A# Sticky options get saved in the options file so they persist from
2281869SN/A# one invocation to the next (unless overridden, in which case the new
2291869SN/A# value becomes sticky).
2301869SN/Asticky_opts = Options(args=ARGUMENTS)
2311869SN/Asticky_opts.AddOptions(
2321884SN/A    EnumOption('TARGET_ISA', 'Target ISA', 'alpha', env['ALL_ISA_LIST']),
2331884SN/A    BoolOption('FULL_SYSTEM', 'Full-system support', False),
2341884SN/A    # There's a bug in scons 0.96.1 that causes ListOptions with list
2351869SN/A    # values (more than one value) not to be able to be restored from
2361858SN/A    # a saved option file.  If this causes trouble then upgrade to
2371869SN/A    # scons 0.96.90 or later.
2381869SN/A    ListOption('CPU_MODELS', 'CPU models', 'all', env['ALL_CPU_LIST']),
2391869SN/A    BoolOption('ALPHA_TLASER',
2401869SN/A               'Model Alpha TurboLaser platform (vs. Tsunami)', False),
2411869SN/A    BoolOption('NO_FAST_ALLOC', 'Disable fast object allocator', False),
2421858SN/A    BoolOption('EFENCE', 'Link with Electric Fence malloc debugger',
2431869SN/A               False),
2441869SN/A    BoolOption('SS_COMPATIBLE_FP',
2451869SN/A               'Make floating-point results compatible with SimpleScalar',
2461869SN/A               False),
2471869SN/A    BoolOption('USE_SSE2',
2481869SN/A               'Compile for SSE2 (-msse2) to get IEEE FP on x86 hosts',
2491869SN/A               False),
2501869SN/A    BoolOption('STATS_BINNING', 'Bin statistics by CPU mode', have_mysql),
2511869SN/A    BoolOption('USE_MYSQL', 'Use MySQL for stats output', have_mysql),
2521869SN/A    BoolOption('USE_FENV', 'Use <fenv.h> IEEE mode control', have_fenv),
2531858SN/A    ('CC', 'C compiler', os.environ.get('CC', env['CC'])),
254955SN/A    ('CXX', 'C++ compiler', os.environ.get('CXX', env['CXX'])),
255955SN/A    BoolOption('BATCH', 'Use batch pool for build and tests', False),
2561869SN/A    ('BATCH_CMD', 'Batch pool submission command name', 'qdo')
2571869SN/A    )
2581869SN/A
2591869SN/A# Non-sticky options only apply to the current build.
2601869SN/Anonsticky_opts = Options(args=ARGUMENTS)
2611869SN/Anonsticky_opts.AddOptions(
2621869SN/A    BoolOption('update_ref', 'Update test reference outputs', False)
2631869SN/A    )
2641869SN/A
2651869SN/A# These options get exported to #defines in config/*.hh (see m5/SConscript).
2661869SN/Aenv.ExportOptions = ['FULL_SYSTEM', 'ALPHA_TLASER', 'USE_FENV', \
2671869SN/A                     'USE_MYSQL', 'NO_FAST_ALLOC', 'SS_COMPATIBLE_FP', \
2681869SN/A                     'STATS_BINNING']
2691869SN/A
2701869SN/A# Define a handy 'no-op' action
2711869SN/Adef no_action(target, source, env):
2721869SN/A    return 0
2731869SN/A
2741869SN/Aenv.NoAction = Action(no_action, None)
2751869SN/A
2761869SN/A# libelf build is described in its own SConscript file.
2771869SN/A# SConscript-global is the build in build/libelf shared among all
2781869SN/A# configs.
2791869SN/Aenv.SConscript('m5/libelf/SConscript-global', exports = 'env')
2801869SN/A
2811869SN/A###################################################
2821869SN/A#
2831869SN/A# Define a SCons builder for configuration flag headers.
2841869SN/A#
2851869SN/A###################################################
2861869SN/A
2871869SN/A# This function generates a config header file that #defines the
2881869SN/A# option symbol to the current option setting (0 or 1).  The source
2891869SN/A# operands are the name of the option and a Value node containing the
2901869SN/A# value of the option.
2911869SN/Adef build_config_file(target, source, env):
2921869SN/A    (option, value) = [s.get_contents() for s in source]
2931869SN/A    f = file(str(target[0]), 'w')
2941869SN/A    print >> f, '#define', option, value
2952634Sstever@eecs.umich.edu    f.close()
2962634Sstever@eecs.umich.edu    return None
2972634Sstever@eecs.umich.edu
2982634Sstever@eecs.umich.edu# Generate the message to be printed when building the config file.
2992634Sstever@eecs.umich.edudef build_config_file_string(target, source, env):
3002634Sstever@eecs.umich.edu    (option, value) = [s.get_contents() for s in source]
3011869SN/A    return "Defining %s as %s in %s." % (option, value, target[0])
3021869SN/A
303955SN/A# Combine the two functions into a scons Action object.
304955SN/Aconfig_action = Action(build_config_file, build_config_file_string)
305955SN/A
306955SN/A# The emitter munges the source & target node lists to reflect what
3071858SN/A# we're really doing.
3081858SN/Adef config_emitter(target, source, env):
3091858SN/A    # extract option name from Builder arg
3102634Sstever@eecs.umich.edu    option = str(target[0])
3112634Sstever@eecs.umich.edu    # True target is config header file
3122634Sstever@eecs.umich.edu    target = os.path.join('config', option.lower() + '.hh')
3132634Sstever@eecs.umich.edu    # Force value to 0/1 even if it's a Python bool
3142634Sstever@eecs.umich.edu    val = int(eval(str(env[option])))
3152634Sstever@eecs.umich.edu    # Sources are option name & value (packaged in SCons Value nodes)
3162634Sstever@eecs.umich.edu    return ([target], [Value(option), Value(val)])
3172634Sstever@eecs.umich.edu
3182634Sstever@eecs.umich.educonfig_builder = Builder(emitter = config_emitter, action = config_action)
3192634Sstever@eecs.umich.edu
3202598SN/Aenv.Append(BUILDERS = { 'ConfigFile' : config_builder })
3212632Sstever@eecs.umich.edu
3222632Sstever@eecs.umich.edu###################################################
3232632Sstever@eecs.umich.edu#
3242632Sstever@eecs.umich.edu# Define build environments for selected configurations.
3252632Sstever@eecs.umich.edu#
3262634Sstever@eecs.umich.edu###################################################
3272634Sstever@eecs.umich.edu
3282023SN/A# rename base env
3292632Sstever@eecs.umich.edubase_env = env
3302632Sstever@eecs.umich.edu
3312632Sstever@eecs.umich.edufor build_dir in build_dirs:
3322632Sstever@eecs.umich.edu    # Make a copy of the default environment to use for this config.
3332632Sstever@eecs.umich.edu    env = base_env.Copy()
3342632Sstever@eecs.umich.edu
3352632Sstever@eecs.umich.edu    # Record what build_dir was in the environment
3362632Sstever@eecs.umich.edu    env.Append(BUILD_DIR=build_dir);
3372632Sstever@eecs.umich.edu
3382632Sstever@eecs.umich.edu    # Set env according to the build directory config.
3392632Sstever@eecs.umich.edu
3402023SN/A    sticky_opts.files = []
3412632Sstever@eecs.umich.edu    # Name of default options file is taken from 'default=' on command
3422632Sstever@eecs.umich.edu    # line if set, otherwise name of build dir.
3431889SN/A    default_options_file = os.path.join('default_options',
3441889SN/A                                        ARGUMENTS.get('default', build_dir))
3452632Sstever@eecs.umich.edu    if os.path.isfile(default_options_file):
3462632Sstever@eecs.umich.edu        sticky_opts.files.append(default_options_file)
3472632Sstever@eecs.umich.edu    current_options_file = os.path.join('options', build_dir)
3482632Sstever@eecs.umich.edu    if os.path.isfile(current_options_file):
3492632Sstever@eecs.umich.edu        sticky_opts.files.append(current_options_file)
3502632Sstever@eecs.umich.edu    else:
3512632Sstever@eecs.umich.edu        # if file doesn't exist, make sure at least the directory is there
3522632Sstever@eecs.umich.edu        # so we can create it later
3532632Sstever@eecs.umich.edu        opt_dir = os.path.dirname(current_options_file)
3542632Sstever@eecs.umich.edu        if not os.path.isdir(opt_dir):
3552632Sstever@eecs.umich.edu            os.mkdir(opt_dir)
3562632Sstever@eecs.umich.edu    if not sticky_opts.files:
3572632Sstever@eecs.umich.edu        print "%s: No options file found in options, using defaults." \
3582632Sstever@eecs.umich.edu              % build_dir
3591888SN/A
3601888SN/A    # Apply current option settings to env
3611869SN/A    sticky_opts.Update(env)
3621869SN/A    nonsticky_opts.Update(env)
3631858SN/A
3642598SN/A    # Process option settings.
3652598SN/A
3662598SN/A    if not have_fenv and env['USE_FENV']:
3672598SN/A        print "Warning: <fenv.h> not available; " \
3682598SN/A              "forcing USE_FENV to False in", build_dir + "."
3691858SN/A        env['USE_FENV'] = False
3701858SN/A
3711858SN/A    if not env['USE_FENV']:
3721858SN/A        print "Warning: No IEEE FP rounding mode control in", build_dir + "."
3731858SN/A        print "         FP results may deviate slightly from other platforms."
3741858SN/A
3751858SN/A    if env['EFENCE']:
3761858SN/A        env.Append(LIBS=['efence'])
3771858SN/A
3781871SN/A    if env['USE_MYSQL']:
3791858SN/A        if not have_mysql:
3801858SN/A            print "Warning: MySQL not available; " \
3811858SN/A                  "forcing USE_MYSQL to False in", build_dir + "."
3821858SN/A            env['USE_MYSQL'] = False
3831858SN/A        else:
3841858SN/A            print "Compiling in", build_dir, "with MySQL support."
3851858SN/A            env.ParseConfig(mysql_config_libs)
3861858SN/A            env.ParseConfig(mysql_config_include)
3871858SN/A
3881858SN/A    # Save sticky option settings back to current options file
3891858SN/A    sticky_opts.Save(current_options_file, env)
3901859SN/A
3911859SN/A    # Do this after we save setting back, or else we'll tack on an
3921869SN/A    # extra 'qdo' every time we run scons.
3931888SN/A    if env['BATCH']:
3942632Sstever@eecs.umich.edu        env['CC']  = env['BATCH_CMD'] + ' ' + env['CC']
3951869SN/A        env['CXX'] = env['BATCH_CMD'] + ' ' + env['CXX']
3961884SN/A
3971884SN/A    if env['USE_SSE2']:
3981884SN/A        env.Append(CCFLAGS='-msse2')
3991884SN/A
4001884SN/A    # The m5/SConscript file sets up the build rules in 'env' according
4011884SN/A    # to the configured options.  It returns a list of environments,
4021965SN/A    # one for each variant build (debug, opt, etc.)
4031965SN/A    envList = SConscript('m5/SConscript', build_dir = build_dir,
4041965SN/A                         exports = 'env', duplicate = False)
405955SN/A
4061869SN/A    # Set up the regression tests for each build.
4071869SN/A    for e in envList:
4082632Sstever@eecs.umich.edu        SConscript('m5-test/SConscript',
4091869SN/A                   build_dir = os.path.join(build_dir, 'test', e.Label),
4101869SN/A                   exports = { 'env' : e }, duplicate = False)
4111869SN/A
4122632Sstever@eecs.umich.edu###################################################
4132632Sstever@eecs.umich.edu#
4142632Sstever@eecs.umich.edu# Let SCons do its thing.  At this point SCons will use the defined
4152632Sstever@eecs.umich.edu# build environments to build the requested targets.
416955SN/A#
4172598SN/A###################################################
4182598SN/A
419955SN/A