From d6ee9155105cb90a388cd6c9474ec43261541a1c Mon Sep 17 00:00:00 2001 From: Kenneth Russel Date: Sun, 2 Apr 2006 23:44:40 +0000 Subject: Replaced absolute path to libGL.so.1 with relative path to presumably fix problems with ATI's fglrx drivers, which use a libGL.so.1.2 placed in a nonstandard location git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/trunk@698 232f8b59-042b-4e1e-8c03-345bb8c30851 --- src/classes/com/sun/opengl/impl/x11/DRIHack.java | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'src/classes') diff --git a/src/classes/com/sun/opengl/impl/x11/DRIHack.java b/src/classes/com/sun/opengl/impl/x11/DRIHack.java index 40b7d1950..18bf3d5e8 100644 --- a/src/classes/com/sun/opengl/impl/x11/DRIHack.java +++ b/src/classes/com/sun/opengl/impl/x11/DRIHack.java @@ -103,7 +103,23 @@ public class DRIHack { } NativeLibLoader.loadDRIHack(); - libGLHandle = dlopen("/usr/lib/libGL.so.1"); + // Try a few different variants for best robustness + // In theory probably only the first is necessary + libGLHandle = dlopen("libGL.so.1"); + if (DEBUG && libGLHandle != 0) System.err.println(" Found libGL.so.1"); + if (libGLHandle == 0) { + libGLHandle = dlopen("libGL.so.1.2"); + if (DEBUG && libGLHandle != 0) System.err.println(" Found libGL.so.1.2"); + } + // Allow ATI's fglrx to supersede version in /usr/lib + if (libGLHandle == 0) { + libGLHandle = dlopen("/usr/lib/ati-fglrx/libGL.so.1.2"); + if (DEBUG && libGLHandle != 0) System.err.println(" Found /usr/lib/ati-fglrx/libGL.so.1.2"); + } + if (libGLHandle == 0) { + libGLHandle = dlopen("/usr/lib/libGL.so.1"); + if (DEBUG && libGLHandle != 0) System.err.println(" Found /usr/lib/libGL.so.1"); + } } } -- cgit v1.2.3