diff --git a/build-macos.sh b/build-macos.sh index b9b9ea9..6a3f9cb 100755 --- a/build-macos.sh +++ b/build-macos.sh @@ -7,7 +7,16 @@ for patch in ../*.patch; do patch -N -p1 -i "$patch" done export CFLAGS="-arch arm64 -arch x86_64 -mmacosx-version-min=10.11" -./configure --target=powerpc-eabi --prefix="$PREFIX" --disable-nls --disable-shared --disable-gprof --without-zstd -make -j$(nproc) configure-host -make -j$(nproc) +if command -v nproc >/dev/null 2>&1; then + JOBS="$(nproc)" +else + JOBS="$(getconf _NPROCESSORS_ONLN 2>/dev/null || sysctl -n hw.ncpu 2>/dev/null || echo 4)" +fi +case "$JOBS" in + ''|*[!0-9]*) JOBS=4 ;; +esac + +./configure --target=powerpc-eabi --prefix="$PREFIX" --disable-nls --disable-shared --disable-gprof --without-zstd --with-system-zlib +make -j"$JOBS" configure-host +make -j"$JOBS" make install-strip