[PATCH weston] build: Allow more control over cairo use in the clients

Rob Bradford robert.bradford at intel.com
Fri Aug 9 08:52:46 PDT 2013


From: Rob Bradford <rob at linux.intel.com>

Previously the configure script would silently disable the use of
accelerated cairo in the clients if cairo-gl could not be found (or
cairo-glesv2 if that was requested.) Conversely the use of cairo-gl
would be automatically enabled if it was found with no way to disable
that feature

This change adds --with-cairo which takes one of "image", "gl" or
"glesv2" (defaulting to "image"). If "gl" or "glesv2" is specified
cairo-egl is checked for as well as the specified renderer. If the check
fails then the configure process errors out.
---
 configure.ac | 43 ++++++++++++++++++++++++++++++++++---------
 1 file changed, 34 insertions(+), 9 deletions(-)

diff --git a/configure.ac b/configure.ac
index f9f1c53..f08693a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -201,14 +201,35 @@ if test x$enable_rdp_compositor = xyes; then
   PKG_CHECK_MODULES(RDP_COMPOSITOR, [freerdp >= 1.1.0])
 fi
 
+AC_ARG_WITH(cairo,
+	    AS_HELP_STRING([--with-cairo=@<:@image|gl|glesv2@:>@]
+			   [Which Cairo renderer to use for the clients]),
+			   [],[with_cairo="image"])
+
+if test "x$with_cairo" = "ximage"; then
+	cairo_modules="cairo"
+else
+if test "x$with_cairo" = "xgl"; then
+	cairo_modules="cairo-gl"
+else
+if test "x$with_cairo" = "xglesv2"; then
+	cairo_modules="cairo-glesv2"
+else
+	AC_ERROR([Unknown cairo renderer requested])
+fi
+fi
+fi
+
+# Included for legacy compat
 AC_ARG_WITH(cairo-glesv2,
             AS_HELP_STRING([--with-cairo-glesv2],
-                           [Use GLESv2 cairo instead of full GL]))
+                           [Use GLESv2 cairo]))
 if test "x$with_cairo_glesv2" = "xyes"; then
   cairo_modules="cairo-glesv2"
-  AC_DEFINE([USE_CAIRO_GLESV2], [1], [Use the GLESv2 GL cairo backend])
-else
-  cairo_modules="cairo-gl"
+fi
+
+if test "x$cairo_modules" = "xcairo-glesv2"; then
+AC_DEFINE([USE_CAIRO_GLESV2], [1], [Use the GLESv2 GL cairo backend])
 fi
 
 PKG_CHECK_MODULES(PIXMAN, [pixman-1])
@@ -257,11 +278,15 @@ if test x$enable_clients = xyes; then
 
   PKG_CHECK_MODULES(POPPLER, [poppler-glib glib-2.0 gobject-2.0 gio-2.0 ],
 			     [have_poppler=yes], [have_poppler=no])
-  PKG_CHECK_MODULES(CAIRO_EGL, [wayland-egl egl >= 7.10 cairo-egl >= 1.11.3 $cairo_modules],
-		    [have_cairo_egl=yes], [have_cairo_egl=no])
-  AS_IF([test "x$have_cairo_egl" = "xyes"],
-        [AC_DEFINE([HAVE_CAIRO_EGL], [1], [Have cairo-egl])],
-        [AC_MSG_WARN([clients will use cairo image, cairo-egl not used because $CAIRO_EGL_PKG_ERRORS])])
+
+  # Only check for cairo-egl if a GL or GLES renderer requested
+  AS_IF([test "x$cairo_modules" = "xcairo-gl" -o "x$cairo_modules" = "xcairo-glesv2"], [
+    PKG_CHECK_MODULES(CAIRO_EGL, [wayland-egl egl >= 7.10 cairo-egl >= 1.11.3 $cairo_modules],
+                      [have_cairo_egl=yes], [have_cairo_egl=no])
+    AS_IF([test "x$have_cairo_egl" = "xyes"],
+	  [AC_DEFINE([HAVE_CAIRO_EGL], [1], [Have cairo-egl])],
+	  [AC_ERROR([cairo-egl not used because $CAIRO_EGL_PKG_ERRORS])])])
+
   PKG_CHECK_MODULES(PANGO, [pangocairo], [have_pango=yes], [have_pango=no])
 fi
 
-- 
1.8.3.1



More information about the wayland-devel mailing list