summaryrefslogtreecommitdiffstats
path: root/src/java/com/sun/gluegen
diff options
context:
space:
mode:
authorKenneth Russel <[email protected]>2007-01-21 01:27:27 +0000
committerKenneth Russel <[email protected]>2007-01-21 01:27:27 +0000
commit828dc89c33b8de399090e4d2c9a892611a3bd569 (patch)
tree8ff97e7b8eca3d8e38698c836499f669a88671a3 /src/java/com/sun/gluegen
parent438e69da7bf59b9f513e890626b87c7b373ce966 (diff)
Fixed Issue 262: DRIHack problems with ATI and possibly other drivers
Added support to GlueGen's NativeLibrary class for relative library path names which do not require expansion; for example, "libGL.so.1". Changed the DRIHack to first attempt to open libGL.so.1 instead of "GL", which expanded to "libGL.so". For some reason, this causes ATI's drivers to be picked up properly. Tested with various JOGL demos. git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/../svn-server-sync/gluegen/trunk@56 a78bb65f-1512-4460-ba86-f6dc96a7bf27
Diffstat (limited to 'src/java/com/sun/gluegen')
-rwxr-xr-xsrc/java/com/sun/gluegen/runtime/NativeLibrary.java27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/java/com/sun/gluegen/runtime/NativeLibrary.java b/src/java/com/sun/gluegen/runtime/NativeLibrary.java
index 9b28da4..1341012 100755
--- a/src/java/com/sun/gluegen/runtime/NativeLibrary.java
+++ b/src/java/com/sun/gluegen/runtime/NativeLibrary.java
@@ -306,6 +306,33 @@ public class NativeLibrary {
}
private static String[] buildNames(String libName) {
+ // If the library name already has the prefix / suffix added
+ // (principally because we want to force a version number on Unix
+ // operating systems) then just return the library name.
+ if (libName.startsWith(prefixes[0])) {
+ if (libName.endsWith(suffixes[0])) {
+ return new String[] { libName };
+ }
+
+ int idx = libName.indexOf(suffixes[0]);
+ boolean ok = true;
+ if (idx >= 0) {
+ // Check to see if everything after it is a Unix version number
+ for (int i = idx + suffixes[0].length();
+ i < libName.length();
+ i++) {
+ char c = libName.charAt(i);
+ if (!(c == '.' || (c >= '0' && c <= '9'))) {
+ ok = false;
+ break;
+ }
+ }
+ if (ok) {
+ return new String[] { libName };
+ }
+ }
+ }
+
String[] res = new String[prefixes.length * suffixes.length];
int idx = 0;
for (int i = 0; i < prefixes.length; i++) {