out-of-date
This commit is contained in:
parent
750b31b29a
commit
ccc2efd456
71
misc/android
71
misc/android
@ -1,71 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
#
|
|
||||||
# script to compile yap for Android.
|
|
||||||
|
|
||||||
BUILD=x86_64-apple-darwin
|
|
||||||
|
|
||||||
export SDK_ROOT=$HOME/Yap/android-sdk-macosx
|
|
||||||
export NDK_ROOT=$HOME/Yap/android-ndk-r9d
|
|
||||||
export NDK_HOST=darwin-x86_64
|
|
||||||
export GCC_VERSION=4.8
|
|
||||||
#export PATH=$PATH:"$NDK_ROOT"/toolchains/arm-linux-androideabi-"$GCC_VERSION"/prebuilt/$NDK_HOST/bin
|
|
||||||
export PATH=$PATH:"$SDK_ROOT"/tools:"$NDK_ROOT"
|
|
||||||
|
|
||||||
export GMPDIR=$HOME/Yap/gmp-android
|
|
||||||
|
|
||||||
export ANDROID_NDK_ROOT="$NDK_ROOT"/
|
|
||||||
export ANDROID_SYSROOT="$NDK_ROOT"/platforms/android-17/arch-arm
|
|
||||||
|
|
||||||
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-17 \
|
|
||||||
--toolchain=arm-linux-androideabi-"$GCC_VERSION" \
|
|
||||||
--install-dir="$HOME"/Yap/my-android-toolchain
|
|
||||||
fi
|
|
||||||
|
|
||||||
export PATH=$HOME/Yap/my-android-toolchain/bin:$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 first &
|
|
||||||
~/eclipse/eclipse &
|
|
||||||
exit 0;
|
|
||||||
# not working
|
|
||||||
# elif test x$1 = xgmp
|
|
||||||
# then
|
|
||||||
# cd ~/Yap/gmp-6.0.0
|
|
||||||
# export LDFLAGS="-Wl,--fix-cortex-a8 -Wl,--no-undefined -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now"
|
|
||||||
# export BASE_CFLAGS='-O2 -g -pedantic -fomit-frame-pointer -Wa,--noexecstack -ffunction-sections -funwind-tables -fstack-protector -fno-strict-aliasing'
|
|
||||||
# export CFLAGS="${BASE_CFLAGS} -mfloat-abi=softfp -mfpu=vfp"
|
|
||||||
# export LIBGMP_LDFLAGS='-avoid-version'
|
|
||||||
# export LIBGMPXX_LDFLAGS='-avoid-version'
|
|
||||||
# export PATH="$NDK_ROOT"/toolchains/arm-linux-androideabi-4.8/prebuilt/$NDK_HOST/arm-linux-androideabi/bin:$PATH
|
|
||||||
# export MPN_PATH="arm/v6t2 arm/v6 arm/v5 arm generic"
|
|
||||||
# ./configure --host=arm-linux-androideabi --build=$BUILD --prefix=$HOME/Yap/gmp-android
|
|
||||||
# # make
|
|
||||||
# exit 0
|
|
||||||
else
|
|
||||||
rm -rf ~/Yap/bins/android/*
|
|
||||||
~/git/yap-6.3/configure --host=arm-linux-androideabi --prefix=`pwd` --with-readline=no --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
|
|
||||||
cp libYap.so libYapi.so $GMPDIR/lib/libgmp.so $ANDROID_NDK_ROOT/build/core/lib/
|
|
||||||
cd packages/swig
|
|
||||||
mkdir -p $ANDROID_NDK_ROOT/build/core/lib
|
|
||||||
make android
|
|
||||||
adb uninstall org.swig.simple
|
|
||||||
adb install android/bin/SwigSimple-debug.apk
|
|
186
misc/mkandroid
186
misc/mkandroid
@ -1,186 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
#
|
|
||||||
# script to compile yap for Android.
|
|
||||||
#
|
|
||||||
# variables are
|
|
||||||
#
|
|
||||||
# SDK_ROOT: where is the SDK
|
|
||||||
# NDK_ROOT: and the NDK
|
|
||||||
# GMPDIR: get your copy of GMP from
|
|
||||||
# SQLite3DIr: a pre-compiled version of sqlite3
|
|
||||||
# BUILDDROID: where we want to compile yap
|
|
||||||
|
|
||||||
|
|
||||||
# ANDROID_RELEASE= 17 is 4.2.2, 19 is 4.4.2
|
|
||||||
ANDROID_RELEASE=19
|
|
||||||
# ANDROID_ARCH= arm, x86, mips
|
|
||||||
ANDROID_ARCH=arm
|
|
||||||
# ANDROID_BUILD=linux
|
|
||||||
if test `uname` = Darwin
|
|
||||||
then
|
|
||||||
ANDROID_BUILD_TOOLS=macosx
|
|
||||||
ANDROID_BUILD=darwin
|
|
||||||
else
|
|
||||||
ANDROID_BUILD_TOOLS=linux
|
|
||||||
ANDROID_BUILD=linux
|
|
||||||
fi
|
|
||||||
|
|
||||||
# use `android list target` to check for available targets
|
|
||||||
export ANDROID_TARGET=3
|
|
||||||
|
|
||||||
# what android to compile for, use
|
|
||||||
ANDROID_IMAGE=first
|
|
||||||
|
|
||||||
# YAP_SRC="$HOME/Yap/yap-6.3"
|
|
||||||
if test -d "$HOME/git/yap-6.3"
|
|
||||||
then
|
|
||||||
export YAP_SRC="$HOME/git/yap-6.3"
|
|
||||||
elif test -d "$HOME/Yap/yap-6.3"
|
|
||||||
then
|
|
||||||
export YAP_SRC="$HOME/Yap/yap-6.3"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# check if the SDK is at the usual locations
|
|
||||||
|
|
||||||
if test -d $HOME/Yap/android-sdk-"$ANDROID_BUILD_TOOLS"
|
|
||||||
then
|
|
||||||
export SDK_ROOT=$HOME/Yap/android-sdk-"$ANDROID_BUILD_TOOLS"
|
|
||||||
else
|
|
||||||
export SDK_ROOT=/scratch/vitor/android-sdk-"$ANDROID_BUILD_TOOLS"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# check if the NDK is at the usual locations
|
|
||||||
if test -d $HOME/Yap/android-ndk-r9d
|
|
||||||
then
|
|
||||||
export NDK_ROOT=$HOME/Yap/android-ndk-r9d
|
|
||||||
elif test -d /scratch/vitor/android-ndk-r9d
|
|
||||||
then
|
|
||||||
export NDK_ROOT=/scratch/vitor/android-ndk-r9d
|
|
||||||
fi
|
|
||||||
|
|
||||||
# fetch GMP from https://github.com/Rupan/gmp,
|
|
||||||
# or compile it.
|
|
||||||
if test -d /scratch
|
|
||||||
then
|
|
||||||
export GMPDIR=/scratch/vitor/gmp-android
|
|
||||||
else
|
|
||||||
export GMPDIR="$HOME"/Yap/gmp-android
|
|
||||||
fi
|
|
||||||
|
|
||||||
# fetch SQLITE3 from https://github.com/Rupan/gmp,
|
|
||||||
# and have two versions: one to build myddas, the
|
|
||||||
# other to build the app.
|
|
||||||
#
|
|
||||||
# This one is used to build myddas
|
|
||||||
if test -d /scratch
|
|
||||||
then
|
|
||||||
export SQLITE3DIR=/scratch/vitor/sqlite3-android
|
|
||||||
else
|
|
||||||
export SQLITE3DIR="$HOME"/Yap/sqlite3-android
|
|
||||||
fi
|
|
||||||
|
|
||||||
#where I want to compile
|
|
||||||
#export BUILDTOOLCHAIN="$HOME/Yap/my-android-toolchain"
|
|
||||||
if test -d /scratch
|
|
||||||
then
|
|
||||||
export BUILDTOOLCHAIN="/scratch/vitor/my-android-toolchain"
|
|
||||||
export BUILDDROID="/scratch/vitor/yap-android"
|
|
||||||
else
|
|
||||||
export BUILDTOOLCHAIN="$HOME/Yap/my-android-toolchain"
|
|
||||||
export BUILDDROID="$HOME/Yap/bins/android"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# which gcc to use
|
|
||||||
GCC_VERSION=4.8
|
|
||||||
|
|
||||||
#========================================================
|
|
||||||
# should need no further work.
|
|
||||||
#========================================================
|
|
||||||
|
|
||||||
export ANDROID_NDK_ROOT="$NDK_ROOT"/
|
|
||||||
export ANDROID_SYSROOT="$NDK_ROOT"/platforms/android-"$ANDROID_RELEASE"/arch-"$ANDROID_ARCH"
|
|
||||||
|
|
||||||
# which platform to compile for
|
|
||||||
ANDROID_PLATFORM=android-"$ANDROID_RELEASE"
|
|
||||||
# which disk
|
|
||||||
IMAGE="$ANDROID_IMAGE"
|
|
||||||
|
|
||||||
export PATH="$BUILDTOOLCHAIN"/bin:"$NDK_ROOT":"$SDK_ROOT/tools":"$SDK_ROOT/platform-tools":$PATH
|
|
||||||
|
|
||||||
echo $PATH
|
|
||||||
|
|
||||||
if test -d "$BUILDTOOLCHAIN"
|
|
||||||
then
|
|
||||||
echo using the setup at "$BUILDTOOLCHAIN"
|
|
||||||
else
|
|
||||||
"$NDK_ROOT"/build/tools/make-standalone-toolchain.sh \
|
|
||||||
--platform="$ANDROID_PLATFORM" \
|
|
||||||
--toolchain="$ANDROID_ARCH"-linux-androideabi-"$GCC_VERSION" \
|
|
||||||
--install-dir="$BUILDTOOLCHAIN"
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
mkdir -p $BUILDDROID
|
|
||||||
|
|
||||||
startemulator () {
|
|
||||||
EMS=`ps -ef | grep emulator64| grep -v grep`
|
|
||||||
if test x"$EMS" = x
|
|
||||||
then
|
|
||||||
nohup emulator -avd $IMAGE &
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
androidize () {
|
|
||||||
cd packages/swig
|
|
||||||
mkdir -p "$ANDROID_NDK_ROOT"/build/core/lib
|
|
||||||
make install-android
|
|
||||||
cd ../..
|
|
||||||
}
|
|
||||||
|
|
||||||
cd $BUILDDROID
|
|
||||||
|
|
||||||
export HOST="$ANDROID_ARCH"-linux-androideabi
|
|
||||||
export CPP="$HOST"-cpp
|
|
||||||
export DESTDIR=`pwd`/packages/swig/android
|
|
||||||
export PATH="$PATH":/usr/local/bin
|
|
||||||
|
|
||||||
if test x$1 = xenv
|
|
||||||
then
|
|
||||||
return 0
|
|
||||||
elif test x$1 = xdmake
|
|
||||||
then
|
|
||||||
make
|
|
||||||
elif test x$1 = xmake
|
|
||||||
then
|
|
||||||
pushd packages/swig
|
|
||||||
make clean
|
|
||||||
popd
|
|
||||||
./config.status
|
|
||||||
CFLAGS="-g" make -j install
|
|
||||||
elif test x$1 = xeclipse
|
|
||||||
then
|
|
||||||
startemulator
|
|
||||||
"$ECLIPSE" &
|
|
||||||
return 0
|
|
||||||
else
|
|
||||||
startemulator
|
|
||||||
rm -rf "$BUILDDROID"/*
|
|
||||||
cd "$BUILDDROID"
|
|
||||||
"$YAP_SRC"/configure \
|
|
||||||
--host="$HOST" \
|
|
||||||
--enable-low-level-tracer \
|
|
||||||
--enable-debug-yap \
|
|
||||||
--enable-dynamic-loading \
|
|
||||||
--bindir=/usr/bin \
|
|
||||||
--prefix=/assets \
|
|
||||||
--enable-dynamic-loading \
|
|
||||||
--with-swig \
|
|
||||||
--with-gmp="$GMPDIR" \
|
|
||||||
--with-sqlite3="$SQLITE3DIR"
|
|
||||||
|
|
||||||
#\
|
|
||||||
#--enable-chr=yes #--enable-threads
|
|
||||||
make depend
|
|
||||||
CFLAGS="-g" make -j install
|
|
||||||
fi
|
|
||||||
androidize
|
|
Reference in New Issue
Block a user