scons: Updates for targets/egl-static.
[mesa.git] / src / egl / main / egldriver.c
index 62c56955134f7706a921056a177bd7a28480342a..b7c3de3e38e2c7ffe14c0fc5df90fa9357d48857 100644 (file)
@@ -37,6 +37,9 @@ const struct {
    const char *name;
    _EGLMain_t main;
 } _eglBuiltInDrivers[] = {
+#ifdef _EGL_BUILT_IN_DRIVER_GALLIUM
+   { "egl_gallium", _eglBuiltInDriverGALLIUM },
+#endif
 #ifdef _EGL_BUILT_IN_DRIVER_DRI2
    { "egl_dri2", _eglBuiltInDriverDRI2 },
 #endif
@@ -141,9 +144,6 @@ _eglOpenLibrary(const char *driverPath, lib_handle *handle)
    if (!lib) {
       _eglLog(_EGL_WARNING, "Could not open driver %s (%s)",
               driverPath, error);
-      if (!getenv("EGL_DRIVER"))
-         _eglLog(_EGL_WARNING,
-                 "The driver can be overridden by setting EGL_DRIVER");
       return NULL;
    }
 
@@ -467,6 +467,19 @@ _eglAddUserDriver(void)
 }
 
 
+/**
+ * Add egl_gallium to the module array.
+ */
+static void
+_eglAddGalliumDriver(void)
+{
+#ifndef _EGL_BUILT_IN_DRIVER_GALLIUM
+   void *external = (void *) "egl_gallium";
+   _eglPreloadForEach(_eglGetSearchPath(), _eglLoaderFile, external);
+#endif
+}
+
+
 /**
  * Add built-in drivers to the module array.
  */
@@ -491,14 +504,12 @@ _eglAddBuiltInDrivers(void)
 static EGLBoolean
 _eglAddDrivers(void)
 {
-   void *external = (void *) "egl_gallium";
-
    if (_eglModules)
       return EGL_TRUE;
 
    /* the order here decides the priorities of the drivers */
    _eglAddUserDriver();
-   _eglPreloadForEach(_eglGetSearchPath(), _eglLoaderFile, external);
+   _eglAddGalliumDriver();
    _eglAddBuiltInDrivers();
 
    return (_eglModules != NULL);