summaryrefslogtreecommitdiff
path: root/SConstruct
diff options
context:
space:
mode:
authorAndrew Morrow <acm@mongodb.com>2018-06-04 10:40:41 -0400
committerAndrew Morrow <acm@mongodb.com>2018-07-17 15:31:15 -0400
commitd175ae80e6af61f9f37bdebbde3b2b5115ae2a9f (patch)
tree491b4c6d5ca985c4a31f2819b35d4d6a0683e631 /SConstruct
parent1c0bce5f9792f0f6d4f26cd041a0c60c0398bd5e (diff)
downloadmongo-d175ae80e6af61f9f37bdebbde3b2b5115ae2a9f.tar.gz
SERVER-36147 Add basic support for targeting emscripten
Diffstat (limited to 'SConstruct')
-rw-r--r--SConstruct26
1 files changed, 14 insertions, 12 deletions
diff --git a/SConstruct b/SConstruct
index c840aaa2480..922ab79ef34 100644
--- a/SConstruct
+++ b/SConstruct
@@ -727,10 +727,6 @@ env_vars.Add('MONGO_BUILDINFO_ENVIRONMENT_DATA',
help='Sets the info returned from the buildInfo command and --version command-line flag',
default=mongo_generators.default_buildinfo_environment_data())
-# Exposed to be able to cross compile Android/*nix from Windows without ending up with the .exe suffix.
-env_vars.Add('PROGSUFFIX',
- help='Sets the suffix for built executable files')
-
env_vars.Add('MONGO_DIST_SRC_PREFIX',
help='Sets the prefix for files in the source distribution archive',
converter=variable_distsrc_converter,
@@ -773,6 +769,10 @@ env_vars.Add('OBJCOPY',
help='Sets the path to objcopy',
default=WhereIs('objcopy'))
+# Exposed to be able to cross compile Android/*nix from Windows without ending up with the .exe suffix.
+env_vars.Add('PROGSUFFIX',
+ help='Sets the suffix for built executable files')
+
env_vars.Add('RPATH',
help='Set the RPATH for dynamic libraries and executables',
converter=variable_shlex_converter)
@@ -1049,13 +1049,14 @@ elif endian == "big":
# NOTE: Remember to add a trailing comma to form any required one
# element tuples, or your configure checks will fail in strange ways.
processor_macros = {
- 'arm' : { 'endian': 'little', 'defines': ('__arm__',) },
- 'aarch64' : { 'endian': 'little', 'defines': ('__arm64__', '__aarch64__')},
- 'i386' : { 'endian': 'little', 'defines': ('__i386', '_M_IX86')},
- 'ppc64le' : { 'endian': 'little', 'defines': ('__powerpc64__',)},
- 's390x' : { 'endian': 'big', 'defines': ('__s390x__',)},
- 'sparc' : { 'endian': 'big', 'defines': ('__sparc',)},
- 'x86_64' : { 'endian': 'little', 'defines': ('__x86_64', '_M_AMD64')},
+ 'arm' : { 'endian': 'little', 'defines': ('__arm__',) },
+ 'aarch64' : { 'endian': 'little', 'defines': ('__arm64__', '__aarch64__')},
+ 'i386' : { 'endian': 'little', 'defines': ('__i386', '_M_IX86')},
+ 'ppc64le' : { 'endian': 'little', 'defines': ('__powerpc64__',)},
+ 's390x' : { 'endian': 'big', 'defines': ('__s390x__',)},
+ 'sparc' : { 'endian': 'big', 'defines': ('__sparc',)},
+ 'x86_64' : { 'endian': 'little', 'defines': ('__x86_64', '_M_AMD64')},
+ 'emscripten' : { 'endian': 'little', 'defines': ('__EMSCRIPTEN__', )},
}
def CheckForProcessor(context, which_arch):
@@ -1109,6 +1110,7 @@ os_macros = {
"macOS": "defined(__APPLE__) && (TARGET_OS_OSX || (TARGET_OS_MAC && !TARGET_OS_IPHONE))",
"linux": "defined(__linux__)",
"android": "defined(__ANDROID__)",
+ "emscripten": "defined(__EMSCRIPTEN__)",
}
def CheckForOS(context, which_os):
@@ -1711,7 +1713,7 @@ if env.TargetOSIs('posix'):
# -Winvalid-pch Warn if a precompiled header (see Precompiled Headers) is found in the search path but can't be used.
env.Append( CCFLAGS=["-fno-omit-frame-pointer",
"-fno-strict-aliasing",
- "-ggdb",
+ "-ggdb" if not env.TargetOSIs('emscripten') else "-g",
"-pthread",
"-Wall",
"-Wsign-compare",