7 NDK
=$ANDROID/android-ndk-r8-crystax-1
8 SDK
=$ANDROID/android-sdk-linux
9 TOOLCHAIN
=$ANDROID/toolchain-0ad
23 SYSROOT
=$TOOLCHAIN/sysroot
24 export PATH
=$TOOLCHAIN/bin
:$PATH
25 CFLAGS
="-mandroid -mthumb -mcpu=cortex-a9 -mfpu=neon -mfloat-abi=softfp"
30 if [ ! -e boost_1_45_0.
tar.bz2
]; then
31 wget http
://downloads.sourceforge.net
/project
/boost
/boost
/1.45.0/boost_1_45_0.
tar.bz2
34 if [ ! -e curl-7.33
.0.
tar.bz2
]; then
35 wget http
://curl.haxx.se
/download
/curl-7.33
.0.
tar.bz2
38 if [ ! -e MysticTreeGames-Boost-for-Android-70838fc.
tar.gz
]; then
39 wget https
://github.com
/MysticTreeGames
/Boost-for-Android
/tarball
/70838fcfba930646cac724a77f5c626e930431f6
-O MysticTreeGames-Boost-for-Android-70838fc.
tar.gz
42 if [ ! -e enet-1.3
.3.
tar.gz
]; then
43 wget http
://enet.bespin.org
/download
/enet-1.3
.3.
tar.gz
46 if [ ! -e js185-1.0
.0.
tar.gz
]; then
47 cp ..
/..
/..
/libraries
/source
/spidermonkey
/js185-1.0
.0.
tar.gz .
50 if [ ! -e libjpeg-turbo-1.3
.0.
tar.gz
]; then
51 wget http
://downloads.sourceforge.net
/project
/libjpeg-turbo
/1.3.0/libjpeg-turbo-1.3
.0.
tar.gz
54 if [ ! -e libpng-1.5
.8.
tar.xz
]; then
55 wget http
://prdownloads.sourceforge.net
/libpng
/libpng-1.5
.8.
tar.xz
58 if [ ! -e libxml2-2.7
.8.
tar.gz
]; then
59 wget
ftp://xmlsoft.org
/libxml
2/libxml2-2.7
.8.
tar.gz
65 if [ "$build_toolchain" = "true" ]; then
67 rm -r $TOOLCHAIN || true
68 $NDK/build
/tools
/make-standalone-toolchain.sh
--platform=android-14
--toolchain=arm-linux-androideabi-4.6
--install-dir=$TOOLCHAIN --system=linux-x86_64
70 mkdir
-p $SYSROOT/usr
/local
72 # Set up some symlinks to make the SpiderMonkey build system happy
73 ln -sfT ..
/platforms
$NDK/build
/platforms
74 for f
in $TOOLCHAIN/bin
/arm-linux-androideabi-
*; do
75 ln -sf $f ${f/arm-linux-androideabi-/arm-eabi-}
78 # Set up some symlinks for the typical autoconf-based build systems
79 for f
in $TOOLCHAIN/bin
/arm-linux-androideabi-
*; do
80 ln -sf $f ${f/arm-linux-androideabi-/arm-linux-eabi-}
87 if [ "$build_boost" = "true" ]; then
88 rm -rf temp
/MysticTreeGames-Boost-for-Android-70838fc
89 tar xvf
files
/MysticTreeGames-Boost-for-Android-70838fc.
tar.gz
-C temp
/
90 cp files
/boost_1_45_0.
tar.bz2 temp
/MysticTreeGames-Boost-for-Android-70838fc
/
91 patch temp
/MysticTreeGames-Boost-for-Android-70838fc
/build-android.sh
< boost-android-build.
patch
92 pushd temp
/MysticTreeGames-Boost-for-Android-70838fc
93 .
/build-android.sh
$TOOLCHAIN
94 cp -rv build
/{include
,lib
} $SYSROOT/usr
/local
/
98 if [ "$build_curl" = "true" ]; then
99 rm -rf temp
/curl-7.33
.0
100 tar xvf
files
/curl-7.33
.0.
tar.bz2
-C temp
/
101 pushd temp
/curl-7.33
.0
102 .
/configure
--host=arm-linux-androideabi
--with-sysroot=$SYSROOT --prefix=$SYSROOT/usr
/local CFLAGS
="$CFLAGS" LDFLAGS
="-lm" --disable-shared
108 if [ "$build_libpng" = "true" ]; then
109 rm -rf temp
/libpng-1.5
.8
110 tar xvf
files
/libpng-1.5
.8.
tar.xz
-C temp
/
111 pushd temp
/libpng-1.5
.8
112 .
/configure
--host=arm-linux-eabi
--with-sysroot=$SYSROOT --prefix=$SYSROOT/usr
/local CFLAGS
="$CFLAGS"
118 if [ "$build_libjpeg" = "true" ]; then
119 rm -rf temp
/libjpeg-turbo-1.3
.0
120 tar xvf
files
/libjpeg-turbo-1.3
.0.
tar.gz
-C temp
/
121 pushd temp
/libjpeg-turbo-1.3
.0
122 .
/configure
--host=arm-linux-eabi
--with-sysroot=$SYSROOT --prefix=$SYSROOT/usr
/local CFLAGS
="$CFLAGS" LDFLAGS
="-lm"
128 if [ "$build_libxml2" = "true" ]; then
129 rm -rf temp
/libxml2-2.7
.8
130 tar xvf
files
/libxml2-2.7
.8.
tar.gz
-C temp
/
131 patch temp
/libxml2-2.7
.8/Makefile.
in < libxml2-android-build.
patch
132 pushd temp
/libxml2-2.7
.8
133 .
/configure
--host=arm-linux-eabi
--with-sysroot=$SYSROOT --prefix=$SYSROOT/usr
/local CFLAGS
="$CFLAGS"
139 if [ "$build_enet" = "true" ]; then
140 rm -rf temp
/enet-1.3
.3
141 tar xvf
files
/enet-1.3
.3.
tar.gz
-C temp
/
142 pushd temp
/enet-1.3
.3
143 .
/configure
--host=arm-linux-eabi
--with-sysroot=$SYSROOT --prefix=$SYSROOT/usr
/local CFLAGS
="$CFLAGS"
149 if [ "$build_js185" = "true" ]; then
151 tar xvf
files
/js185-1.0
.0.
tar.gz
-C temp
/
152 patch temp
/js-1.8
.5/js
/src
/assembler
/wtf
/Platform.h
< js185-android-build.
patch
153 pushd temp
/js-1.8
.5/js
/src
154 CXXFLAGS
="-I $TOOLCHAIN/arm-linux-androideabi/include/c++/4.4.3/arm-linux-androideabi" \
155 HOST_CXXFLAGS
="-DFORCE_LITTLE_ENDIAN" \
157 --prefix=$SYSROOT/usr
/local \
158 --target=arm-android-eabi \
159 --with-android-ndk=$NDK \
160 --with-android-sdk=$SDK \
161 --with-android-toolchain=$TOOLCHAIN \
162 --with-android-version=9 \
164 --disable-shared-js \
167 make $JOBS JS_DISABLE_SHELL
=1
168 make install JS_DISABLE_SHELL
=1