[PATCH] Fix Xephyr build when DRI is enabled but GLX is not

Alan Coopersmith alan.coopersmith at oracle.com
Thu May 24 21:32:11 PDT 2012


Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>
---
 configure.ac                |    8 ++++++--
 hw/kdrive/ephyr/Makefile.am |    7 ++++++-
 hw/kdrive/ephyr/ephyr.c     |    2 ++
 hw/kdrive/ephyr/hostx.c     |    4 ++++
 4 files changed, 18 insertions(+), 3 deletions(-)

diff --git a/configure.ac b/configure.ac
index 97ceab1..7440156 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2068,8 +2068,12 @@ if test "$KDRIVE" = yes; then
     if test "x$XV" = xyes; then
         XEPHYR_REQUIRED_LIBS="$XEPHYR_REQUIRED_LIBS xv"
     fi
-    if test "x$DRI" = xyes && test "x$GLX" = xyes; then
-        XEPHYR_REQUIRED_LIBS="$XEPHYR_REQUIRED_LIBS $LIBGL libdrm"
+    if test "x$DRI" = xyes ; then
+        if test "x$GLX" = xyes; then
+            XEPHYR_REQUIRED_LIBS="$XEPHYR_REQUIRED_LIBS $LIBGL libdrm"
+        else
+            XEPHYR_REQUIRED_LIBS="$XEPHYR_REQUIRED_LIBS libdrm"
+        fi
     fi
 
     if test "x$XEPHYR" = xauto; then
diff --git a/hw/kdrive/ephyr/Makefile.am b/hw/kdrive/ephyr/Makefile.am
index 9d9b64e..127444f 100644
--- a/hw/kdrive/ephyr/Makefile.am
+++ b/hw/kdrive/ephyr/Makefile.am
@@ -36,7 +36,9 @@ HOSTDRI_SRCS =			\
 	ephyrdri.c		\
 	ephyrdri.h		\
 	XF86dri.c		\
-	xf86dri.h		\
+	xf86dri.h
+
+HOSTGLX_SRCS =			\
 	ephyrglxext.c		\
 	ephyrglxext.h		\
 	ephyrhostglx.c		\
@@ -57,6 +59,9 @@ endif
 
 if DRI
 libxephyr_hostdri_la_SOURCES = $(HOSTDRI_SRCS)
+if GLX
+libxephyr_hostdri_la_SOURCES += $(HOSTGLX_SRCS)
+endif
 endif
 
 libxephyr_la_SOURCES = $(XEPHYR_SRCS)
diff --git a/hw/kdrive/ephyr/ephyr.c b/hw/kdrive/ephyr/ephyr.c
index 8eda539..86a7a53 100644
--- a/hw/kdrive/ephyr/ephyr.c
+++ b/hw/kdrive/ephyr/ephyr.c
@@ -633,7 +633,9 @@ ephyrInitScreen(ScreenPtr pScreen)
     }
     if (!ephyrNoDRI) {
         ephyrDRIExtensionInit(pScreen);
+#ifdef GLXEXT
         ephyrHijackGLXExtension();
+#endif
     }
 #endif
 
diff --git a/hw/kdrive/ephyr/hostx.c b/hw/kdrive/ephyr/hostx.c
index 6988f16..491c07a 100644
--- a/hw/kdrive/ephyr/hostx.c
+++ b/hw/kdrive/ephyr/hostx.c
@@ -1363,6 +1363,7 @@ hostx_has_dri(void)
 int
 hostx_has_glx(void)
 {
+#ifdef GLXEXT
     Display *dpy = hostx_get_display();
     int event_base = 0, error_base = 0;
 
@@ -1370,6 +1371,9 @@ hostx_has_glx(void)
         return FALSE;
     }
     return TRUE;
+#else
+    return FALSE;
+#endif
 }
 
 #endif                          /* XF86DRI */
-- 
1.7.9.2



More information about the xorg-devel mailing list