SConstruct revision 3717
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
9# notice, this list of conditions and the following disclaimer;
10# redistributions in binary form must reproduce the above copyright
11# notice, this list of conditions and the following disclaimer in the
12# documentation and/or other materials provided with the distribution;
13# neither the name of the copyright holders nor the names of its
14# contributors may be used to endorse or promote products derived from
15# this software without specific prior written permission.
16#
17# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
20# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
21# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
22# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28#
29# Authors: Steve Reinhardt
30
31###################################################
32#
33# SCons top-level build description (SConstruct) file.
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#
64###################################################
65
66# Python library imports
67import sys
68import os
69from os.path import join as joinpath
70
71# Check for recent-enough Python and SCons versions.  If your system's
72# default installation of Python is not recent enough, you can use a
73# non-default installation of the Python interpreter by either (1)
74# rearranging your PATH so that scons finds the non-default 'python'
75# first or (2) explicitly invoking an alternative interpreter on the
76# scons script, e.g., "/usr/local/bin/python2.4 `which scons` [args]".
77EnsurePythonVersion(2,4)
78
79# Ironically, SCons 0.96 dies if you give EnsureSconsVersion a
80# 3-element version number.
81min_scons_version = (0,96,91)
82try:
83    EnsureSConsVersion(*min_scons_version)
84except:
85    print "Error checking current SCons version."
86    print "SCons", ".".join(map(str,min_scons_version)), "or greater required."
87    Exit(2)
88    
89
90# The absolute path to the current directory (where this file lives).
91ROOT = Dir('.').abspath
92
93# Path to the M5 source tree.
94SRCDIR = joinpath(ROOT, 'src')
95
96# tell python where to find m5 python code
97sys.path.append(joinpath(ROOT, 'src/python'))
98
99###################################################
100#
101# Figure out which configurations to set up based on the path(s) of
102# the target(s).
103#
104###################################################
105
106# Find default configuration & binary.
107Default(os.environ.get('M5_DEFAULT_BINARY', 'build/ALPHA_SE/m5.debug'))
108
109# Ask SCons which directory it was invoked from.
110launch_dir = GetLaunchDir()
111
112# Make targets relative to invocation directory
113abs_targets = map(lambda x: os.path.normpath(joinpath(launch_dir, str(x))),
114                  BUILD_TARGETS)
115
116# helper function: find last occurrence of element in list
117def rfind(l, elt, offs = -1):
118    for i in range(len(l)+offs, 0, -1):
119        if l[i] == elt:
120            return i
121    raise ValueError, "element not found"
122
123# helper function: compare dotted version numbers.
124# E.g., compare_version('1.3.25', '1.4.1')
125# returns -1, 0, 1 if v1 is <, ==, > v2
126def compare_versions(v1, v2):
127    # Convert dotted strings to lists
128    v1 = map(int, v1.split('.'))
129    v2 = map(int, v2.split('.'))
130    # Compare corresponding elements of lists
131    for n1,n2 in zip(v1, v2):
132        if n1 < n2: return -1
133        if n1 > n2: return  1
134    # all corresponding values are equal... see if one has extra values
135    if len(v1) < len(v2): return -1
136    if len(v1) > len(v2): return  1
137    return 0
138
139# Each target must have 'build' in the interior of the path; the
140# directory below this will determine the build parameters.  For
141# example, for target 'foo/bar/build/ALPHA_SE/arch/alpha/blah.do' we
142# recognize that ALPHA_SE specifies the configuration because it
143# follow 'build' in the bulid path.
144
145# Generate a list of the unique build roots and configs that the
146# collected targets reference.
147build_paths = []
148build_root = None
149for t in abs_targets:
150    path_dirs = t.split('/')
151    try:
152        build_top = rfind(path_dirs, 'build', -2)
153    except:
154        print "Error: no non-leaf 'build' dir found on target path", t
155        Exit(1)
156    this_build_root = joinpath('/',*path_dirs[:build_top+1])
157    if not build_root:
158        build_root = this_build_root
159    else:
160        if this_build_root != build_root:
161            print "Error: build targets not under same build root\n"\
162                  "  %s\n  %s" % (build_root, this_build_root)
163            Exit(1)
164    build_path = joinpath('/',*path_dirs[:build_top+2])
165    if build_path not in build_paths:
166        build_paths.append(build_path)
167
168###################################################
169#
170# Set up the default build environment.  This environment is copied
171# and modified according to each selected configuration.
172#
173###################################################
174
175env = Environment(ENV = os.environ,  # inherit user's environment vars
176                  ROOT = ROOT,
177                  SRCDIR = SRCDIR)
178
179#Parse CC/CXX early so that we use the correct compiler for 
180# to test for dependencies/versions/libraries/includes
181if ARGUMENTS.get('CC', None):
182    env['CC'] = ARGUMENTS.get('CC')
183
184if ARGUMENTS.get('CXX', None):
185    env['CXX'] = ARGUMENTS.get('CXX')
186
187env.SConsignFile(joinpath(build_root,"sconsign"))
188
189# Default duplicate option is to use hard links, but this messes up
190# when you use emacs to edit a file in the target dir, as emacs moves
191# file to file~ then copies to file, breaking the link.  Symbolic
192# (soft) links work better.
193env.SetOption('duplicate', 'soft-copy')
194
195# I waffle on this setting... it does avoid a few painful but
196# unnecessary builds, but it also seems to make trivial builds take
197# noticeably longer.
198if False:
199    env.TargetSignatures('content')
200
201# M5_PLY is used by isa_parser.py to find the PLY package.
202env.Append(ENV = { 'M5_PLY' : Dir('ext/ply') })
203
204# Set up default C++ compiler flags
205env.Append(CCFLAGS='-pipe')
206env.Append(CCFLAGS='-fno-strict-aliasing')
207env.Append(CCFLAGS=Split('-Wall -Wno-sign-compare -Werror -Wundef'))
208if sys.platform == 'cygwin':
209    # cygwin has some header file issues...
210    env.Append(CCFLAGS=Split("-Wno-uninitialized"))
211env.Append(CPPPATH=[Dir('ext/dnet')])
212
213# Check for SWIG
214if not env.has_key('SWIG'):
215    print 'Error: SWIG utility not found.'
216    print '       Please install (see http://www.swig.org) and retry.'
217    Exit(1)
218
219# Check for appropriate SWIG version
220swig_version = os.popen('swig -version').read().split()
221# First 3 words should be "SWIG Version x.y.z"
222if swig_version[0] != 'SWIG' or swig_version[1] != 'Version':
223    print 'Error determining SWIG version.'
224    Exit(1)
225
226min_swig_version = '1.3.28'
227if compare_versions(swig_version[2], min_swig_version) < 0:
228    print 'Error: SWIG version', min_swig_version, 'or newer required.'
229    print '       Installed version:', swig_version[2]
230    Exit(1)
231
232# Set up SWIG flags & scanner
233env.Append(SWIGFLAGS=Split('-c++ -python -modern $_CPPINCFLAGS'))
234
235import SCons.Scanner
236
237swig_inc_re = '^[ \t]*[%,#][ \t]*(?:include|import)[ \t]*(<|")([^>"]+)(>|")'
238
239swig_scanner = SCons.Scanner.ClassicCPP("SwigScan", ".i", "CPPPATH",
240                                        swig_inc_re)
241
242env.Append(SCANNERS = swig_scanner)
243
244# Platform-specific configuration.  Note again that we assume that all
245# builds under a given build root run on the same host platform.
246conf = Configure(env,
247                 conf_dir = joinpath(build_root, '.scons_config'),
248                 log_file = joinpath(build_root, 'scons_config.log'))
249
250# Find Python include and library directories for embedding the
251# interpreter.  For consistency, we will use the same Python
252# installation used to run scons (and thus this script).  If you want
253# to link in an alternate version, see above for instructions on how
254# to invoke scons with a different copy of the Python interpreter.
255
256# Get brief Python version name (e.g., "python2.4") for locating
257# include & library files
258py_version_name = 'python' + sys.version[:3]
259
260# include path, e.g. /usr/local/include/python2.4
261py_header_path = joinpath(sys.exec_prefix, 'include', py_version_name)
262env.Append(CPPPATH = py_header_path)
263# verify that it works
264if not conf.CheckHeader('Python.h', '<>'):
265    print "Error: can't find Python.h header in", py_header_path
266    Exit(1)
267
268# add library path too if it's not in the default place
269py_lib_path = None
270if sys.exec_prefix != '/usr':
271    py_lib_path = joinpath(sys.exec_prefix, 'lib')
272elif sys.platform == 'cygwin':
273    # cygwin puts the .dll in /bin for some reason
274    py_lib_path = '/bin'
275if py_lib_path:
276    env.Append(LIBPATH = py_lib_path)
277    print 'Adding', py_lib_path, 'to LIBPATH for', py_version_name
278if not conf.CheckLib(py_version_name):
279    print "Error: can't find Python library", py_version_name
280    Exit(1)
281
282# On Solaris you need to use libsocket for socket ops
283if not conf.CheckLibWithHeader(None, 'sys/socket.h', 'C++', 'accept(0,0,0);'):
284   if not conf.CheckLibWithHeader('socket', 'sys/socket.h', 'C++', 'accept(0,0,0);'):
285       print "Can't find library with socket calls (e.g. accept())"
286       Exit(1)
287
288# Check for zlib.  If the check passes, libz will be automatically
289# added to the LIBS environment variable.
290if not conf.CheckLibWithHeader('z', 'zlib.h', 'C++'):
291    print 'Error: did not find needed zlib compression library '\
292          'and/or zlib.h header file.'
293    print '       Please install zlib and try again.'
294    Exit(1)
295
296# Check for <fenv.h> (C99 FP environment control)
297have_fenv = conf.CheckHeader('fenv.h', '<>')
298if not have_fenv:
299    print "Warning: Header file <fenv.h> not found."
300    print "         This host has no IEEE FP rounding mode control."
301
302# Check for mysql.
303mysql_config = WhereIs('mysql_config')
304have_mysql = mysql_config != None
305
306# Check MySQL version.
307if have_mysql:
308    mysql_version = os.popen(mysql_config + ' --version').read()
309    min_mysql_version = '4.1'
310    if compare_versions(mysql_version, min_mysql_version) < 0:
311        print 'Warning: MySQL', min_mysql_version, 'or newer required.'
312        print '         Version', mysql_version, 'detected.'
313        have_mysql = False
314
315# Set up mysql_config commands.
316if have_mysql:
317    mysql_config_include = mysql_config + ' --include'
318    if os.system(mysql_config_include + ' > /dev/null') != 0:
319        # older mysql_config versions don't support --include, use
320        # --cflags instead
321        mysql_config_include = mysql_config + ' --cflags | sed s/\\\'//g'
322    # This seems to work in all versions
323    mysql_config_libs = mysql_config + ' --libs'
324
325env = conf.Finish()
326
327# Define the universe of supported ISAs
328env['ALL_ISA_LIST'] = ['alpha', 'sparc', 'mips']
329
330# Define the universe of supported CPU models
331env['ALL_CPU_LIST'] = ['AtomicSimpleCPU', 'TimingSimpleCPU',
332                       'O3CPU', 'OzoneCPU']
333
334if os.path.isdir(joinpath(SRCDIR, 'encumbered/cpu/full')):
335    env['ALL_CPU_LIST'] += ['FullCPU']
336
337# Sticky options get saved in the options file so they persist from
338# one invocation to the next (unless overridden, in which case the new
339# value becomes sticky).
340sticky_opts = Options(args=ARGUMENTS)
341sticky_opts.AddOptions(
342    EnumOption('TARGET_ISA', 'Target ISA', 'alpha', env['ALL_ISA_LIST']),
343    BoolOption('FULL_SYSTEM', 'Full-system support', False),
344    # There's a bug in scons 0.96.1 that causes ListOptions with list
345    # values (more than one value) not to be able to be restored from
346    # a saved option file.  If this causes trouble then upgrade to
347    # scons 0.96.90 or later.
348    ListOption('CPU_MODELS', 'CPU models', 'AtomicSimpleCPU,TimingSimpleCPU,O3CPU',
349               env['ALL_CPU_LIST']),
350    BoolOption('ALPHA_TLASER',
351               'Model Alpha TurboLaser platform (vs. Tsunami)', False),
352    BoolOption('NO_FAST_ALLOC', 'Disable fast object allocator', False),
353    BoolOption('EFENCE', 'Link with Electric Fence malloc debugger',
354               False),
355    BoolOption('SS_COMPATIBLE_FP',
356               'Make floating-point results compatible with SimpleScalar',
357               False),
358    BoolOption('USE_SSE2',
359               'Compile for SSE2 (-msse2) to get IEEE FP on x86 hosts',
360               False),
361    BoolOption('USE_MYSQL', 'Use MySQL for stats output', have_mysql),
362    BoolOption('USE_FENV', 'Use <fenv.h> IEEE mode control', have_fenv),
363    BoolOption('USE_CHECKER', 'Use checker for detailed CPU models', False),
364    ('CC', 'C compiler', os.environ.get('CC', env['CC'])),
365    ('CXX', 'C++ compiler', os.environ.get('CXX', env['CXX'])),
366    BoolOption('BATCH', 'Use batch pool for build and tests', False),
367    ('BATCH_CMD', 'Batch pool submission command name', 'qdo'),
368    ('PYTHONHOME',
369     'Override the default PYTHONHOME for this system (use with caution)',
370     '%s:%s' % (sys.prefix, sys.exec_prefix))
371    )
372
373# Non-sticky options only apply to the current build.
374nonsticky_opts = Options(args=ARGUMENTS)
375nonsticky_opts.AddOptions(
376    BoolOption('update_ref', 'Update test reference outputs', False)
377    )
378
379# These options get exported to #defines in config/*.hh (see src/SConscript).
380env.ExportOptions = ['FULL_SYSTEM', 'ALPHA_TLASER', 'USE_FENV', \
381                     'USE_MYSQL', 'NO_FAST_ALLOC', 'SS_COMPATIBLE_FP', \
382                     'USE_CHECKER', 'PYTHONHOME', 'TARGET_ISA']
383
384# Define a handy 'no-op' action
385def no_action(target, source, env):
386    return 0
387
388env.NoAction = Action(no_action, None)
389
390###################################################
391#
392# Define a SCons builder for configuration flag headers.
393#
394###################################################
395
396# This function generates a config header file that #defines the
397# option symbol to the current option setting (0 or 1).  The source
398# operands are the name of the option and a Value node containing the
399# value of the option.
400def build_config_file(target, source, env):
401    (option, value) = [s.get_contents() for s in source]
402    f = file(str(target[0]), 'w')
403    print >> f, '#define', option, value
404    f.close()
405    return None
406
407# Generate the message to be printed when building the config file.
408def build_config_file_string(target, source, env):
409    (option, value) = [s.get_contents() for s in source]
410    return "Defining %s as %s in %s." % (option, value, target[0])
411
412# Combine the two functions into a scons Action object.
413config_action = Action(build_config_file, build_config_file_string)
414
415# The emitter munges the source & target node lists to reflect what
416# we're really doing.
417def config_emitter(target, source, env):
418    # extract option name from Builder arg
419    option = str(target[0])
420    # True target is config header file
421    target = joinpath('config', option.lower() + '.hh')
422    val = env[option]
423    if isinstance(val, bool):
424        # Force value to 0/1
425        val = int(val)
426    elif isinstance(val, str):
427        val = '"' + val + '"'
428        
429    # Sources are option name & value (packaged in SCons Value nodes)
430    return ([target], [Value(option), Value(val)])
431
432config_builder = Builder(emitter = config_emitter, action = config_action)
433
434env.Append(BUILDERS = { 'ConfigFile' : config_builder })
435
436###################################################
437#
438# Define a SCons builder for copying files.  This is used by the
439# Python zipfile code in src/python/SConscript, but is placed up here
440# since it's potentially more generally applicable.
441#
442###################################################
443
444copy_builder = Builder(action = Copy("$TARGET", "$SOURCE"))
445
446env.Append(BUILDERS = { 'CopyFile' : copy_builder })
447
448###################################################
449#
450# Define a simple SCons builder to concatenate files.
451#
452# Used to append the Python zip archive to the executable.
453#
454###################################################
455
456concat_builder = Builder(action = Action(['cat $SOURCES > $TARGET',
457                                          'chmod +x $TARGET']))
458
459env.Append(BUILDERS = { 'Concat' : concat_builder })
460
461
462# base help text
463help_text = '''
464Usage: scons [scons options] [build options] [target(s)]
465
466'''
467
468# libelf build is shared across all configs in the build root.
469env.SConscript('ext/libelf/SConscript',
470               build_dir = joinpath(build_root, 'libelf'),
471               exports = 'env')
472
473###################################################
474#
475# This function is used to set up a directory with switching headers
476#
477###################################################
478
479def make_switching_dir(dirname, switch_headers, env):
480    # Generate the header.  target[0] is the full path of the output
481    # header to generate.  'source' is a dummy variable, since we get the
482    # list of ISAs from env['ALL_ISA_LIST'].
483    def gen_switch_hdr(target, source, env):
484	fname = str(target[0])
485	basename = os.path.basename(fname)
486	f = open(fname, 'w')
487	f.write('#include "arch/isa_specific.hh"\n')
488	cond = '#if'
489	for isa in env['ALL_ISA_LIST']:
490	    f.write('%s THE_ISA == %s_ISA\n#include "%s/%s/%s"\n'
491		    % (cond, isa.upper(), dirname, isa, basename))
492	    cond = '#elif'
493	f.write('#else\n#error "THE_ISA not set"\n#endif\n')
494	f.close()
495	return 0
496
497    # String to print when generating header
498    def gen_switch_hdr_string(target, source, env):
499	return "Generating switch header " + str(target[0])
500
501    # Build SCons Action object. 'varlist' specifies env vars that this
502    # action depends on; when env['ALL_ISA_LIST'] changes these actions
503    # should get re-executed.
504    switch_hdr_action = Action(gen_switch_hdr, gen_switch_hdr_string,
505                               varlist=['ALL_ISA_LIST'])
506
507    # Instantiate actions for each header
508    for hdr in switch_headers:
509        env.Command(hdr, [], switch_hdr_action)
510
511env.make_switching_dir = make_switching_dir
512
513###################################################
514#
515# Define build environments for selected configurations.
516#
517###################################################
518
519# rename base env
520base_env = env
521
522for build_path in build_paths:
523    print "Building in", build_path
524    # build_dir is the tail component of build path, and is used to
525    # determine the build parameters (e.g., 'ALPHA_SE')
526    (build_root, build_dir) = os.path.split(build_path)
527    # Make a copy of the build-root environment to use for this config.
528    env = base_env.Copy()
529
530    # Set env options according to the build directory config.
531    sticky_opts.files = []
532    # Options for $BUILD_ROOT/$BUILD_DIR are stored in
533    # $BUILD_ROOT/options/$BUILD_DIR so you can nuke
534    # $BUILD_ROOT/$BUILD_DIR without losing your options settings.
535    current_opts_file = joinpath(build_root, 'options', build_dir)
536    if os.path.isfile(current_opts_file):
537        sticky_opts.files.append(current_opts_file)
538        print "Using saved options file %s" % current_opts_file
539    else:
540        # Build dir-specific options file doesn't exist.
541
542        # Make sure the directory is there so we can create it later
543        opt_dir = os.path.dirname(current_opts_file)
544        if not os.path.isdir(opt_dir):
545            os.mkdir(opt_dir)
546
547        # Get default build options from source tree.  Options are
548        # normally determined by name of $BUILD_DIR, but can be
549        # overriden by 'default=' arg on command line.
550        default_opts_file = joinpath('build_opts',
551                                     ARGUMENTS.get('default', build_dir))
552        if os.path.isfile(default_opts_file):
553            sticky_opts.files.append(default_opts_file)
554            print "Options file %s not found,\n  using defaults in %s" \
555                  % (current_opts_file, default_opts_file)
556        else:
557            print "Error: cannot find options file %s or %s" \
558                  % (current_opts_file, default_opts_file)
559            Exit(1)
560
561    # Apply current option settings to env
562    sticky_opts.Update(env)
563    nonsticky_opts.Update(env)
564
565    help_text += "Sticky options for %s:\n" % build_dir \
566                 + sticky_opts.GenerateHelpText(env) \
567                 + "\nNon-sticky options for %s:\n" % build_dir \
568                 + nonsticky_opts.GenerateHelpText(env)
569
570    # Process option settings.
571
572    if not have_fenv and env['USE_FENV']:
573        print "Warning: <fenv.h> not available; " \
574              "forcing USE_FENV to False in", build_dir + "."
575        env['USE_FENV'] = False
576
577    if not env['USE_FENV']:
578        print "Warning: No IEEE FP rounding mode control in", build_dir + "."
579        print "         FP results may deviate slightly from other platforms."
580
581    if env['EFENCE']:
582        env.Append(LIBS=['efence'])
583
584    if env['USE_MYSQL']:
585        if not have_mysql:
586            print "Warning: MySQL not available; " \
587                  "forcing USE_MYSQL to False in", build_dir + "."
588            env['USE_MYSQL'] = False
589        else:
590            print "Compiling in", build_dir, "with MySQL support."
591            env.ParseConfig(mysql_config_libs)
592            env.ParseConfig(mysql_config_include)
593
594    # Save sticky option settings back to current options file
595    sticky_opts.Save(current_opts_file, env)
596
597    # Do this after we save setting back, or else we'll tack on an
598    # extra 'qdo' every time we run scons.
599    if env['BATCH']:
600        env['CC']  = env['BATCH_CMD'] + ' ' + env['CC']
601        env['CXX'] = env['BATCH_CMD'] + ' ' + env['CXX']
602
603    if env['USE_SSE2']:
604        env.Append(CCFLAGS='-msse2')
605
606    # The src/SConscript file sets up the build rules in 'env' according
607    # to the configured options.  It returns a list of environments,
608    # one for each variant build (debug, opt, etc.)
609    envList = SConscript('src/SConscript', build_dir = build_path,
610                         exports = 'env')
611
612    # Set up the regression tests for each build.
613    for e in envList:
614        SConscript('tests/SConscript',
615                   build_dir = joinpath(build_path, 'tests', e.Label),
616                   exports = { 'env' : e }, duplicate = False)
617
618Help(help_text)
619
620
621###################################################
622#
623# Let SCons do its thing.  At this point SCons will use the defined
624# build environments to build the requested targets.
625#
626###################################################
627
628