Mesa (master): Only require libdrm if direct rendering is actually enabled.

Jon TURNEY jturney at kemper.freedesktop.org
Fri Apr 8 12:38:27 PDT 2011


Module: Mesa
Branch: master
Commit: 758561786c3a34303e6c85dfdb996b94a4eed678
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=758561786c3a34303e6c85dfdb996b94a4eed678

Author: Samuel Thibault <samuel.thibault at ens-lyon.org>
Date:   Mon Mar 14 22:08:21 2011 +0000

Only require libdrm if direct rendering is actually enabled.

Fix build when configured --with-driver=dri --disable-driglx-direct on targets
without drm e.g. GNU/Hurd and Cygwin

Based on the Debian patch file '05_hurd-ftbfs.diff' by Samuel Thibault.

Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
Reviewed-by: Julien Cristau <jcristau at debian.org>
Reviewed-By: Jakob Bornecrantz <wallbraker at gmail.com>

---

 configure.ac |   29 ++++++++++++++++++-----------
 1 files changed, 18 insertions(+), 11 deletions(-)

diff --git a/configure.ac b/configure.ac
index b510151..38e673d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -729,6 +729,14 @@ else
     enable_xcb=no
 fi
 
+dnl Direct rendering or just indirect rendering
+AC_ARG_ENABLE([driglx-direct],
+    [AS_HELP_STRING([--disable-driglx-direct],
+        [enable direct rendering in GLX and EGL for DRI \
+            @<:@default=enabled@:>@])],
+    [driglx_direct="$enableval"],
+    [driglx_direct="yes"])
+
 dnl
 dnl libGL configuration per driver
 dnl
@@ -762,12 +770,17 @@ dri|no) # these checks are still desired when there is no mesa_driver
         AC_MSG_ERROR([Can't use static libraries for DRI drivers])
     fi
 
-    # Check for libdrm
-    PKG_CHECK_MODULES([LIBDRM], [libdrm >= $LIBDRM_REQUIRED])
-    PKG_CHECK_MODULES([DRI2PROTO], [dri2proto >= $DRI2PROTO_REQUIRED])
     PKG_CHECK_MODULES([GLPROTO], [glproto >= $GLPROTO_REQUIRED])
-    GL_PC_REQ_PRIV="libdrm >= $LIBDRM_REQUIRED dri2proto >= $DRI2PROTO_REQUIRED glproto >= $GLPROTO_REQUIRED"
-    DRI_PC_REQ_PRIV="libdrm >= $LIBDRM_REQUIRED"
+    GL_PC_REQ_PRIV="glproto >= $GLPROTO_REQUIRED"
+    DRI_PC_REQ_PRIV=""
+
+    if test x"$driglx_direct" = xyes; then
+        # Check for libdrm
+        PKG_CHECK_MODULES([LIBDRM], [libdrm >= $LIBDRM_REQUIRED])
+        PKG_CHECK_MODULES([DRI2PROTO], [dri2proto >= $DRI2PROTO_REQUIRED])
+        GL_PC_REQ_PRIV="$GL_PC_REQ_PRIV libdrm >= $LIBDRM_REQUIRED dri2proto >= $DRI2PROTO_REQUIRED"
+        DRI_PC_REQ_PRIV="libdrm >= $LIBDRM_REQUIRED"
+    fi
 
     # find the DRI deps for libGL
     if test "$x11_pkgconfig" = yes; then
@@ -910,12 +923,6 @@ AC_ARG_WITH([dri-searchpath],
     [DRI_DRIVER_SEARCH_DIR="$withval"],
     [DRI_DRIVER_SEARCH_DIR='${DRI_DRIVER_INSTALL_DIR}'])
 AC_SUBST([DRI_DRIVER_SEARCH_DIR])
-dnl Direct rendering or just indirect rendering
-AC_ARG_ENABLE([driglx-direct],
-    [AS_HELP_STRING([--disable-driglx-direct],
-        [enable direct rendering in GLX and EGL for DRI @<:@default=enabled@:>@])],
-    [driglx_direct="$enableval"],
-    [driglx_direct="yes"])
 dnl Which drivers to build - default is chosen by platform
 AC_ARG_WITH([dri-drivers],
     [AS_HELP_STRING([--with-dri-drivers@<:@=DIRS...@:>@],



More information about the mesa-commit mailing list