[Mesa-dev] [PATCH v2] configure.ac: Fail if egl x11 platform dependencies are not available
Kristian Høgsberg
krh at bitplanet.net
Mon Jun 4 05:36:16 CEST 2012
Currently, if you pass --with-egl-platforms=x11 but xcb-dri2 isn't available
we just silently fail and disables building the EGL DRI2 driver.
This commit cleans up the EGL platfrom checking and fails if a selected
platform can't find its required dependencies.
Signed-off-by: Kristian Høgsberg <krh at bitplanet.net>
---
v2: Edited to set HAVE_EGL_DRIVER_DRI2 only if enable_dri is yes.
configure.ac | 67 ++++++++++++++++++++++++++++++++++------------------------
1 file changed, 39 insertions(+), 28 deletions(-)
diff --git a/configure.ac b/configure.ac
index 527accc..a1b780b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1433,18 +1433,9 @@ if test "x$enable_egl" = xyes; then
if test "$have_libudev" = yes; then
DEFINES="$DEFINES -DHAVE_LIBUDEV"
fi
+
if test "x$enable_dri" = xyes; then
- # build egl_dri2 when xcb-dri2 is available
- PKG_CHECK_MODULES([XCB_DRI2], [x11-xcb xcb-dri2 xcb-xfixes],
- [have_xcb_dri2=yes],[have_xcb_dri2=no])
- if test "$have_xcb_dri2" = yes; then
- HAVE_EGL_DRIVER_DRI2=1
- # workaround a bug in xcb-dri2 generated by xcb-proto 1.6
- save_LIBS="$LIBS"
- AC_CHECK_LIB(xcb-dri2, xcb_dri2_connect_alignment_pad, [],
- [DEFINES="$DEFINES -DXCB_DRI2_CONNECT_DEVICE_NAME_BROKEN"])
- LIBS="$save_LIBS"
- fi
+ HAVE_EGL_DRIVER_DRI2=1
fi
fi
@@ -1722,6 +1713,9 @@ esac
AC_SUBST([VG_LIB_DEPS])
AC_SUBST([EGL_CLIENT_APIS])
+dnl
+dnl EGL Platforms configuration
+dnl
AC_ARG_WITH([egl-platforms],
[AS_HELP_STRING([--with-egl-platforms@<:@=DIRS...@:>@],
[comma delimited native platforms libEGL supports, e.g.
@@ -1739,28 +1733,45 @@ if test "x$with_egl_platforms" != "x" -a "x$enable_egl" != xyes; then
AC_MSG_ERROR([cannot build egl state tracker without EGL library])
fi
-# verify the requested driver directories exist
+# Do per-EGL platform setups and checks
egl_platforms=`IFS=', '; echo $with_egl_platforms`
for plat in $egl_platforms; do
- test -d "$srcdir/src/gallium/state_trackers/egl/$plat" || \
- AC_MSG_ERROR([EGL platform '$plat' does not exist])
- if test "$plat" = "fbdev"; then
- GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS sw/fbdev"
- fi
- if test "$plat" = "null"; then
- GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS sw/null"
- fi
- if test "$plat" = "wayland"; then
+ case "$plat" in
+ fbdev|null)
+ GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS sw/$plat"
+ ;;
+
+ wayland)
PKG_CHECK_MODULES([WAYLAND], [wayland-client wayland-server],, \
[AC_MSG_ERROR([cannot find libwayland-client])])
- GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS sw/wayland"
+ GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS sw/wayland"
+
+ m4_ifdef([WAYLAND_SCANNER_RULES],
+ [WAYLAND_SCANNER_RULES(['$(top_srcdir)/src/egl/wayland/wayland-drm/protocol'])])
+ ;;
+
+ x11)
+ PKG_CHECK_MODULES([XCB_DRI2], [x11-xcb xcb-dri2 xcb-xfixes])
+ # workaround a bug in xcb-dri2 generated by xcb-proto 1.6
+ save_LIBS="$LIBS"
+ AC_CHECK_LIB(xcb-dri2, xcb_dri2_connect_alignment_pad, [],
+ [DEFINES="$DEFINES -DXCB_DRI2_CONNECT_DEVICE_NAME_BROKEN"])
+ LIBS="$save_LIBS"
+ ;;
+
+ drm)
+ test "x$enable_gbm" = "xno" &&
+ AC_MSG_ERROR([EGL platform drm needs gbm])
+ ;;
+
+ android|gdi)
+ ;;
+
+ *)
+ AC_MSG_ERROR([EGL platform '$plat' does not exist])
+ ;;
+ esac
- m4_ifdef([WAYLAND_SCANNER_RULES],
- [WAYLAND_SCANNER_RULES(['$(top_srcdir)/src/egl/wayland/wayland-drm/protocol'])])
- fi
- if test "$plat" = "drm" && test "x$enable_gbm" = "xno"; then
- AC_MSG_ERROR([EGL platform drm needs gbm])
- fi
case "$plat$have_libudev" in
waylandno|drmno)
AC_MSG_ERROR([cannot build $plat platfrom without udev]) ;;
--
1.7.10.2
More information about the mesa-dev
mailing list