egl_dri2: Build drm platform only if enabled
authorBenjamin Franzke <benjaminfranzke@googlemail.com>
Fri, 24 Jun 2011 19:45:05 +0000 (21:45 +0200)
committerBenjamin Franzke <benjaminfranzke@googlemail.com>
Fri, 24 Jun 2011 20:00:45 +0000 (22:00 +0200)
src/egl/drivers/dri2/Makefile
src/egl/drivers/dri2/egl_dri2.c

index 65d35b36206312ad7a94c2b16c8a37d483f46111..d2b1f4f077a546aab657e147aaff5bf2a632d0cb 100644 (file)
@@ -4,7 +4,7 @@ TOP = ../../../..
 include $(TOP)/configs/current
 
 EGL_DRIVER = egl_dri2
-EGL_SOURCES = egl_dri2.c platform_drm.c common.c
+EGL_SOURCES = egl_dri2.c common.c
 
 EGL_INCLUDES = \
        -I$(TOP)/include \
@@ -31,6 +31,11 @@ EGL_INCLUDES += -DHAVE_X11_PLATFORM $(XCB_DRI2_CFLAGS)
 EGL_LIBS +=  $(XCB_DRI2_LIBS)
 endif
 
+ifneq ($(findstring drm, $(EGL_PLATFORMS)),)
+EGL_SOURCES += platform_drm.c
+EGL_INCLUDES += -DHAVE_DRM_PLATFORM
+endif
+
 ifneq ($(findstring wayland, $(EGL_PLATFORMS)),)
 EGL_SOURCES += platform_wayland.c
 EGL_INCLUDES += -DHAVE_WAYLAND_PLATFORM $(WAYLAND_CFLAGS) \
index cad1737f4bff5c852b066720b3139daea1921015..f9a5eb108e50e91864f45b1330b2ca089077fc43 100644 (file)
@@ -546,10 +546,12 @@ dri2_initialize(_EGLDriver *drv, _EGLDisplay *disp)
 #endif
 
 #ifdef HAVE_LIBUDEV
+#ifdef HAVE_DRM_PLATFORM
    case _EGL_PLATFORM_DRM:
       if (disp->Options.TestOnly)
          return EGL_TRUE;
       return dri2_initialize_drm(drv, disp);
+#endif
 #ifdef HAVE_WAYLAND_PLATFORM
    case _EGL_PLATFORM_WAYLAND:
       if (disp->Options.TestOnly)