Replace .jnilib with .dylib on OS X with JDK 6. Resolve #100
This commit is contained in:
parent
45678633f9
commit
8cdaf59905
|
@ -319,6 +319,21 @@ public class LWJGLUtil {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Wraps {@link System#mapLibraryName}. On OS X with JDK 6, the .jnilib file
|
||||||
|
* extension will be replaced with .dylib.
|
||||||
|
*
|
||||||
|
* @param name the name of the library.
|
||||||
|
*
|
||||||
|
* @return a platform-dependent native library name.
|
||||||
|
*/
|
||||||
|
public static String mapLibraryName(String name) {
|
||||||
|
String libName = System.mapLibraryName(name);
|
||||||
|
return LWJGLUtil.getPlatform() == LWJGLUtil.PLATFORM_MACOSX && libName.endsWith(".jnilib")
|
||||||
|
? libName.substring(0, libName.length() - ".jnilib".length()) + ".dylib"
|
||||||
|
: libName;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Locates the paths required by a library.
|
* Locates the paths required by a library.
|
||||||
*
|
*
|
||||||
|
@ -421,7 +436,7 @@ public class LWJGLUtil {
|
||||||
*/
|
*/
|
||||||
private static String getPathFromClassLoader(final String libname, final ClassLoader classloader) {
|
private static String getPathFromClassLoader(final String libname, final ClassLoader classloader) {
|
||||||
Class<?> c = null;
|
Class<?> c = null;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
log("getPathFromClassLoader: searching for: " + libname);
|
log("getPathFromClassLoader: searching for: " + libname);
|
||||||
c = classloader.getClass();
|
c = classloader.getClass();
|
||||||
|
|
|
@ -67,8 +67,7 @@ public final class Sys {
|
||||||
public Object run() {
|
public Object run() {
|
||||||
String library_path = System.getProperty("org.lwjgl.librarypath");
|
String library_path = System.getProperty("org.lwjgl.librarypath");
|
||||||
if (library_path != null) {
|
if (library_path != null) {
|
||||||
System.load(library_path + File.separator +
|
System.load(library_path + File.separator + LWJGLUtil.mapLibraryName(lib_name));
|
||||||
System.mapLibraryName(lib_name));
|
|
||||||
} else {
|
} else {
|
||||||
System.loadLibrary(lib_name);
|
System.loadLibrary(lib_name);
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,6 +31,8 @@
|
||||||
*/
|
*/
|
||||||
package org.lwjgl.util.applet;
|
package org.lwjgl.util.applet;
|
||||||
|
|
||||||
|
import org.lwjgl.LWJGLUtil;
|
||||||
|
|
||||||
import java.applet.Applet;
|
import java.applet.Applet;
|
||||||
import java.applet.AppletStub;
|
import java.applet.AppletStub;
|
||||||
import java.awt.BorderLayout;
|
import java.awt.BorderLayout;
|
||||||
|
@ -1219,7 +1221,7 @@ public class AppletLoader extends Applet implements Runnable, AppletStub {
|
||||||
|
|
||||||
// allow non lwjgl native to be found from cache directory
|
// allow non lwjgl native to be found from cache directory
|
||||||
protected String findLibrary (String libname) {
|
protected String findLibrary (String libname) {
|
||||||
String libPath = path + "natives" + File.separator + System.mapLibraryName(libname);
|
String libPath = path + "natives" + File.separator + LWJGLUtil.mapLibraryName(libname);
|
||||||
|
|
||||||
if (new File(libPath).exists()) {
|
if (new File(libPath).exists()) {
|
||||||
return libPath;
|
return libPath;
|
||||||
|
|
Loading…
Reference in New Issue