diff --git a/core/java/src/net/i2p/util/NativeBigInteger.java b/core/java/src/net/i2p/util/NativeBigInteger.java index d90ca32c27..0b2fae5e3d 100644 --- a/core/java/src/net/i2p/util/NativeBigInteger.java +++ b/core/java/src/net/i2p/util/NativeBigInteger.java @@ -147,6 +147,7 @@ public class NativeBigInteger extends BigInteger { * @since 0.8.7 */ private final static String JBIGI_OPTIMIZATION_ARM = "arm"; + private final static String JBIGI_OPTIMIZATION_PPC = "ppc"; /** * Operating systems @@ -177,6 +178,8 @@ public class NativeBigInteger extends BigInteger { private static final boolean _isArm = System.getProperty("os.arch").startsWith("arm"); + private static final boolean _isPPC = System.getProperty("os.arch").contains("ppc"); + /* libjbigi.so vs jbigi.dll */ private static final String _libPrefix = (_isWin || _isOS2 ? "" : "lib"); private static final String _libSuffix = (_isWin || _isOS2 ? ".dll" : _isMac ? ".jnilib" : ".so"); @@ -184,10 +187,12 @@ public class NativeBigInteger extends BigInteger { private final static String sCPUType; //The CPU Type to optimize for (one of the above strings) static { - if (_isX86) // Don't try to resolve CPU type on PPC and other non x86 hardware + if (_isX86) // Don't try to resolve CPU type on non x86 hardware sCPUType = resolveCPUType(); else if (_isArm) sCPUType = JBIGI_OPTIMIZATION_ARM; + else if (_isPPC && !_isMac) + sCPUType = JBIGI_OPTIMIZATION_PPC; else sCPUType = null; loadNative(); @@ -690,7 +695,7 @@ public class NativeBigInteger extends BigInteger { rv.add(_libPrefix + getMiddleName1() + "none_64" + _libSuffix); // Add libjbigi-xxx-none.so // Note that libjbigi-osx-none.jnilib is a 'fat binary' with both PPC and x86-32 - if (!_isArm) + if ((!_isArm) || (!_isPPC && !_isMac)) rv.add(getResourceName(false)); return rv; } diff --git a/installer/lib/jbigi/libjbigi-linux-ppc.so b/installer/lib/jbigi/libjbigi-linux-ppc.so new file mode 100644 index 0000000000..97ab0b3836 Binary files /dev/null and b/installer/lib/jbigi/libjbigi-linux-ppc.so differ diff --git a/installer/resources/postinstall.sh b/installer/resources/postinstall.sh index 4345fbe842..64b833053f 100644 --- a/installer/resources/postinstall.sh +++ b/installer/resources/postinstall.sh @@ -46,6 +46,9 @@ case $HOST_OS in elif [ `echo $OS_ARCH |grep arm` ]; then wrapperpath="./lib/wrapper/linux-armv5" cp ${wrapperpath}/libwrapper.so ./lib/ + elif [ `echo $OS_ARCH |grep ppc` ]; then + wrapperpath="./lib/wrapper/linux-ppc" + cp ${wrapperpath}/libwrapper.so ./lib/ elif [ "X$X86_64" = "X" ]; then wrapperpath="./lib/wrapper/linux" cp ${wrapperpath}/libwrapper.so ./lib/