no bug - Bumping Firefox l10n changesets r=release a=l10n-bump DONTBUILD CLOSED TREE
[gecko.git] / js / src / moz.build
blob63d0d75509558a08fff81ac507ff57656e126ccb
1 # -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
2 # vim: set filetype=python:
3 # This Source Code Form is subject to the terms of the Mozilla Public
4 # License, v. 2.0. If a copy of the MPL was not distributed with this
5 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
7 include("js-config.mozbuild")
8 include("js-cxxflags.mozbuild")
10 # Directory metadata
11 component_engine = ("Core", "JavaScript Engine")
12 component_gc = ("Core", "JavaScript: GC")
13 component_intl = ("Core", "JavaScript: Internationalization API")
14 component_jit = ("Core", "JavaScript Engine: JIT")
15 component_stl = ("Core", "JavaScript: Standard Library")
16 component_wasm = ("Core", "Javascript: Web Assembly")
18 FILES_PER_UNIFIED_FILE = 6
20 # Prevent redefining FILES_PER_UNIFIED_FILE in each sub-directory of js. This
21 # will not escape this directory.
22 export("FILES_PER_UNIFIED_FILE")
24 with Files("*"):
25     BUG_COMPONENT = component_engine
27 with Files("wasm/**"):
28     BUG_COMPONENT = component_wasm
29 with Files("builtin/**"):
30     BUG_COMPONENT = component_stl
31 with Files("ctypes/**"):
32     BUG_COMPONENT = ("Core", "js-ctypes")
33 with Files("gc/**"):
34     BUG_COMPONENT = component_gc
35 with Files("jit/**"):
36     BUG_COMPONENT = component_jit
38 # File-specific metadata
39 for gcfile in ["devtools/rootAnalysis", "devtools/gc-ubench", "devtools/gctrace"]:
40     with Files(gcfile):
41         BUG_COMPONENT = component_gc
43 for stlfile in ["jsdate.*", "jsnum.*"]:
44     with Files(stlfile):
45         BUG_COMPONENT = component_stl
47 with Files("builtin/intl/*"):
48     BUG_COMPONENT = component_intl
50 if not CONFIG["JS_DISABLE_SHELL"]:
51     DIRS += [
52         "rust",
53         "shell",
54     ]
56     TEST_DIRS += [
57         "gdb",
58         "jsapi-tests",
59         "tests",
60     ]
62     if CONFIG["FUZZING_INTERFACES"]:
63         TEST_DIRS += [
64             "fuzz-tests",
65         ]
67 if CONFIG["FUZZING_INTERFACES"] and CONFIG["LIBFUZZER"]:
68     # In addition to regular coverage provided by trace-pc-guard,
69     # LibFuzzer can use trace-cmp to instrument various compare instructions.
70     # Only use this feature on source files that do a lot of constant
71     # comparisons that would otherwise be hard to guess by LibFuzzer,
72     # as it comes with a larger overhead (requires -use_value_profile=1).
73     include("/tools/fuzzing/libfuzzer-flags.mozbuild")
75     # Any files that are targeted by LibFuzzer should be added here so they can
76     # be built with the necessary instrumentation flags, rather than just building
77     # the whole JS engine with instrumentation, to reduce the amount of noise.
78     SOURCES += [
79         "vm/StructuredClone.cpp",
80     ]
81     SOURCES["vm/StructuredClone.cpp"].flags += libfuzzer_flags
82 else:
83     UNIFIED_SOURCES += [
84         "vm/StructuredClone.cpp",
85     ]
87 if CONFIG["FUZZING_JS_FUZZILLI"]:
88     # When building for Fuzzilli, we instrument everything with standard
89     # trace-pc instrumentation.
90     include("/tools/fuzzing/libfuzzer-config.mozbuild")
92 CONFIGURE_DEFINE_FILES += [
93     "js-confdefs.h",
96 if not CONFIG["JS_STANDALONE"]:
97     CONFIGURE_SUBST_FILES += [
98         "../../config/autoconf-js.mk",
99         "../../config/emptyvars-js.mk",
100     ]
102 CONFIGURE_DEFINE_FILES += [
103     "js-config.h",
106 if CONFIG["HAVE_DTRACE"]:
107     GeneratedFile("javascript-trace.h")
108     EXPORTS += ["!javascript-trace.h"]
110 # Changes to internal header files, used externally, massively slow down
111 # browser builds.  Don't add new files here unless you know what you're
112 # doing!
113 EXPORTS += [
114     "!js-config.h",
115     "jsapi.h",
116     "jsfriendapi.h",
117     "jspubtd.h",
118     "jstypes.h",
121 EXPORTS.js += [
122     "!../public/PrefsGenerated.h",
123     "../public/AllocationLogging.h",
124     "../public/AllocationRecording.h",
125     "../public/AllocPolicy.h",
126     "../public/Array.h",
127     "../public/ArrayBuffer.h",
128     "../public/ArrayBufferMaybeShared.h",
129     "../public/BigInt.h",
130     "../public/BuildId.h",
131     "../public/CallAndConstruct.h",
132     "../public/CallArgs.h",
133     "../public/CallNonGenericMethod.h",
134     "../public/CharacterEncoding.h",
135     "../public/Class.h",
136     "../public/ColumnNumber.h",
137     "../public/ComparisonOperators.h",
138     "../public/CompilationAndEvaluation.h",
139     "../public/CompileOptions.h",
140     "../public/Context.h",
141     "../public/ContextOptions.h",
142     "../public/Conversions.h",
143     "../public/Date.h",
144     "../public/Debug.h",
145     "../public/Equality.h",
146     "../public/ErrorInterceptor.h",
147     "../public/ErrorReport.h",
148     "../public/Exception.h",
149     "../public/ForOfIterator.h",
150     "../public/GCAnnotations.h",
151     "../public/GCAPI.h",
152     "../public/GCHashTable.h",
153     "../public/GCPolicyAPI.h",
154     "../public/GCTypeMacros.h",
155     "../public/GCVariant.h",
156     "../public/GCVector.h",
157     "../public/GlobalObject.h",
158     "../public/HashTable.h",
159     "../public/HeapAPI.h",
160     "../public/HelperThreadAPI.h",
161     "../public/Id.h",
162     "../public/Initialization.h",
163     "../public/Interrupt.h",
164     "../public/Iterator.h",
165     "../public/JitCodeAPI.h",
166     "../public/JSON.h",
167     "../public/LocaleSensitive.h",
168     "../public/MapAndSet.h",
169     "../public/MemoryCallbacks.h",
170     "../public/MemoryFunctions.h",
171     "../public/MemoryMetrics.h",
172     "../public/Modules.h",
173     "../public/Object.h",
174     "../public/Prefs.h",
175     "../public/Principals.h",
176     "../public/Printer.h",
177     "../public/Printf.h",
178     "../public/ProfilingCategory.h",
179     "../public/ProfilingFrameIterator.h",
180     "../public/ProfilingStack.h",
181     "../public/Promise.h",
182     "../public/PropertyAndElement.h",
183     "../public/PropertyDescriptor.h",
184     "../public/PropertySpec.h",
185     "../public/ProtoKey.h",
186     "../public/Proxy.h",
187     "../public/Realm.h",
188     "../public/RealmIterators.h",
189     "../public/RealmOptions.h",
190     "../public/RefCounted.h",
191     "../public/RegExp.h",
192     "../public/RegExpFlags.h",
193     "../public/Result.h",
194     "../public/RootingAPI.h",
195     "../public/SavedFrameAPI.h",
196     "../public/ScalarType.h",
197     "../public/ScriptPrivate.h",
198     "../public/ShadowRealmCallbacks.h",
199     "../public/SharedArrayBuffer.h",
200     "../public/SliceBudget.h",
201     "../public/SourceText.h",
202     "../public/StableStringChars.h",
203     "../public/Stack.h",
204     "../public/StreamConsumer.h",
205     "../public/String.h",
206     "../public/StructuredClone.h",
207     "../public/Symbol.h",
208     "../public/TelemetryTimers.h",
209     "../public/TraceKind.h",
210     "../public/TracingAPI.h",
211     "../public/Transcoding.h",
212     "../public/TypeDecls.h",
213     "../public/UbiNode.h",
214     "../public/UbiNodeBreadthFirst.h",
215     "../public/UbiNodeCensus.h",
216     "../public/UbiNodeDominatorTree.h",
217     "../public/UbiNodePostOrder.h",
218     "../public/UbiNodeShortestPaths.h",
219     "../public/UbiNodeUtils.h",
220     "../public/UniquePtr.h",
221     "../public/Utility.h",
222     "../public/Value.h",
223     "../public/ValueArray.h",
224     "../public/Vector.h",
225     "../public/WaitCallbacks.h",
226     "../public/Warnings.h",
227     "../public/WasmFeatures.h",
228     "../public/WasmModule.h",
229     "../public/WeakMap.h",
230     "../public/WeakMapPtr.h",
231     "../public/Wrapper.h",
232     "../public/WrapperCallbacks.h",
233     "../public/Zone.h",
236 # This lives in mozglue/baseprofiler but we re-publish ourselves to support
237 # standalone SpiderMonkey configurations.
238 EXPORTS.js += [
239     "!/mozglue/baseprofiler/public/ProfilingCategoryList.h",
242 # Public APIs that are experimental: the precise contour of the APIs may still
243 # change, but they're at least plausible first passes at designing something.
244 # We expose them as-is, buyer beware.
245 EXPORTS.js.experimental += [
246     "../public/experimental/CodeCoverage.h",
247     "../public/experimental/CompileScript.h",
248     "../public/experimental/CTypes.h",
249     "../public/experimental/Intl.h",
250     "../public/experimental/JitInfo.h",
251     "../public/experimental/JSStencil.h",
252     "../public/experimental/PCCountProfiling.h",
253     "../public/experimental/SourceHook.h",
254     "../public/experimental/TypedData.h",
257 # Friend APIs are APIs that either basically SpiderMonkey-internal, or their
258 # contours are gross and terrible -- but the functionality is too important to
259 # some embedder (often, Gecko) to just not expose anything or to agonize through
260 # a clean design.  Use this only if you absolutely must, and feel free to
261 # propose clean APIs to replace what's here!
262 EXPORTS.js.friend += [
263     "../public/friend/DOMProxy.h",
264     "../public/friend/DumpFunctions.h",
265     "../public/friend/ErrorMessages.h",
266     "../public/friend/ErrorNumbers.msg",
267     "../public/friend/JSMEnvironment.h",
268     "../public/friend/PerformanceHint.h",
269     "../public/friend/StackLimits.h",
270     "../public/friend/UsageStatistics.h",
271     "../public/friend/WindowProxy.h",
272     "../public/friend/XrayJitInfo.h",
275 # "Shadow" API defines the internal layout of public JSAPI types like |JSObject|
276 # and |JSString|, so that other *inline* public functions can efficiently access
277 # their internal fields.
279 # Embedders must never include these headers themselves or use their contents.
280 # These internal layout details are publicly exposed for access *only* so that
281 # other public API definitions may use them.
283 # When adding new shadow structure definitions (or new fields/static constants
284 # to existing structures) for access by inline methods, make sure to add static
285 # asserts to the original header file to ensure that offsets and duplicated
286 # constants are consistent.  (Long term, it might be worth figuring out some way
287 # to back actual implementations *with* these shadow definitions to eliminate
288 # this requirement.)
289 EXPORTS.js.shadow += [
290     "../public/shadow/Function.h",
291     "../public/shadow/Object.h",
292     "../public/shadow/Realm.h",
293     "../public/shadow/Shape.h",
294     "../public/shadow/String.h",
295     "../public/shadow/Symbol.h",
296     "../public/shadow/Zone.h",
299 UNIFIED_SOURCES += [
300     "builtin/Array.cpp",
301     "builtin/AtomicsObject.cpp",
302     "builtin/BigInt.cpp",
303     "builtin/Boolean.cpp",
304     "builtin/DataViewObject.cpp",
305     "builtin/Eval.cpp",
306     "builtin/FinalizationRegistryObject.cpp",
307     "builtin/JSON.cpp",
308     "builtin/MapObject.cpp",
309     "builtin/ModuleObject.cpp",
310     "builtin/Object.cpp",
311     "builtin/ParseRecordObject.cpp",
312     "builtin/Profilers.cpp",
313     "builtin/Promise.cpp",
314     "builtin/RawJSONObject.cpp",
315     "builtin/Reflect.cpp",
316     "builtin/ReflectParse.cpp",
317     "builtin/ShadowRealm.cpp",
318     "builtin/String.cpp",
319     "builtin/Symbol.cpp",
320     "builtin/TestingFunctions.cpp",
321     "builtin/TestingUtility.cpp",
322     "builtin/WeakMapObject.cpp",
323     "builtin/WeakRefObject.cpp",
324     "builtin/WeakSetObject.cpp",
325     "builtin/WrappedFunctionObject.cpp",
326     "ds/Bitmap.cpp",
327     "ds/LifoAlloc.cpp",
328     "jsapi.cpp",
329     "jsdate.cpp",
330     "jsexn.cpp",
331     "jsfriendapi.cpp",
332     "jsnum.cpp",
333     "proxy/BaseProxyHandler.cpp",
334     "proxy/CrossCompartmentWrapper.cpp",
335     "proxy/DeadObjectProxy.cpp",
336     "proxy/DOMProxy.cpp",
337     "proxy/OpaqueCrossCompartmentWrapper.cpp",
338     "proxy/Proxy.cpp",
339     "proxy/ScriptedProxyHandler.cpp",
340     "proxy/SecurityWrapper.cpp",
341     "proxy/Wrapper.cpp",
342     "threading/Mutex.cpp",
343     "threading/ProtectedData.cpp",
344     "threading/Thread.cpp",
345     "vm/Activation.cpp",
346     "vm/ArgumentsObject.cpp",
347     "vm/ArrayBufferObject.cpp",
348     "vm/ArrayBufferObjectMaybeShared.cpp",
349     "vm/ArrayBufferViewObject.cpp",
350     "vm/AsyncFunction.cpp",
351     "vm/AsyncIteration.cpp",
352     "vm/BigIntType.cpp",
353     "vm/BoundFunctionObject.cpp",
354     "vm/BuildId.cpp",
355     "vm/BuiltinObjectKind.cpp",
356     "vm/BytecodeLocation.cpp",
357     "vm/BytecodeUtil.cpp",
358     "vm/CallAndConstruct.cpp",
359     "vm/CallNonGenericMethod.cpp",
360     "vm/CharacterEncoding.cpp",
361     "vm/CodeCoverage.cpp",
362     "vm/Compartment.cpp",
363     "vm/CompilationAndEvaluation.cpp",
364     "vm/Compression.cpp",
365     "vm/ConcurrentDelazification.cpp",
366     "vm/DateTime.cpp",
367     "vm/EnvironmentObject.cpp",
368     "vm/EqualityOperations.cpp",
369     "vm/ErrorMessages.cpp",
370     "vm/ErrorObject.cpp",
371     "vm/ErrorReporting.cpp",
372     "vm/Exception.cpp",
373     "vm/ForOfIterator.cpp",
374     "vm/FrameIter.cpp",
375     "vm/FunctionFlags.cpp",
376     "vm/GeckoProfiler.cpp",
377     "vm/GeneratorObject.cpp",
378     "vm/GetterSetter.cpp",
379     "vm/GlobalObject.cpp",
380     "vm/HelperThreads.cpp",
381     "vm/Id.cpp",
382     "vm/Initialization.cpp",
383     "vm/InternalThreadPool.cpp",
384     "vm/InvalidatingFuse.cpp",
385     "vm/Iteration.cpp",
386     "vm/Iterator.cpp",
387     "vm/JitActivation.cpp",
388     "vm/JSAtomUtils.cpp",
389     "vm/JSContext.cpp",
390     "vm/JSFunction.cpp",
391     "vm/JSObject.cpp",
392     "vm/JSONParser.cpp",
393     "vm/JSONPrinter.cpp",
394     "vm/JSScript.cpp",
395     "vm/List.cpp",
396     "vm/MemoryMetrics.cpp",
397     "vm/Modules.cpp",
398     "vm/NativeObject.cpp",
399     "vm/OffThreadPromiseRuntimeState.cpp",
400     "vm/PIC.cpp",
401     "vm/PlainObject.cpp",
402     "vm/Prefs.cpp",
403     "vm/Printer.cpp",
404     "vm/Probes.cpp",
405     "vm/PromiseLookup.cpp",
406     "vm/PropertyAndElement.cpp",
407     "vm/PropertyDescriptor.cpp",
408     "vm/PropMap.cpp",
409     "vm/ProxyObject.cpp",
410     "vm/Realm.cpp",
411     "vm/RealmFuses.cpp",
412     "vm/RegExpObject.cpp",
413     "vm/RegExpStatics.cpp",
414     "vm/Runtime.cpp",
415     "vm/SavedStacks.cpp",
416     "vm/Scope.cpp",
417     "vm/SelfHosting.cpp",
418     "vm/Shape.cpp",
419     "vm/ShapeZone.cpp",
420     "vm/SharedArrayObject.cpp",
421     "vm/SharedImmutableStringsCache.cpp",
422     "vm/SharedScriptDataTableHolder.cpp",
423     "vm/SourceHook.cpp",
424     "vm/Stack.cpp",
425     "vm/StaticStrings.cpp",
426     "vm/StencilCache.cpp",
427     "vm/StencilObject.cpp",
428     "vm/StringType.cpp",
429     "vm/SymbolType.cpp",
430     "vm/TaggedProto.cpp",
431     "vm/ThrowMsgKind.cpp",
432     "vm/Time.cpp",
433     "vm/ToSource.cpp",
434     "vm/TypedArrayObject.cpp",
435     "vm/UbiNode.cpp",
436     "vm/UbiNodeCensus.cpp",
437     "vm/UbiNodeShortestPaths.cpp",
438     "vm/UsageStatistics.cpp",
439     "vm/Value.cpp",
440     "vm/Warnings.cpp",
441     "vm/Watchtower.cpp",
442     "vm/WellKnownAtom.cpp",
443     "vm/WindowProxy.cpp",
444     "vm/Xdr.cpp",
447 # builtin/RegExp.cpp cannot be built in unified mode because it causes huge
448 #   win32 test slowdowns
449 # jsmath.cpp cannot be built in unified mode because it needs to re-#define the
450 #   RtlGenRandom declaration's calling convention in <ntsecapi.h> on Windows.
451 # vm/Interpreter.cpp is gigantic and destroys incremental build times for any
452 #   files unlucky enough to be unified with it.
453 SOURCES += [
454     "builtin/RegExp.cpp",
455     "jsmath.cpp",
456     "vm/Interpreter.cpp",
457     "vm/ProfilingStack.cpp",
460 if CONFIG["ENABLE_PORTABLE_BASELINE_INTERP"]:
461     SOURCES += [
462         "vm/PortableBaselineInterpret.cpp",
463     ]
465 if CONFIG["ENABLE_RECORD_TUPLE"]:
466     UNIFIED_SOURCES += [
467         "builtin/RecordObject.cpp",
468         "builtin/TupleObject.cpp",
469         "vm/RecordTupleShared.cpp",
470         "vm/RecordType.cpp",
471         "vm/TupleType.cpp",
472     ]
474 if CONFIG["JS_HAS_INTL_API"]:
475     UNIFIED_SOURCES += [
476         "builtin/intl/Collator.cpp",
477         "builtin/intl/CommonFunctions.cpp",
478         "builtin/intl/DateTimeFormat.cpp",
479         "builtin/intl/DisplayNames.cpp",
480         "builtin/intl/IntlObject.cpp",
481         "builtin/intl/LanguageTag.cpp",
482         "builtin/intl/ListFormat.cpp",
483         "builtin/intl/Locale.cpp",
484         "builtin/intl/NumberFormat.cpp",
485         "builtin/intl/PluralRules.cpp",
486         "builtin/intl/RelativeTimeFormat.cpp",
487         "builtin/intl/Segmenter.cpp",
488         "builtin/intl/SharedIntlData.cpp",
489     ]
491 if CONFIG["MOZ_INSTRUMENTS"]:
492     SOURCES += [
493         "devtools/Instruments.cpp",
494     ]
496 if CONFIG["OS_ARCH"] == "WINNT":
497     OS_LIBS += [
498         "advapi32",
499     ]
500     UNIFIED_SOURCES += [
501         "threading/windows/CpuCount.cpp",
502         "threading/windows/WindowsThread.cpp",
503     ]
504 # WASI hasn't supported thread yet so noop implementation is used.
505 elif CONFIG["OS_ARCH"] == "WASI":
506     UNIFIED_SOURCES += [
507         "threading/noop/CpuCount.cpp",
508         "threading/noop/NoopThread.cpp",
509     ]
510 else:
511     UNIFIED_SOURCES += [
512         "threading/posix/CpuCount.cpp",
513         "threading/posix/PosixThread.cpp",
514     ]
516 if CONFIG["JS_HAS_INTL_API"] and CONFIG["MOZ_ICU4X"]:
517     LOCAL_INCLUDES += [
518         "/intl/icu_capi/c/include",
519     ]
521 if CONFIG["JS_HAS_CTYPES"]:
522     SOURCES += [
523         "ctypes/CTypes.cpp",
524         "ctypes/Library.cpp",
525     ]
526     if not CONFIG["MOZ_SYSTEM_FFI"]:
527         LOCAL_INCLUDES += [
528             "!ctypes/libffi/include",
529             "ctypes/libffi/src/%s" % CONFIG["FFI_TARGET_DIR"],
530         ]
532 if CONFIG["MOZ_VTUNE"]:
533     SOURCES += [
534         "vtune/ittnotify_static.c",
535         "vtune/jitprofiling.c",
536         "vtune/VTuneWrapper.cpp",
537     ]
538     SOURCES["vtune/ittnotify_static.c"].flags += [
539         "-Wno-varargs",
540         "-Wno-sign-compare",
541         "-Wno-unknown-pragmas",
542     ]
543     if CONFIG["CC_TYPE"] == "gcc":
544         SOURCES["vtune/ittnotify_static.c"].flags += ["-Wno-stringop-overflow"]
545         if int(CONFIG["CC_VERSION"].split(".")[0]) >= 8:
546             SOURCES["vtune/ittnotify_static.c"].flags += ["-Wno-stringop-truncation"]
548 DIRS += ["build", "debugger", "frontend", "gc", "irregexp", "jit", "util", "wasm"]
550 if CONFIG["JS_HAS_TEMPORAL_API"]:
551     DIRS += ["builtin/temporal"]
553 # Bug 1739321 - clang 13+ only emits debuginfo for classes that are actually
554 # constructed, and we cheat in a number of cases. The flag exists at least
555 # back to clang 4.
556 if CONFIG["CC_TYPE"] == "clang":
557     CXXFLAGS += ["-fstandalone-debug"]
559 # Bug 1722102 - This should never be enabled in Release without explicit
560 # security and SpiderMonkey review.
561 # See https://bugzilla.mozilla.org/show_bug.cgi?id=1722102#c16
562 if CONFIG["ENABLE_WASM_MOZ_INTGEMM"]:
563     DIRS += ["intgemm"]
565 if CONFIG["JS_JITSPEW"]:
566     DIRS += ["zydis"]
568 FINAL_LIBRARY = "js"
570 selfhosted_inputs = [
571     "../public/friend/ErrorNumbers.msg",
572     # ProfilingCategoryList.h is being indirectly included, and it must be passed
573     # here as an input, so it's generated before this self-hosted JS code
574     # generation. Otherwise, it will intermittently fail to build.
575     "!/mozglue/baseprofiler/public/ProfilingCategoryList.h",
576     "builtin/TypedArrayConstants.h",
577     "builtin/SelfHostingDefines.h",
578     "builtin/Utilities.js",
579     "builtin/Array.js",
580     "builtin/AsyncFunction.js",
581     "builtin/AsyncIteration.js",
582     "builtin/BigInt.js",
583     "builtin/Date.js",
584     "builtin/Error.js",
585     "builtin/Generator.js",
586     "builtin/Iterator.js",
587     "builtin/Map.js",
588     "builtin/Number.js",
589     "builtin/Object.js",
590     "builtin/Promise.js",
591     "builtin/Reflect.js",
592     "builtin/RegExp.js",
593     "builtin/RegExpGlobalReplaceOpt.h.js",
594     "builtin/RegExpLocalReplaceOpt.h.js",
595     "builtin/String.js",
596     "builtin/Set.js",
597     "builtin/Sorting.js",
598     "builtin/TypedArray.js",
599     "builtin/WeakMap.js",
600     "builtin/WeakSet.js",
601 ] + (
602     [
603         "builtin/intl/NumberingSystemsGenerated.h",
604         "builtin/intl/Collator.js",
605         "builtin/intl/CommonFunctions.js",
606         "builtin/intl/CurrencyDataGenerated.js",
607         "builtin/intl/DateTimeFormat.js",
608         "builtin/intl/DisplayNames.js",
609         "builtin/intl/IntlObject.js",
610         "builtin/intl/ListFormat.js",
611         "builtin/intl/NumberFormat.js",
612         "builtin/intl/PluralRules.js",
613         "builtin/intl/RelativeTimeFormat.js",
614         "builtin/intl/SanctionedSimpleUnitIdentifiersGenerated.js",
615         "builtin/intl/Segmenter.js",
616     ]
617     if CONFIG["JS_HAS_INTL_API"]
618     else []
621 if CONFIG["ENABLE_RECORD_TUPLE"]:
622     selfhosted_inputs += ["builtin/Tuple.js"]
624 # Prepare self-hosted JS code for embedding
625 GeneratedFile(
626     "selfhosted.out.h",
627     "selfhosted.js",
628     script="builtin/embedjs.py",
629     entry_point="generate_selfhosted",
630     inputs=selfhosted_inputs,
633 GeneratedFile(
634     "../public/PrefsGenerated.h",
635     script="GeneratePrefs.py",
636     entry_point="generate_prefs_header",
637     inputs=["../../modules/libpref/init/StaticPrefList.yaml"],
640 if CONFIG["JS_HAS_CTYPES"]:
641     if CONFIG["MOZ_SYSTEM_FFI"]:
642         CXXFLAGS += CONFIG["MOZ_FFI_CFLAGS"]
644 if CONFIG["JS_HAS_INTL_API"]:
645     if CONFIG["JS_STANDALONE"]:
646         DIRS += [
647             "../../intl/bidi",
648             "../../intl/components",
649         ]
651     USE_LIBS += ["intlcomponents"]