forked from kivy/kivy-ios
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild-sdlmixer.sh
executable file
·75 lines (63 loc) · 1.88 KB
/
build-sdlmixer.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#!/bin/bash
. $(dirname $0)/environment.sh
pushd $TMPROOT
if [ ! -f SDL ]; then
ln -s $KIVYIOSROOT/src/SDL SDL
fi
if [ ! -d SDL_mixer ]; then
try hg clone http://hg.libsdl.org/SDL_mixer/#SDL-1.2
fi
if [ ! -d libtremor ]; then
try mkdir libtremor
try cd libtremor
try svn co http://svn.xiph.org/trunk/Tremor tremor
try cd tremor
try patch -p0 < $KIVYIOSROOT/src/tremor-configure.patch
try cd ../..
fi
if [ ! -d libogg ]; then
try curl -L http://downloads.xiph.org/releases/ogg/libogg-1.3.0.tar.gz > $CACHEROOT/libogg-1.3.0.tar.gz
try tar xzf $CACHEROOT/libogg-1.3.0.tar.gz
try mv libogg-1.3.0 libogg
fi
if [ ! -f libogg/src/.libs/libogg.a ]; then
try cd libogg
try ./configure --disable-shared \
--host=arm-apple-darwin \
--enable-static=yes \
--enable-shared=no \
CC="$ARM_CC" AR="$ARM_AR" \
LDFLAGS="$ARM_LDFLAGS" CFLAGS="$ARM_CFLAGS"
try make
try cd ..
fi
if [ ! -f libtremor/tremor/.libs/libvorbisidec.a ]; then
try cd libtremor/tremor
echo > asm_arm.h
CC="$ARM_CC" AR="$ARM_AR" \
LDFLAGS="$ARM_LDFLAGS" CFLAGS="$ARM_CFLAGS" \
OGG_CFLAGS="-I../../libogg/include" \
OGG_LDFLAGS="-L../../libogg/src/.libs" \
PKG_CONFIG_LIBDIR="../../libogg" \
ACLOCAL_FLAGS="-I `aclocal --print-ac-dir`" ./autogen.sh \
--disable-shared \
--host=arm-apple-darwin \
--enable-static=yes \
--enable-shared=no
try make
try cd ../..
fi
popd
try cp $TMPROOT/libogg/src/.libs/libogg.a $BUILDROOT/lib
try cp $TMPROOT/libtremor/tremor/.libs/libvorbisidec.a $BUILDROOT/lib
if [ -f $TMPROOT/SDL_mixer/libSDL_mixer-arm7.a ]; then
exit 0;
fi
if [ ! -f $TMPROOT/libtremor/ogg ]; then
ln -s $TMPROOT/libogg/include/ogg $TMPROOT/libtremor
fi
pushd $TMPROOT/SDL_mixer/Xcode-iOS
try xcodebuild -project SDL_mixer.xcodeproj -configuration Release
popd
try cp $TMPROOT/SDL_mixer/Xcode-iOS/build/Release-iphoneos/libSDL_mixer.a $BUILDROOT/lib
try cp -a $TMPROOT/SDL_mixer/SDL_mixer.h $BUILDROOT/include