summaryrefslogtreecommitdiff
path: root/SConstruct
diff options
context:
space:
mode:
authorMark Benvenuto <mark.benvenuto@mongodb.com>2015-04-23 12:57:52 -0400
committerMark Benvenuto <mark.benvenuto@mongodb.com>2015-04-24 18:29:39 -0400
commit3800339557b1003b77d79dc2c536b21f22ca2abf (patch)
treef9d0627d6db5f2108f32b95fb7f4d18aef355a7a /SConstruct
parentf80670de2a961a2dec5e00d35e098c37c8f4d7ea (diff)
downloadmongo-3800339557b1003b77d79dc2c536b21f22ca2abf.tar.gz
TC Malloc
Diffstat (limited to 'SConstruct')
-rw-r--r--SConstruct14
1 files changed, 14 insertions, 0 deletions
diff --git a/SConstruct b/SConstruct
index 9d9a3918a2e..1d32cf05a6c 100644
--- a/SConstruct
+++ b/SConstruct
@@ -34,6 +34,9 @@ AddOption("--enable-python", dest="lang-python", type="string", nargs=1, action=
AddOption("--enable-snappy", dest="snappy", type="string", nargs=1, action="store",
help="Use snappy compression")
+AddOption("--enable-tcmalloc", dest="tcmalloc", type="string", nargs=1, action="store",
+ help="Use TCMalloc for memory allocation")
+
AddOption("--enable-verbose", dest="verbose", action="store_true", default=False,
help="Configure WiredTiger to support the verbose configuration string to wiredtiger_open")
@@ -113,6 +116,7 @@ useZlib = GetOption("zlib")
useSnappy = GetOption("snappy")
useLz4 = GetOption("lz4")
useBdb = GetOption("bdb")
+useTcmalloc = GetOption("tcmalloc")
wtlibs = []
conf = Configure(env)
@@ -157,6 +161,16 @@ if useBdb:
print 'db.h must be installed!'
Exit(1)
+if useTcmalloc:
+ conf.env.Append(CPPPATH=[useTcmalloc + "/include"])
+ conf.env.Append(LIBPATH=[useTcmalloc + "/lib"])
+ if conf.CheckCHeader('gperftools/tcmalloc.h'):
+ wtlibs.append("libtcmalloc_minimal")
+ conf.env.Append(CPPDEFINES=['HAVE_LIBTCMALLOC'])
+ else:
+ print 'tcmalloc.h must be installed!'
+ Exit(1)
+
env = conf.Finish()
# Configure build environment variables