I2P Address: [http://git.idk.i2p]

Skip to content
Snippets Groups Projects
Commit 47215495 authored by kytv's avatar kytv
Browse files

add patch from ticket #1103, consistency fixes, remove some unneeded bashisms,...

add patch from ticket #1103, consistency fixes, remove some unneeded bashisms, set proper JAVA_HOME on OSX
parent 9e45f199
No related branches found
No related tags found
No related merge requests found
...@@ -41,8 +41,8 @@ I2PBASE=${1:-../../../i2p.i2p} ...@@ -41,8 +41,8 @@ I2PBASE=${1:-../../../i2p.i2p}
#export NDK=$(realpath ../../android-ndk-r5b/) #export NDK=$(realpath ../../android-ndk-r5b/)
## Simple fix for osx development ## Simple fix for osx development
if [ "`uname -s`" == "Darwin" ]; then if [ `uname -s` = "Darwin" ]; then
export NDK=/Developer/android/ndk/ export NDK="/Developer/android/ndk/"
else else
export NDK="`readlink -n -e $(for last in ../../android-ndk-r*/.; do true; done ; echo $last)`" export NDK="`readlink -n -e $(for last in ../../android-ndk-r*/.; do true; done ; echo $last)`"
fi fi
...@@ -50,15 +50,17 @@ fi ...@@ -50,15 +50,17 @@ fi
# API level, must match that in ../AndroidManifest.xml # API level, must match that in ../AndroidManifest.xml
# #
LEVEL=8 LEVEL=8
ARCH=arm ARCH="arm"
export SYSROOT=$NDK/platforms/android-$LEVEL/arch-$ARCH/ export SYSROOT="$NDK/platforms/android-$LEVEL/arch-$ARCH/"
export AABI=arm-linux-androideabi-4.4.3 export AABI="arm-linux-androideabi-4.4.3"
if [ "`uname -s`" == "Darwin" ]; then if [ `uname -s` = "Darwin" ]; then
export SYSTEM=darwin-x86 export SYSTEM="darwin-x86"
elif [ `uname -m` = "x86_64" ]; then
export SYSTEM="linux-x86_64"
else else
export SYSTEM=linux-x86 export SYSTEM="linux-x86"
fi fi
export BINPREFIX=arm-linux-androideabi- export BINPREFIX="arm-linux-androideabi-"
export CC="$NDK/toolchains/$AABI/prebuilt/$SYSTEM/bin/${BINPREFIX}gcc --sysroot=$SYSROOT" export CC="$NDK/toolchains/$AABI/prebuilt/$SYSTEM/bin/${BINPREFIX}gcc --sysroot=$SYSROOT"
# worked without this on 4.3.2, but 5.0.2 couldn't find it # worked without this on 4.3.2, but 5.0.2 couldn't find it
export NM="$NDK/toolchains/$AABI/prebuilt/$SYSTEM/bin/${BINPREFIX}nm" export NM="$NDK/toolchains/$AABI/prebuilt/$SYSTEM/bin/${BINPREFIX}nm"
...@@ -78,13 +80,12 @@ JBIGI="$I2PBASE/core/c/jbigi" ...@@ -78,13 +80,12 @@ JBIGI="$I2PBASE/core/c/jbigi"
# jbigi about 20-25% slower than java on emulator # jbigi about 20-25% slower than java on emulator
# #
GMPVER=4.3.2 GMPVER=4.3.2
GMP=$JBIGI/gmp-$GMPVER GMP="$JBIGI/gmp-$GMPVER"
if [ ! -d $GMP ] if [ ! -d "$GMP" ]; then
then echo "Source dir for GMP version $GMPVER not found in $GMP"
echo "Source dir for GMP version $GMPVER not found in $GMP" echo "Install it there or change GMPVER and/or GMP in this script"
echo "Install it there or change GMPVER and/or GMP in this script" exit 1
exit 1
fi fi
mkdir -p build mkdir -p build
...@@ -93,25 +94,24 @@ cd build ...@@ -93,25 +94,24 @@ cd build
# we must set both build and host, so that the configure # we must set both build and host, so that the configure
# script will set cross_compile=yes, so that it # script will set cross_compile=yes, so that it
# won't attempt to run the a.out files # won't attempt to run the a.out files
if [ ! -f config.status ] if [ ! -f config.status ]; then
then echo "Configuring GMP..."
echo "Configuring GMP..." if [ `uname -s` = "Darwin" ]; then
if [ "`uname -s`" == "Darwin" ]; then $GMP/configure --with-pic --build=x86-darwin --host=armv5-eabi-linux || exit 1
$GMP/configure --with-pic --build=x86-darwin --host=armv5-eabi-linux || exit 1
else else
$GMP/configure --with-pic --build=x86-none-linux --host=armv5-eabi-linux || exit 1 $GMP/configure --with-pic --build=x86-none-linux --host=armv5-eabi-linux || exit 1
fi fi
fi fi
echo "Building GMP..." echo "Building GMP..."
make || exit 1 make || exit 1
if [ "`uname -s`" == "Darwin" ]; then if [ `uname -s` = "Darwin" ]; then
# Depends on version export JAVA_HOME=$(/usr/libexec/java_home)
# TODO: Fix something for finding the newest jdk and set it as home.
export JAVA_HOME="/Library/Java/JavaVirtualMachines/1.7.0.jdk/Contents/Home/"
else else
export JAVA_HOME=$(dirname $(dirname $(realpath $(which javac)))) # FIXME This will not work everywhere (e.g. BSD). Could borrow my
# 'find-java-home' script for this
export JAVA_HOME="$(dirname $(dirname $(realpath $(which javac))))"
fi fi
if [ ! -f "$JAVA_HOME/include/jni.h" ]; then if [ ! -f "$JAVA_HOME/include/jni.h" ]; then
echo "Cannot find jni.h! Looked in '$JAVA_HOME/include/jni.h'" echo "Cannot find jni.h! Looked in '$JAVA_HOME/include/jni.h'"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment