1
1
#! /bin/sh
2
2
set -e
3
+ set -x
3
4
4
5
PLATFORM=OS
5
6
VERBOSE=no
6
- SDK_VERSION=8.1
7
- SDK_MIN=5.1.1
7
+ SDK_VERSION=$( xcodebuild -showsdks | grep iphoneos | sort | tail -n 1 | awk ' {print substr($NF,9)}' )
8
+ # FIXME: why min deploy target can't use 5.1.1
9
+ SDK_MIN=6.0
8
10
ARCH=armv7
9
11
12
+ # TODO: configure to compile speficy 3rd party libraries
13
+ OPTIONS="
14
+ --enable-lua
15
+ --enable-freetype2
16
+ --enable-png
17
+ "
18
+
19
+
10
20
usage ()
11
21
{
12
22
cat << EOF
13
- usage: $0 [-s] [-k sdk]
23
+ usage: $0 [-s] [-k sdk] [-a arch] [-l libname]
14
24
15
25
OPTIONS
16
26
-k <sdk version> Specify which sdk to use ('xcodebuild -showsdks', current: ${SDK_VERSION} )
17
27
-s Build for simulator
18
28
-a <arch> Specify which arch to use (current: ${ARCH} )
29
+ -l <libname> Specify which static library to build
19
30
EOF
20
31
}
21
32
37
48
}
38
49
39
50
40
- while getopts " hvsk:a:" OPTION
51
+ while getopts " hvsk:a:l: " OPTION
41
52
do
42
53
case $OPTION in
43
54
h)
56
67
a)
57
68
ARCH=$OPTARG
58
69
;;
70
+ l)
71
+ OPTIONS=--enable-$OPTARG
72
+ ;;
59
73
? )
60
74
usage
61
75
exit 1
80
94
info " Building cocos2d-x third party libraries for iOS"
81
95
82
96
if [ " $PLATFORM " = " Simulator" ]; then
83
- TARGET=" ${ARCH} -apple-darwin14 "
97
+ TARGET=" ${ARCH} -apple-darwin "
84
98
OPTIM=" -O3 -g"
85
99
else
86
- TARGET=" arm-apple-darwin14 "
100
+ TARGET=" arm-apple-darwin "
87
101
OPTIM=" -O3 -g"
88
102
fi
89
103
90
104
info " Using ${ARCH} with SDK version ${SDK_VERSION} "
91
105
92
- THIS_SCRIPT_PATH=` pwd` / $0
106
+ THIS_SCRIPT_PATH=` pwd`
93
107
94
- # spushd `dirname ${THIS_SCRIPT_PATH}`/../../..
95
- COCOSROOT=` pwd` # Let's make sure COCOSROOT is an absolute path
96
- # spopd
108
+ COCOSROOT=` pwd` /../..
97
109
98
110
if test -z " $SDKROOT "
99
111
then
@@ -113,11 +125,6 @@ PREFIX="${COCOSROOT}/install-ios-${PLATFORM}/${ARCH}"
113
125
114
126
export PATH=" /usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin"
115
127
116
- # info "Building tools"
117
- # spushd "${COCOSROOT}/contrib/ios"
118
- # ./bootstrap
119
- # make
120
- # spopd
121
128
122
129
info " Building contrib for iOS in '${COCOSROOT} /contrib/iPhone${PLATFORM} -${ARCH} '"
123
130
@@ -175,7 +182,7 @@ spushd ${COCOSROOT}
175
182
176
183
echo ${COCOSROOT}
177
184
mkdir -p " ${COCOSROOT} /contrib/iPhone${PLATFORM} -${ARCH} "
178
- cd " ${COCOSROOT} /contrib/iPhone${PLATFORM} -${ARCH} "
185
+ spushd " ${COCOSROOT} /contrib/iPhone${PLATFORM} -${ARCH} "
179
186
180
187
# # FIXME: do we need to replace Apple's gas?
181
188
if [ " $PLATFORM " = " OS" ]; then
@@ -189,120 +196,14 @@ else
189
196
export ASCPP=" xcrun as"
190
197
fi
191
198
192
- # # FIXME: add more convenient
193
- ../bootstrap --build=x86_64-apple-darwin14 --host=${TARGET} --prefix=${COCOSROOT} /contrib/${TARGET} -${ARCH} \
194
- --disable-lua \
195
- --disable-freetype2 \
196
- --enable-png > ${out}
199
+ ../bootstrap ${OPTIONS} \
200
+ --build=x86_64-apple-darwin14 \
201
+ --host=${TARGET} \
202
+ --prefix=${COCOSROOT} /contrib/${TARGET} -${ARCH} > ${out}
197
203
198
204
echo " EXTRA_CFLAGS += ${EXTRA_CFLAGS} " >> config.mak
199
205
echo " EXTRA_LDFLAGS += ${EXTRA_LDFLAGS} " >> config.mak
200
206
make fetch
207
+ make list
201
208
make
202
209
spopd
203
-
204
- # info "Bootstraping vlc"
205
- # pwd
206
- # info "VLCROOT = ${VLCROOT}"
207
- # if ! [ -e ${VLCROOT}/configure ]; then
208
- # ${VLCROOT}/bootstrap > ${out}
209
- # fi
210
-
211
- # info "Bootstraping vlc finished"
212
-
213
- # if [ ".$PLATFORM" != ".Simulator" ]; then
214
- # # FIXME - Do we still need this?
215
- # export AVCODEC_CFLAGS="-I${PREFIX}/include "
216
- # export AVCODEC_LIBS="-L${PREFIX}/lib -lavcodec -lavutil -lz"
217
- # export AVFORMAT_CFLAGS="-I${PREFIX}/include"
218
- # export AVFORMAT_LIBS="-L${PREFIX}/lib -lavcodec -lz -lavutil -lavformat"
219
- # fi
220
-
221
- # mkdir -p ${BUILDDIR}
222
- # spushd ${BUILDDIR}
223
-
224
- # info ">> --prefix=${PREFIX} --host=${TARGET}"
225
-
226
- # # Run configure only upon changes.
227
- # if [ "${VLCROOT}/configure" -nt config.log -o \
228
- # "${THIS_SCRIPT_PATH}" -nt config.log ]; then
229
- # ${VLCROOT}/configure \
230
- # --prefix="${PREFIX}" \
231
- # --host="${TARGET}" \
232
- # --with-contrib="${VLCROOT}/contrib/${TARGET}-${ARCH}" \
233
- # --disable-debug \
234
- # --enable-static \
235
- # --disable-macosx \
236
- # --disable-macosx-dialog-provider \
237
- # --disable-macosx-qtkit \
238
- # --disable-macosx-eyetv \
239
- # --disable-macosx-vlc-app \
240
- # --disable-macosx-avfoundation \
241
- # --disable-audioqueue \
242
- # --disable-shared \
243
- # --enable-macosx-quartztext \
244
- # --enable-avcodec \
245
- # --enable-mkv \
246
- # --enable-opus \
247
- # --disable-sout \
248
- # --disable-faad \
249
- # --disable-lua \
250
- # --disable-a52 \
251
- # --enable-fribidi \
252
- # --disable-qt --disable-skins2 \
253
- # --disable-vcd \
254
- # --disable-vlc \
255
- # --disable-vlm \
256
- # --disable-httpd \
257
- # --disable-nls \
258
- # --disable-glx \
259
- # --disable-sse \
260
- # --enable-neon \
261
- # --disable-notify \
262
- # --enable-live555 \
263
- # --enable-realrtsp \
264
- # --enable-dvbpsi \
265
- # --enable-swscale \
266
- # --disable-projectm \
267
- # --enable-libass \
268
- # --enable-libxml2 \
269
- # --disable-goom \
270
- # --disable-dvdread \
271
- # --disable-dvdnav \
272
- # --disable-bluray \
273
- # --disable-linsys \
274
- # --disable-libva \
275
- # --disable-gme \
276
- # --disable-tremor \
277
- # --enable-vorbis \
278
- # --disable-fluidsynth \
279
- # --disable-jack \
280
- # --disable-pulse \
281
- # --disable-mtp \
282
- # --enable-ogg \
283
- # --enable-speex \
284
- # --enable-theora \
285
- # --enable-flac \
286
- # --disable-screen \
287
- # --enable-freetype \
288
- # --enable-taglib \
289
- # --disable-mmx \
290
- # --disable-addonmanagermodules \
291
- # --disable-mad > ${out} # MMX and SSE support requires llvm which is broken on Simulator
292
- # fi
293
-
294
- # CORE_COUNT=`sysctl -n machdep.cpu.core_count`
295
- # let MAKE_JOBS=$CORE_COUNT+1
296
-
297
- # info "Building libvlc"
298
- # make -j$MAKE_JOBS > ${out}
299
-
300
- # info "Installing libvlc"
301
- # make install > ${out}
302
-
303
- # find ${PREFIX}/lib/vlc/plugins -name *.a -type f -exec cp '{}' ${PREFIX}/lib/vlc/plugins \;
304
- # rm -rf "${PREFIX}/contribs"
305
- # cp -R "${VLCROOT}/contrib/${TARGET}-${ARCH}" "${PREFIX}/contribs"
306
-
307
-
308
- # popd
0 commit comments