[PATCH] Adding -enable-egl-dri2 option.

Arthur Zhu xiaoxiaomuyusajiangtian at gmail.com
Thu Feb 3 05:12:04 PST 2011


---
 configure.ac |   26 ++++++++++++--------------
 1 files changed, 12 insertions(+), 14 deletions(-)

diff --git a/configure.ac b/configure.ac
index 46938f4..bd50767 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1091,6 +1091,12 @@ if test "x$enable_egl" = xno; then
         AC_MSG_ERROR([cannot enable OpenVG without EGL])
     fi
 fi
+
+AC_ARG_ENABLE([egl-dri2],
+    [AS_HELP_STRING([--enable-egl-dri2],
+        [enable EGL egl-dri2 driver @<:@default=disabled@:>@])],
+    [enable_egl_dri2="$enableval"],
+    [enable_egl_dri2=no])
 if test "x$enable_egl" = xyes; then
     SRC_DIRS="$SRC_DIRS egl"
     EGL_LIB_DEPS="$DLOPEN_LIBS -lpthread"
@@ -1100,21 +1106,13 @@ 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" = 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
-            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"
-- 
1.7.0.4

--90e6ba53a5e43d2425049b60b833
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

<br>Thanks your good suggestions.<br><br>Arthur<br><br><br>From 7034307045f=
1d334e25adf7f739c5144a9afcb46 Mon Sep 17 00:00:00 2001<br>From: Arthur Zhu =
&lt;<a href=3D"mailto:xiaoxiaomuyusajiangtian at gmail.com">xiaoxiaomuyusajian=
gtian at gmail.com</a>&gt;<br>
Date: Thu, 3 Feb 2011 21:12:04 +0800<br>Subject: [PATCH] Adding -enable-egl=
-dri2 option.<br><br>---<br>=A0<a href=3D"http://configure.ac">configure.ac=
</a> |=A0=A0 26 ++++++++++++--------------<br>=A01 files changed, 12 insert=
ions(+), 14 deletions(-)<br>
<br>diff --git a/<a href=3D"http://configure.ac">configure.ac</a> b/<a href=
=3D"http://configure.ac">configure.ac</a><br>index 46938f4..bd50767 100644<=
br>--- a/<a href=3D"http://configure.ac">configure.ac</a><br>+++ b/<a href=
=3D"http://configure.ac">configure.ac</a><br>
@@ -1091,6 +1091,12 @@ if test &quot;x$enable_egl&quot; =3D xno; then<br>=
=A0=A0=A0=A0=A0=A0=A0=A0 AC_MSG_ERROR([cannot enable OpenVG without EGL])<b=
r>=A0=A0=A0=A0 fi<br>=A0fi<br>+<br>+AC_ARG_ENABLE([egl-dri2],<br>+=A0=A0=A0=
 [AS_HELP_STRING([--enable-egl-dri2],<br>
+=A0=A0=A0=A0=A0=A0=A0 [enable EGL egl-dri2 driver @&lt;:@default=3Ddisable=
d@:&gt;@])],<br>+=A0=A0=A0 [enable_egl_dri2=3D&quot;$enableval&quot;],<br>+=
=A0=A0=A0 [enable_egl_dri2=3Dno])<br>=A0if test &quot;x$enable_egl&quot; =
=3D xyes; then<br>=A0=A0=A0=A0 SRC_DIRS=3D&quot;$SRC_DIRS egl&quot;<br>
=A0=A0=A0=A0 EGL_LIB_DEPS=3D&quot;$DLOPEN_LIBS -lpthread&quot;<br>@@ -1100,=
21 +1106,13 @@ if test &quot;x$enable_egl&quot; =3D xyes; then<br>=A0=A0=A0=
=A0=A0=A0=A0=A0 if test &quot;$mesa_driver&quot; =3D xlib -o &quot;$mesa_dr=
iver&quot; =3D dri; then<br>
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 EGL_DRIVERS_DIRS=3D&quot;glx&quot;<br>=
=A0=A0=A0=A0=A0=A0=A0=A0 fi<br>-<br>-=A0=A0=A0=A0=A0=A0=A0 if test &quot;$m=
esa_driver&quot; =3D dri; then<br>+=A0=A0=A0=A0=A0=A0=A0 if test &quot;x$en=
able_egl_dri2&quot; =3D xyes -a &quot;$mesa_driver&quot; =3D dri; then<br>
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 # build egl_dri2 when xcb-dri2 is avai=
lable<br>-=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 PKG_CHECK_MODULES([XCB_DRI2], [=
x11-xcb xcb-dri2 xcb-xfixes],<br>-=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 =A0=A0=
=A0 =A0=A0=A0 =A0 [have_xcb_dri2=3Dyes],[have_xcb_dri2=3Dno])<br>-=A0=A0=A0=
=A0=A0=A0=A0=A0=A0=A0=A0 PKG_CHECK_MODULES([LIBUDEV], [libudev &gt; 150],<b=
r>
-=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0 [have_libudev=3D=
yes],[have_libudev=3Dno])<br>-=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 <br>-=A0=A0=
=A0=A0=A0=A0=A0=A0=A0=A0=A0 if test &quot;$have_xcb_dri2&quot; =3D yes; the=
n<br>-=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 EGL_DRIVER_DRI2=3Ddri2<=
br>-=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 DEFINES=3D&quot;$DEFINES =
-DHAVE_XCB_DRI2&quot;<br>
-=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 if test &quot;$have_libudev&=
quot; =3D yes; then<br>-=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0 DEFINES=3D&quot;$DEFINES -DHAVE_LIBUDEV&quot;<br>-=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0=A0=A0=A0 fi<br>-=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 fi<br>=
+=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 PKG_CHECK_MODULES([XCB_DRI2], [x11-xcb x=
cb-dri2 xcb-xfixes])<br>
+=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 EGL_DRIVER_DRI2=3Ddri2<br>+=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0=A0 DEFINES=3D&quot;$DEFINES -DHAVE_XCB_DRI2&quot;<br>+=
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 PKG_CHECK_MODULES([LIBUDEV], [libudev &gt=
; 150])<br>+=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 DEFINES=3D&quot;$DEFINES -DHA=
VE_LIBUDEV&quot;<br>
=A0=A0=A0=A0 fi<br>=A0<br>=A0=A0=A0=A0=A0=A0=A0=A0 EGL_DRIVERS_DIRS=3D&quot=
;$EGL_DRIVERS_DIRS $EGL_DRIVER_DRI2&quot;<br>-- <br>1.7.0.4<br><br><br>

--90e6ba53a5e43d2425049b60b833--


More information about the wayland-devel mailing list