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

Dan Nicholson dbn.lists at gmail.com
Wed Feb 2 06:09:17 PST 2011


On Tue, Feb 1, 2011 at 5:41 AM, Arthur Zhu
<xiaoxiaomuyusajiangtian at gmail.com> wrote:
> From: Arthur Zhu <arthur.zhuyong at gmail.com>
>
> ---
>  configure.ac |   29 +++++++++++++++--------------
>  1 files changed, 15 insertions(+), 14 deletions(-)
>
> diff --git a/configure.ac b/configure.ac
> index 46938f4..8a429a7 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -1100,23 +1100,24 @@ if test "x$enable_egl" = xyes; then
>         if test "$mesa_driver" = xlib -o "$mesa_driver" = dri; then
>             EGL_DRIVERS_DIRS="glx"
>         fi
> +    fi
> +fi
>
> +AC_ARG_ENABLE([egl-dri2],
> +    [AS_HELP_STRING([--enable-egl-dri2],
> +        [enable egl-dri2 driver. @<:@default=disabled@:>@])],
> +    [enable_egl_dri2="$enableval"],
> +    [enable_egl_dri2=no])
> +if test "x$enable_egl_dri2" = xyes; then
> +    if test "$enable_static" != yes; then
>         if test "$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
> -            fi
> -       fi
> -
> +            PKG_CHECK_MODULES([XCB_DRI2], [x11-xcb xcb-dri2 xcb-xfixes])
> +            EGL_DRIVER_DRI2=dri2
> +            DEFINES="$DEFINES -DHAVE_XCB_DRI2"
> +            PKG_CHECK_MODULES([LIBUDEV], [libudev > 150])
> +            DEFINES="$DEFINES -DHAVE_LIBUDEV"
> +        fi
>         EGL_DRIVERS_DIRS="$EGL_DRIVERS_DIRS $EGL_DRIVER_DRI2"
>     fi
>  fi

This looks good, but I think it would be better if this stayed within
the same conditional block as before. There's no sense checking for
the egl_dri2 components if we're not using dri. So, I think you should
just put the macro right before the x$enable_egl = xyes code.
Something like this:

AC_ARG_ENABLE([egl],
    [AS_HELP_STRING([--disable-egl],
        [disable EGL library @<:@default=enabled@:>@])],
    [enable_egl="$enableval"],
    [enable_egl=yes])
<sanitive --disable-egl input>
AC_ARG_ENABLE([egl-dri2], ...)
if test "x$enable_egl" = xyes; then
    ...
    if "x$enable_egl_dri2" = xyes && test "$mesa_driver" = dri; then
        <egl_dri2 checks>
    fi
    ...
fi

Then the rest of the code is nearly unchanged in this case.

--
Dan


More information about the wayland-devel mailing list