Don't use magic numbers.
[gem5.git] / SConscript
index 10722007a59c95f3ff844ae561d39a69b7cacace..ce90d9cb2daaec23362afb812e5ddbea060bd28a 100644 (file)
@@ -173,6 +173,7 @@ base_sources = Split('''
        mem/timing_mem/base_memory.cc
        mem/timing_mem/memory_builder.cc
        mem/timing_mem/simple_mem_bank.cc
+        mem/trace/itx_writer.cc
        mem/trace/mem_trace_writer.cc
        mem/trace/m5_writer.cc
 
@@ -190,7 +191,6 @@ base_sources = Split('''
        sim/sim_object.cc
        sim/stat_context.cc
        sim/stat_control.cc
-       sim/sw_context.cc
        sim/trace_context.cc
        sim/universe.cc
         sim/pyconfig/pyconfig.cc
@@ -244,6 +244,7 @@ full_system_sources = Split('''
        arch/alpha/pseudo_inst.cc
        arch/alpha/vtophys.cc
 
+       base/crc.cc
        base/inet.cc
        base/remote_gdb.cc
 
@@ -288,6 +289,7 @@ full_system_sources = Split('''
        dev/tsunami_pchip.cc
        dev/uart.cc
 
+       kern/kernel_binning.cc
        kern/kernel_stats.cc
        kern/system_events.cc
        kern/linux/linux_events.cc
@@ -351,6 +353,7 @@ syscall_emulation_sources = Split('''
        arch/alpha/alpha_linux_process.cc
        arch/alpha/alpha_tru64_process.cc
        cpu/memtest/memtest.cc
+        cpu/trace/opt_cpu.cc
        cpu/trace/trace_cpu.cc
        eio/eio.cc
        eio/exolex.cc
@@ -366,6 +369,34 @@ syscall_emulation_obj_desc_files = Split('''
         sim/Process.od
        ''')
 
+targetarch_files = Split('''
+        alpha_common_syscall_emul.hh
+        alpha_linux_process.hh
+        alpha_memory.hh
+        alpha_tru64_process.hh
+        aout_machdep.h
+        arguments.hh
+        byte_swap.hh
+        ecoff_machdep.h
+        elf_machdep.h
+        ev5.hh
+        faults.hh
+        isa_fullsys_traits.hh
+        isa_traits.hh
+        machine_exo.h
+        osfpal.hh
+        pmap.h
+        pseudo_inst.hh
+        syscalls.hh
+        vptr.hh
+        vtophys.hh
+        ''')
+
+for f in targetarch_files:
+    env.Command('targetarch/' + f, 'arch/alpha/' + f,
+                '''echo '#include "arch/alpha/%s"' > $TARGET''' % f)
+
+
 # Set up complete list of sources based on configuration.
 sources = base_sources
 obj_desc_files = base_obj_desc_files
@@ -377,8 +408,19 @@ else:
     sources += syscall_emulation_sources
     obj_desc_files += syscall_emulation_obj_desc_files
 
+extra_libraries = []
 if env['USE_MYSQL']:
     sources += mysql_sources
+    env.Append(CPPDEFINES = 'USE_MYSQL')
+    env.Append(CPPDEFINES = 'STATS_BINNING')
+    env.Append(CPPPATH=['/usr/local/include/mysql', '/usr/include/mysql'])
+    env.Append(LIBS=['z'])
+    if os.path.isdir('/usr/lib64'):
+        env.Append(LIBPATH=['/usr/lib64/mysql'])
+    else:
+        env.Append(LIBPATH=['/usr/lib/mysql/'])
+    env.Append(LIBS=['mysqlclient'])
+
 
 ###################################################
 #
@@ -403,22 +445,6 @@ env.Command(Split('''arch/alpha/decoder.cc
             '$SRCDIR/arch/isa_parser.py $SOURCE $TARGET.dir arch/alpha')
 
 
-# 'targetarch' is a symlink to arch/$TARGET_ISA.
-def link_targetarch(target, source, env):
-    link_target = str(target[0])
-    link_source = env.subst('$SRCDIR/arch/$TARGET_ISA')
-    if not os.path.isdir(link_target):
-        print "symlinking", link_source, "to", link_target
-        try:
-            os.symlink(link_source, link_target)
-        except OSError, desc:
-            print "Error creating symlink %s: %s" % (link_target, desc)
-            sys.exit(-1)
-
-# Tell SCons to use the link_targetarch function to make 'targetarch'
-env.Command('targetarch', None, link_targetarch)
-
-
 # libelf build is described in its own SConscript file.
 # SConscript-local is the per-config build, which just copies some
 # header files into a place where they can be found.
@@ -432,16 +458,15 @@ SConscript('sim/pyconfig/SConscript', exports = ['env', 'obj_desc_files'],
 # environment, and returns a list of all the corresponding SCons
 # Object nodes (including an extra one for date.cc).  We explicitly
 # add the Object nodes so we can set up special dependencies for
-# targetarch and date.cc.
+# date.cc.
 def make_objs(sources, env):
     objs = [env.Object(s) for s in sources]
-    # make all objects depend on the targetarch link so it gets made first.
-    env.Depends(objs, 'targetarch')
     # make date.cc depend on all other objects so it always gets
     # recompiled whenever anything else does
     date_obj = env.Object('base/date.cc')
     env.Depends(date_obj, objs)
     objs.append(date_obj)
+    objs.extend(extra_libraries)
     return objs
 
 ###################################################