[Mesa-dev] [PATCH] Adding -enable-egl-dri2 option. Happy Chinese Spring Festival!

Dan Nicholson dbn.lists at gmail.com
Mon Feb 7 06:30:28 PST 2011


On Mon, Feb 07, 2011 at 01:58:19PM +0800, Arthur Zhu wrote:
> From 7f26f3b6692a8a8061c0d817388505d4190e88a0 Mon Sep 17 00:00:00 2001
> From: Arthur Zhu <xiaoxiaomuyusajiangtian at gmail.com>
> Date: Mon, 7 Feb 2011 13:50:55 +0800
> Subject: [PATCH] Adding --enable-egl-dri2-x11&drm option.
> 
> ---
>  configure.ac |   34 +++++++++++++++++++++-------------
>  1 files changed, 21 insertions(+), 13 deletions(-)
> 
> diff --git a/configure.ac b/configure.ac
> index 46938f4..18c2731 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -1091,6 +1091,20 @@ if test "x$enable_egl" = xno; then
>          AC_MSG_ERROR([cannot enable OpenVG without EGL])
>      fi
>  fi
> +
> +AC_ARG_ENABLE([egl-dri2-x11],
> +    [AS_HELP_STRING([--enable-egl-dri2-x11],
> +        [enable EGL egl-dri2-x11 driver,
> +        Just omits libudev package checking. @<:@default=disabled@:>@])],
> +    [enable_egl_dri2_x11="$enableval"],
> +    [enable_egl_dri2_x11=no])
> +
> +AC_ARG_ENABLE([egl-dri2-drm],
> +    [AS_HELP_STRING([--enable-egl-dri2-drm],
> +        [enable EGL egl-dri2-drm driver. @<:@default=disabled@:>@])],
> +    [enable_egl_dri2_drm="$enableval"],
> +    [enable_egl_dri2_drm=no])
> +
>  if test "x$enable_egl" = xyes; then
>      SRC_DIRS="$SRC_DIRS egl"
>      EGL_LIB_DEPS="$DLOPEN_LIBS -lpthread"
> @@ -1100,20 +1114,14 @@ if test "x$enable_egl" = xyes; then
>          if test "$mesa_driver" = xlib -o "$mesa_driver" = dri; then
>              EGL_DRIVERS_DIRS="glx"
>          fi
> -
> -        if test "$mesa_driver" = dri; then
> +        if test "x$enable_egl_dri2_x11" = xyes -o "x$enable_egl_dri2_drm" =
> xyes -a "$mesa_driver" = dri; then

It would be nice if you could wrap this into a newline. Like:

        if test "x$enable_egl_dri2_x11" = xyes -o \
           "x$enable_egl_dri2_drm" = xyes -a "$mesa_driver" = dri; 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])
> -            PKG_CHECK_MODULES([LIBUDEV], [libudev > 150],
> -                      [have_libudev=yes],[have_libudev=no])
> -
> -            if test "$have_xcb_dri2" = yes; then
> -                EGL_DRIVER_DRI2=dri2
> -                DEFINES="$DEFINES -DHAVE_XCB_DRI2"
> -                if test "$have_libudev" = yes; then
> -                    DEFINES="$DEFINES -DHAVE_LIBUDEV"
> -                fi
> +            PKG_CHECK_MODULES([XCB_DRI2], [x11-xcb xcb-dri2 xcb-xfixes])
> +            EGL_DRIVER_DRI2=dri2
> +            DEFINES="$DEFINES -DHAVE_XCB_DRI2"
> +            if test "x$enable_egl_dri2_drm" = xyes; then
> +                PKG_CHECK_MODULES([LIBUDEV], [libudev > 150])
> +                DEFINES="$DEFINES -DHAVE_LIBUDEV"
>              fi
>      fi
> 

Looks good to me otherwise.

--
Dan


More information about the wayland-devel mailing list