[freenet-cvs] r18389 - in trunk/freenet/src/freenet/support: . io

nextgens at freenetproject.org nextgens at freenetproject.org
Thu Mar 6 15:31:37 UTC 2008


Author: nextgens
Date: 2008-03-06 15:31:37 +0000 (Thu, 06 Mar 2008)
New Revision: 18389

Modified:
   trunk/freenet/src/freenet/support/LibraryLoader.java
   trunk/freenet/src/freenet/support/io/NativeThread.java
Log:
Tweak NativeThread to toad the library on MacOs as well

Modified: trunk/freenet/src/freenet/support/LibraryLoader.java
===================================================================
--- trunk/freenet/src/freenet/support/LibraryLoader.java	2008-03-06 14:51:09 UTC (rev 18388)
+++ trunk/freenet/src/freenet/support/LibraryLoader.java	2008-03-06 15:31:37 UTC (rev 18389)
@@ -35,7 +35,7 @@
 		final boolean isWindows = File.pathSeparatorChar == '\\';
 		final String libraryNameWithPrefix = (isWindows ? "" : "lib") + libraryName;
 		final String libraryNameWithPrefixAndArch = libraryNameWithPrefix + '-' + getSimplifiedArchitecture();
-		final String libraryNameWithPrefixAndArchAndSuffix = libraryNameWithPrefixAndArch + (isWindows ? ".dll" : ".so");
+		final String libraryNameWithPrefixAndArchAndSuffix = libraryNameWithPrefixAndArch + (isWindows ? ".dll" : ((System.getProperty("os.name")).toLowerCase().startsWith("mac") ? ".jnilib" : ".so"));
 		String resourceName = path + libraryNameWithPrefixAndArchAndSuffix;
 
 		File nativeLib = new File((System.getProperty("java.library.path")) + "/lib" + libraryName + (isWindows ? ".dll" : ".so"));

Modified: trunk/freenet/src/freenet/support/io/NativeThread.java
===================================================================
--- trunk/freenet/src/freenet/support/io/NativeThread.java	2008-03-06 14:51:09 UTC (rev 18388)
+++ trunk/freenet/src/freenet/support/io/NativeThread.java	2008-03-06 15:31:37 UTC (rev 18389)
@@ -4,6 +4,7 @@
 
 package freenet.support.io;
 
+import java.io.File;
 import freenet.node.NodeStarter;
 import freenet.support.LibraryLoader;
 import freenet.support.Logger;
@@ -37,7 +38,7 @@
 	
 	static {
 		Logger.minor(NativeThread.class, "Running init()");
-		_loadNative = "Linux".equalsIgnoreCase(System.getProperty("os.name")) && NodeStarter.extBuildNumber > 18;
+		_loadNative = !(File.pathSeparatorChar == '\\') && NodeStarter.extBuildNumber > 18;
 		if(_loadNative) {
 			//System.loadLibrary("NativeThread");
 			LibraryLoader.loadNative("/freenet/support/io/", "NativeThread");




More information about the cvs mailing list