1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/js/src/moz.build Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,466 @@ 1.4 +# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*- 1.5 +# vim: set filetype=python: 1.6 +# This Source Code Form is subject to the terms of the Mozilla Public 1.7 +# License, v. 2.0. If a copy of the MPL was not distributed with this 1.8 +# file, You can obtain one at http://mozilla.org/MPL/2.0/. 1.9 + 1.10 +if CONFIG['DEHYDRA_PATH']: 1.11 + DIRS += ['analysis-tests'] 1.12 + 1.13 +if CONFIG['JS_NATIVE_EDITLINE']: 1.14 + DIRS += ['editline'] 1.15 + 1.16 +# editline needs to get built before the shell 1.17 +if not CONFIG['JS_DISABLE_SHELL']: 1.18 + DIRS += ['shell'] 1.19 + 1.20 +TEST_DIRS += ['jsapi-tests', 'tests', 'gdb'] 1.21 + 1.22 +LOCAL_INCLUDES += ['../../mfbt/double-conversion'] 1.23 + 1.24 +LIBRARY_NAME = CONFIG['JS_LIBRARY_NAME'] 1.25 + 1.26 +CONFIGURE_SUBST_FILES += [ 1.27 + 'devtools/rootAnalysis/Makefile', 1.28 + 'js-confdefs.h', 1.29 + 'js-config', 1.30 + 'js.pc', 1.31 +] 1.32 + 1.33 +if CONFIG['JS_STANDALONE']: 1.34 + DEFINES['IMPL_MFBT'] = True 1.35 +else: 1.36 + CONFIGURE_SUBST_FILES += [ 1.37 + '../../config/autoconf-js.mk', 1.38 + '../../config/emptyvars-js.mk', 1.39 + ] 1.40 + 1.41 +CONFIGURE_DEFINE_FILES += [ 1.42 + 'js-config.h', 1.43 +] 1.44 + 1.45 +# Changes to internal header files, used externally, massively slow down 1.46 +# browser builds. Don't add new files here unless you know what you're 1.47 +# doing! 1.48 +EXPORTS += [ 1.49 + 'js.msg', 1.50 + 'jsalloc.h', 1.51 + 'jsapi.h', 1.52 + 'jsbytecode.h', 1.53 + 'jsclist.h', 1.54 + 'jscpucfg.h', 1.55 + 'jsfriendapi.h', 1.56 + 'jsprf.h', 1.57 + 'jsprototypes.h', 1.58 + 'jsproxy.h', 1.59 + 'jspubtd.h', 1.60 + 'jstypes.h', 1.61 + 'jsversion.h', 1.62 + 'jswrapper.h', 1.63 + 'perf/jsperf.h', 1.64 +] 1.65 + 1.66 +# If you add a header here, add it to js/src/jsapi-tests/testIntTypesABI.cpp so 1.67 +# that we ensure we don't over-expose our internal integer typedefs. Note that 1.68 +# LegacyIntTypes.h below is deliberately exempted from this requirement. 1.69 +EXPORTS.js += [ 1.70 + '../public/Anchor.h', 1.71 + '../public/CallArgs.h', 1.72 + '../public/CallNonGenericMethod.h', 1.73 + '../public/CharacterEncoding.h', 1.74 + '../public/Class.h', 1.75 + '../public/Date.h', 1.76 + '../public/GCAPI.h', 1.77 + '../public/HashTable.h', 1.78 + '../public/HeapAPI.h', 1.79 + '../public/Id.h', 1.80 + '../public/LegacyIntTypes.h', 1.81 + '../public/MemoryMetrics.h', 1.82 + '../public/OldDebugAPI.h', 1.83 + '../public/Principals.h', 1.84 + '../public/ProfilingStack.h', 1.85 + '../public/PropertyKey.h', 1.86 + '../public/RequiredDefines.h', 1.87 + '../public/RootingAPI.h', 1.88 + '../public/SliceBudget.h', 1.89 + '../public/StructuredClone.h', 1.90 + '../public/TracingAPI.h', 1.91 + '../public/TypeDecls.h', 1.92 + '../public/Utility.h', 1.93 + '../public/Value.h', 1.94 + '../public/Vector.h', 1.95 + '../public/WeakMapPtr.h', 1.96 +] 1.97 + 1.98 +UNIFIED_SOURCES += [ 1.99 + 'assembler/jit/ExecutableAllocator.cpp', 1.100 + 'builtin/Eval.cpp', 1.101 + 'builtin/Intl.cpp', 1.102 + 'builtin/MapObject.cpp', 1.103 + 'builtin/Object.cpp', 1.104 + 'builtin/Profilers.cpp', 1.105 + 'builtin/SIMD.cpp', 1.106 + 'builtin/TestingFunctions.cpp', 1.107 + 'builtin/TypedObject.cpp', 1.108 + 'devtools/sharkctl.cpp', 1.109 + 'ds/LifoAlloc.cpp', 1.110 + 'frontend/BytecodeCompiler.cpp', 1.111 + 'frontend/BytecodeEmitter.cpp', 1.112 + 'frontend/FoldConstants.cpp', 1.113 + 'frontend/NameFunctions.cpp', 1.114 + 'frontend/ParseMaps.cpp', 1.115 + 'frontend/ParseNode.cpp', 1.116 + 'frontend/TokenStream.cpp', 1.117 + 'gc/Barrier.cpp', 1.118 + 'gc/Iteration.cpp', 1.119 + 'gc/Marking.cpp', 1.120 + 'gc/Memory.cpp', 1.121 + 'gc/Nursery.cpp', 1.122 + 'gc/RootMarking.cpp', 1.123 + 'gc/Statistics.cpp', 1.124 + 'gc/StoreBuffer.cpp', 1.125 + 'gc/Tracer.cpp', 1.126 + 'gc/Verifier.cpp', 1.127 + 'gc/Zone.cpp', 1.128 + 'jsalloc.cpp', 1.129 + 'jsanalyze.cpp', 1.130 + 'jsapi.cpp', 1.131 + 'jsbool.cpp', 1.132 + 'jscntxt.cpp', 1.133 + 'jscompartment.cpp', 1.134 + 'jscrashreport.cpp', 1.135 + 'jsdate.cpp', 1.136 + 'jsdtoa.cpp', 1.137 + 'jsexn.cpp', 1.138 + 'jsfriendapi.cpp', 1.139 + 'jsfun.cpp', 1.140 + 'jsgc.cpp', 1.141 + 'jsinfer.cpp', 1.142 + 'jsiter.cpp', 1.143 + 'jsnativestack.cpp', 1.144 + 'jsnum.cpp', 1.145 + 'jsobj.cpp', 1.146 + 'json.cpp', 1.147 + 'jsonparser.cpp', 1.148 + 'jsopcode.cpp', 1.149 + 'jsprf.cpp', 1.150 + 'jspropertytree.cpp', 1.151 + 'jsproxy.cpp', 1.152 + 'jsreflect.cpp', 1.153 + 'jsscript.cpp', 1.154 + 'jsstr.cpp', 1.155 + 'jswatchpoint.cpp', 1.156 + 'jsweakmap.cpp', 1.157 + 'jsworkers.cpp', 1.158 + 'jswrapper.cpp', 1.159 + 'perf/jsperf.cpp', 1.160 + 'prmjtime.cpp', 1.161 + 'vm/ArgumentsObject.cpp', 1.162 + 'vm/ArrayBufferObject.cpp', 1.163 + 'vm/CallNonGenericMethod.cpp', 1.164 + 'vm/CharacterEncoding.cpp', 1.165 + 'vm/Compression.cpp', 1.166 + 'vm/DateTime.cpp', 1.167 + 'vm/Debugger.cpp', 1.168 + 'vm/DebuggerMemory.cpp', 1.169 + 'vm/ErrorObject.cpp', 1.170 + 'vm/ForkJoin.cpp', 1.171 + 'vm/GlobalObject.cpp', 1.172 + 'vm/Id.cpp', 1.173 + 'vm/Interpreter.cpp', 1.174 + 'vm/MemoryMetrics.cpp', 1.175 + 'vm/Monitor.cpp', 1.176 + 'vm/ObjectImpl.cpp', 1.177 + 'vm/OldDebugAPI.cpp', 1.178 + 'vm/PIC.cpp', 1.179 + 'vm/Probes.cpp', 1.180 + 'vm/PropertyKey.cpp', 1.181 + 'vm/ProxyObject.cpp', 1.182 + 'vm/RegExpObject.cpp', 1.183 + 'vm/RegExpStatics.cpp', 1.184 + 'vm/Runtime.cpp', 1.185 + 'vm/SavedStacks.cpp', 1.186 + 'vm/ScopeObject.cpp', 1.187 + 'vm/SelfHosting.cpp', 1.188 + 'vm/Shape.cpp', 1.189 + 'vm/SharedArrayObject.cpp', 1.190 + 'vm/SPSProfiler.cpp', 1.191 + 'vm/Stack.cpp', 1.192 + 'vm/String.cpp', 1.193 + 'vm/StringBuffer.cpp', 1.194 + 'vm/StructuredClone.cpp', 1.195 + 'vm/ThreadPool.cpp', 1.196 + 'vm/TypedArrayObject.cpp', 1.197 + 'vm/Unicode.cpp', 1.198 + 'vm/Value.cpp', 1.199 + 'vm/WeakMapPtr.cpp', 1.200 + 'vm/Xdr.cpp', 1.201 + 'yarr/PageBlock.cpp', 1.202 + 'yarr/YarrCanonicalizeUCS2.cpp', 1.203 + 'yarr/YarrInterpreter.cpp', 1.204 + 'yarr/YarrPattern.cpp', 1.205 + 'yarr/YarrSyntaxChecker.cpp', 1.206 +] 1.207 + 1.208 +# jsarray.cpp and jsatom.cpp cannot be built in unified mode because 1.209 +# xpcshell is broken during packaging when compiled with gcc-4.8.2 1.210 +# builtin/RegExp.cpp cannot be built in unified mode because it is built 1.211 +# without PGO 1.212 +# frontend/Parser.cpp cannot be built in unified mode because of explicit 1.213 +# template instantiations. 1.214 +# jsmath.cpp cannot be built in unified mode because it needs to pull rand_s 1.215 +# from <stdlib.h> on Windows through a preprocessor define. 1.216 +# jsutil.cpp cannot be built in unified mode because it is needed for 1.217 +# check-vanilla-allocations. 1.218 +SOURCES += [ 1.219 + 'builtin/RegExp.cpp', 1.220 + 'frontend/Parser.cpp', 1.221 + 'jsarray.cpp', 1.222 + 'jsatom.cpp', 1.223 + 'jsmath.cpp', 1.224 + 'jsutil.cpp', 1.225 +] 1.226 + 1.227 +if CONFIG['JS_POSIX_NSPR']: 1.228 + UNIFIED_SOURCES += [ 1.229 + 'vm/PosixNSPR.cpp', 1.230 + ] 1.231 + 1.232 +if CONFIG['MOZ_INSTRUMENTS']: 1.233 + SOURCES += [ 1.234 + 'devtools/Instruments.cpp', 1.235 + ] 1.236 + 1.237 +if CONFIG['ENABLE_TRACE_LOGGING']: 1.238 + SOURCES += [ 1.239 + 'vm/TraceLogging.cpp', 1.240 + ] 1.241 + 1.242 +if CONFIG['ENABLE_ION']: 1.243 + UNIFIED_SOURCES += [ 1.244 + 'jit/AliasAnalysis.cpp', 1.245 + 'jit/AsmJS.cpp', 1.246 + 'jit/AsmJSLink.cpp', 1.247 + 'jit/AsmJSModule.cpp', 1.248 + 'jit/AsmJSSignalHandlers.cpp', 1.249 + 'jit/BacktrackingAllocator.cpp', 1.250 + 'jit/Bailouts.cpp', 1.251 + 'jit/BaselineBailouts.cpp', 1.252 + 'jit/BaselineCompiler.cpp', 1.253 + 'jit/BaselineDebugModeOSR.cpp', 1.254 + 'jit/BaselineFrame.cpp', 1.255 + 'jit/BaselineFrameInfo.cpp', 1.256 + 'jit/BaselineIC.cpp', 1.257 + 'jit/BaselineInspector.cpp', 1.258 + 'jit/BaselineJIT.cpp', 1.259 + 'jit/BitSet.cpp', 1.260 + 'jit/BytecodeAnalysis.cpp', 1.261 + 'jit/C1Spewer.cpp', 1.262 + 'jit/CodeGenerator.cpp', 1.263 + 'jit/CompileWrappers.cpp', 1.264 + 'jit/EdgeCaseAnalysis.cpp', 1.265 + 'jit/EffectiveAddressAnalysis.cpp', 1.266 + 'jit/Ion.cpp', 1.267 + 'jit/IonAnalysis.cpp', 1.268 + 'jit/IonBuilder.cpp', 1.269 + 'jit/IonCaches.cpp', 1.270 + 'jit/IonFrames.cpp', 1.271 + 'jit/IonMacroAssembler.cpp', 1.272 + 'jit/IonOptimizationLevels.cpp', 1.273 + 'jit/IonSpewer.cpp', 1.274 + 'jit/JitOptions.cpp', 1.275 + 'jit/JSONSpewer.cpp', 1.276 + 'jit/LICM.cpp', 1.277 + 'jit/LinearScan.cpp', 1.278 + 'jit/LIR.cpp', 1.279 + 'jit/LiveRangeAllocator.cpp', 1.280 + 'jit/Lowering.cpp', 1.281 + 'jit/MCallOptimize.cpp', 1.282 + 'jit/MIR.cpp', 1.283 + 'jit/MIRGraph.cpp', 1.284 + 'jit/MoveResolver.cpp', 1.285 + 'jit/ParallelFunctions.cpp', 1.286 + 'jit/ParallelSafetyAnalysis.cpp', 1.287 + 'jit/PerfSpewer.cpp', 1.288 + 'jit/RangeAnalysis.cpp', 1.289 + 'jit/Recover.cpp', 1.290 + 'jit/RegisterAllocator.cpp', 1.291 + 'jit/RematerializedFrame.cpp', 1.292 + 'jit/Safepoints.cpp', 1.293 + 'jit/shared/BaselineCompiler-shared.cpp', 1.294 + 'jit/shared/CodeGenerator-shared.cpp', 1.295 + 'jit/shared/Lowering-shared.cpp', 1.296 + 'jit/Snapshots.cpp', 1.297 + 'jit/StupidAllocator.cpp', 1.298 + 'jit/TypeDescrSet.cpp', 1.299 + 'jit/TypePolicy.cpp', 1.300 + 'jit/UnreachableCodeElimination.cpp', 1.301 + 'jit/ValueNumbering.cpp', 1.302 + 'jit/VMFunctions.cpp', 1.303 + ] 1.304 + if CONFIG['JS_CODEGEN_X86'] or CONFIG['JS_CODEGEN_X64']: 1.305 + UNIFIED_SOURCES += [ 1.306 + 'jit/shared/Assembler-x86-shared.cpp', 1.307 + 'jit/shared/BaselineCompiler-x86-shared.cpp', 1.308 + 'jit/shared/BaselineIC-x86-shared.cpp', 1.309 + 'jit/shared/CodeGenerator-x86-shared.cpp', 1.310 + 'jit/shared/Lowering-x86-shared.cpp', 1.311 + 'jit/shared/MacroAssembler-x86-shared.cpp', 1.312 + 'jit/shared/MoveEmitter-x86-shared.cpp', 1.313 + ] 1.314 + if CONFIG['JS_CODEGEN_X64']: 1.315 + UNIFIED_SOURCES += [ 1.316 + 'jit/x64/Assembler-x64.cpp', 1.317 + 'jit/x64/Bailouts-x64.cpp', 1.318 + 'jit/x64/BaselineCompiler-x64.cpp', 1.319 + 'jit/x64/BaselineIC-x64.cpp', 1.320 + 'jit/x64/CodeGenerator-x64.cpp', 1.321 + 'jit/x64/Lowering-x64.cpp', 1.322 + 'jit/x64/MacroAssembler-x64.cpp', 1.323 + 'jit/x64/Trampoline-x64.cpp', 1.324 + ] 1.325 + else: 1.326 + UNIFIED_SOURCES += [ 1.327 + 'jit/x86/Assembler-x86.cpp', 1.328 + 'jit/x86/Bailouts-x86.cpp', 1.329 + 'jit/x86/BaselineCompiler-x86.cpp', 1.330 + 'jit/x86/BaselineIC-x86.cpp', 1.331 + 'jit/x86/CodeGenerator-x86.cpp', 1.332 + 'jit/x86/Lowering-x86.cpp', 1.333 + 'jit/x86/MacroAssembler-x86.cpp', 1.334 + 'jit/x86/Trampoline-x86.cpp', 1.335 + ] 1.336 + elif CONFIG['JS_CODEGEN_ARM']: 1.337 + UNIFIED_SOURCES += [ 1.338 + 'jit/arm/Architecture-arm.cpp', 1.339 + 'jit/arm/Assembler-arm.cpp', 1.340 + 'jit/arm/Bailouts-arm.cpp', 1.341 + 'jit/arm/BaselineCompiler-arm.cpp', 1.342 + 'jit/arm/BaselineIC-arm.cpp', 1.343 + 'jit/arm/CodeGenerator-arm.cpp', 1.344 + 'jit/arm/Lowering-arm.cpp', 1.345 + 'jit/arm/MacroAssembler-arm.cpp', 1.346 + 'jit/arm/MoveEmitter-arm.cpp', 1.347 + 'jit/arm/Trampoline-arm.cpp', 1.348 + ] 1.349 + if CONFIG['JS_ARM_SIMULATOR']: 1.350 + UNIFIED_SOURCES += [ 1.351 + 'jit/arm/Simulator-arm.cpp' 1.352 + ] 1.353 + 1.354 +if CONFIG['OS_ARCH'] == 'WINNT': 1.355 + SOURCES += [ 1.356 + 'assembler/jit/ExecutableAllocatorWin.cpp', 1.357 + 'yarr/OSAllocatorWin.cpp', 1.358 + ] 1.359 + # _CRT_RAND_S must be #defined before #including stdlib.h to get rand_s() 1.360 + DEFINES['_CRT_RAND_S'] = True 1.361 +else: 1.362 + SOURCES += [ 1.363 + 'assembler/jit/ExecutableAllocatorPosix.cpp', 1.364 + 'yarr/OSAllocatorPosix.cpp', 1.365 + ] 1.366 + 1.367 +if CONFIG['ENABLE_ION'] or CONFIG['ENABLE_YARR_JIT']: 1.368 + if CONFIG['JS_CODEGEN_X86'] or CONFIG['JS_CODEGEN_X64']: 1.369 + SOURCES += [ 1.370 + 'assembler/assembler/MacroAssemblerX86Common.cpp', 1.371 + ] 1.372 + elif CONFIG['JS_CODEGEN_ARM']: 1.373 + SOURCES += [ 1.374 + 'assembler/assembler/ARMAssembler.cpp', 1.375 + 'assembler/assembler/MacroAssemblerARM.cpp', 1.376 + ] 1.377 + 1.378 +if CONFIG['ENABLE_YARR_JIT']: 1.379 + SOURCES += [ 1.380 + 'yarr/YarrJIT.cpp' 1.381 + ] 1.382 + 1.383 +if CONFIG['JS_HAS_CTYPES']: 1.384 + SOURCES += [ 1.385 + 'ctypes/CTypes.cpp', 1.386 + 'ctypes/Library.cpp', 1.387 + ] 1.388 + if not CONFIG['MOZ_NATIVE_FFI']: 1.389 + GENERATED_INCLUDES += [ 1.390 + 'ctypes/libffi/include', 1.391 + ] 1.392 + 1.393 +if CONFIG['MOZ_VTUNE']: 1.394 + SOURCES += [ 1.395 + 'vtune/jitprofiling.c' 1.396 + ] 1.397 + 1.398 +if CONFIG['HAVE_LINUX_PERF_EVENT_H']: 1.399 + SOURCES += [ 1.400 + 'perf/pm_linux.cpp' 1.401 + ] 1.402 + SOURCES['perf/pm_linux.cpp'].flags += [CONFIG['LINUX_HEADERS_INCLUDES']] 1.403 +else: 1.404 + SOURCES += [ 1.405 + 'perf/pm_stub.cpp' 1.406 + ] 1.407 + 1.408 +MSVC_ENABLE_PGO = True 1.409 + 1.410 +HOST_SOURCES += [ 1.411 + 'jskwgen.cpp', 1.412 +] 1.413 + 1.414 +HOST_SIMPLE_PROGRAMS += [ 1.415 + 'host_%s' % f.replace('.cpp', '') for f in HOST_SOURCES 1.416 +] 1.417 + 1.418 +# JavaScript must be built shared, even for static builds, as it is used by 1.419 +# other modules which are always built shared. Failure to do so results in 1.420 +# the js code getting copied into xpinstall and jsd as well as mozilla-bin, 1.421 +# and then the static data cells used for locking no longer work. 1.422 +# 1.423 +# In fact, we now build both a static and a shared library, as the 1.424 +# JS shell would like to link to the static library. 1.425 + 1.426 +if CONFIG['JS_SHARED_LIBRARY']: 1.427 + FORCE_SHARED_LIB = True 1.428 + 1.429 +FORCE_STATIC_LIB = True 1.430 + 1.431 +if CONFIG['MOZ_ETW']: 1.432 + GENERATED_FILES = [ 1.433 + 'ETWProvider.h', 1.434 + ] 1.435 + # This will get the ETW provider resources into the library mozjs.dll 1.436 + RESFILE = 'ETWProvider.res' 1.437 + 1.438 +if CONFIG['NIGHTLY_BUILD']: 1.439 + DEFINES['ENABLE_PARALLEL_JS'] = True 1.440 + DEFINES['ENABLE_BINARYDATA'] = True 1.441 + DEFINES['ENABLE_SHARED_ARRAY_BUFFER'] = True 1.442 + 1.443 +DEFINES['EXPORT_JS_API'] = True 1.444 + 1.445 +if CONFIG['JS_THREADSAFE']: 1.446 + DEFINES['JS_THREADSAFE'] = True 1.447 + 1.448 +if CONFIG['JS_HAS_CTYPES']: 1.449 + DEFINES['JS_HAS_CTYPES'] = True 1.450 + for var in ('DLL_PREFIX', 'DLL_SUFFIX'): 1.451 + DEFINES[var] = '"%s"' % CONFIG[var] 1.452 + 1.453 +if CONFIG['MOZ_LINKER']: 1.454 + DEFINES['MOZ_LINKER'] = True 1.455 + 1.456 +if CONFIG['_MSC_VER']: 1.457 + if CONFIG['CPU_ARCH'] == 'x86': 1.458 + SOURCES['builtin/RegExp.cpp'].no_pgo = True # Bug 772303 1.459 + elif CONFIG['CPU_ARCH'] == 'x86_64' and CONFIG['JS_HAS_CTYPES']: 1.460 + SOURCES['ctypes/CTypes.cpp'].no_pgo = True # Bug 810661 1.461 + 1.462 +# Needed to "configure" it correctly. Unfortunately these 1.463 +# flags wind up being applied to all code in js/src, not just 1.464 +# the code in js/src/assembler. 1.465 +DEFINES['USE_SYSTEM_MALLOC'] = 1 1.466 +DEFINES['ENABLE_ASSEMBLER'] = 1 1.467 + 1.468 +if CONFIG['ENABLE_YARR_JIT']: 1.469 + DEFINES['ENABLE_JIT'] = 1