Skip to content

Commit

Permalink
Fix running make-macosx{,-ub2}.sh on Linux
Browse files Browse the repository at this point in the history
osxcross doesn't support ppc so it's not possible to compile Universal
Binary 1.
  • Loading branch information
zturtleman committed Feb 19, 2023
1 parent 819e983 commit 847dfe1
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 11 deletions.
14 changes: 10 additions & 4 deletions make-macosx-ub.sh
Original file line number Diff line number Diff line change
Expand Up @@ -73,29 +73,35 @@ echo "Building PPC Client/Dedicated Server against \"$PPC_SDK\""
echo

# For parallel make on multicore boxes...
NCPU=`sysctl -n hw.ncpu`
SYSCTL_PATH=`command -v sysctl 2> /dev/null`
if [ -n "$SYSCTL_PATH" ]; then
NCPU=`sysctl -n hw.ncpu`
else
# osxcross on linux
NCPU=`nproc`
fi

# x86_64 client and server
#if [ -d build/release-release-x86_64 ]; then
# rm -r build/release-darwin-x86_64
#fi
(ARCH=x86_64 CC=gcc-4.0 CFLAGS=$X86_64_CFLAGS MACOSX_VERSION_MIN=$X86_64_MACOSX_VERSION_MIN make -j$NCPU) || exit 1;
(PLATFORM=darwin ARCH=x86_64 CC=gcc-4.0 CFLAGS=$X86_64_CFLAGS MACOSX_VERSION_MIN=$X86_64_MACOSX_VERSION_MIN make -j$NCPU) || exit 1;

echo;echo

# x86 client and server
#if [ -d build/release-darwin-x86 ]; then
# rm -r build/release-darwin-x86
#fi
(ARCH=x86 CC=gcc-4.0 CFLAGS=$X86_CFLAGS MACOSX_VERSION_MIN=$X86_MACOSX_VERSION_MIN make -j$NCPU) || exit 1;
(PLATFORM=darwin ARCH=x86 CC=gcc-4.0 CFLAGS=$X86_CFLAGS MACOSX_VERSION_MIN=$X86_MACOSX_VERSION_MIN make -j$NCPU) || exit 1;

echo;echo

# PPC client and server
#if [ -d build/release-darwin-ppc ]; then
# rm -r build/release-darwin-ppc
#fi
(ARCH=ppc CC=gcc-4.0 CFLAGS=$PPC_CFLAGS MACOSX_VERSION_MIN=$PPC_MACOSX_VERSION_MIN make -j$NCPU) || exit 1;
(PLATFORM=darwin ARCH=ppc CC=gcc-4.0 CFLAGS=$PPC_CFLAGS MACOSX_VERSION_MIN=$PPC_MACOSX_VERSION_MIN make -j$NCPU) || exit 1;

echo

Expand Down
14 changes: 10 additions & 4 deletions make-macosx-ub2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,21 +28,27 @@ if [ "$1" == "" ]; then
fi

# For parallel make on multicore boxes...
NCPU=`sysctl -n hw.ncpu`
SYSCTL_PATH=`command -v sysctl 2> /dev/null`
if [ -n "$SYSCTL_PATH" ]; then
NCPU=`sysctl -n hw.ncpu`
else
# osxcross on linux
NCPU=`nproc`
fi

# x86_64 client and server
#if [ -d build/release-release-x86_64 ]; then
# rm -r build/release-darwin-x86_64
#fi
(ARCH=x86_64 CFLAGS=$X86_64_CFLAGS MACOSX_VERSION_MIN=$X86_64_MACOSX_VERSION_MIN make -j$NCPU) || exit 1;
(PLATFORM=darwin ARCH=x86_64 CFLAGS=$X86_64_CFLAGS MACOSX_VERSION_MIN=$X86_64_MACOSX_VERSION_MIN make -j$NCPU) || exit 1;

echo;echo

# arm64 client and server
#if [ -d build/release-release-arm64 ]; then
# rm -r build/release-darwin-arm64
#fi
(ARCH=arm64 CFLAGS=$ARM64_CFLAGS MACOSX_VERSION_MIN=$ARM64_MACOSX_VERSION_MIN make -j$NCPU) || exit 1;
(PLATFORM=darwin ARCH=arm64 CFLAGS=$ARM64_CFLAGS MACOSX_VERSION_MIN=$ARM64_MACOSX_VERSION_MIN make -j$NCPU) || exit 1;

echo

Expand Down Expand Up @@ -150,4 +156,4 @@ if [ "$1" == "notarize" ]; then
ditto -c -k --sequesterRsrc --keepParent ${RELEASE_BUILD} ${POST_NOTARIZED_ZIP}

echo "done. ${POST_NOTARIZED_ZIP} contains notarized ${RELEASE_BUILD} build."
fi
fi
11 changes: 8 additions & 3 deletions make-macosx.sh
Original file line number Diff line number Diff line change
Expand Up @@ -106,14 +106,19 @@ if [ ! -d $DESTDIR ]; then
fi

# For parallel make on multicore boxes...
NCPU=`sysctl -n hw.ncpu`

SYSCTL_PATH=`command -v sysctl 2> /dev/null`
if [ -n "$SYSCTL_PATH" ]; then
NCPU=`sysctl -n hw.ncpu`
else
# osxcross on linux
NCPU=`nproc`
fi

# intel client and server
#if [ -d build/release-darwin-${BUILDARCH} ]; then
# rm -r build/release-darwin-${BUILDARCH}
#fi
(ARCH=${BUILDARCH} CFLAGS=$ARCH_CFLAGS MACOSX_VERSION_MIN=$ARCH_MACOSX_VERSION_MIN make -j$NCPU) || exit 1;
(PLATFORM=darwin ARCH=${BUILDARCH} CFLAGS=$ARCH_CFLAGS MACOSX_VERSION_MIN=$ARCH_MACOSX_VERSION_MIN make -j$NCPU) || exit 1;

# use the following shell script to build an application bundle
export MACOSX_DEPLOYMENT_TARGET="${ARCH_MACOSX_VERSION_MIN}"
Expand Down

0 comments on commit 847dfe1

Please sign in to comment.