make all of the turbolaser stuff only compile if ALPHA_TLASER
[gem5.git] / build / SConstruct
index d6d723c95d2c688e3120e9f34c10e13771bbacc4..89183f17d0902e0aec2d111e684bd52405060ff9 100644 (file)
@@ -37,7 +37,7 @@
 #
 # Then type 'scons' to build the default configuration (see below), or
 # 'scons <CONFIG>/<binary>' to build some other configuration (e.g.,
-# 'KERNEL/m5.opt' for the optimized full-system version).
+# 'ALPHA_FS/m5.opt' for the optimized full-system version).
 #
 ###################################################
 
@@ -62,6 +62,9 @@ if not os.path.isdir('ext'):
           % EXT_SRCDIR
     sys.exit(1)
 
+# tell python where to find m5 python code
+sys.path.append(os.path.join(SRCDIR, 'python'))
+
 
 ###################################################
 #
@@ -70,7 +73,7 @@ if not os.path.isdir('ext'):
 # The build system infers the build options from the subdirectory name
 # that the simulator is built under.  The subdirectory name must be of
 # the form <CONFIG>[.<OPT>]*, where <CONFIG> is a base configuration
-# (e.g., ALPHA or KERNEL) and OPT is an option (e.g., MYSQL).  The
+# (e.g., ALPHA_SE or ALPHA_FS) and OPT is an option (e.g., MYSQL).  The
 # following code defines the standard configurations and options.
 # Additional local configurations and options are read from the file
 # 'local_configs' if it exists.
@@ -85,40 +88,34 @@ if not os.path.isdir('ext'):
 ###################################################
 
 # Base non-full-system Alpha ISA configuration.
-def AlphaConfig(env):
+def AlphaSyscallEmulConfig(env):
     env.Replace(TARGET_ISA = 'alpha')
     env.Append(CPPDEFINES = 'SS_COMPATIBLE_FP')
 
 # Base full-system configuration.
-def KernelConfig(env):
+def AlphaFullSysConfig(env):
     env.Replace(TARGET_ISA = 'alpha')
     env.Replace(FULL_SYSTEM = True)
-    env.Append(CPPDEFINES = ['FULL_SYSTEM', 'SYSTEM_EV5'])
+    env.Append(CPPDEFINES = ['FULL_SYSTEM'])
 
 # Base configurations map.
 configs_map = {
-    'ALPHA' : AlphaConfig,
-    'KERNEL' : KernelConfig
+    'ALPHA_SE' : AlphaSyscallEmulConfig,
+    'ALPHA_FS' : AlphaFullSysConfig
     }
 
-# Enable detailed full-system binning.
-def MeasureOpt(env):
-    env.Replace(USE_MYSQL = True)
-    env.Append(CPPDEFINES = 'FS_MEASURE')
-
-# Enable MySql database output for stats.
-def MySqlOpt(env):
-    env.Replace(USE_MYSQL = True)
-
 # Disable FastAlloc object allocation.
 def NoFastAllocOpt(env):
     env.Append(CPPDEFINES = 'NO_FAST_ALLOC')
 
+# Enable efence
+def EfenceOpt(env):
+    env.Append(LIBS=['efence'])
+
 # Configuration options map.
 options_map = {
-    'MEASURE' : MeasureOpt,
-    'MYSQL' : MySqlOpt,
-    'NO_FAST_ALLOC' : NoFastAllocOpt
+    'NO_FAST_ALLOC' : NoFastAllocOpt,
+    'EFENCE' : EfenceOpt
     }
 
 # The 'local_configs' file can be used to define additional base
@@ -144,7 +141,7 @@ def set_dir_options(dir, env):
 
 # Set the default configuration and binary.  The default target (if
 # scons is invoked at the top level with no command-line targets) is
-# 'ALPHA/m5.debug'.  If scons is invoked in a subdirectory with no
+# 'ALPHA_SE/m5.debug'.  If scons is invoked in a subdirectory with no
 # command-line targets, the configuration
 
 ###################################################
@@ -166,7 +163,7 @@ def set_dir_options(dir, env):
 #
 # 3. If there are no command-line targets and scons was invoked from
 #    the root build directory, a default configuration is used.  The
-#    built-in default is ALPHA, but this can be overridden by setting the
+#    built-in default is ALPHA_SE, but this can be overridden by setting the
 #    M5_DEFAULT_CONFIG shell environment veriable.
 #
 # In cases 2 & 3, the specific file target defaults to 'm5.debug', but
@@ -176,7 +173,7 @@ def set_dir_options(dir, env):
 ###################################################
 
 # Find default configuration & binary.
-default_config = os.environ.get('M5_DEFAULT_CONFIG', 'ALPHA')
+default_config = os.environ.get('M5_DEFAULT_CONFIG', 'ALPHA_SE')
 default_binary = os.environ.get('M5_DEFAULT_BINARY', 'm5.debug')
 
 # Ask SCons which directory it was invoked from.  If you invoke SCons
@@ -190,7 +187,7 @@ if launch_dir == ROOT:
         # easy: use specified targets as is
         my_targets = COMMAND_LINE_TARGETS
     else:
-        # default target (ALPHA/m5.debug, unless overridden)
+        # default target (ALPHA_SE/m5.debug, unless overridden)
         target = os.path.join(default_config, default_binary)
         my_targets = [target]
         Default(target)
@@ -237,20 +234,34 @@ default_env = Environment(ENV = os.environ,  # inherit user's enviroment vars
                           EXT_SRCDIR = EXT_SRCDIR,
                           CPPDEFINES = [],
                           FULL_SYSTEM = False,
+                          ALPHA_TLASER = False,
                           USE_MYSQL = False)
 
+default_env.SConsignFile("sconsign")
+
+# For some reason, the CC and CXX variables don't get passed into the
+# environment correctly.  This is probably some sort of scons bug that
+# will eventually be fixed.
+if os.environ.has_key('CC'):
+    default_env.Replace(CC=os.environ['CC'])
+
+if os.environ.has_key('CXX'):
+    default_env.Replace(CXX=os.environ['CXX'])
+
 # M5_EXT is used by isa_parser.py to find the PLY package.
 default_env.Append(ENV = { 'M5_EXT' : EXT_SRCDIR })
 
 default_env.Append(CCFLAGS='-pipe')
 default_env.Append(CCFLAGS='-fno-strict-aliasing')
 default_env.Append(CCFLAGS=Split('-Wall -Wno-sign-compare -Werror -Wundef'))
+default_env.Append(CPPPATH=[os.path.join(EXT_SRCDIR + '/dnet')])
 
 # libelf build is described in its own SConscript file.  Using a
 # dictionary for exports lets us export "default_env" so the
-# SConscript will see it as "env".
-default_env.SConscript('m5/libelf/SConscript', exports={'env' : default_env})
-
+# SConscript will see it as "env".  SConscript-global is the build in
+# build/libelf shared among all configs.
+default_env.SConscript('m5/libelf/SConscript-global',
+                       exports={'env' : default_env})
 
 ###################################################
 #
@@ -276,7 +287,7 @@ for build_dir in build_dirs:
 ###################################################
 #
 # Let SCons do its thing.  At this point SCons will use the defined
-# build enviornments to build the requested targets.
+# build environments to build the requested targets.
 #
 ###################################################