summaryrefslogtreecommitdiff
path: root/SConstruct
diff options
context:
space:
mode:
authorCurtis Dunham <Curtis.Dunham@arm.com>2014-09-22 14:37:23 -0500
committerCurtis Dunham <Curtis.Dunham@arm.com>2014-09-22 14:37:23 -0500
commitded540a661d9ff572ca58cd2e990460b2518dc28 (patch)
tree078dd8d2a58d0480423a82e0cc66caee83f55078 /SConstruct
parentf7c6a2cbed3fa0653e3badfcdbc48f7c3792ba53 (diff)
downloadgem5-ded540a661d9ff572ca58cd2e990460b2518dc28.tar.xz
scons: Add --without-tcmalloc build option
Disabling tcmalloc is required for valgrind's memcheck to work properly; this option makes it easier to create such a build.
Diffstat (limited to 'SConstruct')
-rwxr-xr-xSConstruct22
1 files changed, 13 insertions, 9 deletions
diff --git a/SConstruct b/SConstruct
index 034e8e626..1d1b95711 100755
--- a/SConstruct
+++ b/SConstruct
@@ -186,6 +186,9 @@ AddLocalOption('--verbose', dest='verbose', action='store_true',
AddLocalOption('--without-python', dest='without_python',
action='store_true',
help='Build without Python configuration support')
+AddLocalOption('--without-tcmalloc', dest='without_tcmalloc',
+ action='store_true',
+ help='Disable linking against tcmalloc')
termcap = get_termcap(GetOption('use_colors'))
@@ -973,15 +976,16 @@ have_posix_timers = \
conf.CheckLibWithHeader([None, 'rt'], [ 'time.h', 'signal.h' ], 'C',
'timer_create(CLOCK_MONOTONIC, NULL, NULL);')
-if conf.CheckLib('tcmalloc'):
- main.Append(CCFLAGS=main['TCMALLOC_CCFLAGS'])
-elif conf.CheckLib('tcmalloc_minimal'):
- main.Append(CCFLAGS=main['TCMALLOC_CCFLAGS'])
-else:
- print termcap.Yellow + termcap.Bold + \
- "You can get a 12% performance improvement by installing tcmalloc "\
- "(libgoogle-perftools-dev package on Ubuntu or RedHat)." + \
- termcap.Normal
+if not GetOption('without_tcmalloc'):
+ if conf.CheckLib('tcmalloc'):
+ main.Append(CCFLAGS=main['TCMALLOC_CCFLAGS'])
+ elif conf.CheckLib('tcmalloc_minimal'):
+ main.Append(CCFLAGS=main['TCMALLOC_CCFLAGS'])
+ else:
+ print termcap.Yellow + termcap.Bold + \
+ "You can get a 12% performance improvement by "\
+ "installing tcmalloc (libgoogle-perftools-dev package "\
+ "on Ubuntu or RedHat)." + termcap.Normal
if not have_posix_clock:
print "Can't find library for POSIX clocks."