Commit a4666025 authored by Florian Hölzl's avatar Florian Hölzl

Moved libraries to match com.microsoft.z3 setup. 32-bit OS X not supported anymore.

refs 2456
parent 26f4b7d5
......@@ -28,9 +28,9 @@ Export-Package: org.fortiss.tooling.graphicsGL.ui,
org.newdawn.slick.util
Bundle-ClassPath: lib/lwjgl.jar,
.
Bundle-NativeCode: lib/liblwjgl.so ; lib/libjemalloc.so ; osname = linux ; processor = x86_64,
lib/liblwjgl32.so ; lib/libjemalloc32.so ; osname = linux ; processor = x86,
lib/liblwjgl.dylib ; lib/libjemalloc.dylib ; osname = macosx ; processor = x86_64,
lib/lwjgl.dll ; lib/jemalloc.dll ; osname = win32 ; processor = x86_64 ; osname = Windows 8 ; osname = Windows8 ; osname = Win8 ; osname = Windows 8.1 ; osname = Windows8.1 ; osname = Win8.1 ; ; processor = x86_64,
lib/lwjgl32.dll ; lib/jemalloc32.dll ; osname = win32 ; processor = x86
Bundle-NativeCode: lib/x64/liblwjgl.so ; lib/x64/libjemalloc.so ; osname = linux ; processor = x86_64,
lib/x32/liblwjgl32.so ; lib/x32/libjemalloc32.so ; osname = linux ; processor = x86,
lib/x64/liblwjgl.dylib ; lib/x64/libjemalloc.dylib ; osname = macosx ; processor = x86_64,
lib/x64/lwjgl.dll ; lib/x64/jemalloc.dll ; osname = win32 ; processor = x86_64 ; osname = Windows 8 ; osname = Windows8 ; osname = Win8 ; osname = Windows 8.1 ; osname = Windows8.1 ; osname = Win8.1 ; ; processor = x86_64,
lib/x32/lwjgl32.dll ; lib/x32/jemalloc32.dll ; osname = win32 ; processor = x86
Eclipse-BundleShape: dir
......@@ -50,22 +50,37 @@ public class ToolingGraphicsGLUIActivator extends AbstractUIPlugin {
System.out.println("Preloading native LWJGL libraries.");
boolean is64bit;
if(System.getProperty("os.name").contains("Windows")) {
is64bit = (System.getenv("ProgramFiles(x86)") != null);
} else {
is64bit = (System.getProperty("os.arch").indexOf("64") != -1);
}
// preload JEMALLOC
String jemallocLibPath = loadPluginLocalLibrary(getBundle(), "/lib", "jemalloc");
String jemallocLibPath = loadPluginLocalLibrary(getBundle(), "jemalloc", is64bit);
System.out.println("LWJGL jemalloc library path = " + jemallocLibPath);
// LWJGL has its own System.load() call when this property is provided
System.setProperty("org.lwjgl.system.jemalloc.libname", jemallocLibPath);
// preload LWJGL
String lwjglLibPath = loadPluginLocalLibrary(getBundle(), "/lib", "lwjgl");
String lwjglLibPath = loadPluginLocalLibrary(getBundle(), "lwjgl", is64bit);
System.out.println("LWJGL lwjgl library path = " + lwjglLibPath);
System.out.println("Done preloading native LWJGL libraries.");
}
/** Load the given local library using {@link System#load(String)}. */
private String loadPluginLocalLibrary(Bundle bundle, String bundleLocalLibraryFolder,
String libraryName) throws Exception {
private String loadPluginLocalLibrary(Bundle bundle, String libraryName, boolean is64bit)
throws Exception {
String osLibName = mapLibraryName(libraryName);
String bundleLocalLibraryFolder;
if(!is64bit) {
String[] parts = osLibName.split(".");
osLibName = parts[0] + "32." + parts[1];
bundleLocalLibraryFolder = "/lib/x32";
} else {
bundleLocalLibraryFolder = "/lib/x64";
}
String fullPath =
toFileURL(bundle.getEntry(bundleLocalLibraryFolder)).getPath() + osLibName;
System.load(fullPath);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment