diff --git a/build.xml b/build.xml
index 7e36c40c52..ebb7e47700 100644
--- a/build.xml
+++ b/build.xml
@@ -493,6 +493,9 @@
+
+
+
@@ -521,6 +524,7 @@
+
diff --git a/core/java/src/net/i2p/util/NativeBigInteger.java b/core/java/src/net/i2p/util/NativeBigInteger.java
index 4f51584ae4..b1de68e55d 100644
--- a/core/java/src/net/i2p/util/NativeBigInteger.java
+++ b/core/java/src/net/i2p/util/NativeBigInteger.java
@@ -140,6 +140,15 @@ public class NativeBigInteger extends BigInteger {
/** all libjbibi builds are identical to pentium3, case handled in getMiddleName2() */
private final static String JBIGI_OPTIMIZATION_VIAC32 = "viac32";
+ /**
+ * Non-x86, no fallbacks to older libs or to "none"
+ * @since 0.8.7
+ */
+ private final static String JBIGI_OPTIMIZATION_ARM = "arm";
+
+ /**
+ * Operating systems
+ */
private static final boolean _isWin = System.getProperty("os.name").startsWith("Win");
private static final boolean _isOS2 = System.getProperty("os.name").startsWith("OS/2");
private static final boolean _isMac = System.getProperty("os.name").startsWith("Mac");
@@ -164,6 +173,8 @@ public class NativeBigInteger extends BigInteger {
private static final boolean _isX86 = System.getProperty("os.arch").contains("86") ||
System.getProperty("os.arch").equals("amd64");
+ private static final boolean _isArm = System.getProperty("os.arch").startsWith("arm");
+
/* libjbigi.so vs jbigi.dll */
private static final String _libPrefix = (_isWin || _isOS2 ? "" : "lib");
private static final String _libSuffix = (_isWin || _isOS2 ? ".dll" : _isMac ? ".jnilib" : ".so");
@@ -173,12 +184,16 @@ public class NativeBigInteger extends BigInteger {
static {
if (_isX86) // Don't try to resolve CPU type on PPC and other non x86 hardware
sCPUType = resolveCPUType();
+ else if (_isArm)
+ sCPUType = JBIGI_OPTIMIZATION_ARM;
else
sCPUType = null;
loadNative();
}
- /** Tries to resolve the best type of CPU that we have an optimized jbigi-dll/so for.
+ /**
+ * Tries to resolve the best type of CPU that we have an optimized jbigi-dll/so for.
+ * This is for x86 only.
* @return A string containing the CPU-type or null if CPU type is unknown
*/
private static String resolveCPUType() {
@@ -639,10 +654,13 @@ public class NativeBigInteger extends BigInteger {
rv.add(_libPrefix + getMiddleName1() + JBIGI_OPTIMIZATION_ATHLON64 + _libSuffix);
}
}
- // add libjbigi-xxx-none.so
+ // Add libjbigi-xxx-none_64.so
if (_is64)
rv.add(_libPrefix + getMiddleName1() + "none_64" + _libSuffix);
- rv.add(getResourceName(false));
+ // Add libjbigi-xxx-none.so
+ // Note that libjbigi-osx-none.jnilib is a 'fat binary' with both PPC and x86-32
+ if (!_isArm)
+ rv.add(getResourceName(false));
return rv;
}
diff --git a/history.txt b/history.txt
index 15d8d53cd0..4aced4e112 100644
--- a/history.txt
+++ b/history.txt
@@ -1,3 +1,10 @@
+2011-06-14 zzz
+ * Jbigi / NBI / wrapper / installer:
+ jbigi and wrapper files for arm.
+ Compiled on trimslice with gcc version 4.4.5 (Ubuntu/Linaro 4.4.4-14ubuntu5)
+ Log postinstall errors to postinstall.log.
+ * RateStat: final
+
2011-06-13 duck
* Finnish, Italian, Polish and Vietnamese translations, thanks Transifex teams.
diff --git a/installer/lib/jbigi/libjbigi-linux-arm.so b/installer/lib/jbigi/libjbigi-linux-arm.so
new file mode 100644
index 0000000000..00c1234758
Binary files /dev/null and b/installer/lib/jbigi/libjbigi-linux-arm.so differ
diff --git a/installer/lib/wrapper/linux-arm/README.txt b/installer/lib/wrapper/linux-arm/README.txt
new file mode 100644
index 0000000000..ce42dd08ec
--- /dev/null
+++ b/installer/lib/wrapper/linux-arm/README.txt
@@ -0,0 +1,6 @@
+Wrapper build instructions (Ubuntu):
+
+export ANT_HOME=/usr/share/ant
+export JAVA_HOME=/usr/lib/jvm/java-6-openjdk
+cp src/c/Makefile-linux-x86-32.make src/c/Makefile-linux-arm-32.make
+build32.sh
diff --git a/installer/lib/wrapper/linux-arm/i2psvc b/installer/lib/wrapper/linux-arm/i2psvc
new file mode 100644
index 0000000000..e6064c258d
Binary files /dev/null and b/installer/lib/wrapper/linux-arm/i2psvc differ
diff --git a/installer/lib/wrapper/linux-arm/libwrapper.so b/installer/lib/wrapper/linux-arm/libwrapper.so
new file mode 100644
index 0000000000..faccdaab0a
Binary files /dev/null and b/installer/lib/wrapper/linux-arm/libwrapper.so differ
diff --git a/installer/resources/postinstall.sh b/installer/resources/postinstall.sh
index a8882f71ff..9e9216063c 100644
--- a/installer/resources/postinstall.sh
+++ b/installer/resources/postinstall.sh
@@ -23,11 +23,15 @@ chmod 755 ./runplain.sh
# chmod 755 ./uninstall_i2p_service_unix
ERROR_MSG="Cannot determine operating system type. From the subdirectory in lib/wrapper matching your operating system, please move i2psvc to your base I2P directory, and move the remaining two files to the lib directory."
+LOGFILE=./postinstall.log
HOST_OS=`./osid`
-if [ "X$HOST_OS" = "X" -o $HOST_OS = "unknown" ]; then
+if [ "X$HOST_OS" = "X" -o "X$HOST_OS" = "Xunknown" ]; then
echo "$ERROR_MSG"
+ echo "Host OS is $HOST_OS" >> $LOGFILE
+ echo "Host architecture is $OS_ARCH" >> $LOGFILE
+ echo "$ERROR_MSG" >> $LOGFILE
exit 1
fi
@@ -36,7 +40,10 @@ X86_64=`echo "${OS_ARCH}" | grep x86_64`
case $HOST_OS in
debian | fedora | gentoo | linux | mandrake | redhat | suse )
- if [ "X$X86_64" = "X" ]; then
+ if [ `echo $OS_ARCH |grep arm` ]; then
+ wrapperpath="./lib/wrapper/linux-arm"
+ cp ${wrapperpath}/libwrapper.so ./lib/
+ elif [ "X$X86_64" = "X" ]; then
wrapperpath="./lib/wrapper/linux"
cp ${wrapperpath}/libwrapper.so ./lib/
else
@@ -47,7 +54,7 @@ case $HOST_OS in
fi
;;
freebsd )
- if [ ! `uname -m |grep amd64` ]; then
+ if [ ! `echo $OS_ARCH | grep amd64` ]; then
wrapperpath="./lib/wrapper/freebsd"
cp ${wrapperpath}/libwrapper.so ./lib/
else
@@ -67,6 +74,9 @@ case $HOST_OS in
;;
* )
echo "${ERROR_MSG}"
+ echo "Host OS is $HOST_OS" >> $LOGFILE
+ echo "Host architecture is $OS_ARCH" >> $LOGFILE
+ echo "$ERROR_MSG" >> $LOGFILE
exit 1
;;
esac
diff --git a/router/java/src/net/i2p/router/RouterVersion.java b/router/java/src/net/i2p/router/RouterVersion.java
index 5f540c84e1..3388ca8193 100644
--- a/router/java/src/net/i2p/router/RouterVersion.java
+++ b/router/java/src/net/i2p/router/RouterVersion.java
@@ -18,7 +18,7 @@ public class RouterVersion {
/** deprecated */
public final static String ID = "Monotone";
public final static String VERSION = CoreVersion.VERSION;
- public final static long BUILD = 26;
+ public final static long BUILD = 27;
/** for example "-test" */
public final static String EXTRA = "";