From ff20fcd3b163bfd2dc47db7a980a44272d81cc35 Mon Sep 17 00:00:00 2001 From: Luke Street Date: Fri, 20 Feb 2026 11:05:05 -0700 Subject: [PATCH] macOS: use system zlib and portable make job count --- build-macos.sh | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) 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