summaryrefslogtreecommitdiff
path: root/SConstruct
diff options
context:
space:
mode:
authorAlex Gorrod <alexander.gorrod@mongodb.com>2015-03-20 14:15:35 +1100
committerAlex Gorrod <alexander.gorrod@mongodb.com>2015-03-20 14:15:35 +1100
commitf6aee6ab5a4c2cb47872a694843dc2695b0f2d8a (patch)
tree1bfc792db4a82632e09f0ca31cb14eec39873fcd /SConstruct
parent9cb948e8680149e270b095fe14ba067f905e9a75 (diff)
parent6c4e81f6c02fc3cca594659ff722e459de28b6fb (diff)
downloadmongo-f6aee6ab5a4c2cb47872a694843dc2695b0f2d8a.tar.gz
Merge pull request #1790 from markbenvenuto/scons_lz4
Add LZ4 support to SCons
Diffstat (limited to 'SConstruct')
-rw-r--r--SConstruct17
1 files changed, 17 insertions, 0 deletions
diff --git a/SConstruct b/SConstruct
index d366f5714b6..5c4b90992f2 100644
--- a/SConstruct
+++ b/SConstruct
@@ -25,6 +25,9 @@ AddOption("--enable-attach", dest="attach", action="store_true", default=False,
AddOption("--enable-diagnostic", dest="diagnostic", action="store_true", default=False,
help="Configure WiredTiger to perform various run-time diagnostic tests. DO NOT configure this option in production environments.")
+AddOption("--enable-lz4", dest="lz4", type="string", nargs=1, action="store",
+ help="Use LZ4 compression")
+
AddOption("--enable-python", dest="lang-python", type="string", nargs=1, action="store",
help="Build Python extension, specify location of swig.exe binary")
@@ -102,6 +105,7 @@ env['STATIC_AND_SHARED_OBJECTS_ARE_THE_SAME'] = 1
useZlib = GetOption("zlib")
useSnappy = GetOption("snappy")
+useLz4 = GetOption("lz4")
useBdb = GetOption("bdb")
wtlibs = []
@@ -130,6 +134,16 @@ if useSnappy:
print 'snappy-c.h must be installed!'
Exit(1)
+if useLz4:
+ conf.env.Append(CPPPATH=[useLz4 + "/include"])
+ conf.env.Append(LIBPATH=[useLz4 + "/lib"])
+ if conf.CheckCHeader('lz4.h'):
+ conf.env.Append(CPPDEFINES=['HAVE_BUILTIN_EXTENSION_LZ4'])
+ wtlibs.append("lz4")
+ else:
+ print 'lz4.h must be installed!'
+ Exit(1)
+
if useBdb:
conf.env.Append(CPPPATH=[useBdb+ "/include"])
conf.env.Append(LIBPATH=[useBdb+ "/lib"])
@@ -217,6 +231,9 @@ if useZlib:
if useSnappy:
wtsources.append("ext/compressors/snappy/snappy_compress.c")
+if useLz4:
+ wtsources.append("ext/compressors/lz4/lz4_compress.c")
+
wt_objs = [env.Object(a) for a in wtsources]
# Static Library - libwiredtiger.lib