1
1
#! /bin/sh
2
2
set -e
3
+ set -x
3
4
4
5
info ()
5
6
{
@@ -15,9 +16,9 @@ SDKROOT=`xcode-select -print-path`/Platforms/MacOSX.platform/Developer/SDKs/MacO
15
16
16
17
# TODO: configure to compile specify 3rd party libraries
17
18
OPTIONS="
18
- --disable -lua
19
+ --enable -lua
19
20
--enable-freetype2
20
- --disable -png
21
+ --enable -png
21
22
"
22
23
23
24
usage ()
@@ -30,6 +31,7 @@ OPTIONS:
30
31
-q Be quiet
31
32
-k <sdk> Use the specified sdk (default: $SDKROOT )
32
33
-a <arch> Use the specified arch (default: $ARCH )
34
+ -l <libname> Use the specified library name
33
35
EOF
34
36
}
35
37
spushd ()
@@ -40,7 +42,7 @@ spopd()
40
42
{
41
43
popd > /dev/null
42
44
}
43
- while getopts " hvk:a:" OPTION
45
+ while getopts " hvk:a:l: " OPTION
44
46
do
45
47
case $OPTION in
46
48
h)
50
52
q)
51
53
set +x
52
54
QUIET=" yes"
53
- ;;
55
+ ;;
54
56
a)
55
57
ARCH=$OPTARG
56
- ;;
58
+ ;;
59
+ l)
60
+ OPTIONS=--enable-$OPTARG
61
+ ;;
57
62
k)
58
63
SDKROOT=$OPTARG
59
- ;;
64
+ ;;
60
65
esac
61
66
done
62
67
shift $(( $OPTIND - 1 ))
75
80
info " Building 3rd party libraries for the Mac OS X"
76
81
cocos_root=` pwd` /../..
77
82
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"
81
87
export OSX_VERSION
82
88
export SDKROOT
83
89
export PATH=" ${cocos_root} /extras/tools/bin:$PATH "
@@ -88,14 +94,15 @@ export PATH="${cocos_root}/extras/tools/bin:$PATH"
88
94
info " Building static libraries"
89
95
spushd " ${cocos_root} /contrib"
90
96
mkdir -p " mac-${ARCH} " && cd " mac-${ARCH} "
91
- ../bootstrap ${OPTIONS} > $out
97
+ ../bootstrap ${OPTIONS} > $out
92
98
93
99
#
94
100
# make
95
101
#
102
+ # FIXME: Can't use parallax make,
96
103
core_count=` sysctl -n machdep.cpu.core_count`
97
104
let jobs=$core_count +1
98
105
info " Running make -j$jobs "
99
106
make fetch
100
107
make list
101
- make -j $jobs
108
+ make
0 commit comments