SConstruct revision 1869
1955SN/A# -*- mode:python -*- 2955SN/A 310841Sandreas.sandberg@arm.com# Copyright (c) 2004-2005 The Regents of The University of Michigan 49812Sandreas.hansson@arm.com# All rights reserved. 59812Sandreas.hansson@arm.com# 69812Sandreas.hansson@arm.com# Redistribution and use in source and binary forms, with or without 79812Sandreas.hansson@arm.com# modification, are permitted provided that the following conditions are 89812Sandreas.hansson@arm.com# met: redistributions of source code must retain the above copyright 99812Sandreas.hansson@arm.com# notice, this list of conditions and the following disclaimer; 109812Sandreas.hansson@arm.com# redistributions in binary form must reproduce the above copyright 119812Sandreas.hansson@arm.com# notice, this list of conditions and the following disclaimer in the 129812Sandreas.hansson@arm.com# documentation and/or other materials provided with the distribution; 139812Sandreas.hansson@arm.com# neither the name of the copyright holders nor the names of its 149812Sandreas.hansson@arm.com# contributors may be used to endorse or promote products derived from 157816Ssteve.reinhardt@amd.com# this software without specific prior written permission. 165871Snate@binkert.org# 171762SN/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# 33955SN/A# To build M5, you need a directory with three things: 34955SN/A# 1. A copy of this file (named SConstruct). 35955SN/A# 2. A link named 'm5' to the top of the M5 simulator source tree. 36955SN/A# 3. A link named 'ext' to the top of the M5 external source tree. 37955SN/A# 38955SN/A# Then type 'scons' to build the default configuration (see below), or 39955SN/A# 'scons <CONFIG>/<binary>' to build some other configuration (e.g., 40955SN/A# 'ALPHA_FS/m5.opt' for the optimized full-system version). 41955SN/A# 422665Ssaidi@eecs.umich.edu################################################### 432665Ssaidi@eecs.umich.edu 445863Snate@binkert.org# Python library imports 45955SN/Aimport sys 46955SN/Aimport os 47955SN/A 48955SN/A# Check for recent-enough Python and SCons versions 49955SN/AEnsurePythonVersion(2,3) 508878Ssteve.reinhardt@amd.comEnsureSConsVersion(0,96) 512632Sstever@eecs.umich.edu 528878Ssteve.reinhardt@amd.com# The absolute path to the current directory (where this file lives). 532632Sstever@eecs.umich.eduROOT = Dir('.').abspath 54955SN/A 558878Ssteve.reinhardt@amd.com# Paths to the M5 and external source trees (local symlinks). 562632Sstever@eecs.umich.eduSRCDIR = os.path.join(ROOT, 'm5') 572761Sstever@eecs.umich.eduEXT_SRCDIR = os.path.join(ROOT, 'ext') 582632Sstever@eecs.umich.edu 592632Sstever@eecs.umich.edu# Check for 'm5' and 'ext' links, die if they don't exist. 602632Sstever@eecs.umich.eduif not os.path.isdir(SRCDIR): 612761Sstever@eecs.umich.edu print "Error: '%s' must be a link to the M5 source tree." % SRCDIR 622761Sstever@eecs.umich.edu Exit(1) 632761Sstever@eecs.umich.edu 648878Ssteve.reinhardt@amd.comif not os.path.isdir('ext'): 658878Ssteve.reinhardt@amd.com print "Error: '%s' must be a link to the M5 external source tree." \ 662761Sstever@eecs.umich.edu % EXT_SRCDIR 672761Sstever@eecs.umich.edu Exit(1) 682761Sstever@eecs.umich.edu 692761Sstever@eecs.umich.edu# tell python where to find m5 python code 702761Sstever@eecs.umich.edusys.path.append(os.path.join(SRCDIR, 'python')) 718878Ssteve.reinhardt@amd.com 728878Ssteve.reinhardt@amd.com################################################### 732632Sstever@eecs.umich.edu# 742632Sstever@eecs.umich.edu# Figure out which configurations to set up. 758878Ssteve.reinhardt@amd.com# 768878Ssteve.reinhardt@amd.com# 772632Sstever@eecs.umich.edu# 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# 80955SN/A# 1. If there are command-line targets, the configuration(s) are inferred 815863Snate@binkert.org# from the directories of those targets. If scons was invoked from a 825863Snate@binkert.org# subdirectory (using 'scons -u'), those targets have to be 835863Snate@binkert.org# interpreted relative to that subdirectory. 845863Snate@binkert.org# 855863Snate@binkert.org# 2. If there are no command-line targets, and scons was invoked from a 865863Snate@binkert.org# subdirectory (using 'scons -u'), the configuration is inferred from 875863Snate@binkert.org# the name of the subdirectory. 885863Snate@binkert.org# 895863Snate@binkert.org# 3. If there are no command-line targets and scons was invoked from 905863Snate@binkert.org# the root build directory, a default configuration is used. The 915863Snate@binkert.org# built-in default is ALPHA_SE, but this can be overridden by setting the 928878Ssteve.reinhardt@amd.com# M5_DEFAULT_CONFIG shell environment veriable. 935863Snate@binkert.org# 945863Snate@binkert.org# In cases 2 & 3, the specific file target defaults to 'm5.debug', but 955863Snate@binkert.org# this can be overridden by setting the M5_DEFAULT_BINARY shell 969812Sandreas.hansson@arm.com# environment veriable. 979812Sandreas.hansson@arm.com# 985863Snate@binkert.org################################################### 999812Sandreas.hansson@arm.com 1005863Snate@binkert.org# Find default configuration & binary. 1015863Snate@binkert.orgdefault_config = os.environ.get('M5_DEFAULT_CONFIG', 'ALPHA_SE') 1025863Snate@binkert.orgdefault_binary = os.environ.get('M5_DEFAULT_BINARY', 'm5.debug') 1039812Sandreas.hansson@arm.com 1049812Sandreas.hansson@arm.com# Ask SCons which directory it was invoked from. If you invoke SCons 1055863Snate@binkert.org# from a subdirectory you must use the '-u' flag. 1065863Snate@binkert.orglaunch_dir = GetLaunchDir() 1078878Ssteve.reinhardt@amd.com 1085863Snate@binkert.org# Build a list 'my_targets' of all the targets relative to ROOT. 1095863Snate@binkert.orgif launch_dir == ROOT: 1105863Snate@binkert.org # invoked from root build dir 1116654Snate@binkert.org if len(COMMAND_LINE_TARGETS) != 0: 11210196SCurtis.Dunham@arm.com # easy: use specified targets as is 113955SN/A my_targets = COMMAND_LINE_TARGETS 1145396Ssaidi@eecs.umich.edu else: 1155863Snate@binkert.org # default target (ALPHA_SE/m5.debug, unless overridden) 1165863Snate@binkert.org target = os.path.join(default_config, default_binary) 1174202Sbinkertn@umich.edu my_targets = [target] 1185863Snate@binkert.org Default(target) 1195863Snate@binkert.orgelse: 1205863Snate@binkert.org # invoked from subdirectory 1215863Snate@binkert.org if not launch_dir.startswith(ROOT): 122955SN/A print "Error: launch dir (%s) not a subdirectory of ROOT (%s)!" \ 1236654Snate@binkert.org (launch_dir, ROOT) 1245273Sstever@gmail.com Exit(1) 1255871Snate@binkert.org # make launch_dir relative to ROOT (strip ROOT plus slash off front) 1265273Sstever@gmail.com launch_dir = launch_dir[len(ROOT)+1:] 1276655Snate@binkert.org if len(COMMAND_LINE_TARGETS) != 0: 1288878Ssteve.reinhardt@amd.com # make specified targets relative to ROOT 1296655Snate@binkert.org my_targets = map(lambda x: os.path.join(launch_dir, x), 1306655Snate@binkert.org COMMAND_LINE_TARGETS) 1319219Spower.jg@gmail.com else: 1326655Snate@binkert.org # build default binary (m5.debug, unless overridden) using the 1335871Snate@binkert.org # config inferred by the invocation directory (the first 1346654Snate@binkert.org # subdirectory after ROOT) 1358947Sandreas.hansson@arm.com target = os.path.join(launch_dir.split('/')[0], default_binary) 1365396Ssaidi@eecs.umich.edu my_targets = [target] 1378120Sgblack@eecs.umich.edu Default(target) 1388120Sgblack@eecs.umich.edu 1398120Sgblack@eecs.umich.edu# Normalize target paths (gets rid of '..' in the middle, etc.) 1408120Sgblack@eecs.umich.edumy_targets = map(os.path.normpath, my_targets) 1418120Sgblack@eecs.umich.edu 1428120Sgblack@eecs.umich.edu# Generate a list of the unique configs that the collected targets reference. 1438120Sgblack@eecs.umich.edubuild_dirs = [] 1448120Sgblack@eecs.umich.edufor t in my_targets: 1458879Ssteve.reinhardt@amd.com dir = t.split('/')[0] 1468879Ssteve.reinhardt@amd.com if dir not in build_dirs: 1478879Ssteve.reinhardt@amd.com build_dirs.append(dir) 1488879Ssteve.reinhardt@amd.com 1498879Ssteve.reinhardt@amd.com################################################### 1508879Ssteve.reinhardt@amd.com# 1518879Ssteve.reinhardt@amd.com# Set up the default build environment. This environment is copied 1528879Ssteve.reinhardt@amd.com# and modified according to each selected configuration. 1538879Ssteve.reinhardt@amd.com# 1548879Ssteve.reinhardt@amd.com################################################### 1558879Ssteve.reinhardt@amd.com 1568879Ssteve.reinhardt@amd.comenv = Environment(ENV = os.environ, # inherit user's environment vars 1578879Ssteve.reinhardt@amd.com ROOT = ROOT, 1588120Sgblack@eecs.umich.edu SRCDIR = SRCDIR, 1598120Sgblack@eecs.umich.edu EXT_SRCDIR = EXT_SRCDIR) 1608120Sgblack@eecs.umich.edu 1618120Sgblack@eecs.umich.eduenv.SConsignFile("sconsign") 1628120Sgblack@eecs.umich.edu 1638120Sgblack@eecs.umich.edu# I waffle on this setting... it does avoid a few painful but 1648120Sgblack@eecs.umich.edu# unnecessary builds, but it also seems to make trivial builds take 1658120Sgblack@eecs.umich.edu# noticeably longer. 1668120Sgblack@eecs.umich.eduif False: 1678120Sgblack@eecs.umich.edu env.TargetSignatures('content') 1688120Sgblack@eecs.umich.edu 1698120Sgblack@eecs.umich.edu# M5_EXT is used by isa_parser.py to find the PLY package. 1708120Sgblack@eecs.umich.eduenv.Append(ENV = { 'M5_EXT' : EXT_SRCDIR }) 1718120Sgblack@eecs.umich.edu 1728879Ssteve.reinhardt@amd.com# Set up default C++ compiler flags 1738879Ssteve.reinhardt@amd.comenv.Append(CCFLAGS='-pipe') 1748879Ssteve.reinhardt@amd.comenv.Append(CCFLAGS='-fno-strict-aliasing') 1758879Ssteve.reinhardt@amd.comenv.Append(CCFLAGS=Split('-Wall -Wno-sign-compare -Werror -Wundef')) 17610458Sandreas.hansson@arm.comif sys.platform == 'cygwin': 17710458Sandreas.hansson@arm.com # cygwin has some header file issues... 17810458Sandreas.hansson@arm.com env.Append(CCFLAGS=Split("-Wno-uninitialized")) 1798879Ssteve.reinhardt@amd.comenv.Append(CPPPATH=[os.path.join(EXT_SRCDIR + '/dnet')]) 1808879Ssteve.reinhardt@amd.com 1818879Ssteve.reinhardt@amd.com# Default libraries 1828879Ssteve.reinhardt@amd.comenv.Append(LIBS=['z']) 1839227Sandreas.hansson@arm.com 1849227Sandreas.hansson@arm.com# Platform-specific configuration 1858879Ssteve.reinhardt@amd.comconf = Configure(env) 1868879Ssteve.reinhardt@amd.com 1878879Ssteve.reinhardt@amd.com# Check for <fenv.h> (C99 FP environment control) 1888879Ssteve.reinhardt@amd.comhave_fenv = conf.CheckHeader('fenv.h', '<>') 18910453SAndrew.Bardsley@arm.comif not have_fenv: 19010453SAndrew.Bardsley@arm.com print "Warning: Header file <fenv.h> not found." 19110453SAndrew.Bardsley@arm.com print " This host has no IEEE FP rounding mode control." 19210456SCurtis.Dunham@arm.com 19310456SCurtis.Dunham@arm.com# Check for mysql. 19410456SCurtis.Dunham@arm.commysql_config = WhereIs('mysql_config') 19510457Sandreas.hansson@arm.comhave_mysql = mysql_config != None 19610457Sandreas.hansson@arm.com 19711342Sandreas.hansson@arm.com# Check MySQL version. 19811342Sandreas.hansson@arm.comif have_mysql: 1998120Sgblack@eecs.umich.edu mysql_version = os.popen(mysql_config + ' --version').read() 2008947Sandreas.hansson@arm.com mysql_version = mysql_version.split('.') 2017816Ssteve.reinhardt@amd.com mysql_major = int(mysql_version[0]) 2025871Snate@binkert.org mysql_minor = int(mysql_version[1]) 2035871Snate@binkert.org # This version check is probably overly conservative, but it deals 2046121Snate@binkert.org # with the versions we have installed. 2055871Snate@binkert.org if mysql_major < 3 or \ 2065871Snate@binkert.org mysql_major == 3 and mysql_minor < 23 or \ 2079926Sstan.czerniawski@arm.com mysql_major == 4 and mysql_minor < 1: 2089926Sstan.czerniawski@arm.com print "Warning: MySQL v3.23 or v4.1 or newer required." 2099119Sandreas.hansson@arm.com have_mysql = False 21010068Sandreas.hansson@arm.com 21110068Sandreas.hansson@arm.com# Set up mysql_config commands. 212955SN/Aif have_mysql: 2139416SAndreas.Sandberg@ARM.com mysql_config_include = mysql_config + ' --include' 21411342Sandreas.hansson@arm.com if os.system(mysql_config_include + ' > /dev/null') != 0: 21511212Sjoseph.gross@amd.com # older mysql_config versions don't support --include, use 21611212Sjoseph.gross@amd.com # --cflags instead 21711212Sjoseph.gross@amd.com mysql_config_include = mysql_config + ' --cflags | sed s/\\\'//g' 21811212Sjoseph.gross@amd.com # This seems to work in all versions 21911212Sjoseph.gross@amd.com mysql_config_libs = mysql_config + ' --libs' 2209416SAndreas.Sandberg@ARM.com 2219416SAndreas.Sandberg@ARM.comenv = conf.Finish() 2225871Snate@binkert.org 22310584Sandreas.hansson@arm.com# Sticky options get saved in the options file so they persist from 2249416SAndreas.Sandberg@ARM.com# one invocation to the next (unless overridden, in which case the new 2259416SAndreas.Sandberg@ARM.com# value becomes sticky). 2265871Snate@binkert.orgsticky_opts = Options(args=ARGUMENTS) 227955SN/Asticky_opts.AddOptions( 22810671Sandreas.hansson@arm.com EnumOption('TARGET_ISA', 'Target ISA', 'alpha', ('alpha')), 22910671Sandreas.hansson@arm.com BoolOption('FULL_SYSTEM', 'Full-system support', False), 23010671Sandreas.hansson@arm.com BoolOption('ALPHA_TLASER', 23110671Sandreas.hansson@arm.com 'Model Alpha TurboLaser platform (vs. Tsunami)', False), 2328881Smarc.orr@gmail.com BoolOption('NO_FAST_ALLOC', 'Disable fast object allocator', False), 2336121Snate@binkert.org BoolOption('EFENCE', 'Link with Electric Fence malloc debugger', 2346121Snate@binkert.org False), 2351533SN/A BoolOption('SS_COMPATIBLE_FP', 2369239Sandreas.hansson@arm.com 'Make floating-point results compatible with SimpleScalar', 2379239Sandreas.hansson@arm.com False), 2389239Sandreas.hansson@arm.com BoolOption('STATS_BINNING', 'Bin statistics by CPU mode', have_mysql), 2399239Sandreas.hansson@arm.com BoolOption('USE_MYSQL', 'Use MySQL for stats output', have_mysql), 2409239Sandreas.hansson@arm.com BoolOption('USE_FENV', 'Use <fenv.h> IEEE mode control', have_fenv), 2419239Sandreas.hansson@arm.com ('CC', 'C compiler', os.environ.get('CC', env['CC'])), 2429239Sandreas.hansson@arm.com ('CXX', 'C++ compiler', os.environ.get('CXX', env['CXX'])) 2439239Sandreas.hansson@arm.com ) 2449239Sandreas.hansson@arm.com 2459239Sandreas.hansson@arm.com# Non-sticky options only apply to the current build. 2469239Sandreas.hansson@arm.comnonsticky_opts = Options(args=ARGUMENTS) 2479239Sandreas.hansson@arm.comnonsticky_opts.AddOptions( 2486655Snate@binkert.org BoolOption('update_ref', 'Update test reference outputs', False) 2496655Snate@binkert.org ) 2506655Snate@binkert.org 2516655Snate@binkert.org# These options get exported to #defines in config/*.hh (see m5/SConscript). 2525871Snate@binkert.orgenv.ExportOptions = ['FULL_SYSTEM', 'ALPHA_TLASER', 'USE_FENV', \ 2535871Snate@binkert.org 'USE_MYSQL', 'NO_FAST_ALLOC', 'SS_COMPATIBLE_FP', \ 2545863Snate@binkert.org 'STATS_BINNING'] 2555871Snate@binkert.org 2568878Ssteve.reinhardt@amd.com# Define a handy 'no-op' action 2575871Snate@binkert.orgdef no_action(target, source, env): 2585871Snate@binkert.org return 0 2595871Snate@binkert.org 2605863Snate@binkert.orgenv.NoAction = Action(no_action, None) 2616121Snate@binkert.org 2625863Snate@binkert.org# libelf build is described in its own SConscript file. 2635871Snate@binkert.org# SConscript-global is the build in build/libelf shared among all 2648336Ssteve.reinhardt@amd.com# configs. 2658336Ssteve.reinhardt@amd.comenv.SConscript('m5/libelf/SConscript-global', exports = 'env') 2668336Ssteve.reinhardt@amd.com 2678336Ssteve.reinhardt@amd.com################################################### 2684678Snate@binkert.org# 2698336Ssteve.reinhardt@amd.com# Define a SCons builder for configuration flag headers. 2708336Ssteve.reinhardt@amd.com# 2718336Ssteve.reinhardt@amd.com################################################### 2724678Snate@binkert.org 2734678Snate@binkert.org# This function generates a config header file that #defines the 2744678Snate@binkert.org# option symbol to the current option setting (0 or 1). The source 2754678Snate@binkert.org# operands are the name of the option and a Value node containing the 2767827Snate@binkert.org# value of the option. 2777827Snate@binkert.orgdef build_config_file(target, source, env): 2788336Ssteve.reinhardt@amd.com (option, value) = [s.get_contents() for s in source] 2794678Snate@binkert.org f = file(str(target[0]), 'w') 2808336Ssteve.reinhardt@amd.com print >> f, '#define', option, value 2818336Ssteve.reinhardt@amd.com f.close() 2828336Ssteve.reinhardt@amd.com return None 2838336Ssteve.reinhardt@amd.com 2848336Ssteve.reinhardt@amd.com# Generate the message to be printed when building the config file. 2858336Ssteve.reinhardt@amd.comdef build_config_file_string(target, source, env): 2865871Snate@binkert.org (option, value) = [s.get_contents() for s in source] 2875871Snate@binkert.org return "Defining %s as %s in %s." % (option, value, target[0]) 2888336Ssteve.reinhardt@amd.com 2898336Ssteve.reinhardt@amd.com# Combine the two functions into a scons Action object. 2908336Ssteve.reinhardt@amd.comconfig_action = Action(build_config_file, build_config_file_string) 2918336Ssteve.reinhardt@amd.com 2928336Ssteve.reinhardt@amd.com# The emitter munges the source & target node lists to reflect what 2935871Snate@binkert.org# we're really doing. 2948336Ssteve.reinhardt@amd.comdef config_emitter(target, source, env): 2958336Ssteve.reinhardt@amd.com # extract option name from Builder arg 2968336Ssteve.reinhardt@amd.com option = str(target[0]) 2978336Ssteve.reinhardt@amd.com # True target is config header file 2988336Ssteve.reinhardt@amd.com target = os.path.join('config', option.lower() + '.hh') 2994678Snate@binkert.org # Force value to 0/1 even if it's a Python bool 3005871Snate@binkert.org val = int(eval(str(env[option]))) 3014678Snate@binkert.org # Sources are option name & value (packaged in SCons Value nodes) 3028336Ssteve.reinhardt@amd.com return ([target], [Value(option), Value(val)]) 3038336Ssteve.reinhardt@amd.com 3048336Ssteve.reinhardt@amd.comconfig_builder = Builder(emitter = config_emitter, action = config_action) 3058336Ssteve.reinhardt@amd.com 3068336Ssteve.reinhardt@amd.comenv.Append(BUILDERS = { 'ConfigFile' : config_builder }) 3078336Ssteve.reinhardt@amd.com 3088336Ssteve.reinhardt@amd.com################################################### 3098336Ssteve.reinhardt@amd.com# 3108336Ssteve.reinhardt@amd.com# Define build environments for selected configurations. 3118336Ssteve.reinhardt@amd.com# 3128336Ssteve.reinhardt@amd.com################################################### 3138336Ssteve.reinhardt@amd.com 3148336Ssteve.reinhardt@amd.com# rename base env 3158336Ssteve.reinhardt@amd.combase_env = env 3168336Ssteve.reinhardt@amd.com 3178336Ssteve.reinhardt@amd.comfor build_dir in build_dirs: 3188336Ssteve.reinhardt@amd.com # Make a copy of the default environment to use for this config. 3195871Snate@binkert.org env = base_env.Copy() 3206121Snate@binkert.org # Set env according to the build directory config. 321955SN/A options_file = os.path.join('build_options', build_dir) 322955SN/A if os.path.isfile(options_file): 3232632Sstever@eecs.umich.edu sticky_opts.files = [options_file] 3242632Sstever@eecs.umich.edu else: 325955SN/A print "Options file %s not found, using defaults." % options_file 326955SN/A 327955SN/A sticky_opts.Update(env) 328955SN/A nonsticky_opts.Update(env) 3298878Ssteve.reinhardt@amd.com 330955SN/A # Process option settings. 3312632Sstever@eecs.umich.edu 3322632Sstever@eecs.umich.edu if not have_fenv and env['USE_FENV']: 3332632Sstever@eecs.umich.edu print "Warning: <fenv.h> not available; " \ 3342632Sstever@eecs.umich.edu "forcing USE_FENV to False in", build_dir + "." 3352632Sstever@eecs.umich.edu env['USE_FENV'] = False 3362632Sstever@eecs.umich.edu 3372632Sstever@eecs.umich.edu if not env['USE_FENV']: 3388268Ssteve.reinhardt@amd.com print "Warning: No IEEE FP rounding mode control in", build_dir + "." 3398268Ssteve.reinhardt@amd.com print " FP results may deviate slightly", \ 3408268Ssteve.reinhardt@amd.com "and some regression tests may fail." 3418268Ssteve.reinhardt@amd.com 3428268Ssteve.reinhardt@amd.com if env['EFENCE']: 3438268Ssteve.reinhardt@amd.com env.Append(LIBS=['efence']) 3448268Ssteve.reinhardt@amd.com 3452632Sstever@eecs.umich.edu if env['USE_MYSQL']: 3462632Sstever@eecs.umich.edu if not have_mysql: 3472632Sstever@eecs.umich.edu print "Warning: MySQL not available; " \ 3482632Sstever@eecs.umich.edu "forcing USE_MYSQL to False in", build_dir + "." 3498268Ssteve.reinhardt@amd.com env['USE_MYSQL'] = False 3502632Sstever@eecs.umich.edu else: 3518268Ssteve.reinhardt@amd.com print "Compiling in", build_dir, "with MySQL support." 3528268Ssteve.reinhardt@amd.com env.ParseConfig(mysql_config_libs) 3538268Ssteve.reinhardt@amd.com env.ParseConfig(mysql_config_include) 3548268Ssteve.reinhardt@amd.com 3553718Sstever@eecs.umich.edu # Save sticky option settings back to file 3562634Sstever@eecs.umich.edu sticky_opts.Save(options_file, env) 3572634Sstever@eecs.umich.edu 3585863Snate@binkert.org # The m5/SConscript file sets up the build rules in 'env' according 3592638Sstever@eecs.umich.edu # to the configured options. It returns a list of environments, 3608268Ssteve.reinhardt@amd.com # one for each variant build (debug, opt, etc.) 3612632Sstever@eecs.umich.edu envList = SConscript('m5/SConscript', build_dir = build_dir, 3622632Sstever@eecs.umich.edu exports = 'env', duplicate = False) 3632632Sstever@eecs.umich.edu 3642632Sstever@eecs.umich.edu # Set up the regression tests for each build. 3652632Sstever@eecs.umich.edu for e in envList: 3661858SN/A SConscript('m5-test/SConscript', 3673716Sstever@eecs.umich.edu build_dir = os.path.join(build_dir, 'test', e.Label), 3682638Sstever@eecs.umich.edu exports = { 'env' : e }, duplicate = False) 3692638Sstever@eecs.umich.edu 3702638Sstever@eecs.umich.edu################################################### 3712638Sstever@eecs.umich.edu# 3722638Sstever@eecs.umich.edu# Let SCons do its thing. At this point SCons will use the defined 3732638Sstever@eecs.umich.edu# build environments to build the requested targets. 3742638Sstever@eecs.umich.edu# 3755863Snate@binkert.org################################################### 3765863Snate@binkert.org 3775863Snate@binkert.org