[mutter/wip/wayland-display: 3/62] configure: Adds wayland config options



commit b89bc873129bb9aaf9d09b7b6e4662f128335879
Author: Robert Bragg <robert linux intel com>
Date:   Thu Jan 5 12:19:58 2012 +0000

    configure: Adds wayland config options
    
    This adds a --enable-wayland configure option to enable building mutter
    as a hybrid X and Wayland compositor. By default the option is disabled.
    If enabled HAVE_WAYLAND is defined for C code and as an automake
    conditional.
    
    In addition a --with-wayland-protocols option has been added since
    wayland support will depend on the xserver.xml extension protocol that's
    currently part of the Weston project which we need the location of.

 configure.ac |   61 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 61 insertions(+), 0 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 7679105..fd556cf 100644
--- a/configure.ac
+++ b/configure.ac
@@ -113,6 +113,27 @@ AC_ARG_ENABLE(shape,
                  [disable mutter's use of the shaped window extension]),,
   enable_shape=auto)
 
+AC_ARG_ENABLE(wayland,
+  AC_HELP_STRING([--enable-wayland],
+                 [Enable support for running as a hybrid X and Wayland compositor]),,
+  enable_wayland=no)
+
+## Wayland support requires the xserver.xml protocol extension found in the weston
+## repository but since there aren't currently established conventions for
+## installing and discovering these we simply require a location to be given
+## explicitly...
+AC_ARG_WITH([wayland-protocols],
+            [AS_HELP_STRING([--with-wayland-protocols], [Location for wayland extension protocol specs])],
+            [
+              AC_PATH_PROG([WAYLAND_SCANNER],[wayland-scanner],[no])
+              AS_IF([test "x$WAYLAND_SCANNER" = "xno"],
+                    AC_MSG_ERROR([Could not find wayland-scanner in your PATH, required for parsing wayland 
extension protocols]))
+              AC_SUBST([WAYLAND_SCANNER])
+              have_wayland_protocols_dir="yes"
+              AC_SUBST([WAYLAND_EXTENSION_PROTOCOLS_DIR],$withval)
+            ],
+            [])
+
 AM_GLIB_GNU_GETTEXT
 
 ## here we get the flags we'll actually use
@@ -199,6 +220,44 @@ if test x$have_xcursor = xyes; then
   AC_DEFINE(HAVE_XCURSOR, , [Building with Xcursor support])
 fi
 
+if test x$enable_wayland = "xno"; then
+   have_wayland=no
+else
+  WAYLAND_VERSION=0.1
+  AC_MSG_CHECKING([Wayland >= $WAYLAND_VERSION])
+  if $PKG_CONFIG --atleast-version $WAYLAND_VERSION wayland-server; then
+    have_wayland=yes
+  else
+    have_wayland=no
+  fi
+  AC_MSG_RESULT($have_wayland)
+  if test x$have_wayland = "xyes"; then
+    CLUTTER_WAYLAND_VERSION=1.9.3
+    AC_MSG_CHECKING([Clutter Wayland Compositor >= $CLUTTER_WAYLAND_VERSION])
+    if ! $PKG_CONFIG --atleast-version $CLUTTER_WAYLAND_VERSION clutter-wayland-compositor-1.0; then
+      have_wayland=no
+    fi
+    AC_MSG_RESULT($have_wayland)
+  fi
+fi
+
+if test x$enable_wayland = "xyes"; then
+  if test x$have_wayland = "xno"; then
+    AC_MSG_ERROR([wayland support enabled but suitable versions of wayland-server and 
clutter-wayland-compositor-1.0 were not found])
+  else
+    if test x$have_wayland_protocols_dir != "xyes"; then
+      AC_MSG_ERROR([wayland support enabled but extensions location not given with --with-wayland-protocols])
+    fi
+  fi
+fi
+
+if test x$have_wayland = "xyes"; then
+  MUTTER_PC_MODULES="$MUTTER_PC_MODULES wayland-server clutter-wayland-compositor-1.0"
+  AC_DEFINE(HAVE_WAYLAND, , [Building with Wayland support])
+fi
+
+AM_CONDITIONAL(HAVE_WAYLAND, test x$have_wayland = "xyes")
+
 PKG_CHECK_MODULES(MUTTER, $MUTTER_PC_MODULES)
 
 PKG_CHECK_EXISTS([xi >= 1.6.99.1],
@@ -465,6 +524,8 @@ mutter-$VERSION
        source code location:     ${srcdir}
        compiler:                 ${CC}
 
+       Wayland:                  ${have_wayland}
+
        Startup notification:     ${have_startup_notification}
        libcanberra:              ${have_libcanberra}
        Introspection:            ${found_introspection}


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