forked from 0ad/0ad
android/setup-libs.sh: move to posix shell
Convert various non posix consturcts and change shebang to /bin/sh Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
This commit is contained in:
parent
2634f8762e
commit
3564512a63
@ -1,4 +1,4 @@
|
|||||||
#!/bin/bash
|
#!/bin/sh
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
set -o nounset
|
set -o nounset
|
||||||
@ -21,11 +21,11 @@ build_js185=true
|
|||||||
JOBS=${JOBS:="-j4"}
|
JOBS=${JOBS:="-j4"}
|
||||||
|
|
||||||
SYSROOT=$TOOLCHAIN/sysroot
|
SYSROOT=$TOOLCHAIN/sysroot
|
||||||
export PATH=$TOOLCHAIN/bin:$PATH
|
export PATH="$TOOLCHAIN/bin:$PATH"
|
||||||
CFLAGS="-mandroid -mthumb -mcpu=cortex-a9 -mfpu=neon -mfloat-abi=softfp"
|
CFLAGS="-mandroid -mthumb -mcpu=cortex-a9 -mfpu=neon -mfloat-abi=softfp"
|
||||||
|
|
||||||
mkdir -p files
|
mkdir -p files
|
||||||
pushd files
|
cd files
|
||||||
|
|
||||||
if [ ! -e boost_1_45_0.tar.bz2 ]; then
|
if [ ! -e boost_1_45_0.tar.bz2 ]; then
|
||||||
wget http://downloads.sourceforge.net/project/boost/boost/1.45.0/boost_1_45_0.tar.bz2
|
wget http://downloads.sourceforge.net/project/boost/boost/1.45.0/boost_1_45_0.tar.bz2
|
||||||
@ -59,7 +59,7 @@ if [ ! -e libxml2-2.7.8.tar.gz ]; then
|
|||||||
wget ftp://xmlsoft.org/libxml2/libxml2-2.7.8.tar.gz
|
wget ftp://xmlsoft.org/libxml2/libxml2-2.7.8.tar.gz
|
||||||
fi
|
fi
|
||||||
|
|
||||||
popd
|
cd -
|
||||||
|
|
||||||
if [ "$build_toolchain" = "true" ]; then
|
if [ "$build_toolchain" = "true" ]; then
|
||||||
|
|
||||||
@ -71,12 +71,12 @@ if [ "$build_toolchain" = "true" ]; then
|
|||||||
# Set up some symlinks to make the SpiderMonkey build system happy
|
# Set up some symlinks to make the SpiderMonkey build system happy
|
||||||
ln -sfT ../platforms "$NDK"/build/platforms
|
ln -sfT ../platforms "$NDK"/build/platforms
|
||||||
for f in "$TOOLCHAIN"/bin/arm-linux-androideabi-*; do
|
for f in "$TOOLCHAIN"/bin/arm-linux-androideabi-*; do
|
||||||
ln -sf "$f" "${f/arm-linux-androideabi-/arm-eabi-}"
|
ln -sf "$f" "$(printf '%s' "$f" | sed "s/arm-linux-androideabi-/arm-eabi-/")"
|
||||||
done
|
done
|
||||||
|
|
||||||
# Set up some symlinks for the typical autoconf-based build systems
|
# Set up some symlinks for the typical autoconf-based build systems
|
||||||
for f in "$TOOLCHAIN"/bin/arm-linux-androideabi-*; do
|
for f in "$TOOLCHAIN"/bin/arm-linux-androideabi-*; do
|
||||||
ln -sf "$f" "${f/arm-linux-androideabi-/arm-linux-eabi-}"
|
ln -sf "$f" "$(printf '%s' "$f" | sed "s/arm-linux-androideabi-/arm-linux-eabi-/")"
|
||||||
done
|
done
|
||||||
|
|
||||||
fi
|
fi
|
||||||
@ -88,68 +88,68 @@ if [ "$build_boost" = "true" ]; then
|
|||||||
tar xvf files/MysticTreeGames-Boost-for-Android-70838fc.tar.gz -C temp/
|
tar xvf files/MysticTreeGames-Boost-for-Android-70838fc.tar.gz -C temp/
|
||||||
cp files/boost_1_45_0.tar.bz2 temp/MysticTreeGames-Boost-for-Android-70838fc/
|
cp files/boost_1_45_0.tar.bz2 temp/MysticTreeGames-Boost-for-Android-70838fc/
|
||||||
patch temp/MysticTreeGames-Boost-for-Android-70838fc/build-android.sh <boost-android-build.patch
|
patch temp/MysticTreeGames-Boost-for-Android-70838fc/build-android.sh <boost-android-build.patch
|
||||||
pushd temp/MysticTreeGames-Boost-for-Android-70838fc
|
cd temp/MysticTreeGames-Boost-for-Android-70838fc
|
||||||
./build-android.sh "$TOOLCHAIN"
|
./build-android.sh "$TOOLCHAIN"
|
||||||
cp -rv build/{include,lib} "$SYSROOT"/usr/local/
|
cp -rv build/include build/lib "$SYSROOT"/usr/local/
|
||||||
popd
|
cd -
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$build_curl" = "true" ]; then
|
if [ "$build_curl" = "true" ]; then
|
||||||
rm -rf temp/curl-7.33.0
|
rm -rf temp/curl-7.33.0
|
||||||
tar xvf files/curl-7.33.0.tar.bz2 -C temp/
|
tar xvf files/curl-7.33.0.tar.bz2 -C temp/
|
||||||
pushd temp/curl-7.33.0
|
cd temp/curl-7.33.0
|
||||||
./configure --host=arm-linux-androideabi --with-sysroot="$SYSROOT" --prefix="$SYSROOT"/usr/local CFLAGS="$CFLAGS" LDFLAGS="-lm" --disable-shared
|
./configure --host=arm-linux-androideabi --with-sysroot="$SYSROOT" --prefix="$SYSROOT"/usr/local CFLAGS="$CFLAGS" LDFLAGS="-lm" --disable-shared
|
||||||
make -j3
|
make -j3
|
||||||
make install
|
make install
|
||||||
popd
|
cd -
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$build_libpng" = "true" ]; then
|
if [ "$build_libpng" = "true" ]; then
|
||||||
rm -rf temp/libpng-1.5.8
|
rm -rf temp/libpng-1.5.8
|
||||||
tar xvf files/libpng-1.5.8.tar.xz -C temp/
|
tar xvf files/libpng-1.5.8.tar.xz -C temp/
|
||||||
pushd temp/libpng-1.5.8
|
cd temp/libpng-1.5.8
|
||||||
./configure --host=arm-linux-eabi --with-sysroot="$SYSROOT" --prefix="$SYSROOT"/usr/local CFLAGS="$CFLAGS"
|
./configure --host=arm-linux-eabi --with-sysroot="$SYSROOT" --prefix="$SYSROOT"/usr/local CFLAGS="$CFLAGS"
|
||||||
make "$JOBS"
|
make "$JOBS"
|
||||||
make install
|
make install
|
||||||
popd
|
cd -
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$build_libjpeg" = "true" ]; then
|
if [ "$build_libjpeg" = "true" ]; then
|
||||||
rm -rf temp/libjpeg-turbo-1.3.0
|
rm -rf temp/libjpeg-turbo-1.3.0
|
||||||
tar xvf files/libjpeg-turbo-1.3.0.tar.gz -C temp/
|
tar xvf files/libjpeg-turbo-1.3.0.tar.gz -C temp/
|
||||||
pushd temp/libjpeg-turbo-1.3.0
|
cd temp/libjpeg-turbo-1.3.0
|
||||||
./configure --host=arm-linux-eabi --with-sysroot="$SYSROOT" --prefix="$SYSROOT"/usr/local CFLAGS="$CFLAGS" LDFLAGS="-lm"
|
./configure --host=arm-linux-eabi --with-sysroot="$SYSROOT" --prefix="$SYSROOT"/usr/local CFLAGS="$CFLAGS" LDFLAGS="-lm"
|
||||||
make "$JOBS"
|
make "$JOBS"
|
||||||
make install
|
make install
|
||||||
popd
|
cd -
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$build_libxml2" = "true" ]; then
|
if [ "$build_libxml2" = "true" ]; then
|
||||||
rm -rf temp/libxml2-2.7.8
|
rm -rf temp/libxml2-2.7.8
|
||||||
tar xvf files/libxml2-2.7.8.tar.gz -C temp/
|
tar xvf files/libxml2-2.7.8.tar.gz -C temp/
|
||||||
patch temp/libxml2-2.7.8/Makefile.in <libxml2-android-build.patch
|
patch temp/libxml2-2.7.8/Makefile.in <libxml2-android-build.patch
|
||||||
pushd temp/libxml2-2.7.8
|
cd temp/libxml2-2.7.8
|
||||||
./configure --host=arm-linux-eabi --with-sysroot="$SYSROOT" --prefix="$SYSROOT"/usr/local CFLAGS="$CFLAGS"
|
./configure --host=arm-linux-eabi --with-sysroot="$SYSROOT" --prefix="$SYSROOT"/usr/local CFLAGS="$CFLAGS"
|
||||||
make "$JOBS"
|
make "$JOBS"
|
||||||
make install
|
make install
|
||||||
popd
|
cd -
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$build_enet" = "true" ]; then
|
if [ "$build_enet" = "true" ]; then
|
||||||
rm -rf temp/enet-1.3.3
|
rm -rf temp/enet-1.3.3
|
||||||
tar xvf files/enet-1.3.3.tar.gz -C temp/
|
tar xvf files/enet-1.3.3.tar.gz -C temp/
|
||||||
pushd temp/enet-1.3.3
|
cd temp/enet-1.3.3
|
||||||
./configure --host=arm-linux-eabi --with-sysroot="$SYSROOT" --prefix="$SYSROOT"/usr/local CFLAGS="$CFLAGS"
|
./configure --host=arm-linux-eabi --with-sysroot="$SYSROOT" --prefix="$SYSROOT"/usr/local CFLAGS="$CFLAGS"
|
||||||
make "$JOBS"
|
make "$JOBS"
|
||||||
make install
|
make install
|
||||||
popd
|
cd -
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$build_js185" = "true" ]; then
|
if [ "$build_js185" = "true" ]; then
|
||||||
rm -rf temp/js-1.8.5
|
rm -rf temp/js-1.8.5
|
||||||
tar xvf files/js185-1.0.0.tar.gz -C temp/
|
tar xvf files/js185-1.0.0.tar.gz -C temp/
|
||||||
patch temp/js-1.8.5/js/src/assembler/wtf/Platform.h <js185-android-build.patch
|
patch temp/js-1.8.5/js/src/assembler/wtf/Platform.h <js185-android-build.patch
|
||||||
pushd temp/js-1.8.5/js/src
|
cd temp/js-1.8.5/js/src
|
||||||
CXXFLAGS="-I $TOOLCHAIN/arm-linux-androideabi/include/c++/4.4.3/arm-linux-androideabi" \
|
CXXFLAGS="-I $TOOLCHAIN/arm-linux-androideabi/include/c++/4.4.3/arm-linux-androideabi" \
|
||||||
HOST_CXXFLAGS="-DFORCE_LITTLE_ENDIAN" \
|
HOST_CXXFLAGS="-DFORCE_LITTLE_ENDIAN" \
|
||||||
./configure \
|
./configure \
|
||||||
@ -165,5 +165,5 @@ if [ "$build_js185" = "true" ]; then
|
|||||||
CFLAGS="$CFLAGS"
|
CFLAGS="$CFLAGS"
|
||||||
make "$JOBS" JS_DISABLE_SHELL=1
|
make "$JOBS" JS_DISABLE_SHELL=1
|
||||||
make install JS_DISABLE_SHELL=1
|
make install JS_DISABLE_SHELL=1
|
||||||
popd
|
cd -
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user