summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlan Hourihane <alanh@tungstengraphics.com>2008-09-26 12:18:16 +0100
committerAlan Hourihane <alanh@tungstengraphics.com>2008-09-26 12:18:16 +0100
commit192f45606a7c388862112b8d53a5983fb125fee3 (patch)
tree72b06da653eb375f40ec281e9d41ebbeceadd218
parent8015f3ae3b96d93e8b1338b8254bcbead45bb91a (diff)
downloadexternal_mesa3d-192f45606a7c388862112b8d53a5983fb125fee3.zip
external_mesa3d-192f45606a7c388862112b8d53a5983fb125fee3.tar.gz
external_mesa3d-192f45606a7c388862112b8d53a5983fb125fee3.tar.bz2
egl: fudge with LIBGL_DRIVERS_PATH to pick up EGL specific DRI driver.
-rw-r--r--src/egl/drivers/glx/egl_glx.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/egl/drivers/glx/egl_glx.c b/src/egl/drivers/glx/egl_glx.c
index 4274493..732d15c 100644
--- a/src/egl/drivers/glx/egl_glx.c
+++ b/src/egl/drivers/glx/egl_glx.c
@@ -545,6 +545,8 @@ _EGLDriver *
_eglMain(_EGLDisplay *disp, const char *args)
{
struct GLX_egl_driver *GLX_drv = CALLOC_STRUCT(GLX_egl_driver);
+ char *env;
+
if (!GLX_drv)
return NULL;
@@ -565,10 +567,17 @@ _eglMain(_EGLDisplay *disp, const char *args)
_eglLog(_EGL_DEBUG, "GLX: main(%s)", args);
- /* set new DRI path to pick up EGL version (no mesa code), but don't
- * override if one is already set.
+ /* set new DRI path to pick up EGL version (which doesn't contain any mesa
+ * code), but don't override if one is already set.
*/
- setenv("LIBGL_DRIVERS_PATH", DEFAULT_DRIVER_DIR"/egl", 0);
+ env = getenv("LIBGL_DRIVERS_PATH");
+ if (env) {
+ if (!strstr(env, "egl")) {
+ sprintf(env, "%s/egl", env);
+ setenv("LIBGL_DRIVERS_PATH", env, 1);
+ }
+ } else
+ setenv("LIBGL_DRIVERS_PATH", DEFAULT_DRIVER_DIR"/egl", 0);
return &GLX_drv->Base;
}