Author: tommy
Date: 2008-02-28 19:03:35 +0000 (Thu, 28 Feb 2008)
New Revision: 18220
Modified:
trunk/freenet/src/freenet/support/LibraryLoader.java
Log:
add support for external libs
Modified: trunk/freenet/src/freenet/support/LibraryLoader.java
===================================================================
--- trunk/freenet/src/freenet/support/LibraryLoader.java 2008-02-28
19:02:33 UTC (rev 18219)
+++ trunk/freenet/src/freenet/support/LibraryLoader.java 2008-02-28
19:03:35 UTC (rev 18220)
@@ -38,6 +38,11 @@
final String libraryNameWithPrefixAndArchAndSuffix =
libraryNameWithPrefixAndArch + (isWindows ? ".dll" : ".so");
String resourceName = path +
libraryNameWithPrefixAndArchAndSuffix;
+ File nativeLib = new
File((System.getProperty("java.library.path")) + "/lib" + libraryName +
(isWindows ? ".dll" : ".so"));
+ if (nativeLib.exists()) {
+ System.out.println("Attempting to load the NativeThread
library ["+libraryName+']');
+ System.loadLibrary(libraryName);
+ } else {
try {
// Get the resource
URL resource =
LibraryLoader.class.getResource(resourceName);
@@ -65,5 +70,6 @@
} catch(Throwable e) {
e.printStackTrace();
}
+ }
}
}