Compare commits

...

6 Commits

Author SHA1 Message Date
163bc2ce58 only build router once 2014-02-27 02:58:59 +00:00
97f52f8139 remove res/raw/license_fatcowicons_txt in the clean target 2014-02-27 01:45:00 +00:00
0094cc5637 Only build the router.....when building (ticket #1214) 2014-02-27 01:31:52 +00:00
01c994e7b2 fix tag 2014-02-27 01:30:07 +00:00
b60ae00fd7 19 isn't a valid target anymore; it's now android-19 2014-02-26 23:50:28 +00:00
zzz
a91261f5ca JNI Build:
- Update JNI build script to use GCC 4.6, required for
   NDK r9b and higher (ticket #1202)
 - Add more checks in build script, to fail quicker on problems
 - Move default NDK build location up one directory level
 - Fix setting JAVA_HOME
 - Fixes for running script in the directory

 I did not replace the checked-in 4.4.3 libjbigi.so with
 the new 4.6 version, as there's no need.
 The 4.6 version will be tested by nextloop in the F-Droid build.
2014-02-23 16:40:47 +00:00
4 changed files with 79 additions and 52 deletions

View File

@ -60,7 +60,7 @@ Instructions:
# Create the android 4.4 (API 19) virtual device # Create the android 4.4 (API 19) virtual device
# (don't make a custom hardware profile) # (don't make a custom hardware profile)
../android-sdk-linux/tools/android create avd --name i2p --target 19 ../android-sdk-linux/tools/android create avd --name i2p --target android-19
# then run the emulator: # then run the emulator:
# This may take a LONG time the first time (half an hour or more)... # This may take a LONG time the first time (half an hour or more)...

View File

@ -364,17 +364,6 @@
<property name="version.name" value="${my.version.name}" /> <property name="version.name" value="${my.version.name}" />
<echo message="version.code '${version.code}', 'version.name '${version.name}', '${my.version.name}'" /> <echo message="version.code '${version.code}', 'version.name '${version.name}', '${my.version.name}'" />
<!-- If we are missing any jars, we _MUST_ make them ahead of time so
the build does not fail! _HOWEVER_ we must only do this if we are
_BUILDING_! Apache Ant does not allow us to know what target we are
about to run, because the authors believe it is 'evil' and other
nonsense. So for now (so sorry!) we force build it ahead of time
always, no matter what target was selected, until some better way
of resolving this issue apears.
-->
<ant dir="routerjars" inheritall="false" useNativeBasedir="true" >
<target name="buildrouter" />
</ant>
<!-- <!--
================================================================================ ================================================================================
New I2P rules New I2P rules
@ -394,12 +383,9 @@
<!-- overrides of those in main_rules.xml --> <!-- overrides of those in main_rules.xml -->
<target name="-pre-build" depends="copy-i2p-resources" > <target name="-pre-build" depends="copy-i2p-resources" >
<!-- aapt messes up when resources are added or deleted, just build every time <ant dir="routerjars" inheritall="false" useNativeBasedir="true" >
<delete dir="${gen.absolute.dir}/net" verbose="${verbose}" /> <target name="buildrouter" />
--> </ant>
<!-- screw it, do the classes too, until I add the depend class
<delete dir="${out.absolute.dir}/classes/net" verbose="${verbose}" />
-->
</target> </target>
<!-- <!--
@ -423,17 +409,8 @@
<copy file="LICENSE.txt" tofile="res/raw/license_app_txt" /> <copy file="LICENSE.txt" tofile="res/raw/license_app_txt" />
<copy file="licenses/LICENSE-Apache2.0.txt" tofile="res/raw/license_apache20_txt" /> <copy file="licenses/LICENSE-Apache2.0.txt" tofile="res/raw/license_apache20_txt" />
<copy file="${i2pbase}/installer/resources/themes/console/images/i2plogo.png" todir="res/drawable/" /> <copy file="${i2pbase}/installer/resources/themes/console/images/i2plogo.png" todir="res/drawable/" />
<!--
<!-- Static web sources should be in the assets directory. -->
No, no, no. Wrong, wrong, wrong. Static web sources should be in
the assets directory.
<copy file="${i2pbase}/installer/resources/themes/console/images/outbound.png" todir="res/drawable/" />
<copy file="${i2pbase}/installer/resources/themes/console/images/inbound.png" todir="res/drawable/" />
<copy file="${i2pbase}/installer/resources/themes/console/light/images/header.png" todir="res/drawable/" />
<copy file="${i2pbase}/installer/resources/themes/console/light/console.css" tofile="res/drawable/console_css" />
-->
<copy file="${i2pbase}/installer/resources/themes/console/images/i2plogo.png" todir="assets/themes/console/images/" /> <copy file="${i2pbase}/installer/resources/themes/console/images/i2plogo.png" todir="assets/themes/console/images/" />
<copy file="${i2pbase}/installer/resources/themes/console/images/outbound.png" todir="assets/themes/console/images/" /> <copy file="${i2pbase}/installer/resources/themes/console/images/outbound.png" todir="assets/themes/console/images/" />
<copy file="${i2pbase}/installer/resources/themes/console/images/inbound.png" todir="assets/themes/console/images/" /> <copy file="${i2pbase}/installer/resources/themes/console/images/inbound.png" todir="assets/themes/console/images/" />
@ -493,13 +470,14 @@
<delete file="res/raw/license_gplv2_txt" /> <delete file="res/raw/license_gplv2_txt" />
<delete file="res/raw/license_gplv3_txt" /> <delete file="res/raw/license_gplv3_txt" />
<delete file="res/raw/license_lgplv3_txt" /> <delete file="res/raw/license_lgplv3_txt" />
<delete file="res/raw/license_fatcowicons_txt" />
<delete file="res/raw/certificates_zip" /> <delete file="res/raw/certificates_zip" />
</target> </target>
<target name="distclean" depends="clean"> <target name="distclean" depends="clean">
<ant dir="routerjars" inheritall="false" useNativeBasedir="true" > <ant dir="routerjars" inheritall="false" useNativeBasedir="true" >
<target name="distclean" /> <target name="distclean" />
</ant> </ant>
<delete file="scripts/build.number" verbose="${verbose}" /> <delete file="scripts/build.number" verbose="${verbose}" />
<delete file="scripts/version.properties" verbose="${verbose}" /> <delete file="scripts/version.properties" verbose="${verbose}" />
<delete file="AndroidManifest.xml" verbose="${verbose}" /> <delete file="AndroidManifest.xml" verbose="${verbose}" />

View File

@ -38,14 +38,28 @@
<!-- new rules --> <!-- new rules -->
<target name="buildrouter" depends="-dirs" >
<!-- build router and core --> <available property="have.router" file="${i2pbase}/build/router.jar" />
<ant dir="${i2pbase}" inheritall="false" useNativeBasedir="true" > <available property="have.bob" file="${i2pbase}/apps/BOB/dist/BOB.jar" />
<target name="buildRouter" /> <available property="have.i2ptunnel" file="${i2pbase}/apps/i2ptunnel/java/build/i2ptunnel.jar" />
<target name="buildI2PTunnelJar" /> <available property="have.addressbook" file="${i2pbase}/apps/addressbook/build" />
<target name="buildAddressbook" />
<target name="buildBOB" /> <target name="buildRouter" unless="have.router">
</ant> <ant dir="${i2pbase}" inheritall="false" useNativeBasedir="true" target="buildRouter" />
</target>
<target name="buildI2PTunnelJar" unless="have.i2ptunnel">
<ant dir="${i2pbase}" inheritall="false" useNativeBasedir="true" target="buildI2PTunnelJar" />
</target>
<target name="buildAddressbook" unless="have.addressbook">
<ant dir="${i2pbase}" inheritall="false" useNativeBasedir="true" target="buildAddressbook" />
</target>
<target name="buildBOB" unless="have.bob">
<ant dir="${i2pbase}" inheritall="false" useNativeBasedir="true" target="buildBOB" />
</target>
<target name="buildrouter" depends="-dirs, buildRouter, buildI2PTunnelJar, buildAddressbook, buildBOB">
<!-- router --> <!-- router -->
<copy file="${i2pbase}/build/router.jar" todir="${jar.libs.dir}" /> <copy file="${i2pbase}/build/router.jar" todir="${jar.libs.dir}" />
@ -61,7 +75,7 @@
<exclude name="net/i2p/util/SecureDirectory.class" /> <exclude name="net/i2p/util/SecureDirectory.class" />
<exclude name="net/i2p/util/SecureFile.class" /> <exclude name="net/i2p/util/SecureFile.class" />
<exclude name="net/i2p/util/SecureFileOutputStream.class" /> <exclude name="net/i2p/util/SecureFileOutputStream.class" />
</zipfileset > </zipfileset>
</jar> </jar>
<!-- i2ptunnel --> <!-- i2ptunnel -->
@ -70,7 +84,7 @@
<jar destfile="${jar.libs.dir}/i2ptunnel.jar" > <jar destfile="${jar.libs.dir}/i2ptunnel.jar" >
<zipfileset src="${i2pbase}/apps/i2ptunnel/java/build/i2ptunnel.jar" > <zipfileset src="${i2pbase}/apps/i2ptunnel/java/build/i2ptunnel.jar" >
<exclude name="net/i2p/i2ptunnel/I2PTunnelGUI.class" /> <exclude name="net/i2p/i2ptunnel/I2PTunnelGUI.class" />
</zipfileset > </zipfileset>
</jar> </jar>
<!-- addressbook - make a jar, it's a war in the i2p distro --> <!-- addressbook - make a jar, it's a war in the i2p distro -->
@ -91,7 +105,8 @@
<target name="distclean" depends="clean"> <target name="distclean" depends="clean">
<delete dir="${jar.libs.dir}" verbose="${verbose}" /> <delete dir="${jar.libs.dir}" verbose="${verbose}" />
<delete dir="jni/build/" verbose="${verbose}" /> <delete dir="jni/build/" verbose="${verbose}" />
<delete file="AndroidManifest.xml" verbose="${verbose}" /> <delete file="AndroidManifest.xml" verbose="${verbose}" />
<ant dir="${i2pbase}" target="distclean" />
</target> </target>
</project> </project>

View File

@ -2,6 +2,8 @@
# #
# build GMP and libjbigi.so using the Android tools directly # build GMP and libjbigi.so using the Android tools directly
# #
# TODO: Get more settings from environment variables set in ../custom-rules.xml
#
# uncomment to skip # uncomment to skip
# exit 0 # exit 0
@ -31,28 +33,56 @@ then
exit 0 exit 0
fi fi
I2PBASE=${1:-../../../i2p.i2p} I2PBASE=${1:-$THISDIR/../../../i2p.i2p}
# #
# Wrong again. We want to be able to not have to update this script # We want to be able to not have to update this script
# every time a new NDK comes out. We solve this by using readlink with # every time a new NDK comes out. We solve this by using readlink with
# a wild card, deglobbing automatically sorts to get the highest revision. # a wild card, deglobbing automatically sorts to get the highest revision.
# the dot at the end ensures that it is a directory, and not a file. # the dot at the end ensures that it is a directory, and not a file.
# #
#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)`" NDK_GLOB=$THISDIR/'../../../android-ndk-r*/.'
export NDK="`readlink -n -e $(for last in $NDK_GLOB; do true; done ; echo $last)`"
fi fi
if [ "$NDK" == "" ]; then
echo "Cannot find NDK in $NDK_GLOB, install it or adjust NDK_GLOB in script"
exit 1
fi
if [ ! -d "$NDK" ]; then
echo "Cannot find NDK in $NDK, install it"
exit 1
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" if [ ! -d "$SYSROOT" ]; then
echo "Cannot find $SYSROOT in NDK, check for support of level: $LEVEL arch: $ARCH or adjust LEVEL and ARCH in script"
exit 1
fi
#
# 4.6 is the GCC version. GCC 4.4.3 support was removed in NDK r9b.
# Available in r9b:
# arm-linux-androideabi-4.6
# arm-linux-androideabi-4.8
# arm-linux-androideabi-clang3.3
# llvm-3.3
# mipsel-linux-android-4.6
# mipsel-linux-android-4.8
# mipsel-linux-android-clang3.3
# x86-4.6
# x86-4.8
# x86-clang3.3
export AABI="arm-linux-androideabi-4.6"
if [ `uname -s` = "Darwin" ]; then if [ `uname -s` = "Darwin" ]; then
export SYSTEM="darwin-x86" export SYSTEM="darwin-x86"
elif [ `uname -m` = "x86_64" ]; then elif [ `uname -m` = "x86_64" ]; then
@ -60,8 +90,14 @@ elif [ `uname -m` = "x86_64" ]; then
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" COMPILER="$NDK/toolchains/$AABI/prebuilt/$SYSTEM/bin/${BINPREFIX}gcc"
if [ ! -f "$COMPILER" ]; then
echo "Cannot find compiler $COMPILER in NDK, check for support of system: $SYSTEM ABI: $AABI or adjust AABI and SYSTEM in script"
exit 1
fi
export CC="$COMPILER --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"
STRIP="$NDK/toolchains/$AABI/prebuilt/$SYSTEM/bin/${BINPREFIX}strip" STRIP="$NDK/toolchains/$AABI/prebuilt/$SYSTEM/bin/${BINPREFIX}strip"
@ -109,9 +145,7 @@ make || exit 1
if [ `uname -s` = "Darwin" ]; then if [ `uname -s` = "Darwin" ]; then
export JAVA_HOME=$(/usr/libexec/java_home) export JAVA_HOME=$(/usr/libexec/java_home)
else else
# FIXME This will not work everywhere (e.g. BSD). Could borrow my [ -z $JAVA_HOME ] && . $I2PBASE/core/c/find-java-home
# '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'"