diff options
author | Sven Gothel <[email protected]> | 2009-06-03 17:29:25 +0000 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2009-06-03 17:29:25 +0000 |
commit | 18f9717d2b1041442ef701abf67cbd8bf9a71c79 (patch) | |
tree | d3b145e3b5828bba23a2441d81ef75c09008ff1b | |
parent | 9a6a6efd45785d0a948a171a8d8f74ce9f8ee337 (diff) |
Clarifying lib loading global/local, global per default
git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/../svn-server-sync/gluegen/branches/JOGL_2_SANDBOX@138 a78bb65f-1512-4460-ba86-f6dc96a7bf27
5 files changed, 13 insertions, 12 deletions
diff --git a/src/java/com/sun/gluegen/runtime/DynamicLinker.java b/src/java/com/sun/gluegen/runtime/DynamicLinker.java index c67c526..c928c4c 100755 --- a/src/java/com/sun/gluegen/runtime/DynamicLinker.java +++ b/src/java/com/sun/gluegen/runtime/DynamicLinker.java @@ -43,7 +43,7 @@ package com.sun.gluegen.runtime; linking functionality. */ interface DynamicLinker { - public long openLibrary(String pathname); + public long openLibraryGlobal(String pathname); public long openLibraryLocal(String pathname); public long lookupSymbol(long libraryHandle, String symbolName); public void closeLibrary(long libraryHandle); diff --git a/src/java/com/sun/gluegen/runtime/MacOSXDynamicLinkerImpl.java b/src/java/com/sun/gluegen/runtime/MacOSXDynamicLinkerImpl.java index 2568050..7322ffa 100755 --- a/src/java/com/sun/gluegen/runtime/MacOSXDynamicLinkerImpl.java +++ b/src/java/com/sun/gluegen/runtime/MacOSXDynamicLinkerImpl.java @@ -37,7 +37,7 @@ public class MacOSXDynamicLinkerImpl implements DynamicLinker return dlopen(pathname, RTLD_LAZY | RTLD_LOCAL); } - public long openLibrary(String pathname) { + public long openLibraryGlobal(String pathname) { // Note we use RTLD_GLOBAL visibility to allow this functionality to // be used to pre-resolve dependent libraries of JNI code without // requiring that all references to symbols in those libraries be diff --git a/src/java/com/sun/gluegen/runtime/NativeLibrary.java b/src/java/com/sun/gluegen/runtime/NativeLibrary.java index e939de4..c0e8cdf 100755 --- a/src/java/com/sun/gluegen/runtime/NativeLibrary.java +++ b/src/java/com/sun/gluegen/runtime/NativeLibrary.java @@ -126,15 +126,15 @@ public class NativeLibrary { path, and in the context of the specified ClassLoader, which is used to help find the library in the case of e.g. Java Web Start. */ public static NativeLibrary open(String libName, ClassLoader loader) { - return open(libName, libName, libName, true, loader, false); + return open(libName, libName, libName, true, loader, true); } /** Opens the given native library, assuming it has the same base name on all platforms, looking first in the system's search path, and in the context of the specified ClassLoader, which is used to help find the library in the case of e.g. Java Web Start. */ - public static NativeLibrary open(String libName, ClassLoader loader, boolean local) { - return open(libName, libName, libName, true, loader, local); + public static NativeLibrary open(String libName, ClassLoader loader, boolean global) { + return open(libName, libName, libName, true, loader, global); } /** Opens the given native library, assuming it has the given base @@ -157,14 +157,14 @@ public class NativeLibrary { String macOSXLibName, boolean searchSystemPathFirst, ClassLoader loader) { - return open(windowsLibName, unixLibName, macOSXLibName, searchSystemPathFirst, loader, false); + return open(windowsLibName, unixLibName, macOSXLibName, searchSystemPathFirst, loader, true); } public static NativeLibrary open(String windowsLibName, String unixLibName, String macOSXLibName, boolean searchSystemPathFirst, - ClassLoader loader, boolean local) { + ClassLoader loader, boolean global) { List possiblePaths = enumerateLibraryPaths(windowsLibName, unixLibName, macOSXLibName, @@ -178,10 +178,10 @@ public class NativeLibrary { } ensureNativeLibLoaded(); long res; - if(local) { - res = dynLink.openLibraryLocal(path); + if(global) { + res = dynLink.openLibraryGlobal(path); } else { - res = dynLink.openLibrary(path); + res = dynLink.openLibraryLocal(path); } if (res != 0) { if (DEBUG) { diff --git a/src/java/com/sun/gluegen/runtime/UnixDynamicLinkerImpl.java b/src/java/com/sun/gluegen/runtime/UnixDynamicLinkerImpl.java index e4c3818..a4f5667 100755 --- a/src/java/com/sun/gluegen/runtime/UnixDynamicLinkerImpl.java +++ b/src/java/com/sun/gluegen/runtime/UnixDynamicLinkerImpl.java @@ -42,7 +42,8 @@ public class UnixDynamicLinkerImpl implements DynamicLinker // RTLD_LOCAL visibility so can't be used for this purpose. return dlopen(pathname, RTLD_LAZY | RTLD_LOCAL); } - public long openLibrary(String pathname) { + + public long openLibraryGlobal(String pathname) { // Note we use RTLD_GLOBAL visibility to allow this functionality to // be used to pre-resolve dependent libraries of JNI code without // requiring that all references to symbols in those libraries be diff --git a/src/java/com/sun/gluegen/runtime/WindowsDynamicLinkerImpl.java b/src/java/com/sun/gluegen/runtime/WindowsDynamicLinkerImpl.java index 3690041..45cb289 100755 --- a/src/java/com/sun/gluegen/runtime/WindowsDynamicLinkerImpl.java +++ b/src/java/com/sun/gluegen/runtime/WindowsDynamicLinkerImpl.java @@ -27,7 +27,7 @@ public class WindowsDynamicLinkerImpl implements DynamicLinker return LoadLibraryW(libraryName); } - public long openLibrary(String libraryName) { + public long openLibraryGlobal(String libraryName) { return LoadLibraryW(libraryName); } |