SConstruct (2766:0844a9607f77) SConstruct (2776:1b766ee324d5)
1# -*- mode:python -*-
2
3# Copyright (c) 2004-2005 The Regents of The University of Michigan
4# All rights reserved.
5#
6# Redistribution and use in source and binary forms, with or without
7# modification, are permitted provided that the following conditions are
8# met: redistributions of source code must retain the above copyright

--- 25 unchanged lines hidden (view full) ---

34#
35# While in this directory ('m5'), just type 'scons' to build the default
36# configuration (see below), or type 'scons build/<CONFIG>/<binary>'
37# to build some other configuration (e.g., 'build/ALPHA_FS/m5.opt' for
38# the optimized full-system version).
39#
40# You can build M5 in a different directory as long as there is a
41# 'build/<CONFIG>' somewhere along the target path. The build system
1# -*- mode:python -*-
2
3# Copyright (c) 2004-2005 The Regents of The University of Michigan
4# All rights reserved.
5#
6# Redistribution and use in source and binary forms, with or without
7# modification, are permitted provided that the following conditions are
8# met: redistributions of source code must retain the above copyright

--- 25 unchanged lines hidden (view full) ---

34#
35# While in this directory ('m5'), just type 'scons' to build the default
36# configuration (see below), or type 'scons build/<CONFIG>/<binary>'
37# to build some other configuration (e.g., 'build/ALPHA_FS/m5.opt' for
38# the optimized full-system version).
39#
40# You can build M5 in a different directory as long as there is a
41# 'build/<CONFIG>' somewhere along the target path. The build system
42# expdects that all configs under the same build directory are being
42# expects that all configs under the same build directory are being
43# built for the same host system.
44#
45# Examples:
43# built for the same host system.
44#
45# Examples:
46# These two commands are equivalent. The '-u' option tells scons to
47# search up the directory tree for this SConstruct file.
46#
47# The following two commands are equivalent. The '-u' option tells
48# scons to search up the directory tree for this SConstruct file.
48# % cd <path-to-src>/m5 ; scons build/ALPHA_FS/m5.debug
49# % cd <path-to-src>/m5/build/ALPHA_FS; scons -u m5.debug
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
50# These two commands are equivalent and demonstrate building in a
51# directory outside of the source tree. The '-C' option tells scons
52# to chdir to the specified directory to find this SConstruct file.
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.
53# % cd <path-to-src>/m5 ; scons /local/foo/build/ALPHA_FS/m5.debug
54# % cd /local/foo/build/ALPHA_FS; scons -C <path-to-src>/m5 m5.debug
55#
56# You can use 'scons -H' to print scons options. If you're in this
57# 'm5' directory (or use -u or -C to tell scons where to find this
58# file), you can use 'scons -h' to print all the M5-specific build
59# options as well.
60#

--- 90 unchanged lines hidden (view full) ---

151# and modified according to each selected configuration.
152#
153###################################################
154
155env = Environment(ENV = os.environ, # inherit user's environment vars
156 ROOT = ROOT,
157 SRCDIR = SRCDIR)
158
56# % cd <path-to-src>/m5 ; scons /local/foo/build/ALPHA_FS/m5.debug
57# % cd /local/foo/build/ALPHA_FS; scons -C <path-to-src>/m5 m5.debug
58#
59# You can use 'scons -H' to print scons options. If you're in this
60# 'm5' directory (or use -u or -C to tell scons where to find this
61# file), you can use 'scons -h' to print all the M5-specific build
62# options as well.
63#

--- 90 unchanged lines hidden (view full) ---

154# and modified according to each selected configuration.
155#
156###################################################
157
158env = Environment(ENV = os.environ, # inherit user's environment vars
159 ROOT = ROOT,
160 SRCDIR = SRCDIR)
161
159env.SConsignFile("sconsign")
162env.SConsignFile(os.path.join(build_root,"sconsign"))
160
161# Default duplicate option is to use hard links, but this messes up
162# when you use emacs to edit a file in the target dir, as emacs moves
163# file to file~ then copies to file, breaking the link. Symbolic
164# (soft) links work better.
165env.SetOption('duplicate', 'soft-copy')
166
167# I waffle on this setting... it does avoid a few painful but

--- 129 unchanged lines hidden (view full) ---

297 )
298
299# Non-sticky options only apply to the current build.
300nonsticky_opts = Options(args=ARGUMENTS)
301nonsticky_opts.AddOptions(
302 BoolOption('update_ref', 'Update test reference outputs', False)
303 )
304
163
164# Default duplicate option is to use hard links, but this messes up
165# when you use emacs to edit a file in the target dir, as emacs moves
166# file to file~ then copies to file, breaking the link. Symbolic
167# (soft) links work better.
168env.SetOption('duplicate', 'soft-copy')
169
170# I waffle on this setting... it does avoid a few painful but

--- 129 unchanged lines hidden (view full) ---

300 )
301
302# Non-sticky options only apply to the current build.
303nonsticky_opts = Options(args=ARGUMENTS)
304nonsticky_opts.AddOptions(
305 BoolOption('update_ref', 'Update test reference outputs', False)
306 )
307
305# These options get exported to #defines in config/*.hh (see m5/SConscript).
308# These options get exported to #defines in config/*.hh (see src/SConscript).
306env.ExportOptions = ['FULL_SYSTEM', 'ALPHA_TLASER', 'USE_FENV', \
307 'USE_MYSQL', 'NO_FAST_ALLOC', 'SS_COMPATIBLE_FP', \
308 'USE_CHECKER']
309
310# Define a handy 'no-op' action
311def no_action(target, source, env):
312 return 0
313

--- 153 unchanged lines hidden (view full) ---

467 print "Warning: MySQL not available; " \
468 "forcing USE_MYSQL to False in", build_dir + "."
469 env['USE_MYSQL'] = False
470 else:
471 print "Compiling in", build_dir, "with MySQL support."
472 env.ParseConfig(mysql_config_libs)
473 env.ParseConfig(mysql_config_include)
474
309env.ExportOptions = ['FULL_SYSTEM', 'ALPHA_TLASER', 'USE_FENV', \
310 'USE_MYSQL', 'NO_FAST_ALLOC', 'SS_COMPATIBLE_FP', \
311 'USE_CHECKER']
312
313# Define a handy 'no-op' action
314def no_action(target, source, env):
315 return 0
316

--- 153 unchanged lines hidden (view full) ---

470 print "Warning: MySQL not available; " \
471 "forcing USE_MYSQL to False in", build_dir + "."
472 env['USE_MYSQL'] = False
473 else:
474 print "Compiling in", build_dir, "with MySQL support."
475 env.ParseConfig(mysql_config_libs)
476 env.ParseConfig(mysql_config_include)
477
478 # Check if the Checker is being used. If so append it to env['CPU_MODELS']
479 if env['USE_CHECKER']:
480 env['CPU_MODELS'].append('CheckerCPU')
481
475 # Save sticky option settings back to current options file
476 sticky_opts.Save(current_opts_file, env)
477
478 # Do this after we save setting back, or else we'll tack on an
479 # extra 'qdo' every time we run scons.
480 if env['BATCH']:
481 env['CC'] = env['BATCH_CMD'] + ' ' + env['CC']
482 env['CXX'] = env['BATCH_CMD'] + ' ' + env['CXX']
483
484 if env['USE_SSE2']:
485 env.Append(CCFLAGS='-msse2')
486
482 # Save sticky option settings back to current options file
483 sticky_opts.Save(current_opts_file, env)
484
485 # Do this after we save setting back, or else we'll tack on an
486 # extra 'qdo' every time we run scons.
487 if env['BATCH']:
488 env['CC'] = env['BATCH_CMD'] + ' ' + env['CC']
489 env['CXX'] = env['BATCH_CMD'] + ' ' + env['CXX']
490
491 if env['USE_SSE2']:
492 env.Append(CCFLAGS='-msse2')
493
487 # The m5/SConscript file sets up the build rules in 'env' according
494 # The src/SConscript file sets up the build rules in 'env' according
488 # to the configured options. It returns a list of environments,
489 # one for each variant build (debug, opt, etc.)
490 envList = SConscript('src/SConscript', build_dir = build_path,
491 exports = 'env')
492
493 # Set up the regression tests for each build.
494# for e in envList:
495# SConscript('m5-test/SConscript',

--- 12 unchanged lines hidden ---
495 # to the configured options. It returns a list of environments,
496 # one for each variant build (debug, opt, etc.)
497 envList = SConscript('src/SConscript', build_dir = build_path,
498 exports = 'env')
499
500 # Set up the regression tests for each build.
501# for e in envList:
502# SConscript('m5-test/SConscript',

--- 12 unchanged lines hidden ---