diff --git a/core/java/src/net/i2p/util/NativeBigInteger.java b/core/java/src/net/i2p/util/NativeBigInteger.java index ef3844ecf..975775594 100644 --- a/core/java/src/net/i2p/util/NativeBigInteger.java +++ b/core/java/src/net/i2p/util/NativeBigInteger.java @@ -102,6 +102,14 @@ public class NativeBigInteger extends BigInteger { private static boolean _doLog = System.getProperty("jbigi.dontLog") == null && I2PAppContext.getGlobalContext().isRouterContext(); + /** + * The following libraries are be available in jbigi.jar in all I2P versions + * originally installed as release 0.6.1.10 or later (released 2006-01-16), + * for linux, freebsd, and windows, EXCEPT: + * - k63 was removed for linux and freebsd in 0.8.7 (identical to k62) + * - athlon64 not available for freebsd + * - viac3 not available for windows + */ private final static String JBIGI_OPTIMIZATION_K6 = "k6"; private final static String JBIGI_OPTIMIZATION_K6_2 = "k62"; private final static String JBIGI_OPTIMIZATION_K6_3 = "k63"; @@ -165,6 +173,9 @@ public class NativeBigInteger extends BigInteger { } catch (UnknownCPUException e) { // log? } + if (_isFreebsd) + // athlon64 not available for freebsd + return JBIGI_OPTIMIZATION_ATHLON; return JBIGI_OPTIMIZATION_ATHLON64; } @@ -456,6 +467,7 @@ public class NativeBigInteger extends BigInteger { private static final boolean loadGeneric(boolean optimized) { return loadGeneric(getMiddleName(optimized)); } + private static final boolean loadGeneric(String name) { try { if(name == null) @@ -491,6 +503,7 @@ public class NativeBigInteger extends BigInteger { String resourceName = getResourceName(optimized); return loadFromResource(resourceName); } + private static final boolean loadFromResource(String resourceName) { if (resourceName == null) return false; //URL resource = NativeBigInteger.class.getClassLoader().getResource(resourceName); @@ -523,12 +536,16 @@ public class NativeBigInteger extends BigInteger { + " was not a valid library for this platform"); ule.printStackTrace(); } + if (outFile != null) + outFile.delete(); return false; } catch (IOException ioe) { if (_doLog) { System.err.println("ERROR: Problem writing out the temporary native library data"); ioe.printStackTrace(); } + if (outFile != null) + outFile.delete(); return false; } finally { if (fos != null) { @@ -567,6 +584,8 @@ public class NativeBigInteger extends BigInteger { else if (sCPUType.equals(JBIGI_OPTIMIZATION_VIAC32)) // viac32 and pentium3 identical sAppend = "-" + JBIGI_OPTIMIZATION_PENTIUM3; + //else if (sCPUType.equals(JBIGI_OPTIMIZATION_VIAC3) && _isWin) + // FIXME no viac3 available for windows, what to use instead? else sAppend = "-" + sCPUType; } else { diff --git a/history.txt b/history.txt index 7fdc3d250..2f6a80d0a 100644 --- a/history.txt +++ b/history.txt @@ -1,6 +1,9 @@ 2011-05-25 zzz * CPUID: Load 64-bit libcpuid if available * HTTP Proxy: Address helper refactoring, address book add form + * JBigI: + - Start updating NativeBigInteger + - Remove k63 libs that are dup of k62; handle in NBI * Naming: B32 fixes * NetDB: Increase floodfills again diff --git a/router/java/src/net/i2p/router/RouterVersion.java b/router/java/src/net/i2p/router/RouterVersion.java index fecba78d6..a6204817e 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 = 7; + public final static long BUILD = 8; /** for example "-test" */ public final static String EXTRA = "";