Skip to content

Commit 847dfe1

Browse files
committed
Fix running make-macosx{,-ub2}.sh on Linux
osxcross doesn't support ppc so it's not possible to compile Universal Binary 1.
1 parent 819e983 commit 847dfe1

File tree

3 files changed

+28
-11
lines changed

3 files changed

+28
-11
lines changed

make-macosx-ub.sh

+10-4
Original file line numberDiff line numberDiff line change
@@ -73,29 +73,35 @@ echo "Building PPC Client/Dedicated Server against \"$PPC_SDK\""
7373
echo
7474

7575
# For parallel make on multicore boxes...
76-
NCPU=`sysctl -n hw.ncpu`
76+
SYSCTL_PATH=`command -v sysctl 2> /dev/null`
77+
if [ -n "$SYSCTL_PATH" ]; then
78+
NCPU=`sysctl -n hw.ncpu`
79+
else
80+
# osxcross on linux
81+
NCPU=`nproc`
82+
fi
7783

7884
# x86_64 client and server
7985
#if [ -d build/release-release-x86_64 ]; then
8086
# rm -r build/release-darwin-x86_64
8187
#fi
82-
(ARCH=x86_64 CC=gcc-4.0 CFLAGS=$X86_64_CFLAGS MACOSX_VERSION_MIN=$X86_64_MACOSX_VERSION_MIN make -j$NCPU) || exit 1;
88+
(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;
8389

8490
echo;echo
8591

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

9298
echo;echo
9399

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

100106
echo
101107

make-macosx-ub2.sh

+10-4
Original file line numberDiff line numberDiff line change
@@ -28,21 +28,27 @@ if [ "$1" == "" ]; then
2828
fi
2929

3030
# For parallel make on multicore boxes...
31-
NCPU=`sysctl -n hw.ncpu`
31+
SYSCTL_PATH=`command -v sysctl 2> /dev/null`
32+
if [ -n "$SYSCTL_PATH" ]; then
33+
NCPU=`sysctl -n hw.ncpu`
34+
else
35+
# osxcross on linux
36+
NCPU=`nproc`
37+
fi
3238

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

3945
echo;echo
4046

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

4753
echo
4854

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

152158
echo "done. ${POST_NOTARIZED_ZIP} contains notarized ${RELEASE_BUILD} build."
153-
fi
159+
fi

make-macosx.sh

+8-3
Original file line numberDiff line numberDiff line change
@@ -106,14 +106,19 @@ if [ ! -d $DESTDIR ]; then
106106
fi
107107

108108
# For parallel make on multicore boxes...
109-
NCPU=`sysctl -n hw.ncpu`
110-
109+
SYSCTL_PATH=`command -v sysctl 2> /dev/null`
110+
if [ -n "$SYSCTL_PATH" ]; then
111+
NCPU=`sysctl -n hw.ncpu`
112+
else
113+
# osxcross on linux
114+
NCPU=`nproc`
115+
fi
111116

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

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

0 commit comments

Comments
 (0)