Re: [Mesa-dev] [PATCH] configure.ac: Fail if egl x11 platform dependencies are not available

2012-06-03 Thread Kristian Høgsberg
On Fri, Jun 1, 2012 at 9:52 PM, Eric Anholt  wrote:
> On Fri,  1 Jun 2012 14:29:44 -0400, Kristian Høgsberg  
> wrote:
>> 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.
>
>> +     wayland)
>> +             HAVE_EGL_DRIVER_DRI2=1
>>               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'])])
>> +             ;;
>> +
>
>
> I note that this also turns on HAVE_EGL_DRIVER_DRI2 for a few
> platforms.  That appears to be correct, but I wasn't expecting it from
> the commit mesage.

Ah, you're right, and that's problem if you're only looking to build
the gallium side of egl.  So we need to keep the enable_dri test and
enable HAVE_EGL_DRIVER_DRI2 if that's set, and then the platform
checks don't need to set it.  I'll send out v2.

Kristian
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] configure.ac: Fail if egl x11 platform dependencies are not available

2012-06-01 Thread Eric Anholt
On Fri,  1 Jun 2012 14:29:44 -0400, Kristian Høgsberg  
wrote:
> 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.

> + wayland)
> + HAVE_EGL_DRIVER_DRI2=1
>   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'])])
> + ;;
> +


I note that this also turns on HAVE_EGL_DRIVER_DRI2 for a few
platforms.  That appears to be correct, but I wasn't expecting it from
the commit mesage.


pgp2KX5fE9JkU.pgp
Description: PGP signature
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH] configure.ac: Fail if egl x11 platform dependencies are not available

2012-06-01 Thread Kristian Høgsberg
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.
---
 configure.ac |   71 +-
 1 file changed, 40 insertions(+), 31 deletions(-)

diff --git a/configure.ac b/configure.ac
index 527accc..32f80c8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1433,20 +1433,6 @@ 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
-   fi
-
 fi
 fi
 AC_SUBST([EGL_LIB_DEPS])
@@ -1722,6 +1708,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 +1728,48 @@ 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)
+   HAVE_EGL_DRIVER_DRI2=1
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)
+   HAVE_EGL_DRIVER_DRI2=1
+   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)
+   HAVE_EGL_DRIVER_DRI2=1
+   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

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev