diff options
author | Ramon Fernandez <ramon.fernandez@mongodb.com> | 2015-03-26 12:27:35 -0400 |
---|---|---|
committer | Ramon Fernandez <ramon.fernandez@mongodb.com> | 2015-03-26 12:27:35 -0400 |
commit | 61d6d65a8b6c18f38465e2379b9897cab8f3f5e8 (patch) | |
tree | 89911163de7a4e1a1fcfe9deaa966d6d93840b5f /src/third_party/wiredtiger/SConstruct | |
parent | 06b58e9c7c349ce81504cf6ce2823082205ab0f7 (diff) | |
download | mongo-61d6d65a8b6c18f38465e2379b9897cab8f3f5e8.tar.gz |
Import wiredtiger-wiredtiger-2.5.2-293-g3e37e1f.tar.gz from wiredtiger branch mongodb-3.0
Diffstat (limited to 'src/third_party/wiredtiger/SConstruct')
-rw-r--r-- | src/third_party/wiredtiger/SConstruct | 102 |
1 files changed, 69 insertions, 33 deletions
diff --git a/src/third_party/wiredtiger/SConstruct b/src/third_party/wiredtiger/SConstruct index 1c109c973c0..8e9fae28ac6 100644 --- a/src/third_party/wiredtiger/SConstruct +++ b/src/third_party/wiredtiger/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") @@ -49,46 +52,66 @@ swig_binary = GetOption("lang-python") # Initialize environment # +var = Variables() + +var.Add('MSVC_USE_SCRIPT', 'Path to vcvars.bat to override SCons default VS tool search'); + +var.Add('CPPPATH', 'C Preprocessor include path', [ + "#/src/include/", + "#/build_win", + "#/test/windows", + "#/.", +]) + +var.Add('CFLAGS', 'C Compiler Flags', [ + "/Z7", # Generate debugging symbols + "/wd4090", # Ignore warning about mismatched const qualifiers + "/wd4996", # Ignore deprecated functions + "/W3", # Warning level 3 + #"/we4244", # Possible loss of data + "/we4013", # Error on undefined functions + #"/we4047", # Indirection differences in types + #"/we4024", # Differences in parameter types + #"/we4100", # Unreferenced local parameter + "/TC", # Compile as C code + #"/Od", # Disable optimization + "/Ob1", # inline expansion + "/O2", # optimize for speed + "/GF", # enable string pooling + "/EHsc", # extern "C" does not throw + #"/RTC1", # enable stack checks + "/GS", # enable security checks + "/Gy", # separate functions for linker + "/Zc:wchar_t", + "/Gd", + "/MD" if GetOption("dynamic-crt") else "/MT", +]) + +var.Add('LINKFLAGS', 'Linker Flags', [ + "/DEBUG", # Generate debug symbols + "/INCREMENTAL:NO", # Disable incremental linking + "/OPT:REF", # Remove dead code + "/DYNAMICBASE", + "/NXCOMPAT", +]) + +var.Add('TOOLS', 'SCons tools', [ + "default", + "swig", + "textfile" +]) + +var.Add('SWIG', 'SWIG binary location', swig_binary) + env = Environment( - CPPPATH = ["#/src/include/", - "#/build_win", - "#/test/windows", - "#/.", - ], - CFLAGS = [ - "/Z7", # Generate debugging symbols - "/wd4090", # Ignore warning about mismatched const qualifiers - "/wd4996", - "/W3", # Warning level 3 - "/we4013", # Error on undefined functions - "/TC", # Compile as C code - #"/Od", # Disable optimization - "/Ob1", # inline expansion - "/O2", # optimize for speed - "/GF", # enable string pooling - "/EHsc", # extern "C" does not throw - #"/RTC1", # enable stack checks - "/GS", # enable secrutiy checks - "/Gy", # separate functions for linker - "/Zc:wchar_t", - "/Gd", - "/MD" if GetOption("dynamic-crt") else "/MT", - ], - LINKFLAGS = [ - "/DEBUG", # Generate debug symbols - "/INCREMENTAL:NO", # Disable incremental linking - "/OPT:REF", # Remove dead code - "/DYNAMICBASE", - "/NXCOMPAT", - ], - tools=["default", "swig", "textfile"], - SWIG=swig_binary + variables = var ) env['STATIC_AND_SHARED_OBJECTS_ARE_THE_SAME'] = 1 useZlib = GetOption("zlib") useSnappy = GetOption("snappy") +useLz4 = GetOption("lz4") useBdb = GetOption("bdb") wtlibs = [] @@ -117,6 +140,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"]) @@ -204,6 +237,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 |