Fix spidermonkey profiling build

Instruments is macOS only, so don't try to enable it on other platforms.

Also don't quote ${JOBS} as it might be unset and passing an empty
string to "mach build" may result in configure failing.

Fixes: #7470
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
This commit is contained in:
Ralph Sennhauser
2025-01-07 17:58:01 +01:00
parent e5c2193313
commit f97a1f1c54
+15 -8
View File
@@ -6,7 +6,7 @@ cd "$(dirname "$0")"
# This should match the version in config/milestone.txt
FOLDER="mozjs-115.16.1"
# If same-version changes are needed, increment this.
LIB_VERSION="115.16.1+2"
LIB_VERSION="115.16.1+3"
LIB_NAME="mozjs115"
echo "Building SpiderMonkey..."
@@ -72,11 +72,16 @@ tar xfJ "${FOLDER}.tar.xz"
export MOZBUILD_STATE_PATH="${MOZBUILD_STATE_PATH:=$(pwd)/mozbuild-state}"
if [ -n "$PROFILE" ]; then
CONF_OPTS="$CONF_OPTS --enable-profiling
--enable-perf
--enable-instruments
--enable-jitspew
--with-jitreport-granularity=3"
CONF_OPTS="$CONF_OPTS
--enable-profiling
--enable-perf
--enable-jitspew
--with-jitreport-granularity=3"
if [ "${OS}" = "Darwin" ]; then
CONF_OPTS="$CONF_OPTS
--enable-instruments"
fi
fi
if [ "${OS}" = "Windows_NT" ]; then
@@ -119,20 +124,22 @@ tar xfJ "${FOLDER}.tar.xz"
# Build
# Debug (broken on FreeBSD)
if [ "${OS}" != "FreeBSD" ]; then
# shellcheck disable=SC2086
MOZCONFIG="$(pwd)/../mozconfig" \
MOZCONFIG_OPTIONS="${CONF_OPTS} \
--enable-debug \
--disable-optimize \
--enable-gczeal" \
BUILD_DIR="build-debug" \
./mach build "${JOBS}"
./mach build ${JOBS}
fi
# Release
# shellcheck disable=SC2086
MOZCONFIG="$(pwd)/../mozconfig" \
MOZCONFIG_OPTIONS="${CONF_OPTS} \
--enable-optimize" \
BUILD_DIR="build-release" \
./mach build "${JOBS}"
./mach build ${JOBS}
)
# install