summaryrefslogtreecommitdiff
path: root/SConstruct
diff options
context:
space:
mode:
authorAndy Schwerin <schwerin@10gen.com>2012-03-19 11:12:25 -0400
committerAndy Schwerin <schwerin@10gen.com>2012-03-19 15:10:35 -0400
commit0e0adf8855859a206ff41188cc5b128cc37d5f40 (patch)
tree7c122e390827758329d5995d9faae3cef57d5c96 /SConstruct
parent8395e741a51529efa6a61289e8f8357cf1604504 (diff)
downloadmongo-0e0adf8855859a206ff41188cc5b128cc37d5f40.tar.gz
Enable/disable DB-level locking at compile time.
Use the "--mongod-concurrency-level=db" flag to scons to enable db-level locking. Defaults to disabled, can be disabled explicitly with "--mongod-concurrency-level=global".
Diffstat (limited to 'SConstruct')
-rw-r--r--SConstruct16
1 files changed, 12 insertions, 4 deletions
diff --git a/SConstruct b/SConstruct
index ff7e3427cd7..2def84cfe9f 100644
--- a/SConstruct
+++ b/SConstruct
@@ -64,21 +64,23 @@ options = {}
options_topass = {}
-def add_option( name, help , nargs , contibutesToVariantDir , dest=None ):
+def add_option( name, help , nargs , contributesToVariantDir , dest=None,
+ type="string", choices=None ):
if dest is None:
dest = name
AddOption( "--" + name ,
dest=dest,
- type="string",
+ type=type,
nargs=nargs,
action="store",
+ choices=choices,
help=help )
options[name] = { "help" : help ,
"nargs" : nargs ,
- "contibutesToVariantDir" : contibutesToVariantDir ,
+ "contributesToVariantDir" : contributesToVariantDir ,
"dest" : dest }
def get_option( name ):
@@ -115,7 +117,7 @@ def get_variant_dir():
o = options[name]
if not has_option( o["dest"] ):
continue
- if not o["contibutesToVariantDir"]:
+ if not o["contributesToVariantDir"]:
continue
if o["nargs"] == 0:
@@ -215,6 +217,9 @@ add_option( "use-cpu-profiler",
"Link against the google-perftools profiler library",
0, True )
+add_option("mongod-concurrency-level", "Concurrency level, \"global\" or \"db\"", 1, True,
+ type="choice", choices=["global", "db"])
+
# don't run configure if user calls --help
if GetOption('help'):
Return()
@@ -281,6 +286,9 @@ env = Environment( BUILD_DIR=variantDir,
PCRE_VERSION='8.30',
)
+if has_option('mongod-concurrency-level'):
+ env.Append(CPPDEFINES=['MONGOD_CONCURRENCY_LEVEL=MONGOD_CONCURRENCY_LEVEL_%s' % get_option('mongod-concurrency-level').upper()])
+ print str(env['CPPDEFINES'])
libdeps.setup_environment( env )