summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKenneth Russel <[email protected]>2006-09-03 06:37:19 +0000
committerKenneth Russel <[email protected]>2006-09-03 06:37:19 +0000
commit7e8627f45bc83985bf2809d0379d3d55fe8009ce (patch)
tree052828ed6c68370809b5e025f61bfa90dec49ce6 /src
parentcc59eab358c1021008d880982c2af853d4e9d7bd (diff)
Fixed run-time breakage due to NativeLibrary usage in JOAL. Added
search of Frameworks directory for NativeLibrary on Mac OS X. git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/../svn-server-sync/gluegen/trunk@44 a78bb65f-1512-4460-ba86-f6dc96a7bf27
Diffstat (limited to 'src')
-rwxr-xr-xsrc/java/com/sun/gluegen/runtime/NativeLibrary.java27
1 files changed, 19 insertions, 8 deletions
diff --git a/src/java/com/sun/gluegen/runtime/NativeLibrary.java b/src/java/com/sun/gluegen/runtime/NativeLibrary.java
index 01148b1..7ae9cdf 100755
--- a/src/java/com/sun/gluegen/runtime/NativeLibrary.java
+++ b/src/java/com/sun/gluegen/runtime/NativeLibrary.java
@@ -64,7 +64,7 @@ public class NativeLibrary {
private static boolean DEBUG;
private static int platform;
private static DynamicLinker dynLink;
- private static String prefix;
+ private static String[] prefixes;
private static String[] suffixes;
static {
@@ -89,18 +89,18 @@ public class NativeLibrary {
switch (platform) {
case WINDOWS:
dynLink = new WindowsDynamicLinkerImpl();
- prefix = "";
+ prefixes = new String[] { "" };
suffixes = new String[] { ".dll" };
break;
case UNIX:
dynLink = new UnixDynamicLinkerImpl();
- prefix = "lib";
+ prefixes = new String[] { "lib" };
suffixes = new String[] { ".so" };
break;
case MACOSX:
dynLink = new MacOSXDynamicLinkerImpl();
- prefix = "lib";
- suffixes = new String[] { ".dylib", ".jnilib" };
+ prefixes = new String[] { "lib", "" };
+ suffixes = new String[] { ".dylib", ".jnilib", "" };
break;
default:
throw new InternalError("Platform not initialized properly");
@@ -260,6 +260,14 @@ public class NativeLibrary {
});
addPaths(userDir, baseNames, paths);
+ // Add probable Mac OS X-specific paths
+ if (platform == MACOSX) {
+ // Add historical location
+ addPaths("/Library/Frameworks/" + libName + ".Framework", baseNames, paths);
+ // Add current location
+ addPaths("/System/Library/Frameworks/" + libName + ".Framework", baseNames, paths);
+ }
+
if (!searchSystemPathFirst) {
// Add just the library names to use the OS's search algorithm
for (int i = 0; i < baseNames.length; i++) {
@@ -287,9 +295,12 @@ public class NativeLibrary {
}
private static String[] buildNames(String libName) {
- String[] res = new String[suffixes.length];
- for (int i = 0; i < suffixes.length; i++) {
- res[i] = prefix + libName + suffixes[i];
+ String[] res = new String[prefixes.length * suffixes.length];
+ int idx = 0;
+ for (int i = 0; i < prefixes.length; i++) {
+ for (int j = 0; j < suffixes.length; j++) {
+ res[idx++] = prefixes[i] + libName + suffixes[j];
+ }
}
return res;
}