[clutter] build: Manually check for Wayland support in Cogl



commit 2fd47ce08e1017143f150ea26074bc138084683c
Author: Emmanuele Bassi <ebassi gnome org>
Date:   Wed Jun 10 13:59:18 2015 +0100

    build: Manually check for Wayland support in Cogl
    
    The Cogl pkg-config file does not specify the supported backends, which
    means we need to manually check for the platform, like we do for Mir.

 configure.ac |   24 ++++++++++++++++++++++++
 1 files changed, 24 insertions(+), 0 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index f9aaf97..cf34a48 100644
--- a/configure.ac
+++ b/configure.ac
@@ -343,6 +343,30 @@ AS_IF([test "x$enable_wayland" = "xyes"],
         SUPPORT_WAYLAND=1
         SUPPORT_COGL=1
 
+        # We need to manually check for Wayland support in Cogl because
+        # the windowing systems are not exposed in the pkg-config file
+        saved_CFLAGS="${CFLAGS}"
+        CFLAGS="`$PKG_CONFIG --cflags $CLUTTER_BASE_PC_FILES`"
+
+        AC_MSG_CHECKING([for Wayland Cogl backend])
+        AC_TRY_COMPILE([#include <cogl/cogl.h>],
+                       [
+                         #ifndef COGL_HAS_EGL_PLATFORM_WAYLAND_SUPPORT
+                         #error "No Wayland support in Cogl"
+                         #endif
+                         int main (void) { return 0; }
+                       ],
+                       [
+                         AC_MSG_RESULT(yes)
+                         have_cogl_wayland=yes
+                       ],
+                       [
+                         AC_MSG_RESULT(no)
+                         have_cogl_wayland=no
+                       ])
+        CFLAGS="${saved_CFLAGS}"
+        AS_IF([test "x$have_cogl_wayland" = xno], [AC_MSG_ERROR("*** Cogl is missing Wayland support.")])
+
         PKG_CHECK_EXISTS([wayland-client wayland-cursor xkbcommon gdk-pixbuf-2.0],
                          [
                             BACKEND_PC_FILES="$BACKEND_PC_FILES wayland-cursor wayland-client xkbcommon"


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]