This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
yap-6.3/misc/mkandroid
2014-07-09 23:28:10 -05:00

67 lines
1.7 KiB
Bash
Executable File

#!/bin/bash
#
# script to compile yap for Android.
if test -d $HOME/Yap/android-sdk-linux
then
export SDK_ROOT=$HOME/Yap/android-sdk-linux
elif test -d $HOME/Yap/android-sdk-macosx
then
export SDK_ROOT=$HOME/Yap/android-sdk-macosx
fi
export NDK_ROOT=$HOME/Yap/android-ndk-r9d
export GMPDIR=$HOME/Yap/gmp-android
export ANDROID_NDK_ROOT="$NDK_ROOT"/
export ANDROID_SYSROOT="$NDK_ROOT"/platforms/android-17/arch-arm
# which platform to compile for
ANDROID_PLATFORM=android-17
# which gcc to use
GCC_VERSION=4.8
# which disk
IMAGE=first
if test -d $HOME/Yap/my-android-toolchain
then
echo using the setup at $HOME/Yap/my-android-toolchain
else
"$NDK_ROOT"/build/tools/make-standalone-toolchain.sh \
--platform="$ANDROID_PLATFORM" \
--toolchain=arm-linux-androideabi-"$GCC_VERSION" \
--install-dir="$HOME"/Yap/my-android-toolchain
fi
export PATH="$HOME"/Yap/my-android-toolchain/bin:"$NDK_ROOT":"$SDK_ROOT/tools":"$SDK_ROOT/platform-tools":$PATH
cd ~/Yap/bins/android
if test x$1 = xmake
then
make -j install
rm -r packages/swig/android
elif test x$1 = xenv
then
return 0
elif test x$1 = xeclipse
then
emulator -avd $IMAGE &
~/eclipse/eclipse &
return 0
else
emulator -avd $IMAGE &
rm -rf ~/Yap/bins/android/*
cd ~/Yap/bins/android
~/git/yap-6.3/configure --host=arm-linux-androideabi --prefix=`pwd` --enable-low-level-tracer --enable-debug-yap --enable-dynamic-loading --with-swig --with-gmp=$GMPDIR --disable-chr #--enable-threads
make depend
make -j install
fi
cd packages/swig
mkdir -p $ANDROID_NDK_ROOT/build/core/lib
make android
make install-android
adb uninstall pt.up.fc.dcc.yap
adb install android/bin/JavaYap-debug.apk