summaryrefslogtreecommitdiff
path: root/src/SConscript
diff options
context:
space:
mode:
authorAli Saidi <saidi@eecs.umich.edu>2007-01-26 18:49:40 -0500
committerAli Saidi <saidi@eecs.umich.edu>2007-01-26 18:49:40 -0500
commitfd8a4ff5a8a9ea65e227f0b4000dfcda06d4764f (patch)
treece2a5d4e12142eab64231daab73953a15384b7c6 /src/SConscript
parent8561c8366c7c9afd7e6b52b6e2385b3c1dde95a9 (diff)
parent63fdabf191b8ac1031fb25da61ab2526d4bb6d05 (diff)
downloadgem5-fd8a4ff5a8a9ea65e227f0b4000dfcda06d4764f.tar.xz
Merge zeep.pool:/z/saidi/work/m5.newmem
into zeep.pool:/z/saidi/work/m5.suncc --HG-- extra : convert_revision : 20f61a524a3b53fc0afcf53a24b5a1fe1d96f579
Diffstat (limited to 'src/SConscript')
-rw-r--r--src/SConscript29
1 files changed, 20 insertions, 9 deletions
diff --git a/src/SConscript b/src/SConscript
index 229418703..a94682bc0 100644
--- a/src/SConscript
+++ b/src/SConscript
@@ -311,30 +311,41 @@ def makeEnv(label, objsfx, strip = False, **kwargs):
envList.append(newEnv)
# Debug binary
-# Solaris seems to have some issue with DWARF2 debugging information, it's ok
-# with stabs though
-if sys.platform == 'sunos5':
- debug_flag = '-gstabs+'
+ccflags = {}
+if env['GCC']:
+ if sys.platform == 'sunos5':
+ ccflags['debug'] = '-gstabs+'
+ else:
+ ccflags['debug'] = '-ggdb3'
+ ccflags['opt'] = '-g -O3'
+ ccflags['fast'] = '-O3'
+ ccflags['prof'] = '-O3 -g -pg'
+elif env['SUNCC']:
+ ccflags['debug'] = '-g0'
+ ccflags['opt'] = '-g -O'
+ ccflags['fast'] = '-fast'
+ ccflags['prof'] = '-fast -g -pg'
else:
- debug_flag = '-ggdb3'
+ print 'Unknown compiler, please fix compiler options'
+ Exit(1)
makeEnv('debug', '.do',
- CCFLAGS = Split('%s -O0' % debug_flag),
+ CCFLAGS = Split(ccflags['debug']),
CPPDEFINES = ['DEBUG', 'TRACING_ON=1'])
# Optimized binary
makeEnv('opt', '.o',
- CCFLAGS = Split('-g -O3'),
+ CCFLAGS = Split(ccflags['opt']),
CPPDEFINES = ['TRACING_ON=1'])
# "Fast" binary
makeEnv('fast', '.fo', strip = True,
- CCFLAGS = Split('-O3'),
+ CCFLAGS = Split(ccflags['fast']),
CPPDEFINES = ['NDEBUG', 'TRACING_ON=0'])
# Profiled binary
makeEnv('prof', '.po',
- CCFLAGS = Split('-O3 -g -pg'),
+ CCFLAGS = Split(ccflags['prof']),
CPPDEFINES = ['NDEBUG', 'TRACING_ON=0'],
LINKFLAGS = '-pg')