michael@0: # -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*- michael@0: # vim: set filetype=python: michael@0: # This Source Code Form is subject to the terms of the Mozilla Public michael@0: # License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: # file, You can obtain one at http://mozilla.org/MPL/2.0/. michael@0: michael@0: if CONFIG['DEHYDRA_PATH']: michael@0: DIRS += ['analysis-tests'] michael@0: michael@0: if CONFIG['JS_NATIVE_EDITLINE']: michael@0: DIRS += ['editline'] michael@0: michael@0: # editline needs to get built before the shell michael@0: if not CONFIG['JS_DISABLE_SHELL']: michael@0: DIRS += ['shell'] michael@0: michael@0: TEST_DIRS += ['jsapi-tests', 'tests', 'gdb'] michael@0: michael@0: LOCAL_INCLUDES += ['../../mfbt/double-conversion'] michael@0: michael@0: LIBRARY_NAME = CONFIG['JS_LIBRARY_NAME'] michael@0: michael@0: CONFIGURE_SUBST_FILES += [ michael@0: 'devtools/rootAnalysis/Makefile', michael@0: 'js-confdefs.h', michael@0: 'js-config', michael@0: 'js.pc', michael@0: ] michael@0: michael@0: if CONFIG['JS_STANDALONE']: michael@0: DEFINES['IMPL_MFBT'] = True michael@0: else: michael@0: CONFIGURE_SUBST_FILES += [ michael@0: '../../config/autoconf-js.mk', michael@0: '../../config/emptyvars-js.mk', michael@0: ] michael@0: michael@0: CONFIGURE_DEFINE_FILES += [ michael@0: 'js-config.h', michael@0: ] michael@0: michael@0: # Changes to internal header files, used externally, massively slow down michael@0: # browser builds. Don't add new files here unless you know what you're michael@0: # doing! michael@0: EXPORTS += [ michael@0: 'js.msg', michael@0: 'jsalloc.h', michael@0: 'jsapi.h', michael@0: 'jsbytecode.h', michael@0: 'jsclist.h', michael@0: 'jscpucfg.h', michael@0: 'jsfriendapi.h', michael@0: 'jsprf.h', michael@0: 'jsprototypes.h', michael@0: 'jsproxy.h', michael@0: 'jspubtd.h', michael@0: 'jstypes.h', michael@0: 'jsversion.h', michael@0: 'jswrapper.h', michael@0: 'perf/jsperf.h', michael@0: ] michael@0: michael@0: # If you add a header here, add it to js/src/jsapi-tests/testIntTypesABI.cpp so michael@0: # that we ensure we don't over-expose our internal integer typedefs. Note that michael@0: # LegacyIntTypes.h below is deliberately exempted from this requirement. michael@0: EXPORTS.js += [ michael@0: '../public/Anchor.h', michael@0: '../public/CallArgs.h', michael@0: '../public/CallNonGenericMethod.h', michael@0: '../public/CharacterEncoding.h', michael@0: '../public/Class.h', michael@0: '../public/Date.h', michael@0: '../public/GCAPI.h', michael@0: '../public/HashTable.h', michael@0: '../public/HeapAPI.h', michael@0: '../public/Id.h', michael@0: '../public/LegacyIntTypes.h', michael@0: '../public/MemoryMetrics.h', michael@0: '../public/OldDebugAPI.h', michael@0: '../public/Principals.h', michael@0: '../public/ProfilingStack.h', michael@0: '../public/PropertyKey.h', michael@0: '../public/RequiredDefines.h', michael@0: '../public/RootingAPI.h', michael@0: '../public/SliceBudget.h', michael@0: '../public/StructuredClone.h', michael@0: '../public/TracingAPI.h', michael@0: '../public/TypeDecls.h', michael@0: '../public/Utility.h', michael@0: '../public/Value.h', michael@0: '../public/Vector.h', michael@0: '../public/WeakMapPtr.h', michael@0: ] michael@0: michael@0: UNIFIED_SOURCES += [ michael@0: 'assembler/jit/ExecutableAllocator.cpp', michael@0: 'builtin/Eval.cpp', michael@0: 'builtin/Intl.cpp', michael@0: 'builtin/MapObject.cpp', michael@0: 'builtin/Object.cpp', michael@0: 'builtin/Profilers.cpp', michael@0: 'builtin/SIMD.cpp', michael@0: 'builtin/TestingFunctions.cpp', michael@0: 'builtin/TypedObject.cpp', michael@0: 'devtools/sharkctl.cpp', michael@0: 'ds/LifoAlloc.cpp', michael@0: 'frontend/BytecodeCompiler.cpp', michael@0: 'frontend/BytecodeEmitter.cpp', michael@0: 'frontend/FoldConstants.cpp', michael@0: 'frontend/NameFunctions.cpp', michael@0: 'frontend/ParseMaps.cpp', michael@0: 'frontend/ParseNode.cpp', michael@0: 'frontend/TokenStream.cpp', michael@0: 'gc/Barrier.cpp', michael@0: 'gc/Iteration.cpp', michael@0: 'gc/Marking.cpp', michael@0: 'gc/Memory.cpp', michael@0: 'gc/Nursery.cpp', michael@0: 'gc/RootMarking.cpp', michael@0: 'gc/Statistics.cpp', michael@0: 'gc/StoreBuffer.cpp', michael@0: 'gc/Tracer.cpp', michael@0: 'gc/Verifier.cpp', michael@0: 'gc/Zone.cpp', michael@0: 'jsalloc.cpp', michael@0: 'jsanalyze.cpp', michael@0: 'jsapi.cpp', michael@0: 'jsbool.cpp', michael@0: 'jscntxt.cpp', michael@0: 'jscompartment.cpp', michael@0: 'jscrashreport.cpp', michael@0: 'jsdate.cpp', michael@0: 'jsdtoa.cpp', michael@0: 'jsexn.cpp', michael@0: 'jsfriendapi.cpp', michael@0: 'jsfun.cpp', michael@0: 'jsgc.cpp', michael@0: 'jsinfer.cpp', michael@0: 'jsiter.cpp', michael@0: 'jsnativestack.cpp', michael@0: 'jsnum.cpp', michael@0: 'jsobj.cpp', michael@0: 'json.cpp', michael@0: 'jsonparser.cpp', michael@0: 'jsopcode.cpp', michael@0: 'jsprf.cpp', michael@0: 'jspropertytree.cpp', michael@0: 'jsproxy.cpp', michael@0: 'jsreflect.cpp', michael@0: 'jsscript.cpp', michael@0: 'jsstr.cpp', michael@0: 'jswatchpoint.cpp', michael@0: 'jsweakmap.cpp', michael@0: 'jsworkers.cpp', michael@0: 'jswrapper.cpp', michael@0: 'perf/jsperf.cpp', michael@0: 'prmjtime.cpp', michael@0: 'vm/ArgumentsObject.cpp', michael@0: 'vm/ArrayBufferObject.cpp', michael@0: 'vm/CallNonGenericMethod.cpp', michael@0: 'vm/CharacterEncoding.cpp', michael@0: 'vm/Compression.cpp', michael@0: 'vm/DateTime.cpp', michael@0: 'vm/Debugger.cpp', michael@0: 'vm/DebuggerMemory.cpp', michael@0: 'vm/ErrorObject.cpp', michael@0: 'vm/ForkJoin.cpp', michael@0: 'vm/GlobalObject.cpp', michael@0: 'vm/Id.cpp', michael@0: 'vm/Interpreter.cpp', michael@0: 'vm/MemoryMetrics.cpp', michael@0: 'vm/Monitor.cpp', michael@0: 'vm/ObjectImpl.cpp', michael@0: 'vm/OldDebugAPI.cpp', michael@0: 'vm/PIC.cpp', michael@0: 'vm/Probes.cpp', michael@0: 'vm/PropertyKey.cpp', michael@0: 'vm/ProxyObject.cpp', michael@0: 'vm/RegExpObject.cpp', michael@0: 'vm/RegExpStatics.cpp', michael@0: 'vm/Runtime.cpp', michael@0: 'vm/SavedStacks.cpp', michael@0: 'vm/ScopeObject.cpp', michael@0: 'vm/SelfHosting.cpp', michael@0: 'vm/Shape.cpp', michael@0: 'vm/SharedArrayObject.cpp', michael@0: 'vm/SPSProfiler.cpp', michael@0: 'vm/Stack.cpp', michael@0: 'vm/String.cpp', michael@0: 'vm/StringBuffer.cpp', michael@0: 'vm/StructuredClone.cpp', michael@0: 'vm/ThreadPool.cpp', michael@0: 'vm/TypedArrayObject.cpp', michael@0: 'vm/Unicode.cpp', michael@0: 'vm/Value.cpp', michael@0: 'vm/WeakMapPtr.cpp', michael@0: 'vm/Xdr.cpp', michael@0: 'yarr/PageBlock.cpp', michael@0: 'yarr/YarrCanonicalizeUCS2.cpp', michael@0: 'yarr/YarrInterpreter.cpp', michael@0: 'yarr/YarrPattern.cpp', michael@0: 'yarr/YarrSyntaxChecker.cpp', michael@0: ] michael@0: michael@0: # jsarray.cpp and jsatom.cpp cannot be built in unified mode because michael@0: # xpcshell is broken during packaging when compiled with gcc-4.8.2 michael@0: # builtin/RegExp.cpp cannot be built in unified mode because it is built michael@0: # without PGO michael@0: # frontend/Parser.cpp cannot be built in unified mode because of explicit michael@0: # template instantiations. michael@0: # jsmath.cpp cannot be built in unified mode because it needs to pull rand_s michael@0: # from on Windows through a preprocessor define. michael@0: # jsutil.cpp cannot be built in unified mode because it is needed for michael@0: # check-vanilla-allocations. michael@0: SOURCES += [ michael@0: 'builtin/RegExp.cpp', michael@0: 'frontend/Parser.cpp', michael@0: 'jsarray.cpp', michael@0: 'jsatom.cpp', michael@0: 'jsmath.cpp', michael@0: 'jsutil.cpp', michael@0: ] michael@0: michael@0: if CONFIG['JS_POSIX_NSPR']: michael@0: UNIFIED_SOURCES += [ michael@0: 'vm/PosixNSPR.cpp', michael@0: ] michael@0: michael@0: if CONFIG['MOZ_INSTRUMENTS']: michael@0: SOURCES += [ michael@0: 'devtools/Instruments.cpp', michael@0: ] michael@0: michael@0: if CONFIG['ENABLE_TRACE_LOGGING']: michael@0: SOURCES += [ michael@0: 'vm/TraceLogging.cpp', michael@0: ] michael@0: michael@0: if CONFIG['ENABLE_ION']: michael@0: UNIFIED_SOURCES += [ michael@0: 'jit/AliasAnalysis.cpp', michael@0: 'jit/AsmJS.cpp', michael@0: 'jit/AsmJSLink.cpp', michael@0: 'jit/AsmJSModule.cpp', michael@0: 'jit/AsmJSSignalHandlers.cpp', michael@0: 'jit/BacktrackingAllocator.cpp', michael@0: 'jit/Bailouts.cpp', michael@0: 'jit/BaselineBailouts.cpp', michael@0: 'jit/BaselineCompiler.cpp', michael@0: 'jit/BaselineDebugModeOSR.cpp', michael@0: 'jit/BaselineFrame.cpp', michael@0: 'jit/BaselineFrameInfo.cpp', michael@0: 'jit/BaselineIC.cpp', michael@0: 'jit/BaselineInspector.cpp', michael@0: 'jit/BaselineJIT.cpp', michael@0: 'jit/BitSet.cpp', michael@0: 'jit/BytecodeAnalysis.cpp', michael@0: 'jit/C1Spewer.cpp', michael@0: 'jit/CodeGenerator.cpp', michael@0: 'jit/CompileWrappers.cpp', michael@0: 'jit/EdgeCaseAnalysis.cpp', michael@0: 'jit/EffectiveAddressAnalysis.cpp', michael@0: 'jit/Ion.cpp', michael@0: 'jit/IonAnalysis.cpp', michael@0: 'jit/IonBuilder.cpp', michael@0: 'jit/IonCaches.cpp', michael@0: 'jit/IonFrames.cpp', michael@0: 'jit/IonMacroAssembler.cpp', michael@0: 'jit/IonOptimizationLevels.cpp', michael@0: 'jit/IonSpewer.cpp', michael@0: 'jit/JitOptions.cpp', michael@0: 'jit/JSONSpewer.cpp', michael@0: 'jit/LICM.cpp', michael@0: 'jit/LinearScan.cpp', michael@0: 'jit/LIR.cpp', michael@0: 'jit/LiveRangeAllocator.cpp', michael@0: 'jit/Lowering.cpp', michael@0: 'jit/MCallOptimize.cpp', michael@0: 'jit/MIR.cpp', michael@0: 'jit/MIRGraph.cpp', michael@0: 'jit/MoveResolver.cpp', michael@0: 'jit/ParallelFunctions.cpp', michael@0: 'jit/ParallelSafetyAnalysis.cpp', michael@0: 'jit/PerfSpewer.cpp', michael@0: 'jit/RangeAnalysis.cpp', michael@0: 'jit/Recover.cpp', michael@0: 'jit/RegisterAllocator.cpp', michael@0: 'jit/RematerializedFrame.cpp', michael@0: 'jit/Safepoints.cpp', michael@0: 'jit/shared/BaselineCompiler-shared.cpp', michael@0: 'jit/shared/CodeGenerator-shared.cpp', michael@0: 'jit/shared/Lowering-shared.cpp', michael@0: 'jit/Snapshots.cpp', michael@0: 'jit/StupidAllocator.cpp', michael@0: 'jit/TypeDescrSet.cpp', michael@0: 'jit/TypePolicy.cpp', michael@0: 'jit/UnreachableCodeElimination.cpp', michael@0: 'jit/ValueNumbering.cpp', michael@0: 'jit/VMFunctions.cpp', michael@0: ] michael@0: if CONFIG['JS_CODEGEN_X86'] or CONFIG['JS_CODEGEN_X64']: michael@0: UNIFIED_SOURCES += [ michael@0: 'jit/shared/Assembler-x86-shared.cpp', michael@0: 'jit/shared/BaselineCompiler-x86-shared.cpp', michael@0: 'jit/shared/BaselineIC-x86-shared.cpp', michael@0: 'jit/shared/CodeGenerator-x86-shared.cpp', michael@0: 'jit/shared/Lowering-x86-shared.cpp', michael@0: 'jit/shared/MacroAssembler-x86-shared.cpp', michael@0: 'jit/shared/MoveEmitter-x86-shared.cpp', michael@0: ] michael@0: if CONFIG['JS_CODEGEN_X64']: michael@0: UNIFIED_SOURCES += [ michael@0: 'jit/x64/Assembler-x64.cpp', michael@0: 'jit/x64/Bailouts-x64.cpp', michael@0: 'jit/x64/BaselineCompiler-x64.cpp', michael@0: 'jit/x64/BaselineIC-x64.cpp', michael@0: 'jit/x64/CodeGenerator-x64.cpp', michael@0: 'jit/x64/Lowering-x64.cpp', michael@0: 'jit/x64/MacroAssembler-x64.cpp', michael@0: 'jit/x64/Trampoline-x64.cpp', michael@0: ] michael@0: else: michael@0: UNIFIED_SOURCES += [ michael@0: 'jit/x86/Assembler-x86.cpp', michael@0: 'jit/x86/Bailouts-x86.cpp', michael@0: 'jit/x86/BaselineCompiler-x86.cpp', michael@0: 'jit/x86/BaselineIC-x86.cpp', michael@0: 'jit/x86/CodeGenerator-x86.cpp', michael@0: 'jit/x86/Lowering-x86.cpp', michael@0: 'jit/x86/MacroAssembler-x86.cpp', michael@0: 'jit/x86/Trampoline-x86.cpp', michael@0: ] michael@0: elif CONFIG['JS_CODEGEN_ARM']: michael@0: UNIFIED_SOURCES += [ michael@0: 'jit/arm/Architecture-arm.cpp', michael@0: 'jit/arm/Assembler-arm.cpp', michael@0: 'jit/arm/Bailouts-arm.cpp', michael@0: 'jit/arm/BaselineCompiler-arm.cpp', michael@0: 'jit/arm/BaselineIC-arm.cpp', michael@0: 'jit/arm/CodeGenerator-arm.cpp', michael@0: 'jit/arm/Lowering-arm.cpp', michael@0: 'jit/arm/MacroAssembler-arm.cpp', michael@0: 'jit/arm/MoveEmitter-arm.cpp', michael@0: 'jit/arm/Trampoline-arm.cpp', michael@0: ] michael@0: if CONFIG['JS_ARM_SIMULATOR']: michael@0: UNIFIED_SOURCES += [ michael@0: 'jit/arm/Simulator-arm.cpp' michael@0: ] michael@0: michael@0: if CONFIG['OS_ARCH'] == 'WINNT': michael@0: SOURCES += [ michael@0: 'assembler/jit/ExecutableAllocatorWin.cpp', michael@0: 'yarr/OSAllocatorWin.cpp', michael@0: ] michael@0: # _CRT_RAND_S must be #defined before #including stdlib.h to get rand_s() michael@0: DEFINES['_CRT_RAND_S'] = True michael@0: else: michael@0: SOURCES += [ michael@0: 'assembler/jit/ExecutableAllocatorPosix.cpp', michael@0: 'yarr/OSAllocatorPosix.cpp', michael@0: ] michael@0: michael@0: if CONFIG['ENABLE_ION'] or CONFIG['ENABLE_YARR_JIT']: michael@0: if CONFIG['JS_CODEGEN_X86'] or CONFIG['JS_CODEGEN_X64']: michael@0: SOURCES += [ michael@0: 'assembler/assembler/MacroAssemblerX86Common.cpp', michael@0: ] michael@0: elif CONFIG['JS_CODEGEN_ARM']: michael@0: SOURCES += [ michael@0: 'assembler/assembler/ARMAssembler.cpp', michael@0: 'assembler/assembler/MacroAssemblerARM.cpp', michael@0: ] michael@0: michael@0: if CONFIG['ENABLE_YARR_JIT']: michael@0: SOURCES += [ michael@0: 'yarr/YarrJIT.cpp' michael@0: ] michael@0: michael@0: if CONFIG['JS_HAS_CTYPES']: michael@0: SOURCES += [ michael@0: 'ctypes/CTypes.cpp', michael@0: 'ctypes/Library.cpp', michael@0: ] michael@0: if not CONFIG['MOZ_NATIVE_FFI']: michael@0: GENERATED_INCLUDES += [ michael@0: 'ctypes/libffi/include', michael@0: ] michael@0: michael@0: if CONFIG['MOZ_VTUNE']: michael@0: SOURCES += [ michael@0: 'vtune/jitprofiling.c' michael@0: ] michael@0: michael@0: if CONFIG['HAVE_LINUX_PERF_EVENT_H']: michael@0: SOURCES += [ michael@0: 'perf/pm_linux.cpp' michael@0: ] michael@0: SOURCES['perf/pm_linux.cpp'].flags += [CONFIG['LINUX_HEADERS_INCLUDES']] michael@0: else: michael@0: SOURCES += [ michael@0: 'perf/pm_stub.cpp' michael@0: ] michael@0: michael@0: MSVC_ENABLE_PGO = True michael@0: michael@0: HOST_SOURCES += [ michael@0: 'jskwgen.cpp', michael@0: ] michael@0: michael@0: HOST_SIMPLE_PROGRAMS += [ michael@0: 'host_%s' % f.replace('.cpp', '') for f in HOST_SOURCES michael@0: ] michael@0: michael@0: # JavaScript must be built shared, even for static builds, as it is used by michael@0: # other modules which are always built shared. Failure to do so results in michael@0: # the js code getting copied into xpinstall and jsd as well as mozilla-bin, michael@0: # and then the static data cells used for locking no longer work. michael@0: # michael@0: # In fact, we now build both a static and a shared library, as the michael@0: # JS shell would like to link to the static library. michael@0: michael@0: if CONFIG['JS_SHARED_LIBRARY']: michael@0: FORCE_SHARED_LIB = True michael@0: michael@0: FORCE_STATIC_LIB = True michael@0: michael@0: if CONFIG['MOZ_ETW']: michael@0: GENERATED_FILES = [ michael@0: 'ETWProvider.h', michael@0: ] michael@0: # This will get the ETW provider resources into the library mozjs.dll michael@0: RESFILE = 'ETWProvider.res' michael@0: michael@0: if CONFIG['NIGHTLY_BUILD']: michael@0: DEFINES['ENABLE_PARALLEL_JS'] = True michael@0: DEFINES['ENABLE_BINARYDATA'] = True michael@0: DEFINES['ENABLE_SHARED_ARRAY_BUFFER'] = True michael@0: michael@0: DEFINES['EXPORT_JS_API'] = True michael@0: michael@0: if CONFIG['JS_THREADSAFE']: michael@0: DEFINES['JS_THREADSAFE'] = True michael@0: michael@0: if CONFIG['JS_HAS_CTYPES']: michael@0: DEFINES['JS_HAS_CTYPES'] = True michael@0: for var in ('DLL_PREFIX', 'DLL_SUFFIX'): michael@0: DEFINES[var] = '"%s"' % CONFIG[var] michael@0: michael@0: if CONFIG['MOZ_LINKER']: michael@0: DEFINES['MOZ_LINKER'] = True michael@0: michael@0: if CONFIG['_MSC_VER']: michael@0: if CONFIG['CPU_ARCH'] == 'x86': michael@0: SOURCES['builtin/RegExp.cpp'].no_pgo = True # Bug 772303 michael@0: elif CONFIG['CPU_ARCH'] == 'x86_64' and CONFIG['JS_HAS_CTYPES']: michael@0: SOURCES['ctypes/CTypes.cpp'].no_pgo = True # Bug 810661 michael@0: michael@0: # Needed to "configure" it correctly. Unfortunately these michael@0: # flags wind up being applied to all code in js/src, not just michael@0: # the code in js/src/assembler. michael@0: DEFINES['USE_SYSTEM_MALLOC'] = 1 michael@0: DEFINES['ENABLE_ASSEMBLER'] = 1 michael@0: michael@0: if CONFIG['ENABLE_YARR_JIT']: michael@0: DEFINES['ENABLE_JIT'] = 1