[mutter/wip/wayland: 1/2] configure: Adds wayland config options



commit 3bbab98578cae2ee83d66b9615ac9bc899262f80
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.in |   61 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 61 insertions(+), 0 deletions(-)
---
diff --git a/configure.in b/configure.in
index 455907d..210771b 100644
--- a/configure.in
+++ b/configure.in
@@ -104,6 +104,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)
+            ],
+            [])
+
 ## try definining HAVE_BACKTRACE
 AC_CHECK_HEADERS(execinfo.h, [AC_CHECK_FUNCS(backtrace)])
 
@@ -218,6 +239,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)
 
 AC_PATH_XTRA
@@ -508,6 +567,8 @@ mutter-$VERSION
 	source code location:	  ${srcdir}
 	compiler:		  ${CC}
 
+	Wayland:		  ${have_wayland}
+
 	XFree86 Xinerama:         ${use_xfree_xinerama}
 	Solaris Xinerama:         ${use_solaris_xinerama}
 	Startup notification:     ${have_startup_notification}



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