summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorWilliam Wold <[email protected]>2018-12-09 21:53:35 -0500
committerWilliam Wold <[email protected]>2018-12-09 21:53:35 -0500
commitd7074e3fb761652d46848093dee5d5e858d1bc36 (patch)
treef02c5900ae6f8f0a12dfe54e69a5fea13a88db06 /configure.ac
parentdc37f884350ff35b148d9fd869d9dedbee16c4b9 (diff)
downloadmate-panel-d7074e3fb761652d46848093dee5d5e858d1bc36.tar.bz2
mate-panel-d7074e3fb761652d46848093dee5d5e858d1bc36.tar.xz
Updated configure.ac for Wayland support
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac59
1 files changed, 57 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac
index da9f172f..ab6baa54 100644
--- a/configure.ac
+++ b/configure.ac
@@ -167,9 +167,62 @@ AM_CONDITIONAL(WNCKLET_INPROCESS, test -n "$WNCKLET_COMPILE_INPROCESS")
# For the run dialog
gl_CHECK_TYPE_STRUCT_DIRENT_D_TYPE
-dnl X development libraries check
+must_enable_x11=no
+must_enable_wayland=no
+try_all_backends=yes
+
+AC_ARG_ENABLE(x11,
+ [AC_HELP_STRING([--enable-x11],
+ [Enable X11 support and disable Wayland (unless it's also enabled explicitly)
+ @<:@default=yes@:>@])],
+ [must_enable_x11=yes
+ try_all_backends=no],)
+
+AC_ARG_ENABLE(wayland,
+ [AC_HELP_STRING([--enable-wayland],
+ [Enable Wayland support and disable X11 (unless it's also enabled explicitly)
+ @<:@default=yes@:>@])],
+ [must_enable_wayland=yes
+ try_all_backends=no],)
+
+# Check if we have wayland-client installed, and thus should build with Wayland support
+
+have_wayland=no
+
+if test "x$must_enable_wayland" = "xyes" -o "x$try_all_backends" = "xyes"; then
+ PKG_CHECK_MODULES(WAYLAND, wayland-client, have_wayland=yes,)
+fi
+
+AM_CONDITIONAL(ENABLE_WAYLAND, [test "x$have_wayland" = "xyes"])
+
+if test "x$have_wayland" = "xyes"; then
+ AC_DEFINE(HAVE_WAYLAND, 1, [Have the Wayland development library])
+fi
+
+# Error out if Wayland was required but not found
+if test "x$have_wayland" != "xyes" -a "x$must_enable_wayland" = "xyes"; then
+ # The user has explicitly told us to use Wayland, but we can't find the library :(
+ AC_MSG_ERROR([Wayland client library not found])
+fi
+
+# Check if we have the X development libraries
+# (we can compile with X and/or Wayland supported)
-PKG_CHECK_MODULES(X, x11 xau, :, AC_MSG_ERROR([X development libraries not found]))
+have_x11=no
+
+if test "x$must_enable_x11" = "xyes" -o "x$try_all_backends" = "xyes"; then
+ PKG_CHECK_MODULES(X, x11 xau, have_x11=yes, AC_MSG_ERROR([X development libraries not found]))
+fi
+
+AM_CONDITIONAL(ENABLE_X11, [test "x$have_x11" = "xyes"])
+
+if test "x$have_x11" = "xyes"; then
+ AC_DEFINE(HAVE_X11, 1, [Have the X11 development library])
+fi
+
+if test "x$have_x11" != "xyes" -a "x$have_wayland" != "xyes"; then
+ AC_MSG_ERROR([No usable backend available, install X or Wayland development libraries])
+fi
AC_SUBST(X_LIBS)
@@ -308,6 +361,8 @@ echo "
Maintainer mode: ${USE_MAINTAINER_MODE}
Use *_DISABLE_DEPRECATED: ${enable_deprecation_flags}
Applets to build in-process: ${PANEL_INPROCESS_APPLETS}
+ X11 support: ${have_x11}
+ Wayland support: ${have_wayland}
XRandr support: ${have_randr}
Build introspection support: ${found_introspection}
Build gtk-doc documentation: ${enable_gtk_doc}