SConstruct revision 2623
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. 282665Ssaidi@eecs.umich.edu 292665Ssaidi@eecs.umich.edu################################################### 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). 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. 372632Sstever@eecs.umich.edu# 382632Sstever@eecs.umich.edu# Then type 'scons' to build the default configuration (see below), or 39955SN/A# '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# 422761Sstever@eecs.umich.edu################################################### 432632Sstever@eecs.umich.edu 442632Sstever@eecs.umich.edu# Python library imports 452632Sstever@eecs.umich.eduimport sys 462761Sstever@eecs.umich.eduimport os 472761Sstever@eecs.umich.edu 482761Sstever@eecs.umich.edu# Check for recent-enough Python and SCons versions 492632Sstever@eecs.umich.eduEnsurePythonVersion(2,3) 502632Sstever@eecs.umich.eduEnsureSConsVersion(0,96) 512761Sstever@eecs.umich.edu 522761Sstever@eecs.umich.edu# The absolute path to the current directory (where this file lives). 532761Sstever@eecs.umich.eduROOT = Dir('.').abspath 542761Sstever@eecs.umich.edu 552761Sstever@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') 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): 612632Sstever@eecs.umich.edu print "Error: '%s' must be a link to the M5 source tree." % SRCDIR 622632Sstever@eecs.umich.edu Exit(1) 63955SN/A 64955SN/Aif not os.path.isdir('ext'): 65955SN/A print "Error: '%s' must be a link to the M5 external source tree." \ 66955SN/A % EXT_SRCDIR 67955SN/A Exit(1) 68955SN/A 69955SN/A# tell python where to find m5 python code 702656Sstever@eecs.umich.edusys.path.append(os.path.join(SRCDIR, 'python')) 712656Sstever@eecs.umich.edu 722656Sstever@eecs.umich.edu################################################### 732656Sstever@eecs.umich.edu# 742656Sstever@eecs.umich.edu# Figure out which configurations to set up. 752656Sstever@eecs.umich.edu# 762656Sstever@eecs.umich.edu# 772653Sstever@eecs.umich.edu# It's prohibitive to do all the combinations of base configurations 782653Sstever@eecs.umich.edu# and options, so we have to infer which ones the user wants. 792653Sstever@eecs.umich.edu# 802653Sstever@eecs.umich.edu# 1. If there are command-line targets, the configuration(s) are inferred 812653Sstever@eecs.umich.edu# from the directories of those targets. If scons was invoked from a 822653Sstever@eecs.umich.edu# subdirectory (using 'scons -u'), those targets have to be 832653Sstever@eecs.umich.edu# interpreted relative to that subdirectory. 842653Sstever@eecs.umich.edu# 852653Sstever@eecs.umich.edu# 2. If there are no command-line targets, and scons was invoked from a 862653Sstever@eecs.umich.edu# subdirectory (using 'scons -u'), the configuration is inferred from 872653Sstever@eecs.umich.edu# the name of the subdirectory. 881852SN/A# 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 91955SN/A# 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# 94955SN/A# In cases 2 & 3, the specific file target defaults to 'm5.debug', but 951533SN/A# this can be overridden by setting the M5_DEFAULT_BINARY shell 962632Sstever@eecs.umich.edu# environment veriable. 971533SN/A# 98955SN/A################################################### 99955SN/A 1002632Sstever@eecs.umich.edu# Find default configuration & binary. 1012632Sstever@eecs.umich.edudefault_config = os.environ.get('M5_DEFAULT_CONFIG', 'ALPHA_SE') 102955SN/Adefault_binary = os.environ.get('M5_DEFAULT_BINARY', 'm5.debug') 103955SN/A 104955SN/A# Ask SCons which directory it was invoked from. If you invoke SCons 105955SN/A# from a subdirectory you must use the '-u' flag. 1062632Sstever@eecs.umich.edulaunch_dir = GetLaunchDir() 107955SN/A 1082632Sstever@eecs.umich.edu# Build a list 'my_targets' of all the targets relative to ROOT. 109955SN/Aif launch_dir == ROOT: 110955SN/A # invoked from root build dir 1112632Sstever@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] 1182632Sstever@eecs.umich.edu Default(target) 1192632Sstever@eecs.umich.eduelse: 1202632Sstever@eecs.umich.edu # invoked from subdirectory 1212632Sstever@eecs.umich.edu if not launch_dir.startswith(ROOT): 1222632Sstever@eecs.umich.edu print "Error: launch dir (%s) not a subdirectory of ROOT (%s)!" \ 1232632Sstever@eecs.umich.edu (launch_dir, ROOT) 1242632Sstever@eecs.umich.edu Exit(1) 1252632Sstever@eecs.umich.edu # make launch_dir relative to ROOT (strip ROOT plus slash off front) 1262632Sstever@eecs.umich.edu launch_dir = launch_dir[len(ROOT)+1:] 1272632Sstever@eecs.umich.edu if len(COMMAND_LINE_TARGETS) != 0: 1282634Sstever@eecs.umich.edu # make specified targets relative to ROOT 1292634Sstever@eecs.umich.edu my_targets = map(lambda x: os.path.join(launch_dir, x), 1302632Sstever@eecs.umich.edu COMMAND_LINE_TARGETS) 1312638Sstever@eecs.umich.edu else: 1322632Sstever@eecs.umich.edu # build default binary (m5.debug, unless overridden) using the 1332632Sstever@eecs.umich.edu # config inferred by the invocation directory (the first 1342632Sstever@eecs.umich.edu # subdirectory after ROOT) 1352632Sstever@eecs.umich.edu target = os.path.join(launch_dir.split('/')[0], default_binary) 1362632Sstever@eecs.umich.edu my_targets = [target] 1372632Sstever@eecs.umich.edu Default(target) 1381858SN/A 1392638Sstever@eecs.umich.edu# Normalize target paths (gets rid of '..' in the middle, etc.) 1402638Sstever@eecs.umich.edumy_targets = map(os.path.normpath, my_targets) 1412638Sstever@eecs.umich.edu 1422638Sstever@eecs.umich.edu# Generate a list of the unique configs that the collected targets reference. 1432638Sstever@eecs.umich.edubuild_dirs = [] 1442638Sstever@eecs.umich.edufor t in my_targets: 1452638Sstever@eecs.umich.edu dir = t.split('/')[0] 1462638Sstever@eecs.umich.edu if dir not in build_dirs: 1472634Sstever@eecs.umich.edu build_dirs.append(dir) 1482634Sstever@eecs.umich.edu 1492634Sstever@eecs.umich.edu################################################### 150955SN/A# 151955SN/A# Set up the default build environment. This environment is copied 152955SN/A# and modified according to each selected configuration. 153955SN/A# 154955SN/A################################################### 155955SN/A 156955SN/Aenv = Environment(ENV = os.environ, # inherit user's environment vars 157955SN/A ROOT = ROOT, 1581858SN/A SRCDIR = SRCDIR, 1591858SN/A EXT_SRCDIR = EXT_SRCDIR) 1602632Sstever@eecs.umich.edu 161955SN/Aenv.SConsignFile("sconsign") 1622776Sstever@eecs.umich.edu 1631105SN/A# I waffle on this setting... it does avoid a few painful but 1642667Sstever@eecs.umich.edu# unnecessary builds, but it also seems to make trivial builds take 1652667Sstever@eecs.umich.edu# noticeably longer. 1662667Sstever@eecs.umich.eduif False: 1672667Sstever@eecs.umich.edu env.TargetSignatures('content') 1682667Sstever@eecs.umich.edu 1692667Sstever@eecs.umich.edu# M5_EXT is used by isa_parser.py to find the PLY package. 1701869SN/Aenv.Append(ENV = { 'M5_EXT' : EXT_SRCDIR }) 1711869SN/A 1721869SN/A# Set up default C++ compiler flags 1731869SN/Aenv.Append(CCFLAGS='-pipe') 1741869SN/Aenv.Append(CCFLAGS='-fno-strict-aliasing') 1751065SN/Aenv.Append(CCFLAGS=Split('-Wall -Wno-sign-compare -Werror -Wundef')) 1762632Sstever@eecs.umich.eduif sys.platform == 'cygwin': 1772632Sstever@eecs.umich.edu # cygwin has some header file issues... 178955SN/A env.Append(CCFLAGS=Split("-Wno-uninitialized")) 1791858SN/Aenv.Append(CPPPATH=[os.path.join(EXT_SRCDIR + '/dnet')]) 1801858SN/A 1811858SN/A# Default libraries 1821858SN/Aenv.Append(LIBS=['z']) 1831851SN/A 1841851SN/A# Platform-specific configuration 1851858SN/Aconf = Configure(env) 1862632Sstever@eecs.umich.edu 187955SN/A# Check for <fenv.h> (C99 FP environment control) 1882656Sstever@eecs.umich.eduhave_fenv = conf.CheckHeader('fenv.h', '<>') 1892656Sstever@eecs.umich.eduif not have_fenv: 1902656Sstever@eecs.umich.edu print "Warning: Header file <fenv.h> not found." 1912656Sstever@eecs.umich.edu print " This host has no IEEE FP rounding mode control." 1922656Sstever@eecs.umich.edu 1932656Sstever@eecs.umich.edu# Check for mysql. 1942656Sstever@eecs.umich.edumysql_config = WhereIs('mysql_config') 1952656Sstever@eecs.umich.eduhave_mysql = mysql_config != None 1962656Sstever@eecs.umich.edu 1972656Sstever@eecs.umich.edu# Check MySQL version. 1982656Sstever@eecs.umich.eduif have_mysql: 1992656Sstever@eecs.umich.edu mysql_version = os.popen(mysql_config + ' --version').read() 2002656Sstever@eecs.umich.edu mysql_version = mysql_version.split('.') 2012656Sstever@eecs.umich.edu mysql_major = int(mysql_version[0]) 2022656Sstever@eecs.umich.edu mysql_minor = int(mysql_version[1]) 2032656Sstever@eecs.umich.edu # This version check is probably overly conservative, but it deals 2042655Sstever@eecs.umich.edu # with the versions we have installed. 2052667Sstever@eecs.umich.edu if mysql_major < 4 or (mysql_major == 4 and mysql_minor < 1): 2062667Sstever@eecs.umich.edu print "Warning: MySQL v4.1 or newer required." 2072667Sstever@eecs.umich.edu have_mysql = False 2082667Sstever@eecs.umich.edu 2092667Sstever@eecs.umich.edu# Set up mysql_config commands. 2102667Sstever@eecs.umich.eduif have_mysql: 2112667Sstever@eecs.umich.edu mysql_config_include = mysql_config + ' --include' 2122667Sstever@eecs.umich.edu if os.system(mysql_config_include + ' > /dev/null') != 0: 2132667Sstever@eecs.umich.edu # older mysql_config versions don't support --include, use 2142667Sstever@eecs.umich.edu # --cflags instead 2152667Sstever@eecs.umich.edu mysql_config_include = mysql_config + ' --cflags | sed s/\\\'//g' 2162667Sstever@eecs.umich.edu # This seems to work in all versions 2172667Sstever@eecs.umich.edu mysql_config_libs = mysql_config + ' --libs' 2182655Sstever@eecs.umich.edu 2191858SN/Aenv = conf.Finish() 2201858SN/A 2212638Sstever@eecs.umich.edu# Define the universe of supported ISAs 2222638Sstever@eecs.umich.eduenv['ALL_ISA_LIST'] = ['alpha', 'sparc', 'mips'] 2232638Sstever@eecs.umich.edu 2242638Sstever@eecs.umich.edu# Define the universe of supported CPU models 2252638Sstever@eecs.umich.eduenv['ALL_CPU_LIST'] = ['AtomicSimpleCPU', 'TimingSimpleCPU', 2261858SN/A 'FastCPU', 'FullCPU', 'AlphaFullCPU'] 2271858SN/A 2281858SN/A# Sticky options get saved in the options file so they persist from 2291858SN/A# one invocation to the next (unless overridden, in which case the new 2301858SN/A# value becomes sticky). 2311858SN/Asticky_opts = Options(args=ARGUMENTS) 2321858SN/Asticky_opts.AddOptions( 2331859SN/A EnumOption('TARGET_ISA', 'Target ISA', 'alpha', env['ALL_ISA_LIST']), 2341858SN/A BoolOption('FULL_SYSTEM', 'Full-system support', False), 2351858SN/A # There's a bug in scons 0.96.1 that causes ListOptions with list 2361858SN/A # values (more than one value) not to be able to be restored from 2371859SN/A # a saved option file. If this causes trouble then upgrade to 2381859SN/A # scons 0.96.90 or later. 2391862SN/A ListOption('CPU_MODELS', 'CPU models', 'all', env['ALL_CPU_LIST']), 2401862SN/A BoolOption('ALPHA_TLASER', 2411862SN/A 'Model Alpha TurboLaser platform (vs. Tsunami)', False), 2421862SN/A BoolOption('NO_FAST_ALLOC', 'Disable fast object allocator', False), 2431859SN/A BoolOption('EFENCE', 'Link with Electric Fence malloc debugger', 2441859SN/A False), 2451963SN/A BoolOption('SS_COMPATIBLE_FP', 2461963SN/A 'Make floating-point results compatible with SimpleScalar', 2471859SN/A False), 2481859SN/A BoolOption('USE_SSE2', 2491859SN/A 'Compile for SSE2 (-msse2) to get IEEE FP on x86 hosts', 2501859SN/A False), 2511859SN/A BoolOption('STATS_BINNING', 'Bin statistics by CPU mode', have_mysql), 2521859SN/A BoolOption('USE_MYSQL', 'Use MySQL for stats output', have_mysql), 2531859SN/A BoolOption('USE_FENV', 'Use <fenv.h> IEEE mode control', have_fenv), 2541859SN/A ('CC', 'C compiler', os.environ.get('CC', env['CC'])), 2551862SN/A ('CXX', 'C++ compiler', os.environ.get('CXX', env['CXX'])), 2561859SN/A BoolOption('BATCH', 'Use batch pool for build and tests', False), 2571859SN/A ('BATCH_CMD', 'Batch pool submission command name', 'qdo') 2581859SN/A ) 2591858SN/A 2601858SN/A# Non-sticky options only apply to the current build. 2612139SN/Anonsticky_opts = Options(args=ARGUMENTS) 2622139SN/Anonsticky_opts.AddOptions( 2632139SN/A BoolOption('update_ref', 'Update test reference outputs', False) 2642155SN/A ) 2652623SN/A 2662817Sksewell@umich.edu# These options get exported to #defines in config/*.hh (see m5/SConscript). 2672792Sktlim@umich.eduenv.ExportOptions = ['FULL_SYSTEM', 'ALPHA_TLASER', 'USE_FENV', \ 2682155SN/A 'USE_MYSQL', 'NO_FAST_ALLOC', 'SS_COMPATIBLE_FP', \ 2691869SN/A 'STATS_BINNING'] 2701869SN/A 2711869SN/A# Define a handy 'no-op' action 2721869SN/Adef no_action(target, source, env): 2731869SN/A return 0 2742139SN/A 2751869SN/Aenv.NoAction = Action(no_action, None) 2762508SN/A 2772508SN/A# libelf build is described in its own SConscript file. 2782508SN/A# SConscript-global is the build in build/libelf shared among all 2792508SN/A# configs. 2802635Sstever@eecs.umich.eduenv.SConscript('m5/libelf/SConscript-global', exports = 'env') 2812635Sstever@eecs.umich.edu 2821869SN/A################################################### 2831869SN/A# 2841869SN/A# Define a SCons builder for configuration flag headers. 2851869SN/A# 2861869SN/A################################################### 2871869SN/A 2881869SN/A# This function generates a config header file that #defines the 2891869SN/A# option symbol to the current option setting (0 or 1). The source 2901965SN/A# operands are the name of the option and a Value node containing the 2911965SN/A# value of the option. 2921965SN/Adef build_config_file(target, source, env): 2931869SN/A (option, value) = [s.get_contents() for s in source] 2941869SN/A f = file(str(target[0]), 'w') 2952733Sktlim@umich.edu print >> f, '#define', option, value 2961869SN/A f.close() 2971884SN/A return None 2981884SN/A 2991884SN/A# Generate the message to be printed when building the config file. 3001869SN/Adef build_config_file_string(target, source, env): 3011858SN/A (option, value) = [s.get_contents() for s in source] 3021869SN/A return "Defining %s as %s in %s." % (option, value, target[0]) 3031869SN/A 3041869SN/A# Combine the two functions into a scons Action object. 3051869SN/Aconfig_action = Action(build_config_file, build_config_file_string) 3061869SN/A 3071858SN/A# The emitter munges the source & target node lists to reflect what 3082761Sstever@eecs.umich.edu# we're really doing. 3091869SN/Adef config_emitter(target, source, env): 3102733Sktlim@umich.edu # extract option name from Builder arg 3112733Sktlim@umich.edu option = str(target[0]) 3121869SN/A # True target is config header file 3131869SN/A target = os.path.join('config', option.lower() + '.hh') 3141869SN/A # Force value to 0/1 even if it's a Python bool 3151869SN/A val = int(eval(str(env[option]))) 3161869SN/A # Sources are option name & value (packaged in SCons Value nodes) 3171869SN/A return ([target], [Value(option), Value(val)]) 3181858SN/A 319955SN/Aconfig_builder = Builder(emitter = config_emitter, action = config_action) 320955SN/A 3211869SN/Aenv.Append(BUILDERS = { 'ConfigFile' : config_builder }) 3221869SN/A 3231869SN/A################################################### 3241869SN/A# 3251869SN/A# Define build environments for selected configurations. 3261869SN/A# 3271869SN/A################################################### 3281869SN/A 3291869SN/A# rename base env 3301869SN/Abase_env = env 3311869SN/A 3321869SN/Ahelp_text = ''' 3331869SN/AUsage: scons [scons options] [build options] [target(s)] 3341869SN/A 3351869SN/A''' 3361869SN/A 3371869SN/Afor build_dir in build_dirs: 3381869SN/A # Make a copy of the default environment to use for this config. 3391869SN/A env = base_env.Copy() 3401869SN/A 3411869SN/A # Record what build_dir was in the environment 3421869SN/A env.Append(BUILD_DIR=build_dir); 3431869SN/A 3441869SN/A # Set env according to the build directory config. 3451869SN/A 3461869SN/A sticky_opts.files = [] 3471869SN/A # Name of default options file is taken from 'default=' on command 3481869SN/A # line if set, otherwise name of build dir. 3491869SN/A default_options_file = os.path.join('default_options', 3501869SN/A ARGUMENTS.get('default', build_dir)) 3511869SN/A if os.path.isfile(default_options_file): 3521869SN/A sticky_opts.files.append(default_options_file) 3531869SN/A current_options_file = os.path.join('options', build_dir) 3541869SN/A if os.path.isfile(current_options_file): 3551869SN/A sticky_opts.files.append(current_options_file) 3561869SN/A else: 3571869SN/A # if file doesn't exist, make sure at least the directory is there 3581869SN/A # so we can create it later 3591869SN/A opt_dir = os.path.dirname(current_options_file) 3602655Sstever@eecs.umich.edu if not os.path.isdir(opt_dir): 3612655Sstever@eecs.umich.edu os.mkdir(opt_dir) 3622655Sstever@eecs.umich.edu if not sticky_opts.files: 3632655Sstever@eecs.umich.edu print "%s: No options file found in options, using defaults." \ 3642655Sstever@eecs.umich.edu % build_dir 3652655Sstever@eecs.umich.edu 3662655Sstever@eecs.umich.edu # Apply current option settings to env 3672655Sstever@eecs.umich.edu sticky_opts.Update(env) 3682655Sstever@eecs.umich.edu nonsticky_opts.Update(env) 3692655Sstever@eecs.umich.edu 3702655Sstever@eecs.umich.edu help_text += "Sticky options for %s:\n" % build_dir \ 3712655Sstever@eecs.umich.edu + sticky_opts.GenerateHelpText(env) \ 3722655Sstever@eecs.umich.edu + "\nNon-sticky options for %s:\n" % build_dir \ 3732655Sstever@eecs.umich.edu + nonsticky_opts.GenerateHelpText(env) 3742655Sstever@eecs.umich.edu 3752655Sstever@eecs.umich.edu # Process option settings. 3762655Sstever@eecs.umich.edu 3772655Sstever@eecs.umich.edu if not have_fenv and env['USE_FENV']: 3782655Sstever@eecs.umich.edu print "Warning: <fenv.h> not available; " \ 3792655Sstever@eecs.umich.edu "forcing USE_FENV to False in", build_dir + "." 3802655Sstever@eecs.umich.edu env['USE_FENV'] = False 3812655Sstever@eecs.umich.edu 3822655Sstever@eecs.umich.edu if not env['USE_FENV']: 3832655Sstever@eecs.umich.edu print "Warning: No IEEE FP rounding mode control in", build_dir + "." 3842655Sstever@eecs.umich.edu print " FP results may deviate slightly from other platforms." 3852655Sstever@eecs.umich.edu 3862634Sstever@eecs.umich.edu if env['EFENCE']: 3872634Sstever@eecs.umich.edu env.Append(LIBS=['efence']) 3882634Sstever@eecs.umich.edu 3892634Sstever@eecs.umich.edu if env['USE_MYSQL']: 3902634Sstever@eecs.umich.edu if not have_mysql: 3912634Sstever@eecs.umich.edu print "Warning: MySQL not available; " \ 3922638Sstever@eecs.umich.edu "forcing USE_MYSQL to False in", build_dir + "." 3932638Sstever@eecs.umich.edu env['USE_MYSQL'] = False 3942638Sstever@eecs.umich.edu else: 3952638Sstever@eecs.umich.edu print "Compiling in", build_dir, "with MySQL support." 3962638Sstever@eecs.umich.edu env.ParseConfig(mysql_config_libs) 3971869SN/A env.ParseConfig(mysql_config_include) 3981869SN/A 399955SN/A # Save sticky option settings back to current options file 400955SN/A sticky_opts.Save(current_options_file, env) 401955SN/A 402955SN/A # Do this after we save setting back, or else we'll tack on an 4031858SN/A # extra 'qdo' every time we run scons. 4041858SN/A if env['BATCH']: 4051858SN/A env['CC'] = env['BATCH_CMD'] + ' ' + env['CC'] 4062632Sstever@eecs.umich.edu env['CXX'] = env['BATCH_CMD'] + ' ' + env['CXX'] 4072632Sstever@eecs.umich.edu 4082632Sstever@eecs.umich.edu if env['USE_SSE2']: 4092632Sstever@eecs.umich.edu env.Append(CCFLAGS='-msse2') 4102632Sstever@eecs.umich.edu 4112634Sstever@eecs.umich.edu # The m5/SConscript file sets up the build rules in 'env' according 4122638Sstever@eecs.umich.edu # to the configured options. It returns a list of environments, 4132023SN/A # one for each variant build (debug, opt, etc.) 4142632Sstever@eecs.umich.edu envList = SConscript('m5/SConscript', build_dir = build_dir, 4152632Sstever@eecs.umich.edu exports = 'env', duplicate = False) 4162632Sstever@eecs.umich.edu 4172632Sstever@eecs.umich.edu # Set up the regression tests for each build. 4182632Sstever@eecs.umich.edu for e in envList: 4192632Sstever@eecs.umich.edu SConscript('m5-test/SConscript', 4202632Sstever@eecs.umich.edu build_dir = os.path.join(build_dir, 'test', e.Label), 4212632Sstever@eecs.umich.edu exports = { 'env' : e }, duplicate = False) 4222632Sstever@eecs.umich.edu 4232632Sstever@eecs.umich.eduHelp(help_text) 4242632Sstever@eecs.umich.edu 4252023SN/A################################################### 4262632Sstever@eecs.umich.edu# 4272632Sstever@eecs.umich.edu# Let SCons do its thing. At this point SCons will use the defined 4281889SN/A# build environments to build the requested targets. 4291889SN/A# 4302632Sstever@eecs.umich.edu################################################### 4312632Sstever@eecs.umich.edu 4322632Sstever@eecs.umich.edu