summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt A. Tobin <email@mattatobin.com>2020-11-03 15:20:38 -0500
committerMatt A. Tobin <email@mattatobin.com>2020-11-03 15:20:38 -0500
commit0cdd39ff120ecf40f8a3443529ec917cf50b867a (patch)
tree369ee274a5320c8900008aef8b9f88432b8e8faf
parent5bf19933d83d4c018eb222d2fd7b13c0e9df3c5f (diff)
downloaduxp-0cdd39ff120ecf40f8a3443529ec917cf50b867a.tar.gz
Issue #1676 - Part 3: Split DEFINES out of js/src/moz.build
-rw-r--r--js/src/js-config.mozbuild32
-rw-r--r--js/src/moz.build41
2 files changed, 37 insertions, 36 deletions
diff --git a/js/src/js-config.mozbuild b/js/src/js-config.mozbuild
new file mode 100644
index 0000000000..82fb4e53e3
--- /dev/null
+++ b/js/src/js-config.mozbuild
@@ -0,0 +1,32 @@
+# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+# Also set in shell/moz.build
+DEFINES['ENABLE_SHARED_ARRAY_BUFFER'] = True
+
+DEFINES['EXPORT_JS_API'] = True
+
+if CONFIG['NIGHTLY_BUILD']:
+ DEFINES['ENABLE_BINARYDATA'] = True
+
+if CONFIG['NIGHTLY_BUILD']:
+ DEFINES['ENABLE_SIMD'] = True
+
+if CONFIG['JS_HAS_CTYPES']:
+ DEFINES['JS_HAS_CTYPES'] = True
+ for var in ('DLL_PREFIX', 'DLL_SUFFIX'):
+ DEFINES[var] = '"%s"' % CONFIG[var]
+
+if CONFIG['MOZ_LINKER']:
+ DEFINES['MOZ_LINKER'] = True
+
+if CONFIG['JS_HAS_CTYPES']:
+ if not CONFIG['MOZ_SYSTEM_FFI']:
+ # Windows needs this to be linked with a static library.
+ DEFINES['FFI_BUILDING'] = True
+
+if CONFIG['OS_ARCH'] == 'WINNT':
+ DEFINES['_CRT_RAND_S'] = True
+ DEFINES['NOMINMAX'] = True \ No newline at end of file
diff --git a/js/src/moz.build b/js/src/moz.build
index 09e4714161..144f21aebf 100644
--- a/js/src/moz.build
+++ b/js/src/moz.build
@@ -3,6 +3,7 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+include('js-config.mozbuild')
include('js-cxxflags.mozbuild')
include('js-testing.mozbuild')
@@ -37,7 +38,6 @@ CONFIGURE_DEFINE_FILES += [
if CONFIG['HAVE_DTRACE']:
GENERATED_FILES += ['javascript-trace.h']
-
EXPORTS += ['!javascript-trace.h']
# Changes to internal header files, used externally, massively slow down
@@ -538,7 +538,6 @@ if CONFIG['OS_ARCH'] == 'WINNT':
'threading/windows/Thread.cpp',
]
# _CRT_RAND_S must be #defined before #including stdlib.h to get rand_s()
- DEFINES['_CRT_RAND_S'] = True
else:
SOURCES += [
'threading/posix/ConditionVariable.cpp',
@@ -615,24 +614,6 @@ USE_LIBS += [
'zlib',
]
-if CONFIG['NIGHTLY_BUILD']:
- DEFINES['ENABLE_BINARYDATA'] = True
-
-if CONFIG['NIGHTLY_BUILD']:
- DEFINES['ENABLE_SIMD'] = True
-
-# Also set in shell/moz.build
-DEFINES['ENABLE_SHARED_ARRAY_BUFFER'] = True
-
-DEFINES['EXPORT_JS_API'] = True
-
-if CONFIG['JS_HAS_CTYPES']:
- DEFINES['JS_HAS_CTYPES'] = True
- for var in ('DLL_PREFIX', 'DLL_SUFFIX'):
- DEFINES[var] = '"%s"' % CONFIG[var]
-
-if CONFIG['MOZ_LINKER']:
- DEFINES['MOZ_LINKER'] = True
if CONFIG['_MSC_VER']:
if CONFIG['CPU_ARCH'] == 'x86':
@@ -641,19 +622,13 @@ if CONFIG['_MSC_VER']:
SOURCES['ctypes/CTypes.cpp'].no_pgo = True # Bug 810661
if CONFIG['OS_ARCH'] not in ('WINNT'):
- OS_LIBS += [
- 'm',
- ]
+ OS_LIBS += ['m']
if CONFIG['OS_ARCH'] == 'FreeBSD':
- OS_LIBS += [
- '-pthread',
- ]
+ OS_LIBS += ['-pthread']
if CONFIG['OS_ARCH'] == 'Linux':
- OS_LIBS += [
- 'dl',
- ]
+ OS_LIBS += ['dl']
if CONFIG['OS_ARCH'] == 'SunOS':
OS_LIBS += [
@@ -706,15 +681,9 @@ selfhosted.inputs = [
'builtin/WeakSet.js'
]
-if CONFIG['JS_HAS_CTYPES']:
- if not CONFIG['MOZ_SYSTEM_FFI']:
- # Windows needs this to be linked with a static library.
- DEFINES['FFI_BUILDING'] = True
-
# Suppress warnings in third-party code.
# We are keeping this in the main moz.build because it is file specific
if CONFIG['CLANG_CXX'] or CONFIG['GNU_CXX']:
SOURCES['jsdtoa.cpp'].flags += ['-Wno-implicit-fallthrough']
-if CONFIG['OS_ARCH'] == 'WINNT':
- DEFINES['NOMINMAX'] = True
+