Index: ps/trunk/libraries/source/spidermonkey/FixBug1021171.diff =================================================================== --- ps/trunk/libraries/source/spidermonkey/FixBug1021171.diff (revision 18655) +++ ps/trunk/libraries/source/spidermonkey/FixBug1021171.diff (nonexistent) @@ -1,245 +0,0 @@ -# Based on -# HG changeset patch -# User Trevor Saunders -# Date 1402083090 14400 -# Node ID fc756706366d983e5d70345cab419fbf72db3d36 -# Parent 78c20dbe259e808fb58d65731efd4f05e8921820 -bug 1021171 - don't return nulllptr in functions returning bool r=bz,waldo - -diff --git a/js/src/builtin/TypedObject.cpp b/js/src/builtin/TypedObject.cpp ---- a/js/src/builtin/TypedObject.cpp -+++ b/js/src/builtin/TypedObject.cpp -@@ -705,35 +705,35 @@ ArrayMetaTypeDescr::construct(JSContext - - // Construct a canonical string `new ArrayType()`: - StringBuffer contents(cx); - contents.append("new ArrayType("); - contents.append(&elementType->stringRepr()); - contents.append(")"); - RootedAtom stringRepr(cx, contents.finishAtom()); - if (!stringRepr) -- return nullptr; -+ return false; - - // Extract ArrayType.prototype - RootedObject arrayTypePrototype(cx, GetPrototype(cx, arrayTypeGlobal)); - if (!arrayTypePrototype) -- return nullptr; -+ return false; - - // Create the instance of ArrayType - Rooted obj(cx); - obj = create(cx, arrayTypePrototype, elementType, - stringRepr, 0); - if (!obj) - return false; - - // Add `length` property, which is undefined for an unsized array. - if (!JSObject::defineProperty(cx, obj, cx->names().length, - UndefinedHandleValue, nullptr, nullptr, - JSPROP_READONLY | JSPROP_PERMANENT)) -- return nullptr; -+ return false; - - args.rval().setObject(*obj); - return true; - } - - /*static*/ bool - UnsizedArrayTypeDescr::dimension(JSContext *cx, unsigned int argc, jsval *vp) - { -@@ -757,30 +757,30 @@ UnsizedArrayTypeDescr::dimension(JSConte - int32_t length = args[0].toInt32(); - Rooted elementType(cx, &unsizedTypeDescr->elementType()); - - // Compute the size. - CheckedInt32 size = CheckedInt32(elementType->size()) * length; - if (!size.isValid()) { - JS_ReportErrorNumber(cx, js_GetErrorMessage, nullptr, - JSMSG_TYPEDOBJECT_TOO_BIG); -- return nullptr; -+ return false; - } - - // Construct a canonical string `new ArrayType().dimension(N)`: - StringBuffer contents(cx); - contents.append("new ArrayType("); - contents.append(&elementType->stringRepr()); - contents.append(").dimension("); - if (!NumberValueToStringBuffer(cx, NumberValue(length), contents)) - return false; - contents.append(")"); - RootedAtom stringRepr(cx, contents.finishAtom()); - if (!stringRepr) -- return nullptr; -+ return false; - - // Create the sized type object. - Rooted obj(cx); - obj = ArrayMetaTypeDescr::create(cx, unsizedTypeDescr, - elementType, - stringRepr, size.value()); - if (!obj) - return false; -@@ -788,25 +788,25 @@ UnsizedArrayTypeDescr::dimension(JSConte - obj->initReservedSlot(JS_DESCR_SLOT_SIZED_ARRAY_LENGTH, - Int32Value(length)); - - // Add `length` property. - RootedValue lengthVal(cx, Int32Value(length)); - if (!JSObject::defineProperty(cx, obj, cx->names().length, - lengthVal, nullptr, nullptr, - JSPROP_READONLY | JSPROP_PERMANENT)) -- return nullptr; -+ return false; - - // Add `unsized` property, which is a link from the sized - // array to the unsized array. - RootedValue unsizedTypeDescrValue(cx, ObjectValue(*unsizedTypeDescr)); - if (!JSObject::defineProperty(cx, obj, cx->names().unsized, - unsizedTypeDescrValue, nullptr, nullptr, - JSPROP_READONLY | JSPROP_PERMANENT)) -- return nullptr; -+ return false; - - args.rval().setObject(*obj); - return true; - } - - bool - js::IsTypedObjectArray(JSObject &obj) - { -@@ -1248,17 +1248,17 @@ DefineSimpleTypeDescr(JSContext *cx, - if (!JS_DefineFunctions(cx, descr, T::typeObjectMethods)) - return false; - - // Create the typed prototype for the scalar type. This winds up - // not being user accessible, but we still create one for consistency. - Rooted proto(cx); - proto = NewObjectWithProto(cx, objProto, nullptr, TenuredObject); - if (!proto) -- return nullptr; -+ return false; - proto->initTypeDescrSlot(*descr); - descr->initReservedSlot(JS_DESCR_SLOT_TYPROTO, ObjectValue(*proto)); - - RootedValue descrValue(cx, ObjectValue(*descr)); - if (!JSObject::defineProperty(cx, module, className, - descrValue, nullptr, nullptr, 0)) - { - return false; -@@ -1353,66 +1353,66 @@ GlobalObject::initTypedObjectModule(JSCo - if (!JS_DefineFunctions(cx, module, TypedObjectMethods)) - return false; - - // uint8, uint16, any, etc - - #define BINARYDATA_SCALAR_DEFINE(constant_, type_, name_) \ - if (!DefineSimpleTypeDescr(cx, global, module, constant_, \ - cx->names().name_)) \ -- return nullptr; -+ return false; - JS_FOR_EACH_SCALAR_TYPE_REPR(BINARYDATA_SCALAR_DEFINE) - #undef BINARYDATA_SCALAR_DEFINE - - #define BINARYDATA_REFERENCE_DEFINE(constant_, type_, name_) \ - if (!DefineSimpleTypeDescr(cx, global, module, constant_, \ - cx->names().name_)) \ -- return nullptr; -+ return false; - JS_FOR_EACH_REFERENCE_TYPE_REPR(BINARYDATA_REFERENCE_DEFINE) - #undef BINARYDATA_REFERENCE_DEFINE - - // ArrayType. - - RootedObject arrayType(cx); - arrayType = DefineMetaTypeDescr( - cx, global, module, TypedObjectModuleObject::ArrayTypePrototype); - if (!arrayType) -- return nullptr; -+ return false; - - RootedValue arrayTypeValue(cx, ObjectValue(*arrayType)); - if (!JSObject::defineProperty(cx, module, cx->names().ArrayType, - arrayTypeValue, - nullptr, nullptr, - JSPROP_READONLY | JSPROP_PERMANENT)) -- return nullptr; -+ return false; - - // StructType. - - RootedObject structType(cx); - structType = DefineMetaTypeDescr( - cx, global, module, TypedObjectModuleObject::StructTypePrototype); - if (!structType) -- return nullptr; -+ return false; - - RootedValue structTypeValue(cx, ObjectValue(*structType)); - if (!JSObject::defineProperty(cx, module, cx->names().StructType, - structTypeValue, - nullptr, nullptr, - JSPROP_READONLY | JSPROP_PERMANENT)) -- return nullptr; -+ return false; - - // Everything is setup, install module on the global object: - RootedValue moduleValue(cx, ObjectValue(*module)); - global->setConstructor(JSProto_TypedObject, moduleValue); - if (!JSObject::defineProperty(cx, global, cx->names().TypedObject, - moduleValue, - nullptr, nullptr, - 0)) - { -- return nullptr; -+ return false; - } - - return module; - } - - JSObject * - js_InitTypedObjectModuleObject(JSContext *cx, HandleObject obj) - { -@@ -2444,17 +2444,17 @@ TypedObject::constructUnsized(JSContext - } - - // Length constructor. - if (args[0].isInt32()) { - int32_t length = args[0].toInt32(); - if (length < 0) { - JS_ReportErrorNumber(cx, js_GetErrorMessage, - nullptr, JSMSG_TYPEDOBJECT_BAD_ARGS); -- return nullptr; -+ return false; - } - Rooted obj(cx, createZeroed(cx, callee, length)); - if (!obj) - return false; - args.rval().setObject(*obj); - return true; - } - -diff --git a/js/src/frontend/BytecodeCompiler.cpp b/js/src/frontend/BytecodeCompiler.cpp ---- a/js/src/frontend/BytecodeCompiler.cpp -+++ b/js/src/frontend/BytecodeCompiler.cpp -@@ -539,17 +539,17 @@ CompileFunctionBody(JSContext *cx, Mutab - - MaybeCallSourceHandler(cx, options, srcBuf); - - if (!CheckLength(cx, srcBuf)) - return false; - - RootedScriptSource sourceObject(cx, CreateScriptSourceObject(cx, options)); - if (!sourceObject) -- return nullptr; -+ return false; - ScriptSource *ss = sourceObject->source(); - - SourceCompressionTask sct(cx); - JS_ASSERT(!options.sourceIsLazy); - if (!cx->compartment()->options().discardSource()) { - if (!ss->setSourceCopy(cx, srcBuf, true, &sct)) - return false; - } Index: ps/trunk/libraries/source/spidermonkey/FixBug1037470.diff =================================================================== --- ps/trunk/libraries/source/spidermonkey/FixBug1037470.diff (revision 18655) +++ ps/trunk/libraries/source/spidermonkey/FixBug1037470.diff (nonexistent) @@ -1,31 +0,0 @@ - -# HG changeset patch -# User Martin Stransky -# Date 1405081680 14400 -# Node ID 46229cdd48f4bafbb5660d1a533449deff0c6bd3 -# Parent c274ab1b4086c248d1e0a21f33b38043c4f1f184 -Bug 1037470 - Fix debug build bustage with Ion disabled. r=jandem - -diff --git a/js/src/vm/Debugger.cpp b/js/src/vm/Debugger.cpp ---- a/js/src/vm/Debugger.cpp -+++ b/js/src/vm/Debugger.cpp -@@ -4108,17 +4108,17 @@ static const JSFunctionSpec DebuggerSour - - - /*** Debugger.Frame ******************************************************************************/ - - static void - UpdateFrameIterPc(FrameIter &iter) - { - if (iter.abstractFramePtr().isRematerializedFrame()) { --#ifdef DEBUG -+#if defined(DEBUG) && defined(JS_ION) - // Rematerialized frames don't need their pc updated. The reason we - // need to update pc is because we might get the same Debugger.Frame - // object for multiple re-entries into debugger code from debuggee - // code. This reentrancy is not possible with rematerialized frames, - // because when returning to debuggee code, we would have bailed out - // to baseline. - // - // We walk the stack to assert that it doesn't need updating. - Index: ps/trunk/libraries/source/spidermonkey/FixTraceLoggerBuild.diff =================================================================== --- ps/trunk/libraries/source/spidermonkey/FixTraceLoggerBuild.diff (revision 18655) +++ ps/trunk/libraries/source/spidermonkey/FixTraceLoggerBuild.diff (nonexistent) @@ -1,28 +0,0 @@ -# HG changeset patch -# User Hannes Verschore -# Date 1398688725 -7200 -# Node ID fbe7d0fd049c7287581d91ccf17a674dfb540a52 -# Parent 0512907b10907cdd3b08b0bfb57aa2578dbb298f -Bug 716647: Fix Tracelogger after baseline adjustments, r=till - -diff --git a/js/src/jit/BaselineCompiler.cpp b/js/src/jit/BaselineCompiler.cpp ---- a/js/src/jit/BaselineCompiler.cpp -+++ b/js/src/jit/BaselineCompiler.cpp -@@ -337,17 +337,17 @@ BaselineCompiler::emitPrologue() - if (needsEarlyStackCheck()) - masm.bind(&earlyStackCheckFailed); - - #ifdef JS_TRACE_LOGGING - TraceLogger *logger = TraceLoggerForMainThread(cx->runtime()); - Register loggerReg = RegisterSet::Volatile().takeGeneral(); - masm.Push(loggerReg); - masm.movePtr(ImmPtr(logger), loggerReg); -- masm.tracelogStart(loggerReg, TraceLogCreateTextId(logger, script.get())); -+ masm.tracelogStart(loggerReg, TraceLogCreateTextId(logger, script)); - masm.tracelogStart(loggerReg, TraceLogger::Baseline); - masm.Pop(loggerReg); - #endif - - // Record the offset of the prologue, because Ion can bailout before - // the scope chain is initialized. - prologueOffset_ = masm.currentOffset(); Property changes on: ps/trunk/libraries/source/spidermonkey/FixTraceLoggerBuild.diff ___________________________________________________________________ Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Index: ps/trunk/libraries/source/spidermonkey/FixBug1119228.diff =================================================================== --- ps/trunk/libraries/source/spidermonkey/FixBug1119228.diff (revision 18655) +++ ps/trunk/libraries/source/spidermonkey/FixBug1119228.diff (nonexistent) @@ -1,65 +0,0 @@ -# Backport of -# HG changeset patch -# User Ehsan Akhgari -# Date 1420727118 18000 -# Node ID bcacb5692ad902fc0ec6ebea2ad382a8a3fd5183 -# Parent 48f8a884901ba9753d3bddab08f25c60e1915601 -Bug 1119228 - Fix a fatal warning in PossiblyFail; r=jandem - -Recent clang emits the following warning (which is treated as an error) on this code: -error: implicit conversion of nullptr constant to 'bool' [-Werror,-Wnull-conversion] - - -diff --git a/js/public/Utility.h b/js/public/Utility.h ---- a/js/public/Utility.h -+++ b/js/public/Utility.h -@@ -83,19 +83,28 @@ static MOZ_NEVER_INLINE void js_failedAl - # define JS_OOM_POSSIBLY_FAIL() \ - do \ - { \ - if (++OOM_counter > OOM_maxAllocations) { \ - JS_OOM_CALL_BP_FUNC();\ - return nullptr; \ - } \ - } while (0) -+# define JS_OOM_POSSIBLY_FAIL_BOOL() \ -+ do \ -+ { \ -+ if (++OOM_counter > OOM_maxAllocations) { \ -+ JS_OOM_CALL_BP_FUNC();\ -+ return false; \ -+ } \ -+ } while (0) - - # else - # define JS_OOM_POSSIBLY_FAIL() do {} while(0) -+# define JS_OOM_POSSIBLY_FAIL_BOOL() do {} while(0) - # endif /* DEBUG || JS_OOM_BREAKPOINT */ - - static inline void* js_malloc(size_t bytes) - { - JS_OOM_POSSIBLY_FAIL(); - return malloc(bytes); - } - ---- a/js/src/jsgcinlines.h -+++ b/js/src/jsgcinlines.h -@@ -403,17 +403,17 @@ - } - return nullptr; - } - #endif /* JSGC_GENERATIONAL */ - - static inline bool - PossiblyFail() - { -- JS_OOM_POSSIBLY_FAIL(); -+ JS_OOM_POSSIBLY_FAIL_BOOL(); - return true; - } - - template - static inline bool - CheckAllocatorState(ThreadSafeContext *cx, AllocKind kind) - { - if (!cx->isJSContext()) Index: ps/trunk/libraries/source/spidermonkey/FixForOfBailouts.diff =================================================================== --- ps/trunk/libraries/source/spidermonkey/FixForOfBailouts.diff (revision 18655) +++ ps/trunk/libraries/source/spidermonkey/FixForOfBailouts.diff (nonexistent) @@ -1,24 +0,0 @@ -# HG changeset patch -# Parent 56861f2edc5d3814d5341d49845eb98fc4669d45 -diff --git a/js/src/jit/MCallOptimize.cpp b/js/src/jit/MCallOptimize.cpp ---- a/js/src/jit/MCallOptimize.cpp -+++ b/js/src/jit/MCallOptimize.cpp -@@ -1789,17 +1789,17 @@ IonBuilder::inlineUnsafeSetReservedSlot( - - callInfo.setImplicitlyUsedUnchecked(); - - MStoreFixedSlot *store = MStoreFixedSlot::New(alloc(), callInfo.getArg(0), slot, callInfo.getArg(2)); - current->add(store); - current->push(store); - - if (NeedsPostBarrier(info(), callInfo.getArg(2))) -- current->add(MPostWriteBarrier::New(alloc(), callInfo.thisArg(), callInfo.getArg(2))); -+ current->add(MPostWriteBarrier::New(alloc(), callInfo.getArg(0), callInfo.getArg(2))); - - return InliningStatus_Inlined; - } - - IonBuilder::InliningStatus - IonBuilder::inlineUnsafeGetReservedSlot(CallInfo &callInfo) - { - if (callInfo.argc() != 2 || callInfo.constructing()) Property changes on: ps/trunk/libraries/source/spidermonkey/FixForOfBailouts.diff ___________________________________________________________________ Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Index: ps/trunk/libraries/source/spidermonkey/FixTraceLoggerFlushing.diff =================================================================== --- ps/trunk/libraries/source/spidermonkey/FixTraceLoggerFlushing.diff (revision 18655) +++ ps/trunk/libraries/source/spidermonkey/FixTraceLoggerFlushing.diff (nonexistent) @@ -1,66 +0,0 @@ -diff -r cd52a7f89548 js/src/vm/TraceLogging.cpp ---- a/js/src/vm/TraceLogging.cpp Thu Jul 17 14:10:32 2014 -0400 -+++ b/js/src/vm/TraceLogging.cpp Sat Nov 08 12:30:05 2014 +0100 -@@ -106,7 +106,7 @@ - - char treeFilename[sizeof TRACE_LOG_DIR "tl-tree.100.tl"]; - sprintf(treeFilename, TRACE_LOG_DIR "tl-tree.%d.tl", loggerId); -- treeFile = fopen(treeFilename, "wb"); -+ treeFile = fopen(treeFilename, "wb+"); - if (!treeFile) { - fclose(dictFile); - dictFile = nullptr; -@@ -280,7 +280,7 @@ - if (bytesWritten < tree.size()) - return false; - -- treeOffset += tree.currentId(); -+ treeOffset += tree.nextId(); - tree.clear(); - } - -@@ -466,7 +466,7 @@ - { - // Entry is still in memory - if (treeId >= treeOffset) { -- *entry = tree[treeId]; -+ *entry = tree[treeId - treeOffset]; - return true; - } - -@@ -570,8 +570,8 @@ - stackEntry.setActive(false); - return; - } -- -- if (!tree.ensureSpaceBeforeAdd()) { -+ -+ if (tree.sizeBytes() > 100 * 1024 * 1024 || !tree.ensureSpaceBeforeAdd()) { - uint64_t start = rdtsc() - traceLoggers.startupTime; - if (!flush()) { - fprintf(stderr, "TraceLogging: Couldn't write the data to disk.\n"); -@@ -633,8 +633,8 @@ - #endif - - if (parent.lastChildId() == 0) { -- MOZ_ASSERT(!entry.hasChildren()); -- MOZ_ASSERT(parent.treeId() == tree.currentId() + treeOffset); -+ MOZ_ASSERT_IF(tree.nextId() > 0, parent.treeId() == tree.currentId() + treeOffset); -+ MOZ_ASSERT_IF(tree.nextId() == 0, parent.treeId() == treeOffset - 1); - - if (!updateHasChildren(parent.treeId())) - return false; -diff -r cd52a7f89548 js/src/vm/TraceLogging.h ---- a/js/src/vm/TraceLogging.h Thu Jul 17 14:10:32 2014 -0400 -+++ b/js/src/vm/TraceLogging.h Sat Nov 08 12:30:05 2014 +0100 -@@ -182,6 +182,10 @@ - return next_; - } - -+ uint32_t sizeBytes() { -+ return next_ * sizeof(T); -+ } -+ - uint32_t nextId() { - return next_; - } Property changes on: ps/trunk/libraries/source/spidermonkey/FixTraceLoggerFlushing.diff ___________________________________________________________________ Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Index: ps/trunk/libraries/osx/build-osx-libs.sh =================================================================== --- ps/trunk/libraries/osx/build-osx-libs.sh (revision 18655) +++ ps/trunk/libraries/osx/build-osx-libs.sh (revision 18656) @@ -1,757 +1,753 @@ #!/bin/bash # # Script for acquiring and building OS X dependencies for 0 A.D. # # The script checks whether a source tarball exists for each # dependency, if not it will download the correct version from # the project's website, then it removes previous build files, # extracts the tarball, configures and builds the lib. The script # should die on any errors to ease troubleshooting. # # make install is used to copy the compiled libs to each specific # directory and also the config tools (e.g. sdl-config). Because # of this, OS X developers must run this script at least once, # to configure the correct lib directories. It must be run again # if the libraries are moved. # # Building against an SDK is an option, though not required, # as not all build environments contain the Developer SDKs # (Xcode does, but the Command Line Tools package does not) # # -------------------------------------------------------------- # Library versions for ease of updating: ZLIB_VERSION="zlib-1.2.8" CURL_VERSION="curl-7.46.0" ICONV_VERSION="libiconv-1.14" XML2_VERSION="libxml2-2.9.3" SDL2_VERSION="SDL2-2.0.4" BOOST_VERSION="boost_1_60_0" WXWIDGETS_VERSION="wxWidgets-3.0.2" # libpng was included as part of X11 but that's removed from Mountain Lion # (also the Snow Leopard version was ancient 1.2) PNG_VERSION="libpng-1.6.21" OGG_VERSION="libogg-1.3.2" VORBIS_VERSION="libvorbis-1.3.5" # gloox is necessary for multiplayer lobby GLOOX_VERSION="gloox-1.0.14" # NSPR is necessary for threadsafe Spidermonkey NSPR_VERSION="4.11" # OS X only includes part of ICU, and only the dylib # NOTE: remember to also update LIB_URL below when changing version ICU_VERSION="icu4c-56_1" ENET_VERSION="enet-1.3.13" MINIUPNPC_VERSION="miniupnpc-1.9.20151026" # -------------------------------------------------------------- # Bundled with the game: -# * SpiderMonkey 31 +# * SpiderMonkey 38 # * NVTT # * FCollada # -------------------------------------------------------------- # Provided by OS X: # * OpenAL # * OpenGL # -------------------------------------------------------------- # Force build architecture, as sometimes environment is broken. # For a universal fat binary, the approach would be to build every # dependency with both archs and combine them with lipo, then do the # same thing with the game itself. # Choices are "x86_64" or "i386" (ppc and ppc64 not supported) ARCH=${ARCH:="x86_64"} # Define compiler as "clang", this is all Mavericks supports. # gcc symlinks may still exist, but they are simply clang with # slightly different config, which confuses build scripts. # llvm-gcc and gcc 4.2 are no longer supported by SpiderMonkey. export CC=${CC:="clang"} CXX=${CXX:="clang++"} export MIN_OSX_VERSION=${MIN_OSX_VERSION:="10.9"} # The various libs offer inconsistent configure options, some allow # setting sysroot and OS X-specific options, others don't. Adding to # the confusion, Apple moved /Developer/SDKs into the Xcode app bundle # so the path can't be guessed by clever build tools (like Boost.Build). # Sometimes configure gets it wrong anyway, especially on cross compiles. # This is why we prefer using (OBJ)CFLAGS, (OBJ)CXXFLAGS, and LDFLAGS. # Check if SYSROOT is set and not empty if [[ $SYSROOT && ${SYSROOT-_} ]]; then C_FLAGS="-isysroot $SYSROOT" LDFLAGS="$LDFLAGS -Wl,-syslibroot,$SYSROOT" fi # Check if MIN_OSX_VERSION is set and not empty if [[ $MIN_OSX_VERSION && ${MIN_OSX_VERSION-_} ]]; then C_FLAGS="$C_FLAGS -mmacosx-version-min=$MIN_OSX_VERSION" # clang and llvm-gcc look at mmacosx-version-min to determine link target # and CRT version, and use it to set the macosx_version_min linker flag LDFLAGS="$LDFLAGS -mmacosx-version-min=$MIN_OSX_VERSION" fi # Force using libc++ since it has better C++11 support required by the game # but pre-Mavericks still use libstdc++ by default # Also enable c++0x for consistency with the game build C_FLAGS="$C_FLAGS -arch $ARCH -fvisibility=hidden" LDFLAGS="$LDFLAGS -arch $ARCH -stdlib=libc++" CFLAGS="$CFLAGS $C_FLAGS" CXXFLAGS="$CXXFLAGS $C_FLAGS -stdlib=libc++ -std=c++0x" OBJCFLAGS="$OBJCFLAGS $C_FLAGS" OBJCXXFLAGS="$OBJCXXFLAGS $C_FLAGS" JOBS=${JOBS:="-j2"} set -e die() { echo ERROR: $* exit 1 } download_lib() { local url=$1 local filename=$2 if [ ! -e $filename ]; then echo "Downloading $filename" curl -L -o ${filename} ${url}${filename} || die "Download of $url$filename failed" fi } already_built() { echo -e "Skipping - already built (use --force-rebuild to override)" } # Check that we're actually on OS X if [ "`uname -s`" != "Darwin" ]; then die "This script is intended for OS X only" fi # Parse command-line options: force_rebuild=false for i in "$@" do case $i in --force-rebuild ) force_rebuild=true;; -j* ) JOBS=$i ;; esac done cd "$(dirname $0)" # Now in libraries/osx/ (where we assume this script resides) # -------------------------------------------------------------- echo -e "Building zlib..." LIB_VERSION="${ZLIB_VERSION}" LIB_ARCHIVE="$LIB_VERSION.tar.gz" LIB_DIRECTORY=$LIB_VERSION LIB_URL="http://zlib.net/" mkdir -p zlib pushd zlib > /dev/null ZLIB_DIR="$(pwd)" if [[ "$force_rebuild" = "true" ]] || [[ ! -e .already-built ]] || [[ .already-built -ot $LIB_DIRECTORY ]] then rm -f .already-built download_lib $LIB_URL $LIB_ARCHIVE rm -rf $LIB_DIRECTORY include lib share tar -xf $LIB_ARCHIVE pushd $LIB_DIRECTORY # patch zlib's configure script to use our CFLAGS and LDFLAGS (patch -p0 -i ../../patches/zlib_flags.diff && CFLAGS="$CFLAGS" LDFLAGS="$LDFLAGS" ./configure --prefix="$ZLIB_DIR" --static && make ${JOBS} && make install) || die "zlib build failed" popd touch .already-built else already_built fi popd > /dev/null # -------------------------------------------------------------- echo -e "Building libcurl..." LIB_VERSION="${CURL_VERSION}" LIB_ARCHIVE="$LIB_VERSION.tar.bz2" LIB_DIRECTORY="$LIB_VERSION" LIB_URL="http://curl.haxx.se/download/" mkdir -p libcurl pushd libcurl > /dev/null if [[ "$force_rebuild" = "true" ]] || [[ ! -e .already-built ]] || [[ .already-built -ot $LIB_DIRECTORY ]] then INSTALL_DIR="$(pwd)" rm -f .already-built download_lib $LIB_URL $LIB_ARCHIVE rm -rf $LIB_DIRECTORY bin include lib share tar -xf $LIB_ARCHIVE pushd $LIB_DIRECTORY (./configure CFLAGS="$CFLAGS" LDFLAGS="$LDFLAGS" --prefix="$INSTALL_DIR" --enable-ipv6 --without-gnutls --without-gssapi --without-libmetalink --without-librtmp --without-libssh2 --without-nss --without-polarssl --without-spnego --without-ssl --disable-ares --disable-ldap --disable-ldaps --without-libidn --with-zlib="${ZLIB_DIR}" --enable-shared=no && make ${JOBS} && make install) || die "libcurl build failed" popd touch .already-built else already_built fi popd > /dev/null # -------------------------------------------------------------- echo -e "Building libiconv..." LIB_VERSION="${ICONV_VERSION}" LIB_ARCHIVE="$LIB_VERSION.tar.gz" LIB_DIRECTORY="$LIB_VERSION" LIB_URL="http://ftp.gnu.org/pub/gnu/libiconv/" mkdir -p iconv pushd iconv > /dev/null ICONV_DIR="$(pwd)" if [[ "$force_rebuild" = "true" ]] || [[ ! -e .already-built ]] || [[ .already-built -ot $LIB_DIRECTORY ]] then rm -f .already-built download_lib $LIB_URL $LIB_ARCHIVE rm -rf $LIB_DIRECTORY bin include lib share tar -xf $LIB_ARCHIVE pushd $LIB_DIRECTORY (./configure CFLAGS="$CFLAGS" LDFLAGS="$LDFLAGS" --prefix="$ICONV_DIR" --without-libiconv-prefix --without-libintl-prefix --disable-nls --enable-shared=no && make ${JOBS} && make install) || die "libiconv build failed" popd touch .already-built else already_built fi popd > /dev/null # -------------------------------------------------------------- echo -e "Building libxml2..." LIB_VERSION="${XML2_VERSION}" LIB_ARCHIVE="$LIB_VERSION.tar.gz" LIB_DIRECTORY="$LIB_VERSION" LIB_URL="ftp://xmlsoft.org/libxml2/" mkdir -p libxml2 pushd libxml2 > /dev/null if [[ "$force_rebuild" = "true" ]] || [[ ! -e .already-built ]] || [[ .already-built -ot $LIB_DIRECTORY ]] then INSTALL_DIR="$(pwd)" rm -f .already-built download_lib $LIB_URL $LIB_ARCHIVE rm -rf $LIB_DIRECTORY bin include lib share tar -xf $LIB_ARCHIVE pushd $LIB_DIRECTORY (./configure CFLAGS="$CFLAGS" LDFLAGS="$LDFLAGS" --prefix="$INSTALL_DIR" --without-lzma --without-python --with-iconv="${ICONV_DIR}" --with-zlib="${ZLIB_DIR}" --enable-shared=no && make ${JOBS} && make install) || die "libxml2 build failed" popd touch .already-built else already_built fi popd > /dev/null # -------------------------------------------------------------- echo -e "Building SDL2..." LIB_VERSION="${SDL2_VERSION}" LIB_ARCHIVE="$LIB_VERSION.tar.gz" LIB_DIRECTORY=$LIB_VERSION LIB_URL="https://libsdl.org/release/" mkdir -p sdl2 pushd sdl2 > /dev/null if [[ "$force_rebuild" = "true" ]] || [[ ! -e .already-built ]] || [[ .already-built -ot $LIB_DIRECTORY ]] then INSTALL_DIR="$(pwd)" rm -f .already-built download_lib $LIB_URL $LIB_ARCHIVE rm -rf $LIB_DIRECTORY bin include lib share tar -xf $LIB_ARCHIVE pushd $LIB_DIRECTORY # We don't want SDL2 to pull in system iconv, force it to detect ours with flags. # Don't use X11 - we don't need it and Mountain Lion removed it (./configure CPPFLAGS="-I${ICONV_DIR}/include" CFLAGS="$CFLAGS" CXXFLAGS="$CXXFLAGS" LDFLAGS="$LDFLAGS -L${ICONV_DIR}/lib" --prefix="$INSTALL_DIR" --disable-video-x11 --without-x --enable-shared=no && make $JOBS && make install) || die "SDL2 build failed" popd touch .already-built else already_built fi popd > /dev/null # -------------------------------------------------------------- echo -e "Building Boost..." LIB_VERSION="${BOOST_VERSION}" LIB_ARCHIVE="$LIB_VERSION.tar.bz2" LIB_DIRECTORY="$LIB_VERSION" LIB_URL="http://download.sourceforge.net/boost/" mkdir -p boost pushd boost > /dev/null if [[ "$force_rebuild" = "true" ]] || [[ ! -e .already-built ]] || [[ .already-built -ot $LIB_DIRECTORY ]] then INSTALL_DIR="$(pwd)" rm -f .already-built download_lib $LIB_URL $LIB_ARCHIVE rm -rf $LIB_DIRECTORY include lib tar -xf $LIB_ARCHIVE pushd $LIB_DIRECTORY # Can't use macosx-version, see above comment. (./bootstrap.sh --with-libraries=filesystem,system --prefix=$INSTALL_DIR && ./b2 cflags="$CFLAGS" toolset=clang cxxflags="$CXXFLAGS" linkflags="$LDFLAGS" ${JOBS} -d2 --layout=tagged --debug-configuration link=static threading=multi variant=release,debug install) || die "Boost build failed" popd touch .already-built else already_built fi popd > /dev/null # -------------------------------------------------------------- # TODO: This build takes ages, anything we can exclude? echo -e "Building wxWidgets..." LIB_VERSION="${WXWIDGETS_VERSION}" LIB_ARCHIVE="$LIB_VERSION.tar.bz2" LIB_DIRECTORY="$LIB_VERSION" LIB_URL="http://download.sourceforge.net/wxwindows/" mkdir -p wxwidgets pushd wxwidgets > /dev/null if [[ "$force_rebuild" = "true" ]] || [[ ! -e .already-built ]] || [[ .already-built -ot $LIB_DIRECTORY ]] then INSTALL_DIR="$(pwd)" rm -f .already-built download_lib $LIB_URL $LIB_ARCHIVE rm -rf $LIB_DIRECTORY bin include lib share tar -xf $LIB_ARCHIVE pushd $LIB_DIRECTORY mkdir -p build-release pushd build-release CONF_OPTS="--prefix=$INSTALL_DIR --disable-shared --enable-macosx_arch=$ARCH --enable-unicode --with-cocoa --with-opengl --with-libiconv-prefix=${ICONV_DIR} --with-expat=builtin --with-png=builtin --without-libtiff --without-sdl --without-x --disable-webview --disable-webkit --disable-webviewwebkit --disable-webviewie" # wxWidgets configure now defaults to targeting 10.5, if not specified, # but that conflicts with our flags if [[ $MIN_OSX_VERSION && ${MIN_OSX_VERSION-_} ]]; then CONF_OPTS="$CONF_OPTS --with-macosx-version-min=$MIN_OSX_VERSION" fi # patch to fix wxWidgets build on Yosemite (fixed upstream, see http://trac.wxwidgets.org/ticket/16329 ) # Force libc++ in CPPFLAGS as well, since CXXFLAGS isn't enough here (patch -p0 -d.. -i../../patches/wxwidgets-webkit-fix.diff && ../configure CFLAGS="$CFLAGS" CXXFLAGS="$CXXFLAGS" CPPFLAGS="-stdlib=libc++" LDFLAGS="$LDFLAGS" $CONF_OPTS && make ${JOBS} && make install) || die "wxWidgets build failed" popd popd touch .already-built else already_built fi popd > /dev/null # -------------------------------------------------------------- echo -e "Building libpng..." LIB_VERSION="${PNG_VERSION}" LIB_ARCHIVE="$LIB_VERSION.tar.gz" LIB_DIRECTORY="$LIB_VERSION" LIB_URL="http://download.sourceforge.net/libpng/" mkdir -p libpng pushd libpng > /dev/null if [[ "$force_rebuild" = "true" ]] || [[ ! -e .already-built ]] || [[ .already-built -ot $LIB_DIRECTORY ]] then INSTALL_DIR="$(pwd)" rm -f .already-built download_lib $LIB_URL $LIB_ARCHIVE rm -rf $LIB_DIRECTORY bin include lib share tar -xf $LIB_ARCHIVE pushd $LIB_DIRECTORY (./configure CFLAGS="$CFLAGS" LDFLAGS="$LDFLAGS" --prefix=$INSTALL_DIR --enable-shared=no && make ${JOBS} && make install) || die "libpng build failed" popd touch .already-built else already_built fi popd > /dev/null # -------------------------------------------------------------- echo -e "Building libogg..." LIB_VERSION="${OGG_VERSION}" LIB_ARCHIVE="$LIB_VERSION.tar.gz" LIB_DIRECTORY="$LIB_VERSION" LIB_URL="http://downloads.xiph.org/releases/ogg/" # Dependency of vorbis # we can install them in the same directory for convenience mkdir -p libogg mkdir -p vorbis pushd libogg > /dev/null OGG_DIR="$(pwd)" if [[ "$force_rebuild" = "true" ]] || [[ ! -e .already-built ]] || [[ .already-built -ot $LIB_DIRECTORY ]] then rm -f .already-built download_lib $LIB_URL $LIB_ARCHIVE rm -rf $LIB_DIRECTORY include lib share tar -xf $LIB_ARCHIVE pushd $LIB_DIRECTORY (./configure CFLAGS="$CFLAGS" LDFLAGS="$LDFLAGS" --prefix=$OGG_DIR --enable-shared=no && make ${JOBS} && make install) || die "libogg build failed" popd touch .already-built else already_built fi popd > /dev/null # -------------------------------------------------------------- echo -e "Building libvorbis..." LIB_VERSION="${VORBIS_VERSION}" LIB_ARCHIVE="$LIB_VERSION.tar.gz" LIB_DIRECTORY="$LIB_VERSION" LIB_URL="http://downloads.xiph.org/releases/vorbis/" pushd vorbis > /dev/null if [[ "$force_rebuild" = "true" ]] || [[ ! -e .already-built ]] || [[ .already-built -ot $LIB_DIRECTORY ]] then INSTALL_DIR="$(pwd)" rm -f .already-built download_lib $LIB_URL $LIB_ARCHIVE rm -rf $LIB_DIRECTORY include lib share tar -xf $LIB_ARCHIVE pushd $LIB_DIRECTORY (./configure CFLAGS="$CFLAGS" LDFLAGS="$LDFLAGS" --prefix="$INSTALL_DIR" --enable-shared=no --with-ogg="$OGG_DIR" && make ${JOBS} && make install) || die "libvorbis build failed" popd touch .already-built else already_built fi popd > /dev/null # -------------------------------------------------------------- echo -e "Building gloox..." LIB_VERSION="${GLOOX_VERSION}" LIB_ARCHIVE="$LIB_VERSION.tar.bz2" LIB_DIRECTORY="$LIB_VERSION" LIB_URL="http://camaya.net/download/" mkdir -p gloox pushd gloox > /dev/null if [[ "$force_rebuild" = "true" ]] || [[ ! -e .already-built ]] || [[ .already-built -ot $LIB_DIRECTORY ]] then INSTALL_DIR="$(pwd)" rm -f .already-built download_lib $LIB_URL $LIB_ARCHIVE rm -rf $LIB_DIRECTORY bin include lib tar -xf $LIB_ARCHIVE pushd $LIB_DIRECTORY # TODO: pulls in libresolv dependency from /usr/lib # TODO: if we ever use SSL/TLS, that will add yet another dependency... (./configure CFLAGS="$CFLAGS" CXXFLAGS="$CXXFLAGS" LDFLAGS="$LDFLAGS" --prefix="$INSTALL_DIR" --enable-shared=no --with-zlib="${ZLIB_DIR}" --without-libidn --without-gnutls --without-openssl --without-tests --without-examples && make ${JOBS} && make install) || die "gloox build failed" popd touch .already-built else already_built fi popd > /dev/null # -------------------------------------------------------------- echo -e "Building NSPR..." LIB_VERSION="${NSPR_VERSION}" LIB_ARCHIVE="nspr-$LIB_VERSION.tar.gz" LIB_DIRECTORY="nspr-$LIB_VERSION" LIB_URL="https://ftp.mozilla.org/pub/mozilla.org/nspr/releases/v$LIB_VERSION/src/" mkdir -p nspr pushd nspr > /dev/null NSPR_DIR="$(pwd)" if [[ "$force_rebuild" = "true" ]] || [[ ! -e .already-built ]] || [[ .already-built -ot $LIB_DIRECTORY ]] then rm -f .already-built download_lib $LIB_URL $LIB_ARCHIVE rm -rf $LIB_DIRECTORY bin include lib share tar -xf $LIB_ARCHIVE pushd $LIB_DIRECTORY/nspr (CFLAGS="$CFLAGS" CXXFLAGS="$CXXFLAGS" LDFLAGS="$LDFLAGS" ./configure --prefix="$NSPR_DIR" && make ${JOBS} && make install) || die "NSPR build failed" popd # TODO: how can we not build the dylibs? rm -f lib/*.dylib touch .already-built else already_built fi popd > /dev/null # -------------------------------------------------------------- echo -e "Building ICU..." LIB_VERSION="${ICU_VERSION}" LIB_ARCHIVE="$LIB_VERSION-src.tgz" LIB_DIRECTORY="icu" LIB_URL="http://download.icu-project.org/files/icu4c/56.1/" mkdir -p icu pushd icu > /dev/null if [[ "$force_rebuild" = "true" ]] || [[ ! -e .already-built ]] || [[ .already-built -ot $LIB_DIRECTORY ]] then INSTALL_DIR="$(pwd)" rm -f .already-built download_lib $LIB_URL $LIB_ARCHIVE rm -rf $LIB_DIRECTORY bin include lib sbin share tar -xf $LIB_ARCHIVE pushd $LIB_DIRECTORY mkdir -p source/build pushd source/build (CFLAGS="$CFLAGS" CXXFLAGS="$CXXFLAGS" LDFLAGS="$LDFLAGS" ../runConfigureICU MacOSX --prefix=$INSTALL_DIR --disable-shared --enable-static --disable-samples --enable-extras --enable-icuio --enable-layout --enable-tools && make ${JOBS} && make install) || die "ICU build failed" popd popd touch .already-built else already_built fi popd > /dev/null # -------------------------------------------------------------- echo -e "Building ENet..." LIB_VERSION="${ENET_VERSION}" LIB_ARCHIVE="$LIB_VERSION.tar.gz" LIB_DIRECTORY="$LIB_VERSION" LIB_URL="http://enet.bespin.org/download/" mkdir -p enet pushd enet > /dev/null if [[ "$force_rebuild" = "true" ]] || [[ ! -e .already-built ]] || [[ .already-built -ot $LIB_DIRECTORY ]] then INSTALL_DIR="$(pwd)" rm -f .already-built download_lib $LIB_URL $LIB_ARCHIVE rm -rf $LIB_DIRECTORY bin include lib sbin share tar -xf $LIB_ARCHIVE pushd $LIB_DIRECTORY (./configure CFLAGS="$CFLAGS" LDFLAGS="$LDFLAGS" --prefix=${INSTALL_DIR} --enable-shared=no && make clean && make ${JOBS} && make install) || die "ENet build failed" popd touch .already-built else already_built fi popd > /dev/null # -------------------------------------------------------------- echo -e "Building MiniUPnPc..." LIB_VERSION="${MINIUPNPC_VERSION}" LIB_ARCHIVE="$LIB_VERSION.tar.gz" LIB_DIRECTORY="$LIB_VERSION" LIB_URL="http://miniupnp.tuxfamily.org/files/download.php?file=" mkdir -p miniupnpc pushd miniupnpc > /dev/null if [[ "$force_rebuild" = "true" ]] || [[ ! -e .already-built ]] || [[ .already-built -ot $LIB_DIRECTORY ]] then INSTALL_DIR="$(pwd)" rm -f .already-built download_lib $LIB_URL $LIB_ARCHIVE rm -rf $LIB_DIRECTORY bin include lib share tar -xf $LIB_ARCHIVE pushd $LIB_DIRECTORY (make clean && CFLAGS=$CFLAGS LDFLAGS=$LDFLAGS make ${JOBS} && INSTALLPREFIX="$INSTALL_DIR" make install) || die "MiniUPnPc build failed" popd # TODO: how can we not build the dylibs? rm -f lib/*.dylib touch .already-built else already_built fi popd > /dev/null # -------------------------------------------------------------------- # The following libraries are shared on different OSes and may # be customized, so we build and install them from bundled sources # -------------------------------------------------------------------- echo -e "Building Spidermonkey..." -LIB_VERSION="mozjs-31.2.0" +LIB_VERSION="mozjs-38.2.1" LIB_ARCHIVE="$LIB_VERSION.rc0.tar.bz2" -LIB_DIRECTORY="mozjs31" +LIB_DIRECTORY="mozjs-38.0.0" pushd ../source/spidermonkey/ > /dev/null if [[ "$force_rebuild" = "true" ]] || [[ ! -e .already-built ]] || [[ .already-built -ot $LIB_DIRECTORY ]] || [[ .already-built -ot README.txt ]] then INSTALL_DIR="$(pwd)" INCLUDE_DIR_DEBUG=$INSTALL_DIR/include-unix-debug INCLUDE_DIR_RELEASE=$INSTALL_DIR/include-unix-release rm -f .already-built rm -f lib/*.a rm -rf $LIB_DIRECTORY $INCLUDE_DIR_DEBUG $INCLUDE_DIR_RELEASE tar -xf $LIB_ARCHIVE - # rename the extracted directory to something shorter - mv $LIB_VERSION $LIB_DIRECTORY # Apply patches pushd $LIB_DIRECTORY . ../patch.sh popd pushd $LIB_DIRECTORY/js/src # We want separate debug/release versions of the library, so change their install name in the Makefile - perl -i.bak -pe 's/(^STATIC_LIBRARY_NAME\s+=).*/$1mozjs31-ps-debug/' Makefile.in - perl -i.bak -pe 's/js_static/mozjs31-ps-debug/g' shell/Makefile.in + perl -i.bak -pe 's/(^STATIC_LIBRARY_NAME\s+=).*/$1'\''mozjs38-ps-debug'\''/' moz.build - CONF_OPTS="--target=$ARCH-apple-darwin --prefix=${INSTALL_DIR} --with-system-nspr --with-nspr-prefix=${NSPR_DIR} --with-system-zlib=${ZLIB_DIR} --enable-gcgenerational --disable-tests --disable-shared-js" # --enable-trace-logging" + CONF_OPTS="--target=$ARCH-apple-darwin --prefix=${INSTALL_DIR} --with-system-nspr --with-nspr-prefix=${NSPR_DIR} --with-system-zlib=${ZLIB_DIR} --disable-tests --disable-shared-js" + # Change the default location where the tracelogger should store its output, which is /tmp/ on OSX. + TLCXXFLAGS='-DTRACE_LOG_DIR="\"../../source/tools/tracelogger/\""' # Uncomment this line for 32-bit 10.5 cross compile: #CONF_OPTS="$CONF_OPTS --target=i386-apple-darwin9.0.0" if [[ $MIN_OSX_VERSION && ${MIN_OSX_VERSION-_} ]]; then CONF_OPTS="$CONF_OPTS --enable-macos-target=$MIN_OSX_VERSION" fi if [[ $SYSROOT && ${SYSROOT-_} ]]; then CONF_OPTS="$CONF_OPTS --with-macosx-sdk=$SYSROOT" fi mkdir -p build-debug pushd build-debug - (CC="clang" CXX="clang++" AR=ar CROSS_COMPILE=1 ../configure $CONF_OPTS --enable-debug --disable-optimize --enable-js-diagnostics --enable-gczeal && make ${JOBS}) || die "Spidermonkey build failed" + (CC="clang" CXX="clang++" CXXFLAGS="${TLCXXFLAGS}" AR=ar CROSS_COMPILE=1 ../configure $CONF_OPTS --enable-debug --disable-optimize --enable-js-diagnostics --enable-gczeal && make ${JOBS}) || die "Spidermonkey build failed" # js-config.h is different for debug and release builds, so we need different include directories for both mkdir -p $INCLUDE_DIR_DEBUG cp -R -L dist/include/* $INCLUDE_DIR_DEBUG/ cp dist/lib/*.a $INSTALL_DIR/lib popd - mv Makefile.in.bak Makefile.in - mv shell/Makefile.in.bak shell/Makefile.in + mv moz.build.bak moz.build - perl -i.bak -pe 's/(^STATIC_LIBRARY_NAME\s+=).*/$1mozjs31-ps-release/' Makefile.in - perl -i.bak -pe 's/js_static/mozjs31-ps-release/g' shell/Makefile.in + perl -i.bak -pe 's/(^STATIC_LIBRARY_NAME\s+=).*/$1'\''mozjs38-ps-release'\''/' moz.build mkdir -p build-release pushd build-release - (CC="clang" CXX="clang++" AR=ar CROSS_COMPILE=1 ../configure $CONF_OPTS --enable-optimize && make ${JOBS}) || die "Spidermonkey build failed" + (CC="clang" CXX="clang++" CXXFLAGS="${TLCXXFLAGS}" AR=ar CROSS_COMPILE=1 ../configure $CONF_OPTS --enable-optimize && make ${JOBS}) || die "Spidermonkey build failed" # js-config.h is different for debug and release builds, so we need different include directories for both mkdir -p $INCLUDE_DIR_RELEASE cp -R -L dist/include/* $INCLUDE_DIR_RELEASE/ cp dist/lib/*.a $INSTALL_DIR/lib popd - mv Makefile.in.bak Makefile.in - mv shell/Makefile.in.bak shell/Makefile.in + mv moz.build.bak moz.build popd touch .already-built else already_built fi popd > /dev/null # -------------------------------------------------------------- # NVTT - no install echo -e "Building NVTT..." pushd ../source/nvtt > /dev/null if [[ "$force_rebuild" = "true" ]] || [[ ! -e .already-built ]] then rm -f .already-built rm -f lib/*.a pushd src rm -rf build mkdir -p build pushd build # Could use CMAKE_OSX_DEPLOYMENT_TARGET and CMAKE_OSX_SYSROOT # but they're not as flexible for cross-compiling # Disable optional libs that we don't need (avoids some conflicts with MacPorts) (cmake .. -DCMAKE_LINK_FLAGS="$LDFLAGS" -DCMAKE_C_FLAGS="$CFLAGS" -DCMAKE_CXX_FLAGS="$CXXFLAGS" -DCMAKE_BUILD_TYPE=Release -DBINDIR=bin -DLIBDIR=lib -DGLUT=0 -DGLEW=0 -DCG=0 -DCUDA=0 -DOPENEXR=0 -DJPEG=0 -DPNG=0 -DTIFF=0 -G "Unix Makefiles" && make clean && make nvtt ${JOBS}) || die "NVTT build failed" popd mkdir -p ../lib cp build/src/nv*/libnv*.a ../lib/ cp build/src/nvtt/squish/libsquish.a ../lib/ popd touch .already-built else already_built fi popd > /dev/null # -------------------------------------------------------------- # FCollada - no install echo -e "Building FCollada..." pushd ../source/fcollada > /dev/null if [[ "$force_rebuild" = "true" ]] || [[ ! -e .already-built ]] then rm -f .already-built rm -f lib/*.a pushd src rm -rf output mkdir -p ../lib # The Makefile refers to pkg-config for libxml2, but we # don't have that (replace with xml2-config instead) sed -i.bak -e 's/pkg-config libxml-2.0/xml2-config/' Makefile (make clean && CXXFLAGS=$CXXFLAGS make ${JOBS}) || die "FCollada build failed" # Undo Makefile change mv Makefile.bak Makefile popd touch .already-built else already_built fi popd > /dev/null Index: ps/trunk/libraries/source/spidermonkey/FixTracelogger.diff =================================================================== --- ps/trunk/libraries/source/spidermonkey/FixTracelogger.diff (nonexistent) +++ ps/trunk/libraries/source/spidermonkey/FixTracelogger.diff (revision 18656) @@ -0,0 +1,565 @@ +diff --git a/js/src/jit-test/tests/tracelogger/bug1231170.js b/js/src/jit-test/tests/tracelogger/bug1231170.js +new file mode 100644 +index 0000000..023e93e +--- /dev/null ++++ b/js/src/jit-test/tests/tracelogger/bug1231170.js +@@ -0,0 +1,3 @@ ++var du = new Debugger(); ++if (typeof du.drainTraceLogger === "function") ++ du.drainTraceLogger(); +diff --git a/js/src/jit-test/tests/tracelogger/bug1266649.js b/js/src/jit-test/tests/tracelogger/bug1266649.js +new file mode 100644 +index 0000000..81ae7ad +--- /dev/null ++++ b/js/src/jit-test/tests/tracelogger/bug1266649.js +@@ -0,0 +1,10 @@ ++ ++var du = new Debugger(); ++if (typeof du.setupTraceLogger === "function" && ++ typeof oomTest === 'function') ++{ ++ du.setupTraceLogger({ ++ Scripts: true ++ }) ++ oomTest(() => function(){}); ++} +diff --git a/js/src/jit/Ion.cpp b/js/src/jit/Ion.cpp +index 93e2fda..09049d6 100644 +--- a/js/src/jit/Ion.cpp ++++ b/js/src/jit/Ion.cpp +@@ -1055,6 +1055,8 @@ IonScript::Destroy(FreeOp* fop, IonScript* script) + + script->destroyCaches(); + script->unlinkFromRuntime(fop); ++ // Frees the potential event we have set. ++ script->traceLoggerScriptEvent_ = TraceLoggerEvent(); + fop->free_(script); + } + +diff --git a/js/src/vm/Debugger.cpp b/js/src/vm/Debugger.cpp +index 26262fd..af7f313 100644 +--- a/js/src/vm/Debugger.cpp ++++ b/js/src/vm/Debugger.cpp +@@ -369,10 +369,10 @@ Debugger::Debugger(JSContext* cx, NativeObject* dbg) + objects(cx), + environments(cx), + #ifdef NIGHTLY_BUILD +- traceLoggerLastDrainedId(0), ++ traceLoggerLastDrainedSize(0), + traceLoggerLastDrainedIteration(0), + #endif +- traceLoggerScriptedCallsLastDrainedId(0), ++ traceLoggerScriptedCallsLastDrainedSize(0), + traceLoggerScriptedCallsLastDrainedIteration(0) + { + assertSameCompartment(cx, dbg); +@@ -3907,9 +3907,9 @@ Debugger::drainTraceLogger(JSContext* cx, unsigned argc, Value* vp) + size_t num; + TraceLoggerThread* logger = TraceLoggerForMainThread(cx->runtime()); + bool lostEvents = logger->lostEvents(dbg->traceLoggerLastDrainedIteration, +- dbg->traceLoggerLastDrainedId); ++ dbg->traceLoggerLastDrainedSize); + EventEntry* events = logger->getEventsStartingAt(&dbg->traceLoggerLastDrainedIteration, +- &dbg->traceLoggerLastDrainedId, ++ &dbg->traceLoggerLastDrainedSize, + &num); + + RootedObject array(cx, NewDenseEmptyArray(cx)); +@@ -4002,10 +4002,10 @@ Debugger::drainTraceLoggerScriptCalls(JSContext* cx, unsigned argc, Value* vp) + size_t num; + TraceLoggerThread* logger = TraceLoggerForMainThread(cx->runtime()); + bool lostEvents = logger->lostEvents(dbg->traceLoggerScriptedCallsLastDrainedIteration, +- dbg->traceLoggerScriptedCallsLastDrainedId); ++ dbg->traceLoggerScriptedCallsLastDrainedSize); + EventEntry* events = logger->getEventsStartingAt( + &dbg->traceLoggerScriptedCallsLastDrainedIteration, +- &dbg->traceLoggerScriptedCallsLastDrainedId, ++ &dbg->traceLoggerScriptedCallsLastDrainedSize, + &num); + + RootedObject array(cx, NewDenseEmptyArray(cx)); +diff --git a/js/src/vm/Debugger.h b/js/src/vm/Debugger.h +index 8cac36a..c92d685 100644 +--- a/js/src/vm/Debugger.h ++++ b/js/src/vm/Debugger.h +@@ -314,10 +314,10 @@ class Debugger : private mozilla::LinkedListElement + * lost events. + */ + #ifdef NIGHTLY_BUILD +- uint32_t traceLoggerLastDrainedId; ++ uint32_t traceLoggerLastDrainedSize; + uint32_t traceLoggerLastDrainedIteration; + #endif +- uint32_t traceLoggerScriptedCallsLastDrainedId; ++ uint32_t traceLoggerScriptedCallsLastDrainedSize; + uint32_t traceLoggerScriptedCallsLastDrainedIteration; + + class FrameRange; +diff --git a/js/src/vm/TraceLogging.cpp b/js/src/vm/TraceLogging.cpp +index 6715b36..9766a6f 100644 +--- a/js/src/vm/TraceLogging.cpp ++++ b/js/src/vm/TraceLogging.cpp +@@ -131,7 +131,7 @@ TraceLoggerThread::init() + { + if (!pointerMap.init()) + return false; +- if (!extraTextId.init()) ++ if (!textIdPayloads.init()) + return false; + if (!events.init()) + return false; +@@ -185,10 +185,10 @@ TraceLoggerThread::~TraceLoggerThread() + graph = nullptr; + } + +- for (TextIdHashMap::Range r = extraTextId.all(); !r.empty(); r.popFront()) +- js_delete(r.front().value()); +- extraTextId.finish(); +- pointerMap.finish(); ++ if (textIdPayloads.initialized()) { ++ for (TextIdHashMap::Range r = textIdPayloads.all(); !r.empty(); r.popFront()) ++ js_delete(r.front().value()); ++ } + } + + bool +@@ -287,7 +287,7 @@ TraceLoggerThread::eventText(uint32_t id) + if (id < TraceLogger_Last) + return TLTextIdString(static_cast(id)); + +- TextIdHashMap::Ptr p = extraTextId.lookup(id); ++ TextIdHashMap::Ptr p = textIdPayloads.lookup(id); + MOZ_ASSERT(p); + + return p->value()->string(); +@@ -341,13 +341,15 @@ TraceLoggerThread::extractScriptDetails(uint32_t textId, const char** filename, + TraceLoggerEventPayload* + TraceLoggerThread::getOrCreateEventPayload(TraceLoggerTextId textId) + { +- TextIdHashMap::AddPtr p = extraTextId.lookupForAdd(textId); +- if (p) ++ TextIdHashMap::AddPtr p = textIdPayloads.lookupForAdd(textId); ++ if (p) { ++ MOZ_ASSERT(p->value()->textId() == textId); // Sanity check. + return p->value(); ++ } + + TraceLoggerEventPayload* payload = js_new(textId, (char*)nullptr); + +- if (!extraTextId.add(p, textId, payload)) ++ if (!textIdPayloads.add(p, textId, payload)) + return nullptr; + + return payload; +@@ -357,8 +359,10 @@ TraceLoggerEventPayload* + TraceLoggerThread::getOrCreateEventPayload(const char* text) + { + PointerHashMap::AddPtr p = pointerMap.lookupForAdd((const void*)text); +- if (p) ++ if (p) { ++ MOZ_ASSERT(p->value()->textId() < nextTextId); // Sanity check. + return p->value(); ++ } + + size_t len = strlen(text); + char* str = js_pod_malloc(len + 1); +@@ -369,7 +373,7 @@ TraceLoggerThread::getOrCreateEventPayload(const char* text) + MOZ_ASSERT(ret == len); + MOZ_ASSERT(strlen(str) == len); + +- uint32_t textId = extraTextId.count() + TraceLogger_Last; ++ uint32_t textId = nextTextId; + + TraceLoggerEventPayload* payload = js_new(textId, str); + if (!payload) { +@@ -377,17 +381,19 @@ TraceLoggerThread::getOrCreateEventPayload(const char* text) + return nullptr; + } + +- if (!extraTextId.putNew(textId, payload)) { ++ if (!textIdPayloads.putNew(textId, payload)) { + js_delete(payload); + return nullptr; + } + +- if (!pointerMap.add(p, text, payload)) +- return nullptr; +- + if (graph.get()) + graph->addTextId(textId, str); + ++ nextTextId++; ++ ++ if (!pointerMap.add(p, text, payload)) ++ return nullptr; ++ + return payload; + } + +@@ -407,9 +413,14 @@ TraceLoggerThread::getOrCreateEventPayload(TraceLoggerTextId type, const char* f + if (!traceLoggerState->isTextIdEnabled(type)) + return getOrCreateEventPayload(type); + +- PointerHashMap::AddPtr p = pointerMap.lookupForAdd(ptr); +- if (p) +- return p->value(); ++ PointerHashMap::AddPtr p; ++ if (ptr) { ++ p = pointerMap.lookupForAdd(ptr); ++ if (p) { ++ MOZ_ASSERT(p->value()->textId() < nextTextId); // Sanity check. ++ return p->value(); ++ } ++ } + + // Compute the length of the string to create. + size_t lenFilename = strlen(filename); +@@ -428,24 +439,28 @@ TraceLoggerThread::getOrCreateEventPayload(TraceLoggerTextId type, const char* f + MOZ_ASSERT(ret == len); + MOZ_ASSERT(strlen(str) == len); + +- uint32_t textId = extraTextId.count() + TraceLogger_Last; ++ uint32_t textId = nextTextId; + TraceLoggerEventPayload* payload = js_new(textId, str); + if (!payload) { + js_free(str); + return nullptr; + } + +- if (!extraTextId.putNew(textId, payload)) { ++ if (!textIdPayloads.putNew(textId, payload)) { + js_delete(payload); + return nullptr; + } + +- if (!pointerMap.add(p, ptr, payload)) +- return nullptr; +- + if (graph.get()) + graph->addTextId(textId, str); + ++ nextTextId++; ++ ++ if (ptr) { ++ if (!pointerMap.add(p, ptr, payload)) ++ return nullptr; ++ } ++ + return payload; + } + +@@ -453,14 +468,14 @@ TraceLoggerEventPayload* + TraceLoggerThread::getOrCreateEventPayload(TraceLoggerTextId type, JSScript* script) + { + return getOrCreateEventPayload(type, script->filename(), script->lineno(), script->column(), +- script); ++ nullptr); + } + + TraceLoggerEventPayload* + TraceLoggerThread::getOrCreateEventPayload(TraceLoggerTextId type, + const JS::ReadOnlyCompileOptions& script) + { +- return getOrCreateEventPayload(type, script.filename(), script.lineno, script.column, &script); ++ return getOrCreateEventPayload(type, script.filename(), script.lineno, script.column, nullptr); + } + + void +@@ -485,7 +500,7 @@ TraceLoggerThread::startEvent(uint32_t id) + if (!traceLoggerState->isTextIdEnabled(id)) + return; + +- logTimestamp(id); ++ log(id); + } + + void +@@ -510,7 +525,7 @@ TraceLoggerThread::stopEvent(uint32_t id) + if (!traceLoggerState->isTextIdEnabled(id)) + return; + +- logTimestamp(TraceLogger_Stop); ++ log(TraceLogger_Stop); + } + + void +@@ -522,23 +537,57 @@ TraceLoggerThread::logTimestamp(TraceLoggerTextId id) + void + TraceLoggerThread::logTimestamp(uint32_t id) + { ++ MOZ_ASSERT(id > TraceLogger_LastTreeItem && id < TraceLogger_Last); ++ log(id); ++} ++ ++void ++TraceLoggerThread::log(uint32_t id) ++{ + if (enabled == 0) + return; + + MOZ_ASSERT(traceLoggerState); +- if (!events.ensureSpaceBeforeAdd()) { ++ ++ // We request for 3 items to add, since if we don't have enough room ++ // we record the time it took to make more place. To log this information ++ // we need 2 extra free entries. ++ if (!events.hasSpaceForAdd(3)) { + uint64_t start = rdtsc() - traceLoggerState->startupTime; + +- if (graph.get()) +- graph->log(events); ++ if (!events.ensureSpaceBeforeAdd(3)) { ++ if (graph.get()) ++ graph->log(events); ++ ++ iteration_++; ++ events.clear(); ++ ++ // Remove the item in the pointerMap for which the payloads ++ // have no uses anymore ++ for (PointerHashMap::Enum e(pointerMap); !e.empty(); e.popFront()) { ++ if (e.front().value()->uses() != 0) ++ continue; ++ ++ TextIdHashMap::Ptr p = textIdPayloads.lookup(e.front().value()->textId()); ++ MOZ_ASSERT(p); ++ textIdPayloads.remove(p); ++ ++ e.removeFront(); ++ } + +- iteration_++; +- events.clear(); ++ // Free all payloads that have no uses anymore. ++ for (TextIdHashMap::Enum e(textIdPayloads); !e.empty(); e.popFront()) { ++ if (e.front().value()->uses() == 0) { ++ js_delete(e.front().value()); ++ e.removeFront(); ++ } ++ } ++ } + + // Log the time it took to flush the events as being from the + // Tracelogger. + if (graph.get()) { +- MOZ_ASSERT(events.capacity() > 2); ++ MOZ_ASSERT(events.hasSpaceForAdd(2)); + EventEntry& entryStart = events.pushUninitialized(); + entryStart.time = start; + entryStart.textId = TraceLogger_Internal; +@@ -548,13 +597,6 @@ TraceLoggerThread::logTimestamp(uint32_t id) + entryStop.textId = TraceLogger_Stop; + } + +- // Free all TextEvents that have no uses anymore. +- for (TextIdHashMap::Enum e(extraTextId); !e.empty(); e.popFront()) { +- if (e.front().value()->uses() == 0) { +- js_delete(e.front().value()); +- e.removeFront(); +- } +- } + } + + uint64_t time = rdtsc() - traceLoggerState->startupTime; +@@ -956,3 +998,16 @@ TraceLoggerEvent::~TraceLoggerEvent() + if (payload_) + payload_->release(); + } ++ ++TraceLoggerEvent& ++TraceLoggerEvent::operator=(const TraceLoggerEvent& other) ++{ ++ if (hasPayload()) ++ payload()->release(); ++ if (other.hasPayload()) ++ other.payload()->use(); ++ ++ payload_ = other.payload_; ++ ++ return *this; ++} +diff --git a/js/src/vm/TraceLogging.h b/js/src/vm/TraceLogging.h +index a124dcb..91a1eb0 100644 +--- a/js/src/vm/TraceLogging.h ++++ b/js/src/vm/TraceLogging.h +@@ -110,6 +110,9 @@ class TraceLoggerEvent { + bool hasPayload() const { + return !!payload_; + } ++ ++ TraceLoggerEvent& operator=(const TraceLoggerEvent& other); ++ TraceLoggerEvent(const TraceLoggerEvent& event) = delete; + }; + + /** +@@ -130,6 +133,10 @@ class TraceLoggerEventPayload { + uses_(0) + { } + ++ ~TraceLoggerEventPayload() { ++ MOZ_ASSERT(uses_ == 0); ++ } ++ + uint32_t textId() { + return textId_; + } +@@ -166,7 +173,8 @@ class TraceLoggerThread + mozilla::UniquePtr graph; + + PointerHashMap pointerMap; +- TextIdHashMap extraTextId; ++ TextIdHashMap textIdPayloads; ++ uint32_t nextTextId; + + ContinuousSpace events; + +@@ -181,6 +189,7 @@ class TraceLoggerThread + : enabled(0), + failed(false), + graph(), ++ nextTextId(TraceLogger_Last), + iteration_(0), + top(nullptr) + { } +@@ -195,22 +204,22 @@ class TraceLoggerThread + bool enable(JSContext* cx); + bool disable(); + +- // Given the previous iteration and lastEntryId, return an array of events ++ // Given the previous iteration and size, return an array of events + // (there could be lost events). At the same time update the iteration and +- // lastEntry and gives back how many events there are. +- EventEntry* getEventsStartingAt(uint32_t* lastIteration, uint32_t* lastEntryId, size_t* num) { ++ // size and gives back how many events there are. ++ EventEntry* getEventsStartingAt(uint32_t* lastIteration, uint32_t* lastSize, size_t* num) { + EventEntry* start; + if (iteration_ == *lastIteration) { +- MOZ_ASSERT(events.lastEntryId() >= *lastEntryId); +- *num = events.lastEntryId() - *lastEntryId; +- start = events.data() + *lastEntryId + 1; ++ MOZ_ASSERT(*lastSize <= events.size()); ++ *num = events.size() - *lastSize; ++ start = events.data() + *lastSize; + } else { +- *num = events.lastEntryId() + 1; ++ *num = events.size(); + start = events.data(); + } + + *lastIteration = iteration_; +- *lastEntryId = events.lastEntryId(); ++ *lastSize = events.size(); + return start; + } + +@@ -220,16 +229,16 @@ class TraceLoggerThread + const char** lineno, size_t* lineno_len, const char** colno, + size_t* colno_len); + +- bool lostEvents(uint32_t lastIteration, uint32_t lastEntryId) { ++ bool lostEvents(uint32_t lastIteration, uint32_t lastSize) { + // If still logging in the same iteration, there are no lost events. + if (lastIteration == iteration_) { +- MOZ_ASSERT(lastEntryId <= events.lastEntryId()); ++ MOZ_ASSERT(lastSize <= events.size()); + return false; + } + +- // When proceeded to the next iteration and lastEntryId points to +- // the maximum capacity there are no logs that are lost. +- if (lastIteration + 1 == iteration_ && lastEntryId == events.capacity()) ++ // If we are in a consecutive iteration we are only sure we didn't lose any events, ++ // when the lastSize equals the maximum size 'events' can get. ++ if (lastIteration == iteration_ - 1 && lastSize == events.maxSize()) + return false; + + return true; +@@ -268,6 +277,7 @@ class TraceLoggerThread + void stopEvent(uint32_t id); + private: + void stopEvent(); ++ void log(uint32_t id); + + public: + static unsigned offsetOfEnabled() { +diff --git a/js/src/vm/TraceLoggingGraph.cpp b/js/src/vm/TraceLoggingGraph.cpp +index d1b7f2e..a4eb273 100644 +--- a/js/src/vm/TraceLoggingGraph.cpp ++++ b/js/src/vm/TraceLoggingGraph.cpp +@@ -276,7 +276,7 @@ TraceLoggerGraph::flush() + if (bytesWritten < tree.size()) + return false; + +- treeOffset += tree.lastEntryId(); ++ treeOffset += tree.size(); + tree.clear(); + } + +@@ -359,7 +359,7 @@ TraceLoggerGraph::startEventInternal(uint32_t id, uint64_t timestamp) + + if (parent.lastChildId() == 0) { + MOZ_ASSERT(!entry.hasChildren()); +- MOZ_ASSERT(parent.treeId() == tree.lastEntryId() + treeOffset); ++ MOZ_ASSERT(parent.treeId() == treeOffset + tree.size() - 1); + + if (!updateHasChildren(parent.treeId())) + return false; +diff --git a/js/src/vm/TraceLoggingTypes.h b/js/src/vm/TraceLoggingTypes.h +index f1c9d0c..10b76d6 100644 +--- a/js/src/vm/TraceLoggingTypes.h ++++ b/js/src/vm/TraceLoggingTypes.h +@@ -21,7 +21,6 @@ + _(Internal) \ + _(Interpreter) \ + _(InlinedScripts) \ +- _(Invalidation) \ + _(IonCompilation) \ + _(IonCompilationPaused) \ + _(IonLinking) \ +@@ -60,6 +59,7 @@ + + #define TRACELOGGER_LOG_ITEMS(_) \ + _(Bailout) \ ++ _(Invalidation) \ + _(Disable) \ + _(Enable) \ + _(Stop) +@@ -130,6 +130,9 @@ class ContinuousSpace { + uint32_t size_; + uint32_t capacity_; + ++ // The maximum amount of ram memory a continuous space structure can take (in bytes). ++ static const uint32_t LIMIT = 200 * 1024 * 1024; ++ + public: + ContinuousSpace () + : data_(nullptr) +@@ -151,6 +154,10 @@ class ContinuousSpace { + data_ = nullptr; + } + ++ static uint32_t maxSize() { ++ return LIMIT / sizeof(T); ++ } ++ + T* data() { + return data_; + } +@@ -187,11 +194,14 @@ class ContinuousSpace { + if (hasSpaceForAdd(count)) + return true; + ++ // Limit the size of a continuous buffer. ++ if (size_ + count > maxSize()) ++ return false; ++ + uint32_t nCapacity = capacity_ * 2; +- if (size_ + count > nCapacity) +- nCapacity = size_ + count; +- T* entries = (T*) js_realloc(data_, nCapacity * sizeof(T)); ++ nCapacity = (nCapacity < maxSize()) ? nCapacity : maxSize(); + ++ T* entries = (T*) js_realloc(data_, nCapacity * sizeof(T)); + if (!entries) + return false; + Index: ps/trunk/libraries/source/spidermonkey/FixVersionDetection.diff =================================================================== --- ps/trunk/libraries/source/spidermonkey/FixVersionDetection.diff (nonexistent) +++ ps/trunk/libraries/source/spidermonkey/FixVersionDetection.diff (revision 18656) @@ -0,0 +1,137 @@ + +# HG changeset patch +# User Sean Stangl +# Date 1426889983 25200 +# Node ID 4f8bbef857155fbee1d064e014b22dd72512b389 +# Parent 6f42f8ee82468d18acd65e0c2b5bf6c040696224 +Bug 1145882 - Part 1/2 - Only use $PYTHON after defined by MOZ_PYTHON. r=glandium + +diff --git a/js/src/configure.in b/js/src/configure.in +--- a/js/src/configure.in ++++ b/js/src/configure.in +@@ -228,61 +228,16 @@ if test -n "$gonkdir" ; then + fi + + AC_DEFINE(ANDROID) + AC_DEFINE(GONK) + else + MOZ_ANDROID_NDK + fi + +-dnl ============================================================== +-dnl Get mozilla version from central milestone file +-dnl ============================================================== +-MOZILLA_VERSION=`$PYTHON $srcdir/python/mozbuild/mozbuild/milestone.py --topsrcdir $srcdir` +-MOZILLA_UAVERSION=`$PYTHON $srcdir/python/mozbuild/mozbuild/milestone.py --topsrcdir $srcdir --uaversion` +-MOZILLA_SYMBOLVERSION=`$PYTHON $srcdir/python/mozbuild/mozbuild/milestone.py --topsrcdir $srcdir --symbolversion` +- +-AC_DEFINE_UNQUOTED(MOZILLA_VERSION,"$MOZILLA_VERSION") +-AC_DEFINE_UNQUOTED(MOZILLA_VERSION_U,$MOZILLA_VERSION) +-AC_DEFINE_UNQUOTED(MOZILLA_UAVERSION,"$MOZILLA_UAVERSION") +-AC_SUBST(MOZILLA_SYMBOLVERSION) +- +-# Separate version into components for use in shared object naming etc +-changequote(,) +-MOZJS_MAJOR_VERSION=`echo $MOZILLA_VERSION | sed "s|\(^[0-9]*\)\.[0-9]*.*|\1|"` +-MOZJS_MINOR_VERSION=`echo $MOZILLA_VERSION | sed "s|^[0-9]*\.\([0-9]*\).*|\1|"` +-MOZJS_PATCH_VERSION=`echo $MOZILLA_VERSION | sed "s|^[0-9]*\.[0-9]*[^0-9]*||"` +-IS_ALPHA=`echo $MOZILLA_VERSION | grep '[ab]'` +- +-dnl XXX in a temporary bid to avoid developer anger at renaming files +-dnl XXX before "js" symlinks exist, don't change names. +-dnl +-dnl if test -n "$JS_STANDALONE"; then +-dnl JS_SHELL_NAME=js$MOZJS_MAJOR_VERSION +-dnl JS_CONFIG_NAME=js$MOZJS_MAJOR_VERSION-config +-dnl else +-JS_SHELL_NAME=js +-JS_CONFIG_NAME=js-config +-dnl fi +- +-changequote([,]) +-if test -n "$IS_ALPHA"; then +- changequote(,) +- MOZJS_ALPHA=`echo $MOZILLA_VERSION | sed "s|^[0-9]*\.[0-9\.]*\([^0-9]\).*|\1|"` +- changequote([,]) +-fi +-AC_DEFINE_UNQUOTED(MOZJS_MAJOR_VERSION,$MOZJS_MAJOR_VERSION) +-AC_DEFINE_UNQUOTED(MOZJS_MINOR_VERSION,$MOZJS_MINOR_VERSION) +-AC_SUBST(JS_SHELL_NAME) +-AC_SUBST(JS_CONFIG_NAME) +-AC_SUBST(MOZJS_MAJOR_VERSION) +-AC_SUBST(MOZJS_MINOR_VERSION) +-AC_SUBST(MOZJS_PATCH_VERSION) +-AC_SUBST(MOZJS_ALPHA) +- + dnl ======================================================== + dnl Checks for compilers. + dnl ======================================================== + + dnl AR_FLAGS set here so HOST_AR_FLAGS can be set correctly (see bug 538269) + AR_FLAGS='crs $@' + + if test "$COMPILE_ENVIRONMENT"; then +@@ -733,16 +688,62 @@ fi + if test "$COMPILE_ENVIRONMENT"; then + + AC_PATH_XTRA + + XCFLAGS="$X_CFLAGS" + + fi # COMPILE_ENVIRONMENT + ++dnl ============================================================== ++dnl Get mozilla version from central milestone file ++dnl ============================================================== ++MOZILLA_VERSION=`$PYTHON $srcdir/python/mozbuild/mozbuild/milestone.py --topsrcdir $srcdir` ++MOZILLA_UAVERSION=`$PYTHON $srcdir/python/mozbuild/mozbuild/milestone.py --topsrcdir $srcdir --uaversion` ++MOZILLA_SYMBOLVERSION=`$PYTHON $srcdir/python/mozbuild/mozbuild/milestone.py --topsrcdir $srcdir --symbolversion` ++ ++AC_DEFINE_UNQUOTED(MOZILLA_VERSION,"$MOZILLA_VERSION") ++AC_DEFINE_UNQUOTED(MOZILLA_VERSION_U,$MOZILLA_VERSION) ++AC_DEFINE_UNQUOTED(MOZILLA_UAVERSION,"$MOZILLA_UAVERSION") ++AC_SUBST(MOZILLA_SYMBOLVERSION) ++ ++# Separate version into components for use in shared object naming etc ++changequote(,) ++MOZJS_MAJOR_VERSION=`echo $MOZILLA_VERSION | sed "s|\(^[0-9]*\)\.[0-9]*.*|\1|"` ++MOZJS_MINOR_VERSION=`echo $MOZILLA_VERSION | sed "s|^[0-9]*\.\([0-9]*\).*|\1|"` ++MOZJS_PATCH_VERSION=`echo $MOZILLA_VERSION | sed "s|^[0-9]*\.[0-9]*[^0-9]*||"` ++IS_ALPHA=`echo $MOZILLA_VERSION | grep '[ab]'` ++ ++dnl XXX in a temporary bid to avoid developer anger at renaming files ++dnl XXX before "js" symlinks exist, don't change names. ++dnl ++dnl if test -n "$JS_STANDALONE"; then ++dnl JS_SHELL_NAME=js$MOZJS_MAJOR_VERSION ++dnl JS_CONFIG_NAME=js$MOZJS_MAJOR_VERSION-config ++dnl else ++JS_SHELL_NAME=js ++JS_CONFIG_NAME=js-config ++dnl fi ++ ++changequote([,]) ++if test -n "$IS_ALPHA"; then ++ changequote(,) ++ MOZJS_ALPHA=`echo $MOZILLA_VERSION | sed "s|^[0-9]*\.[0-9\.]*\([^0-9]\).*|\1|"` ++ changequote([,]) ++fi ++AC_DEFINE_UNQUOTED(MOZJS_MAJOR_VERSION,$MOZJS_MAJOR_VERSION) ++AC_DEFINE_UNQUOTED(MOZJS_MINOR_VERSION,$MOZJS_MINOR_VERSION) ++AC_SUBST(JS_SHELL_NAME) ++AC_SUBST(JS_CONFIG_NAME) ++AC_SUBST(MOZJS_MAJOR_VERSION) ++AC_SUBST(MOZJS_MINOR_VERSION) ++AC_SUBST(MOZJS_PATCH_VERSION) ++AC_SUBST(MOZJS_ALPHA) ++ ++ + dnl ======================================================== + dnl set the defaults first + dnl ======================================================== + AS_BIN=$AS + AR_LIST='$(AR) t' + AR_EXTRACT='$(AR) x' + AR_DELETE='$(AR) d' + AS='$(CC)' + Index: ps/trunk/libraries/source/spidermonkey/FixVersionDetectionConfigure.diff =================================================================== --- ps/trunk/libraries/source/spidermonkey/FixVersionDetectionConfigure.diff (nonexistent) +++ ps/trunk/libraries/source/spidermonkey/FixVersionDetectionConfigure.diff (revision 18656) @@ -0,0 +1,178 @@ +Created from the patched (FixVersionDetection.diff) configure.in, ignoring +unrelated hunks (thus invalidating some hard-coded line numbers). This way +we do not add a dependency on autoconf-2.13. + +diff --git a/js/src/configure b/js/src/configure +--- a/js/src/configure ++++ b/js/src/configure +@@ -1662,70 +1662,6 @@ esac + + fi + +-MOZILLA_VERSION=`$PYTHON $srcdir/python/mozbuild/mozbuild/milestone.py --topsrcdir $srcdir` +-MOZILLA_UAVERSION=`$PYTHON $srcdir/python/mozbuild/mozbuild/milestone.py --topsrcdir $srcdir --uaversion` +-MOZILLA_SYMBOLVERSION=`$PYTHON $srcdir/python/mozbuild/mozbuild/milestone.py --topsrcdir $srcdir --symbolversion` +- +-cat >> confdefs.pytmp <> confdefs.h <> confdefs.pytmp <> confdefs.h <> confdefs.pytmp <> confdefs.h <> confdefs.pytmp <> confdefs.h <> confdefs.pytmp <> confdefs.h <> confdefs.pytmp <> confdefs.h <> confdefs.pytmp <> confdefs.h <> confdefs.pytmp <> confdefs.h <> confdefs.pytmp <> confdefs.h <> confdefs.pytmp <> confdefs.h <> $CONFIG_STATUS <> $CONFIG_STATUS <