mirror of
https://github.com/mongodb/mongo.git
synced 2024-11-30 17:10:48 +01:00
SERVER-13916 added scons flag --server-js to build mongod without JavaScript support while still building shell
Additional changes: fixed scons --noshell flag fixed scons flag --js-engine=none to imply --noshell
This commit is contained in:
parent
01f5345e66
commit
00fe4ffaf0
@ -239,6 +239,8 @@ add_option( "wiredtiger", "Enable wiredtiger", "?", True, "wiredtiger",
|
||||
js_engine_choices = ['v8-3.12', 'v8-3.25', 'none']
|
||||
add_option( "js-engine", "JavaScript scripting engine implementation", 1, False,
|
||||
type='choice', default=js_engine_choices[0], choices=js_engine_choices)
|
||||
add_option( "server-js", "Build mongod without JavaScript support", 1, False,
|
||||
type='choice', choices=["on", "off"], const="on", default="on")
|
||||
add_option( "libc++", "use libc++ (experimental, requires clang)", 0, True )
|
||||
|
||||
add_option( "use-glibcxx-debug",
|
||||
@ -516,11 +518,16 @@ noshell = has_option( "noshell" )
|
||||
|
||||
jsEngine = get_option( "js-engine")
|
||||
|
||||
serverJs = get_option( "server-js" ) == "on"
|
||||
|
||||
usev8 = (jsEngine != 'none')
|
||||
|
||||
v8version = jsEngine[3:] if jsEngine.startswith('v8-') else 'none'
|
||||
v8suffix = '' if v8version == '3.12' else '-' + v8version
|
||||
|
||||
if not serverJs and not usev8:
|
||||
print("Warning: --server-js=off is not needed with --js-engine=none")
|
||||
|
||||
# The Scons 'default' tool enables a lot of tools that we don't actually need to enable.
|
||||
# On platforms like Solaris, it actually does the wrong thing by enabling the sunstudio
|
||||
# toolchain first. As such it is simpler and more efficient to manually load the precise
|
||||
@ -2407,6 +2414,7 @@ Export("env")
|
||||
Export("get_option")
|
||||
Export("has_option use_system_version_of_library")
|
||||
Export("mongoCodeVersion")
|
||||
Export("serverJs")
|
||||
Export("usev8")
|
||||
Export("v8version v8suffix")
|
||||
Export("boostSuffix")
|
||||
|
@ -9,6 +9,7 @@ from buildscripts import utils
|
||||
Import("env")
|
||||
Import("has_option")
|
||||
Import("get_option")
|
||||
Import("serverJs")
|
||||
Import("usev8")
|
||||
Import("v8suffix")
|
||||
Import("darwin windows solaris linux nix")
|
||||
@ -548,6 +549,17 @@ env.Library(
|
||||
],
|
||||
)
|
||||
|
||||
env.Library(
|
||||
target='scripting_none',
|
||||
source=[
|
||||
'scripting/engine_none.cpp',
|
||||
],
|
||||
LIBDEPS=[
|
||||
'bson_template_evaluator',
|
||||
'scripting_common',
|
||||
],
|
||||
)
|
||||
|
||||
env.Library('bson_template_evaluator', ["scripting/bson_template_evaluator.cpp"],
|
||||
LIBDEPS=['bson'])
|
||||
env.CppUnitTest('bson_template_evaluator_test', ['scripting/bson_template_evaluator_test.cpp'],
|
||||
@ -574,11 +586,28 @@ else:
|
||||
env.Library(
|
||||
target='scripting',
|
||||
source=[
|
||||
'scripting/engine_none.cpp',
|
||||
],
|
||||
LIBDEPS=[
|
||||
'bson_template_evaluator',
|
||||
'scripting_common',
|
||||
'scripting_none',
|
||||
],
|
||||
)
|
||||
|
||||
if serverJs:
|
||||
env.Library(
|
||||
target='scripting_server',
|
||||
source=[
|
||||
],
|
||||
LIBDEPS=[
|
||||
'scripting',
|
||||
],
|
||||
)
|
||||
else:
|
||||
env.Library(
|
||||
target='scripting_server',
|
||||
source=[
|
||||
],
|
||||
LIBDEPS=[
|
||||
'scripting_none',
|
||||
],
|
||||
)
|
||||
|
||||
@ -945,7 +974,7 @@ serveronlyLibdeps = ["coreshard",
|
||||
"global_optime",
|
||||
"index_key_validate",
|
||||
'range_deleter',
|
||||
'scripting',
|
||||
'scripting_server',
|
||||
"update_index_data",
|
||||
's/metadata',
|
||||
's/batch_write_types',
|
||||
@ -1226,7 +1255,7 @@ coreShellFiles = [ "shell/bench.cpp",
|
||||
"shell/mk_wcwidth.cpp",
|
||||
"shell/shell_options_init.cpp" ]
|
||||
|
||||
if not has_option('noshell'):
|
||||
if not has_option('noshell') and usev8:
|
||||
env.Library("shell_core", coreShellFiles,
|
||||
LIBDEPS=['clientandshell',
|
||||
'db/index/external_key_generator',
|
||||
@ -1251,6 +1280,8 @@ if not has_option('noshell'):
|
||||
])
|
||||
|
||||
shellEnv.Install( '#/', mongo_shell )
|
||||
else:
|
||||
shellEnv = None
|
||||
|
||||
# ---- INSTALL -------
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user