summaryrefslogtreecommitdiffstats
path: root/js/src/moz.build
blob: a6ee7b7375a3decd57a27de350a6041319ec4aec (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
# -*- 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/.

include('js-config.mozbuild')
include('js-cxxflags.mozbuild')
include('js-testing.mozbuild')

CONFIGURE_SUBST_FILES += [
    'js-config',
    'js.pc',
]

CONFIGURE_DEFINE_FILES += [
    'js-confdefs.h',
]

if not CONFIG['JS_STANDALONE']:
    LIBRARY_DEFINES['MOZ_HAS_MOZGLUE'] = True

    CONFIGURE_SUBST_FILES += [
        '../../config/autoconf-js.mk',
        '../../config/emptyvars-js.mk',
    ]

CONFIGURE_DEFINE_FILES += [
    'js-config.h',
]

if CONFIG['HAVE_DTRACE']:
    GENERATED_FILES += ['javascript-trace.h']
    EXPORTS += ['!javascript-trace.h']

# Changes to internal header files, used externally, massively slow down
# browser builds.  Don't add new files here unless you know what you're
# doing!
EXPORTS += [
    '!js-config.h',
    'js.msg',
    'jsalloc.h',
    'jsapi.h',
    'jsbytecode.h',
    'jsclist.h',
    'jscpucfg.h',
    'jsfriendapi.h',
    'jsprf.h',
    'jsprototypes.h',
    'jspubtd.h',
    'jstypes.h',
    'jsversion.h',
    'jswrapper.h',
]

# If you add a header here, add it to js/src/jsapi-tests/testIntTypesABI.cpp so
# that we ensure we don't over-expose our internal integer typedefs.  Note that
# LegacyIntTypes.h below is deliberately exempted from this requirement.
EXPORTS.js += [
    '../public/CallArgs.h',
    '../public/CallNonGenericMethod.h',
    '../public/CharacterEncoding.h',
    '../public/Class.h',
    '../public/Conversions.h',
    '../public/Date.h',
    '../public/Debug.h',
    '../public/GCAnnotations.h',
    '../public/GCAPI.h',
    '../public/GCHashTable.h',
    '../public/GCPolicyAPI.h',
    '../public/GCVariant.h',
    '../public/GCVector.h',
    '../public/HashTable.h',
    '../public/HeapAPI.h',
    '../public/Id.h',
    '../public/Initialization.h',
    '../public/LegacyIntTypes.h',
    '../public/MemoryMetrics.h',
    '../public/Principals.h',
    '../public/ProfilingFrameIterator.h',
    '../public/ProfilingStack.h',
    '../public/Proxy.h',
    '../public/Realm.h',
    '../public/RequiredDefines.h',
    '../public/RootingAPI.h',
    '../public/SliceBudget.h',
    '../public/StructuredClone.h',
    '../public/SweepingAPI.h',
    '../public/TraceKind.h',
    '../public/TracingAPI.h',
    '../public/TrackedOptimizationInfo.h',
    '../public/TypeDecls.h',
    '../public/UbiNode.h',
    '../public/UbiNodeBreadthFirst.h',
    '../public/UbiNodeCensus.h',
    '../public/UbiNodeDominatorTree.h',
    '../public/UbiNodePostOrder.h',
    '../public/UbiNodeShortestPaths.h',
    '../public/UniquePtr.h',
    '../public/Utility.h',
    '../public/Value.h',
    '../public/Vector.h',
    '../public/WeakMapPtr.h',
]

DIRS += [
    'builtin',
    'devtools',
    'ds',
    'frontend',
    'gc',
    'irregexp',
    'jit',
    'perf',
    'proxy',
    'threading',
    'wasm',
]

if CONFIG['JS_HAS_CTYPES']:
    DIRS += ['ctypes']

if CONFIG['JS_BUNDLED_EDITLINE']:
    DIRS += ['editline']

if CONFIG['JS_NEW_REGEXP']:
    DIRS += ['regexp']

if not CONFIG['JS_DISABLE_SHELL']:
    DIRS += ['shell']

if CONFIG['MOZ_VTUNE']:
    DIRS += ['vtune']

SOURCES += [
    'jsalloc.cpp',
    'jsapi.cpp',
    'jsarray.cpp',
    'jsatom.cpp',
    'jsbool.cpp',
    'jscntxt.cpp',
    'jscompartment.cpp',
    'jsdate.cpp',
    'jsdtoa.cpp',
    'jsexn.cpp',
    'jsfriendapi.cpp',
    'jsfun.cpp',
    'jsgc.cpp',
    'jsiter.cpp',
    'jsmath.cpp',
    'jsnativestack.cpp',
    'jsnum.cpp',
    'jsobj.cpp',
    'json.cpp',
    'jsopcode.cpp',
    'jsprf.cpp',
    'jspropertytree.cpp',
    'jsscript.cpp',
    'jsstr.cpp',
    'jsutil.cpp',
    'jsweakmap.cpp',
]

# 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']

SOURCES += [
    'vm/ArgumentsObject.cpp',
    'vm/ArrayBufferObject.cpp',
    'vm/AsyncFunction.cpp',
    'vm/AsyncIteration.cpp',
    'vm/Caches.cpp',
    'vm/CallNonGenericMethod.cpp',
    'vm/CharacterEncoding.cpp',
    'vm/CodeCoverage.cpp',
    'vm/Compression.cpp',
    'vm/DateTime.cpp',
    'vm/Debugger.cpp',
    'vm/DebuggerMemory.cpp',
    'vm/EnvironmentObject.cpp',
    'vm/ErrorObject.cpp',
    'vm/ForOfIterator.cpp',
    'vm/GeneratorObject.cpp',
    'vm/GlobalObject.cpp',
    'vm/HelperThreads.cpp',
    'vm/Id.cpp',
    'vm/Initialization.cpp',
    'vm/Interpreter.cpp',
    'vm/JSONParser.cpp',
    'vm/MemoryMetrics.cpp',
    'vm/NativeObject.cpp',
    'vm/ObjectGroup.cpp',
    'vm/PIC.cpp',
    'vm/Printer.cpp',
    'vm/Probes.cpp',
    'vm/ProxyObject.cpp',
    'vm/Realm.cpp',
    'vm/ReceiverGuard.cpp',
    'vm/RegExpObject.cpp',
    'vm/RegExpStatics.cpp',
    'vm/Runtime.cpp',
    'vm/SavedStacks.cpp',
    'vm/Scope.cpp',
    'vm/SelfHosting.cpp',
    'vm/Shape.cpp',
    'vm/SharedArrayObject.cpp',
    'vm/SharedImmutableStringsCache.cpp',
    'vm/SPSProfiler.cpp',
    'vm/Stack.cpp',
    'vm/Stopwatch.cpp',
    'vm/String.cpp',
    'vm/StringBuffer.cpp',
    'vm/StructuredClone.cpp',
    'vm/Symbol.cpp',
    'vm/TaggedProto.cpp',
    'vm/Time.cpp',
    'vm/TypedArrayObject.cpp',
    'vm/TypeInference.cpp',
    'vm/UbiNode.cpp',
    'vm/UbiNodeCensus.cpp',
    'vm/UbiNodeShortestPaths.cpp',
    'vm/UnboxedObject.cpp',
    'vm/Unicode.cpp',
    'vm/Value.cpp',
    'vm/WeakMapPtr.cpp',
    'vm/Xdr.cpp',
]

if CONFIG['JS_POSIX_NSPR']:
    SOURCES += [
        'vm/PosixNSPR.cpp',
    ]

if CONFIG['ENABLE_TRACE_LOGGING']:
    SOURCES += [
        'vm/TraceLogging.cpp',
        'vm/TraceLoggingGraph.cpp',
        'vm/TraceLoggingTypes.cpp',
    ]

# JavaScript must be built shared, even for static builds, as it is used by
# other modules which are always built shared. Failure to do so results in
# the js code getting copied into xpinstall and jsd as well as mozilla-bin,
# and then the static data cells used for locking no longer work.
#
# In fact, we now build both a static and a shared library, as the
# JS shell would like to link to the static library.

if CONFIG['JS_SHARED_LIBRARY']:
    GeckoSharedLibrary('js', linkage=None)
    SHARED_LIBRARY_NAME = CONFIG['JS_LIBRARY_NAME']
    SDK_LIBRARY = True
else:
    Library('js')

FORCE_STATIC_LIB = True
STATIC_LIBRARY_NAME = 'js_static'

if not CONFIG['MOZ_ICU_DATA_ARCHIVE']:
    USE_LIBS += [
        'icu',
    ]
else:
    # Linking 'icu' will pull in the stubdata library,
    # which the shell doesn't want, so link the other bits.
    USE_LIBS += [
        'icui18n',
        'icuuc',
    ]

USE_LIBS += [
    'nspr',
    'zlib',
]

if CONFIG['OS_ARCH'] not in ('WINNT'):
    OS_LIBS += ['m']

if CONFIG['OS_ARCH'] == 'FreeBSD':
    OS_LIBS += ['-pthread']

if CONFIG['OS_ARCH'] == 'Linux':
    OS_LIBS += ['dl']

if CONFIG['OS_ARCH'] == 'SunOS':
    OS_LIBS += [
        'posix4',
        'dl',
        'nsl',
        'socket',
    ]

OS_LIBS += CONFIG['REALTIME_LIBS']

NO_EXPAND_LIBS = True

DIST_INSTALL = True