Skip to content

Commit ecbdece

Browse files
committed
make openssl work on mac
1 parent 5a7c01b commit ecbdece

File tree

4 files changed

+756
-18
lines changed

4 files changed

+756
-18
lines changed

build/mac/build.sh

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#!/bin/sh
22
set -e
3+
set -x
34

45
info()
56
{
@@ -15,9 +16,9 @@ SDKROOT=`xcode-select -print-path`/Platforms/MacOSX.platform/Developer/SDKs/MacO
1516

1617
# TODO: configure to compile specify 3rd party libraries
1718
OPTIONS="
18-
--disable-lua
19+
--enable-lua
1920
--enable-freetype2
20-
--disable-png
21+
--enable-png
2122
"
2223

2324
usage()
@@ -30,6 +31,7 @@ OPTIONS:
3031
-q Be quiet
3132
-k <sdk> Use the specified sdk (default: $SDKROOT)
3233
-a <arch> Use the specified arch (default: $ARCH)
34+
-l <libname> Use the specified library name
3335
EOF
3436
}
3537
spushd()
@@ -40,7 +42,7 @@ spopd()
4042
{
4143
popd > /dev/null
4244
}
43-
while getopts "hvk:a:" OPTION
45+
while getopts "hvk:a:l:" OPTION
4446
do
4547
case $OPTION in
4648
h)
@@ -50,13 +52,16 @@ do
5052
q)
5153
set +x
5254
QUIET="yes"
53-
;;
55+
;;
5456
a)
5557
ARCH=$OPTARG
56-
;;
58+
;;
59+
l)
60+
OPTIONS=--enable-$OPTARG
61+
;;
5762
k)
5863
SDKROOT=$OPTARG
59-
;;
64+
;;
6065
esac
6166
done
6267
shift $(($OPTIND - 1))
@@ -75,9 +80,10 @@ fi
7580
info "Building 3rd party libraries for the Mac OS X"
7681
cocos_root=`pwd`/../..
7782

78-
export CC="xcrun clang"
79-
export CXX="xcrun clang++"
80-
export OBJC="xcrun clang"
83+
# FIXME: on MacOSX, we don't need to set the CC/CXX compiler indicators
84+
# export CC="xcrun clang"
85+
# export CXX="xcrun clang++"
86+
# export OBJC="xcrun clang"
8187
export OSX_VERSION
8288
export SDKROOT
8389
export PATH="${cocos_root}/extras/tools/bin:$PATH"
@@ -88,14 +94,15 @@ export PATH="${cocos_root}/extras/tools/bin:$PATH"
8894
info "Building static libraries"
8995
spushd "${cocos_root}/contrib"
9096
mkdir -p "mac-${ARCH}" && cd "mac-${ARCH}"
91-
../bootstrap ${OPTIONS} > $out
97+
../bootstrap ${OPTIONS} > $out
9298

9399
#
94100
# make
95101
#
102+
# FIXME: Can't use parallax make,
96103
core_count=`sysctl -n machdep.cpu.core_count`
97104
let jobs=$core_count+1
98105
info "Running make -j$jobs"
99106
make fetch
100107
make list
101-
make -j$jobs
108+
make

0 commit comments

Comments
 (0)