SConscript revision 1742
1955SN/A# -*- mode:python -*- 2955SN/A 31762SN/A# Copyright (c) 2004 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 294762Snate@binkert.orgimport os 30955SN/Aimport sys 315522Snate@binkert.orgfrom os.path import isdir 326143Snate@binkert.org 334762Snate@binkert.org# This file defines how to build a particular configuration of M5 345522Snate@binkert.org# based on variable settings in the 'env' build environment. 35955SN/A 365522Snate@binkert.org# Import build environment variable from SConstruct. 3711974Sgabeblack@google.comImport('env') 38955SN/A 395522Snate@binkert.org################################################### 404202Sbinkertn@umich.edu# 415742Snate@binkert.org# Define needed sources. 42955SN/A# 434381Sbinkertn@umich.edu################################################### 444381Sbinkertn@umich.edu 4512246Sgabeblack@google.com# Base sources used by all configurations. 4612246Sgabeblack@google.combase_sources = Split(''' 478334Snate@binkert.org arch/alpha/decoder.cc 48955SN/A arch/alpha/alpha_o3_exec.cc 49955SN/A arch/alpha/fast_cpu_exec.cc 504202Sbinkertn@umich.edu arch/alpha/simple_cpu_exec.cc 51955SN/A arch/alpha/full_cpu_exec.cc 524382Sbinkertn@umich.edu arch/alpha/faults.cc 534382Sbinkertn@umich.edu arch/alpha/isa_traits.cc 544382Sbinkertn@umich.edu 556654Snate@binkert.org base/circlebuf.cc 565517Snate@binkert.org base/copyright.cc 578614Sgblack@eecs.umich.edu base/cprintf.cc 587674Snate@binkert.org base/embedfile.cc 596143Snate@binkert.org base/fast_alloc.cc 606143Snate@binkert.org base/fifo_buffer.cc 616143Snate@binkert.org base/hostinfo.cc 6212302Sgabeblack@google.com base/hybrid_pred.cc 6312302Sgabeblack@google.com base/inifile.cc 6412302Sgabeblack@google.com base/intmath.cc 6512302Sgabeblack@google.com base/match.cc 6612302Sgabeblack@google.com base/misc.cc 6712302Sgabeblack@google.com base/output.cc 6812302Sgabeblack@google.com base/pollevent.cc 6912302Sgabeblack@google.com base/python.cc 7012302Sgabeblack@google.com base/range.cc 7112302Sgabeblack@google.com base/random.cc 7212302Sgabeblack@google.com base/sat_counter.cc 7312302Sgabeblack@google.com base/socket.cc 7412302Sgabeblack@google.com base/statistics.cc 7512302Sgabeblack@google.com base/str.cc 7612302Sgabeblack@google.com base/time.cc 7712302Sgabeblack@google.com base/trace.cc 7812302Sgabeblack@google.com base/traceflags.cc 7912302Sgabeblack@google.com base/userinfo.cc 8012302Sgabeblack@google.com base/compression/lzss_compression.cc 8112302Sgabeblack@google.com base/loader/aout_object.cc 8212302Sgabeblack@google.com base/loader/ecoff_object.cc 8312302Sgabeblack@google.com base/loader/elf_object.cc 8412302Sgabeblack@google.com base/loader/object_file.cc 8512302Sgabeblack@google.com base/loader/symtab.cc 8612302Sgabeblack@google.com base/stats/events.cc 8712302Sgabeblack@google.com base/stats/python.cc 8812302Sgabeblack@google.com base/stats/statdb.cc 8912302Sgabeblack@google.com base/stats/visit.cc 9012302Sgabeblack@google.com base/stats/text.cc 9111983Sgabeblack@google.com 926143Snate@binkert.org cpu/base.cc 938233Snate@binkert.org cpu/base_dyn_inst.cc 9412302Sgabeblack@google.com cpu/exec_context.cc 956143Snate@binkert.org cpu/exetrace.cc 966143Snate@binkert.org cpu/pc_event.cc 9712302Sgabeblack@google.com cpu/static_inst.cc 984762Snate@binkert.org cpu/o3/2bit_local_pred.cc 996143Snate@binkert.org cpu/o3/alpha_dyn_inst.cc 1008233Snate@binkert.org cpu/o3/alpha_cpu.cc 1018233Snate@binkert.org cpu/o3/alpha_cpu_builder.cc 10212302Sgabeblack@google.com cpu/o3/bpred_unit.cc 10312302Sgabeblack@google.com cpu/o3/btb.cc 1046143Snate@binkert.org cpu/o3/commit.cc 10512302Sgabeblack@google.com cpu/o3/decode.cc 10612302Sgabeblack@google.com cpu/o3/fetch.cc 10712302Sgabeblack@google.com cpu/o3/free_list.cc 10812302Sgabeblack@google.com cpu/o3/cpu.cc 10912302Sgabeblack@google.com cpu/o3/iew.cc 11012302Sgabeblack@google.com cpu/o3/inst_queue.cc 11112302Sgabeblack@google.com cpu/o3/ldstq.cc 11212302Sgabeblack@google.com cpu/o3/mem_dep_unit.cc 11312302Sgabeblack@google.com cpu/o3/ras.cc 11412302Sgabeblack@google.com cpu/o3/rename.cc 1158233Snate@binkert.org cpu/o3/rename_map.cc 1166143Snate@binkert.org cpu/o3/rob.cc 1176143Snate@binkert.org cpu/o3/sat_counter.cc 1186143Snate@binkert.org cpu/o3/store_set.cc 1196143Snate@binkert.org cpu/o3/tournament_pred.cc 1206143Snate@binkert.org cpu/fast/cpu.cc 1216143Snate@binkert.org cpu/sampler/sampler.cc 1226143Snate@binkert.org cpu/simple/cpu.cc 1236143Snate@binkert.org cpu/trace/reader/mem_trace_reader.cc 1246143Snate@binkert.org cpu/trace/reader/ibm_reader.cc 1257065Snate@binkert.org cpu/trace/reader/itx_reader.cc 1266143Snate@binkert.org cpu/trace/reader/m5_reader.cc 1278233Snate@binkert.org 1288233Snate@binkert.org encumbered/cpu/full/bpred.cc 1298233Snate@binkert.org encumbered/cpu/full/commit.cc 1308233Snate@binkert.org encumbered/cpu/full/cpu.cc 1318233Snate@binkert.org encumbered/cpu/full/create_vector.cc 1328233Snate@binkert.org encumbered/cpu/full/cv_spec_state.cc 1338233Snate@binkert.org encumbered/cpu/full/dd_queue.cc 1348233Snate@binkert.org encumbered/cpu/full/dep_link.cc 1358233Snate@binkert.org encumbered/cpu/full/dispatch.cc 1368233Snate@binkert.org encumbered/cpu/full/dyn_inst.cc 1378233Snate@binkert.org encumbered/cpu/full/execute.cc 1388233Snate@binkert.org encumbered/cpu/full/fetch.cc 1398233Snate@binkert.org encumbered/cpu/full/floss_reasons.cc 1408233Snate@binkert.org encumbered/cpu/full/fu_pool.cc 1418233Snate@binkert.org encumbered/cpu/full/inst_fifo.cc 1428233Snate@binkert.org encumbered/cpu/full/instpipe.cc 1438233Snate@binkert.org encumbered/cpu/full/issue.cc 1448233Snate@binkert.org encumbered/cpu/full/ls_queue.cc 1458233Snate@binkert.org encumbered/cpu/full/machine_queue.cc 1468233Snate@binkert.org encumbered/cpu/full/pc_sample_profile.cc 1478233Snate@binkert.org encumbered/cpu/full/pipetrace.cc 1486143Snate@binkert.org encumbered/cpu/full/readyq.cc 1496143Snate@binkert.org encumbered/cpu/full/reg_info.cc 1506143Snate@binkert.org encumbered/cpu/full/rob_station.cc 1516143Snate@binkert.org encumbered/cpu/full/spec_memory.cc 1526143Snate@binkert.org encumbered/cpu/full/spec_state.cc 1536143Snate@binkert.org encumbered/cpu/full/storebuffer.cc 1549982Satgutier@umich.edu encumbered/cpu/full/writeback.cc 1556143Snate@binkert.org encumbered/cpu/full/iq/iq_station.cc 15612302Sgabeblack@google.com encumbered/cpu/full/iq/iqueue.cc 15712302Sgabeblack@google.com encumbered/cpu/full/iq/segmented/chain_info.cc 15812302Sgabeblack@google.com encumbered/cpu/full/iq/segmented/chain_wire.cc 15912302Sgabeblack@google.com encumbered/cpu/full/iq/segmented/iq_seg.cc 16012302Sgabeblack@google.com encumbered/cpu/full/iq/segmented/iq_segmented.cc 16112302Sgabeblack@google.com encumbered/cpu/full/iq/segmented/seg_chain.cc 16212302Sgabeblack@google.com encumbered/cpu/full/iq/seznec/iq_seznec.cc 16312302Sgabeblack@google.com encumbered/cpu/full/iq/standard/iq_standard.cc 16411983Sgabeblack@google.com encumbered/mem/functional/main.cc 16511983Sgabeblack@google.com 16611983Sgabeblack@google.com mem/base_hier.cc 16712302Sgabeblack@google.com mem/base_mem.cc 16812302Sgabeblack@google.com mem/hier_params.cc 16912302Sgabeblack@google.com mem/mem_cmd.cc 17012302Sgabeblack@google.com mem/mem_debug.cc 17112302Sgabeblack@google.com mem/mem_req.cc 17212302Sgabeblack@google.com mem/memory_interface.cc 17311983Sgabeblack@google.com mem/bus/base_interface.cc 1746143Snate@binkert.org mem/bus/bus.cc 17512305Sgabeblack@google.com mem/bus/bus_bridge.cc 17612302Sgabeblack@google.com mem/bus/bus_bridge_master.cc 17712302Sgabeblack@google.com mem/bus/bus_bridge_slave.cc 17812302Sgabeblack@google.com mem/bus/bus_interface.cc 1796143Snate@binkert.org mem/bus/dma_bus_interface.cc 1806143Snate@binkert.org mem/bus/dma_interface.cc 1816143Snate@binkert.org mem/bus/master_interface.cc 1825522Snate@binkert.org mem/bus/slave_interface.cc 1836143Snate@binkert.org mem/cache/base_cache.cc 1846143Snate@binkert.org mem/cache/cache.cc 1856143Snate@binkert.org mem/cache/cache_builder.cc 1869982Satgutier@umich.edu mem/cache/coherence/coherence_protocol.cc 18712302Sgabeblack@google.com mem/cache/coherence/uni_coherence.cc 18812302Sgabeblack@google.com mem/cache/miss/blocking_buffer.cc 18912302Sgabeblack@google.com mem/cache/miss/miss_queue.cc 1906143Snate@binkert.org mem/cache/miss/mshr.cc 1916143Snate@binkert.org mem/cache/miss/mshr_queue.cc 1926143Snate@binkert.org mem/cache/prefetch/base_prefetcher.cc 1936143Snate@binkert.org mem/cache/prefetch/ghb_prefetcher.cc 1945522Snate@binkert.org mem/cache/prefetch/prefetcher.cc 1955522Snate@binkert.org mem/cache/prefetch/stride_prefetcher.cc 1965522Snate@binkert.org mem/cache/prefetch/tagged_prefetcher.cc 1975522Snate@binkert.org mem/cache/tags/base_tags.cc 1985604Snate@binkert.org mem/cache/tags/cache_tags.cc 1995604Snate@binkert.org mem/cache/tags/fa_lru.cc 2006143Snate@binkert.org mem/cache/tags/iic.cc 2016143Snate@binkert.org mem/cache/tags/lru.cc 2024762Snate@binkert.org mem/cache/tags/split.cc 2034762Snate@binkert.org mem/cache/tags/split_lifo.cc 2046143Snate@binkert.org mem/cache/tags/split_lru.cc 2056727Ssteve.reinhardt@amd.com mem/cache/tags/repl/gen.cc 2066727Ssteve.reinhardt@amd.com mem/cache/tags/repl/repl.cc 2076727Ssteve.reinhardt@amd.com mem/functional/functional.cc 2084762Snate@binkert.org mem/timing/base_memory.cc 2096143Snate@binkert.org mem/timing/memory_builder.cc 2106143Snate@binkert.org mem/timing/simple_mem_bank.cc 2116143Snate@binkert.org mem/trace/itx_writer.cc 2126143Snate@binkert.org mem/trace/mem_trace_writer.cc 2136727Ssteve.reinhardt@amd.com mem/trace/m5_writer.cc 2146143Snate@binkert.org 2157674Snate@binkert.org python/pyconfig.cc 2167674Snate@binkert.org python/embedded_py.cc 2175604Snate@binkert.org 2186143Snate@binkert.org sim/builder.cc 2196143Snate@binkert.org sim/configfile.cc 2206143Snate@binkert.org sim/debug.cc 2214762Snate@binkert.org sim/eventq.cc 2226143Snate@binkert.org sim/main.cc 2234762Snate@binkert.org sim/param.cc 2244762Snate@binkert.org sim/profile.cc 2254762Snate@binkert.org sim/root.cc 2266143Snate@binkert.org sim/serialize.cc 2276143Snate@binkert.org sim/sim_events.cc 2284762Snate@binkert.org sim/sim_exit.cc 22912302Sgabeblack@google.com sim/sim_object.cc 23012302Sgabeblack@google.com sim/startup.cc 2318233Snate@binkert.org sim/stat_context.cc 23212302Sgabeblack@google.com sim/stat_control.cc 2336143Snate@binkert.org sim/trace_context.cc 2346143Snate@binkert.org ''') 2354762Snate@binkert.org 2366143Snate@binkert.org# MySql sources 2374762Snate@binkert.orgmysql_sources = Split(''' 2389396Sandreas.hansson@arm.com base/mysql.cc 2399396Sandreas.hansson@arm.com base/stats/mysql.cc 2409396Sandreas.hansson@arm.com ''') 24112302Sgabeblack@google.com 24212302Sgabeblack@google.com# Full-system sources 24312302Sgabeblack@google.comfull_system_sources = Split(''' 2449396Sandreas.hansson@arm.com arch/alpha/alpha_memory.cc 2459396Sandreas.hansson@arm.com arch/alpha/arguments.cc 2469396Sandreas.hansson@arm.com arch/alpha/ev5.cc 2479396Sandreas.hansson@arm.com arch/alpha/osfpal.cc 2489396Sandreas.hansson@arm.com arch/alpha/pseudo_inst.cc 2499396Sandreas.hansson@arm.com arch/alpha/vtophys.cc 2509396Sandreas.hansson@arm.com 2519930Sandreas.hansson@arm.com base/crc.cc 2529930Sandreas.hansson@arm.com base/inet.cc 2539396Sandreas.hansson@arm.com base/remote_gdb.cc 2548235Snate@binkert.org 2558235Snate@binkert.org cpu/intr_control.cc 2566143Snate@binkert.org 2578235Snate@binkert.org dev/alpha_console.cc 2589003SAli.Saidi@ARM.com dev/baddev.cc 2598235Snate@binkert.org dev/simconsole.cc 2608235Snate@binkert.org dev/disk_image.cc 26112302Sgabeblack@google.com dev/etherbus.cc 2628235Snate@binkert.org dev/etherdump.cc 26312302Sgabeblack@google.com dev/etherint.cc 2648235Snate@binkert.org dev/etherlink.cc 2658235Snate@binkert.org dev/etherpkt.cc 26612302Sgabeblack@google.com dev/ethertap.cc 2678235Snate@binkert.org dev/ide_ctrl.cc 2688235Snate@binkert.org dev/ide_disk.cc 2698235Snate@binkert.org dev/io_device.cc 2708235Snate@binkert.org dev/ns_gige.cc 2719003SAli.Saidi@ARM.com dev/pciconfigall.cc 2728235Snate@binkert.org dev/pcidev.cc 2735584Snate@binkert.org dev/pktfifo.cc 2744382Sbinkertn@umich.edu dev/platform.cc 2754202Sbinkertn@umich.edu dev/sinic.cc 2764382Sbinkertn@umich.edu dev/simple_disk.cc 2774382Sbinkertn@umich.edu dev/tsunami.cc 2789396Sandreas.hansson@arm.com dev/tsunami_cchip.cc 2795584Snate@binkert.org dev/tsunami_fake.cc 2804382Sbinkertn@umich.edu dev/tsunami_io.cc 2814382Sbinkertn@umich.edu dev/tsunami_pchip.cc 2824382Sbinkertn@umich.edu dev/uart.cc 2838232Snate@binkert.org dev/uart8250.cc 2845192Ssaidi@eecs.umich.edu 2858232Snate@binkert.org kern/kernel_binning.cc 2868232Snate@binkert.org kern/kernel_stats.cc 2878232Snate@binkert.org kern/system_events.cc 2885192Ssaidi@eecs.umich.edu kern/linux/linux_events.cc 2898232Snate@binkert.org kern/linux/linux_syscalls.cc 2905192Ssaidi@eecs.umich.edu kern/linux/linux_system.cc 2915799Snate@binkert.org kern/linux/printk.cc 2928232Snate@binkert.org kern/tru64/dump_mbuf.cc 2935192Ssaidi@eecs.umich.edu kern/tru64/printf.cc 2945192Ssaidi@eecs.umich.edu kern/tru64/tru64_events.cc 2955192Ssaidi@eecs.umich.edu kern/tru64/tru64_syscalls.cc 2968232Snate@binkert.org kern/tru64/tru64_system.cc 2975192Ssaidi@eecs.umich.edu 2988232Snate@binkert.org mem/functional/memory_control.cc 2995192Ssaidi@eecs.umich.edu mem/functional/physical.cc 3005192Ssaidi@eecs.umich.edu 3015192Ssaidi@eecs.umich.edu sim/system.cc 3025192Ssaidi@eecs.umich.edu ''') 3034382Sbinkertn@umich.edu 3044382Sbinkertn@umich.edu# turbolaser encumbered sources 3054382Sbinkertn@umich.eduturbolaser_sources = Split(''' 3062667Sstever@eecs.umich.edu encumbered/dev/dma.cc 3072667Sstever@eecs.umich.edu encumbered/dev/etherdev.cc 3082667Sstever@eecs.umich.edu encumbered/dev/scsi.cc 3092667Sstever@eecs.umich.edu encumbered/dev/scsi_ctrl.cc 3102667Sstever@eecs.umich.edu encumbered/dev/scsi_disk.cc 3112667Sstever@eecs.umich.edu encumbered/dev/scsi_none.cc 3125742Snate@binkert.org encumbered/dev/tlaser_clock.cc 3135742Snate@binkert.org encumbered/dev/tlaser_ipi.cc 3145742Snate@binkert.org encumbered/dev/tlaser_mbox.cc 3155793Snate@binkert.org encumbered/dev/tlaser_mc146818.cc 3168334Snate@binkert.org encumbered/dev/tlaser_node.cc 3175793Snate@binkert.org encumbered/dev/tlaser_pcia.cc 3185793Snate@binkert.org encumbered/dev/tlaser_pcidev.cc 3195793Snate@binkert.org encumbered/dev/tlaser_serial.cc 3204382Sbinkertn@umich.edu encumbered/dev/turbolaser.cc 3214762Snate@binkert.org encumbered/dev/uart8530.cc 3225344Sstever@gmail.com ''') 3234382Sbinkertn@umich.edu 3245341Sstever@gmail.com# Syscall emulation (non-full-system) sources 3255742Snate@binkert.orgsyscall_emulation_sources = Split(''' 3265742Snate@binkert.org arch/alpha/alpha_common_syscall_emul.cc 3275742Snate@binkert.org arch/alpha/alpha_linux_process.cc 3285742Snate@binkert.org arch/alpha/alpha_tru64_process.cc 3295742Snate@binkert.org cpu/memtest/memtest.cc 3304762Snate@binkert.org cpu/trace/opt_cpu.cc 3315742Snate@binkert.org cpu/trace/trace_cpu.cc 3325742Snate@binkert.org eio/eio.cc 33311984Sgabeblack@google.com eio/exolex.cc 3347722Sgblack@eecs.umich.edu eio/libexo.cc 3355742Snate@binkert.org sim/process.cc 3365742Snate@binkert.org sim/syscall_emul.cc 3375742Snate@binkert.org ''') 3389930Sandreas.hansson@arm.com 3399930Sandreas.hansson@arm.comtargetarch_files = Split(''' 3409930Sandreas.hansson@arm.com alpha_common_syscall_emul.hh 3419930Sandreas.hansson@arm.com alpha_linux_process.hh 3429930Sandreas.hansson@arm.com alpha_memory.hh 3435742Snate@binkert.org alpha_tru64_process.hh 3448242Sbradley.danofsky@amd.com aout_machdep.h 3458242Sbradley.danofsky@amd.com arguments.hh 3468242Sbradley.danofsky@amd.com byte_swap.hh 3478242Sbradley.danofsky@amd.com ecoff_machdep.h 3485341Sstever@gmail.com elf_machdep.h 3495742Snate@binkert.org ev5.hh 3507722Sgblack@eecs.umich.edu faults.hh 3514773Snate@binkert.org isa_fullsys_traits.hh 3526108Snate@binkert.org isa_traits.hh 3531858SN/A machine_exo.h 3541085SN/A osfpal.hh 3556658Snate@binkert.org pseudo_inst.hh 3566658Snate@binkert.org vptr.hh 3577673Snate@binkert.org vtophys.hh 3586658Snate@binkert.org ''') 3596658Snate@binkert.org 36011308Santhony.gutierrez@amd.comfor f in targetarch_files: 3616658Snate@binkert.org env.Command('targetarch/' + f, 'arch/alpha/' + f, 36211308Santhony.gutierrez@amd.com '''echo '#include "arch/alpha/%s"' > $TARGET''' % f) 3636658Snate@binkert.org 3646658Snate@binkert.org 3657673Snate@binkert.org# Set up complete list of sources based on configuration. 3667673Snate@binkert.orgsources = base_sources 3677673Snate@binkert.org 3687673Snate@binkert.orgif env['FULL_SYSTEM']: 3697673Snate@binkert.org sources += full_system_sources 3707673Snate@binkert.org if env['ALPHA_TLASER']: 3717673Snate@binkert.org sources += turbolaser_sources 37210467Sandreas.hansson@arm.comelse: 3736658Snate@binkert.org sources += syscall_emulation_sources 3747673Snate@binkert.org 37510467Sandreas.hansson@arm.comextra_libraries = [] 37610467Sandreas.hansson@arm.comenv.Append(LIBS=['z']) 37710467Sandreas.hansson@arm.comif isdir('/usr/lib64/mysql') or isdir('/usr/lib/mysql') or \ 37810467Sandreas.hansson@arm.com isdir('/usr/local/lib/mysql'): 37910467Sandreas.hansson@arm.com print 'Compiling with MySQL support!' 38010467Sandreas.hansson@arm.com env.Append(LIBPATH=['/usr/lib64/mysql', '/usr/local/lib/mysql/', 38110467Sandreas.hansson@arm.com '/usr/lib/mysql']) 38210467Sandreas.hansson@arm.com env.Append(CPPPATH=['/usr/local/include/mysql', '/usr/include/mysql']) 38310467Sandreas.hansson@arm.com sources += mysql_sources 38410467Sandreas.hansson@arm.com env.Append(CPPDEFINES = 'USE_MYSQL') 38510467Sandreas.hansson@arm.com env.Append(CPPDEFINES = 'STATS_BINNING') 3867673Snate@binkert.org env.Append(LIBS=['mysqlclient']) 3877673Snate@binkert.org 3887673Snate@binkert.org################################################### 3897673Snate@binkert.org# 3907673Snate@binkert.org# Special build rules. 3919048SAli.Saidi@ARM.com# 3927673Snate@binkert.org################################################### 3937673Snate@binkert.org 3947673Snate@binkert.org# base/traceflags.{cc,hh} are generated from base/traceflags.py. 3957673Snate@binkert.org# $TARGET.base will expand to "<build-dir>/base/traceflags". 3966658Snate@binkert.orgenv.Command(Split('base/traceflags.hh base/traceflags.cc'), 3977756SAli.Saidi@ARM.com 'base/traceflags.py', 3987816Ssteve.reinhardt@amd.com 'python $SOURCE $TARGET.base') 3996658Snate@binkert.org 40011308Santhony.gutierrez@amd.com# several files are generated from arch/$TARGET_ISA/isa_desc. 40111308Santhony.gutierrez@amd.comenv.Command(Split('''arch/alpha/decoder.cc 40211308Santhony.gutierrez@amd.com arch/alpha/decoder.hh 40311308Santhony.gutierrez@amd.com arch/alpha/alpha_o3_exec.cc 40411308Santhony.gutierrez@amd.com arch/alpha/fast_cpu_exec.cc 40511308Santhony.gutierrez@amd.com arch/alpha/simple_cpu_exec.cc 40611308Santhony.gutierrez@amd.com arch/alpha/full_cpu_exec.cc'''), 40711308Santhony.gutierrez@amd.com Split('''arch/alpha/isa_desc 40811308Santhony.gutierrez@amd.com arch/isa_parser.py'''), 40911308Santhony.gutierrez@amd.com '$SRCDIR/arch/isa_parser.py $SOURCE $TARGET.dir arch/alpha') 41011308Santhony.gutierrez@amd.com 41111308Santhony.gutierrez@amd.com 41211308Santhony.gutierrez@amd.com# libelf build is described in its own SConscript file. 41311308Santhony.gutierrez@amd.com# SConscript-local is the per-config build, which just copies some 41411308Santhony.gutierrez@amd.com# header files into a place where they can be found. 41511308Santhony.gutierrez@amd.comSConscript('libelf/SConscript-local', exports = 'env', duplicate=0) 41611308Santhony.gutierrez@amd.comSConscript('python/SConscript', exports = ['env'], duplicate=0) 41711308Santhony.gutierrez@amd.com 41811308Santhony.gutierrez@amd.com# This function adds the specified sources to the given build 41911308Santhony.gutierrez@amd.com# environment, and returns a list of all the corresponding SCons 42011308Santhony.gutierrez@amd.com# Object nodes (including an extra one for date.cc). We explicitly 42111308Santhony.gutierrez@amd.com# add the Object nodes so we can set up special dependencies for 42211308Santhony.gutierrez@amd.com# date.cc. 42311308Santhony.gutierrez@amd.comdef make_objs(sources, env): 42411308Santhony.gutierrez@amd.com objs = [env.Object(s) for s in sources] 42511308Santhony.gutierrez@amd.com # make date.cc depend on all other objects so it always gets 42611308Santhony.gutierrez@amd.com # recompiled whenever anything else does 42711308Santhony.gutierrez@amd.com date_obj = env.Object('base/date.cc') 42811308Santhony.gutierrez@amd.com env.Depends(date_obj, objs) 42911308Santhony.gutierrez@amd.com objs.append(date_obj) 43011308Santhony.gutierrez@amd.com objs.extend(extra_libraries) 43111308Santhony.gutierrez@amd.com return objs 43211308Santhony.gutierrez@amd.com 43311308Santhony.gutierrez@amd.com################################################### 43411308Santhony.gutierrez@amd.com# 43511308Santhony.gutierrez@amd.com# Define binaries. Each different build type (debug, opt, etc.) gets 43611308Santhony.gutierrez@amd.com# a slightly different build environment. 43711308Santhony.gutierrez@amd.com# 43811308Santhony.gutierrez@amd.com################################################### 43911308Santhony.gutierrez@amd.com 44011308Santhony.gutierrez@amd.com# Include file paths are rooted in this directory. SCons will 44111308Santhony.gutierrez@amd.com# automatically expand '.' to refer to both the source directory and 44211308Santhony.gutierrez@amd.com# the corresponding build directory to pick up generated include 44311308Santhony.gutierrez@amd.com# files. 44411308Santhony.gutierrez@amd.comenv.Append(CPPPATH='.') 4454382Sbinkertn@umich.edu 4464382Sbinkertn@umich.edu# Debug binary 4474762Snate@binkert.orgdebug = env.Copy(OBJSUFFIX='.do') 4484762Snate@binkert.orgdebug.Append(CCFLAGS=Split('-g -gstabs+ -O0')) 4494762Snate@binkert.orgdebug.Append(CPPDEFINES='DEBUG') 4506654Snate@binkert.orgdebug.Program(target = 'm5.debug', source = make_objs(sources, debug)) 4516654Snate@binkert.org 4525517Snate@binkert.org# Optimized binary 4535517Snate@binkert.orgopt = env.Copy() 4545517Snate@binkert.orgopt.Append(CCFLAGS=Split('-g -O5')) 4555517Snate@binkert.orgopt.Program(target = 'm5.opt', source = make_objs(sources, opt)) 4565517Snate@binkert.org 4575517Snate@binkert.org# "Fast" binary 4585517Snate@binkert.orgfast = env.Copy(OBJSUFFIX='.fo') 4595517Snate@binkert.orgfast.Append(CCFLAGS=Split('-O5')) 4605517Snate@binkert.orgfast.Append(CPPDEFINES='NDEBUG') 4615517Snate@binkert.orgfast.Program(target = 'm5.fast.unstripped', source = make_objs(sources, fast)) 4625517Snate@binkert.orgfast.Command(target = 'm5.fast', source = 'm5.fast.unstripped', 4635517Snate@binkert.org action = 'strip $SOURCE -o $TARGET') 4645517Snate@binkert.org 4655517Snate@binkert.org# Profiled binary 4665517Snate@binkert.orgprof = env.Copy(OBJSUFFIX='.po') 4675517Snate@binkert.orgprof.Append(CCFLAGS=Split('-O5 -g -pg'), LINKFLAGS='-pg') 4685517Snate@binkert.orgprof.Program(target = 'm5.prof', source = make_objs(sources, prof)) 4696654Snate@binkert.org