From 629c15aaacb69a8f2060e366fba679601738b22d Mon Sep 17 00:00:00 2001 From: Benjamin Franzke Date: Fri, 24 Jun 2011 21:45:05 +0200 Subject: [PATCH] egl_dri2: Build drm platform only if enabled --- src/egl/drivers/dri2/Makefile | 7 ++++++- src/egl/drivers/dri2/egl_dri2.c | 2 ++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/egl/drivers/dri2/Makefile b/src/egl/drivers/dri2/Makefile index 65d35b36206..d2b1f4f077a 100644 --- a/src/egl/drivers/dri2/Makefile +++ b/src/egl/drivers/dri2/Makefile @@ -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) \ diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c index cad1737f4bf..f9a5eb108e5 100644 --- a/src/egl/drivers/dri2/egl_dri2.c +++ b/src/egl/drivers/dri2/egl_dri2.c @@ -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) -- 2.30.2