Changeset View
Standalone View
libraries/source/spidermonkey/build.sh
Show First 20 Lines • Show All 70 Lines • ▼ Show 20 Lines | |||||
CONF_OPTS="${CONF_OPTS} \ | CONF_OPTS="${CONF_OPTS} \ | ||||
${CBUILD:+--build=${CBUILD}} \ | ${CBUILD:+--build=${CBUILD}} \ | ||||
${CHOST:+--host=${CHOST}} \ | ${CHOST:+--host=${CHOST}} \ | ||||
${CTARGET:+--target=${CTARGET}}" | ${CTARGET:+--target=${CTARGET}}" | ||||
echo "SpiderMonkey build options: ${CONF_OPTS}" | echo "SpiderMonkey build options: ${CONF_OPTS}" | ||||
echo ${CONF_OPTS} | echo ${CONF_OPTS} | ||||
FOLDER=mozjs-38.0.0 | FOLDER=mozjs-45.0.0 | ||||
s0600204: The tar file below extracts to `mozjs-45.0.2`
`tar -C $FOLDER -xjf ./mozjs-45.0.2.tar.bz2… | |||||
wraitiiUnsubmitted Not Done Inline ActionsYeah I messed up that one in this patch. I'll update. wraitii: Yeah I messed up that one in this patch. I'll update. | |||||
# Delete the existing directory to avoid conflicts and extract the tarball | # Delete the existing directory to avoid conflicts and extract the tarball | ||||
rm -rf $FOLDER | rm -rf $FOLDER | ||||
tar xjf mozjs-38.2.1.rc0.tar.bz2 | tar xjf mozjs-45.0.2.tar.bz2 | ||||
# Clean up header files that may be left over by earlier versions of SpiderMonkey | # Clean up header files that may be left over by earlier versions of SpiderMonkey | ||||
rm -rf include-unix-* | rm -rf include-unix-* | ||||
cd $FOLDER | cd $FOLDER | ||||
# Apply patches | # Apply patches | ||||
. ../patch.sh | . ../patch.sh | ||||
cd js/src | cd js/src | ||||
# Clean up data generated by previous builds that could cause problems | # Clean up data generated by previous builds that could cause problems | ||||
rm -rf build-debug | rm -rf build-debug | ||||
rm -rf build-release | rm -rf build-release | ||||
# We want separate debug/release versions of the library, so we have to change | # We want separate debug/release versions of the library, so we have to change | ||||
# the LIBRARY_NAME for each build. | # the LIBRARY_NAME for each build. | ||||
# (We use perl instead of sed so that it works with MozillaBuild on Windows, | # (We use perl instead of sed so that it works with MozillaBuild on Windows, | ||||
# which has an ancient sed.) | # which has an ancient sed.) | ||||
perl -i.bak -pe 's/(SHARED_LIBRARY_NAME\s+=).*/$1 '\''mozjs38-ps-debug'\''/' moz.build | perl -i.bak -pe 's/(SHARED_LIBRARY_NAME\s+=).*/$1 '\''mozjs45-ps-debug'\''/' moz.build | ||||
mkdir -p build-debug | mkdir -p build-debug | ||||
cd build-debug | cd build-debug | ||||
CXXFLAGS="${CXXFLAGS} ${TLCXXFLAGS}" ../configure ${CONF_OPTS} --with-nspr-libs="$NSPR_LIBS" --with-nspr-cflags="$NSPR_INCLUDES" --enable-debug --disable-optimize --enable-js-diagnostics --enable-gczeal | CXXFLAGS="${CXXFLAGS} ${TLCXXFLAGS}" ../configure ${CONF_OPTS} --with-nspr-libs="$NSPR_LIBS" --with-nspr-cflags="$NSPR_INCLUDES" --enable-debug --disable-optimize --enable-js-diagnostics --enable-gczeal | ||||
${MAKE} ${MAKE_OPTS} | ${MAKE} ${MAKE_OPTS} | ||||
cd .. | cd .. | ||||
Done Inline ActionsWould be nice to replace these long lines with each flag on a separate line, as in rP22492 (notice the diff here isn't very clean, but compare to build-osx-libs.sh diff) historic_bruno: Would be nice to replace these long lines with each flag on a separate line, as in rP22492… | |||||
Done Inline ActionsDone! Itms: Done! | |||||
perl -i.bak -pe 's/(SHARED_LIBRARY_NAME\s+=).*/$1 '\''mozjs38-ps-release'\''/' moz.build | perl -i.bak -pe 's/(SHARED_LIBRARY_NAME\s+=).*/$1 '\''mozjs45-ps-release'\''/' moz.build | ||||
mkdir -p build-release | mkdir -p build-release | ||||
cd build-release | cd build-release | ||||
CXXFLAGS="${CXXFLAGS} ${TLCXXFLAGS}" ../configure ${CONF_OPTS} --with-nspr-libs="$NSPR_LIBS" --with-nspr-cflags="$NSPR_INCLUDES" --enable-optimize # --enable-gczeal --enable-debug-symbols | CXXFLAGS="${CXXFLAGS} ${TLCXXFLAGS}" ../configure ${CONF_OPTS} --with-nspr-libs="$NSPR_LIBS" --with-nspr-cflags="$NSPR_INCLUDES" --enable-optimize # --enable-gczeal --enable-debug-symbols | ||||
${MAKE} ${MAKE_OPTS} | ${MAKE} ${MAKE_OPTS} | ||||
cd .. | cd .. | ||||
cd ../../.. | cd ../../.. | ||||
Show All 40 Lines | |||||
# js-config.h is different for debug and release builds, so we need different include directories for both | # js-config.h is different for debug and release builds, so we need different include directories for both | ||||
mkdir -p ${INCLUDE_DIR_DEBUG} | mkdir -p ${INCLUDE_DIR_DEBUG} | ||||
mkdir -p ${INCLUDE_DIR_RELEASE} | mkdir -p ${INCLUDE_DIR_RELEASE} | ||||
cp -R -L ${FOLDER}/js/src/build-release/dist/include/* ${INCLUDE_DIR_RELEASE}/ | cp -R -L ${FOLDER}/js/src/build-release/dist/include/* ${INCLUDE_DIR_RELEASE}/ | ||||
cp -R -L ${FOLDER}/js/src/build-debug/dist/include/* ${INCLUDE_DIR_DEBUG}/ | cp -R -L ${FOLDER}/js/src/build-debug/dist/include/* ${INCLUDE_DIR_DEBUG}/ | ||||
mkdir -p lib/ | mkdir -p lib/ | ||||
cp -L ${FOLDER}/js/src/build-debug/dist/lib/${LIB_PREFIX}mozjs38-ps-debug${LIB_SRC_SUFFIX} lib/${LIB_PREFIX}mozjs38-ps-debug${LIB_DST_SUFFIX} | cp -L ${FOLDER}/js/src/build-debug/dist/lib/${LIB_PREFIX}mozjs45-ps-debug${LIB_SRC_SUFFIX} lib/${LIB_PREFIX}mozjs45-ps-debug${LIB_DST_SUFFIX} | ||||
s0600204Unsubmitted Not Done Inline ActionsThe folder ${FOLDER}/js/src/build-debug/dist/lib/ does not exist at this point in the compilation. However, ${FOLDER}/js/src/build-debug/dist/sdk/lib/ appears to contain the appropriate symbolic link. Certainly, if I look at an SM38 build (in a different repo instance), both the libmozjs38-ps-debug.so symlinks inside that version's dist/lib and dist/sdk/lib folders point to the same target. s0600204: The folder `${FOLDER}/js/src/build-debug/dist/lib/` does not exist at this point in the… | |||||
cp -L ${FOLDER}/js/src/build-release/dist/lib/${LIB_PREFIX}mozjs38-ps-release${LIB_SRC_SUFFIX} lib/${LIB_PREFIX}mozjs38-ps-release${LIB_DST_SUFFIX} | cp -L ${FOLDER}/js/src/build-release/dist/lib/${LIB_PREFIX}mozjs45-ps-release${LIB_SRC_SUFFIX} lib/${LIB_PREFIX}mozjs45-ps-release${LIB_DST_SUFFIX} | ||||
s0600204Unsubmitted Not Done Inline ActionsDitto here: ${FOLDER}/js/src/build-release/dist/lib/ does not exist, s0600204: Ditto here: `${FOLDER}/js/src/build-release/dist/lib/` does not exist,
but… | |||||
wraitiiUnsubmitted Not Done Inline ActionsYup, needs to be updated too. wraitii: Yup, needs to be updated too. | |||||
cp -L ${FOLDER}/js/src/build-debug/dist/bin/${LIB_PREFIX}mozjs38-ps-debug${DLL_SRC_SUFFIX} ../../../binaries/system/${LIB_PREFIX}mozjs38-ps-debug${DLL_DST_SUFFIX} | cp -L ${FOLDER}/js/src/build-debug/dist/bin/${LIB_PREFIX}mozjs45-ps-debug${DLL_SRC_SUFFIX} ../../../binaries/system/${LIB_PREFIX}mozjs45-ps-debug${DLL_DST_SUFFIX} | ||||
cp -L ${FOLDER}/js/src/build-release/dist/bin/${LIB_PREFIX}mozjs38-ps-release${DLL_SRC_SUFFIX} ../../../binaries/system/${LIB_PREFIX}mozjs38-ps-release${DLL_DST_SUFFIX} | cp -L ${FOLDER}/js/src/build-release/dist/bin/${LIB_PREFIX}mozjs45-ps-release${DLL_SRC_SUFFIX} ../../../binaries/system/${LIB_PREFIX}mozjs45-ps-release${DLL_DST_SUFFIX} | ||||
# On Windows, also copy debugging symbols files | # On Windows, also copy debugging symbols files | ||||
if [ "${OS}" = "Windows_NT" ] | if [ "${OS}" = "Windows_NT" ] | ||||
then | then | ||||
cp -L ${FOLDER}/js/src/build-debug/js/src/${LIB_PREFIX}mozjs38-ps-debug.pdb ../../../binaries/system/${LIB_PREFIX}mozjs38-ps-debug.pdb | cp -L ${FOLDER}/js/src/build-debug/js/src/${LIB_PREFIX}mozjs45-ps-debug.pdb ../../../binaries/system/${LIB_PREFIX}mozjs45-ps-debug.pdb | ||||
cp -L ${FOLDER}/js/src/build-release/js/src/${LIB_PREFIX}mozjs38-ps-release.pdb ../../../binaries/system/${LIB_PREFIX}mozjs38-ps-release.pdb | cp -L ${FOLDER}/js/src/build-release/js/src/${LIB_PREFIX}mozjs45-ps-release.pdb ../../../binaries/system/${LIB_PREFIX}mozjs45-ps-release.pdb | ||||
fi | fi | ||||
# Flag that it's already been built successfully so we can skip it next time | # Flag that it's already been built successfully so we can skip it next time | ||||
touch .already-built | touch .already-built |
The tar file below extracts to mozjs-45.0.2
tar -C $FOLDER -xjf ./mozjs-45.0.2.tar.bz2 --strip-components=1 works if you wish to keep the folder the same between sub-releases. (You'll need a mkdir first, though.)