summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilliam Wold <[email protected]>2020-09-13 23:06:06 -0700
committerraveit65 <[email protected]>2020-10-24 16:49:14 +0200
commit6224c6d9e636186105fb08eb4724d499b1264fb0 (patch)
treed13d6f4d624560af50784058f70c84ea7a83b5bb
parentef9c8d6d603689c861397ac9a7bac6749663e898 (diff)
downloadmate-notification-daemon-6224c6d9e636186105fb08eb4724d499b1264fb0.tar.bz2
mate-notification-daemon-6224c6d9e636186105fb08eb4724d499b1264fb0.tar.xz
Support --enable-x11 and --enable-wayland
-rw-r--r--configure.ac67
1 files changed, 64 insertions, 3 deletions
diff --git a/configure.ac b/configure.ac
index 8ea0bc5..5566ced 100644
--- a/configure.ac
+++ b/configure.ac
@@ -126,11 +126,70 @@ pkg_modules="
glib-2.0 >= $REQ_GLIB_VERSION, \
gio-2.0 >= $REQ_GLIB_VERSION, \
$GMODULE_ADD \
- libcanberra-gtk3 >= $REQ_LIBCANBERRA_GTK_VERSION, \
- libwnck-3.0 \
- x11 \
+ libcanberra-gtk3 >= $REQ_LIBCANBERRA_GTK_VERSION \
"
PKG_CHECK_MODULES(NOTIFICATION_DAEMON, $pkg_modules)
+
+dnl Will call AC_SUBSET on NOTIFICATION_DAEMON_* below after appending X11 and Wayland flags
+
+dnl ---------------------------------------------------------------------------
+dnl Support X11, Wayland or both for the daemon
+dnl ---------------------------------------------------------------------------
+
+dnl $enable_x11 and $enable_wayland will be set to "yes", "no" or "auto"
+AC_ARG_ENABLE(x11,
+ [AC_HELP_STRING([--enable-x11],
+ [Explicitly enable or disable X11 support
+ (default is to enable only if X development libraries are detected)])],
+ [enable_x11=$enableval],
+ [enable_x11=auto])
+
+AC_ARG_ENABLE(wayland,
+ [AC_HELP_STRING([--enable-wayland],
+ [Explicitly enable or disable Wayland support
+ (default is to enable only if Wayland client development library is detected)])],
+ [enable_wayland=$enableval],
+ [enable_wayland=auto])
+
+dnl Check if we have gtk-layer-shell installed, and thus should build with Wayland support
+have_wayland=no
+if test "x$enable_wayland" != "xno"; then
+ PKG_CHECK_MODULES(NOTIFICATION_DAEMON_WAYLAND, gtk-layer-shell-0, [
+ have_wayland=yes
+ AC_DEFINE(HAVE_WAYLAND, 1, [Have the Wayland development library])
+ NOTIFICATION_DAEMON_CFLAGS="$NOTIFICATION_DAEMON_CFLAGS $NOTIFICATION_DAEMON_WAYLAND_CFLAGS"
+ NOTIFICATION_DAEMON_LIBS="$NOTIFICATION_DAEMON_LIBS $NOTIFICATION_DAEMON_WAYLAND_LIBS"
+ ], [
+ if test "x$enable_wayland" = "xyes"; then
+ AC_MSG_ERROR([Wayland enabled but GTK Layer Shell library not found])
+ fi
+ ])
+fi
+
+dnl Check if we have the X development libraries
+have_x11=no
+if test "x$enable_x11" != "xno"; then
+ x11_pkg_modules="libwnck-3.0, x11"
+ PKG_CHECK_MODULES(NOTIFICATION_DAEMON_X11, $x11_pkg_modules, [
+ have_x11=yes
+ AC_DEFINE(HAVE_X11, 1, [Have the X11 development library])
+ NOTIFICATION_DAEMON_CFLAGS="$NOTIFICATION_DAEMON_CFLAGS $NOTIFICATION_DAEMON_X11_CFLAGS"
+ NOTIFICATION_DAEMON_LIBS="$NOTIFICATION_DAEMON_LIBS $NOTIFICATION_DAEMON_X11_LIBS"
+ ], [
+ AC_MSG_ERROR([Did not find X11])
+ if test "x$enable_x11" = "xyes"; then
+ AC_MSG_ERROR([X development libraries not found])
+ fi
+ ])
+fi
+
+AM_CONDITIONAL(ENABLE_WAYLAND, [test "x$have_wayland" = "xyes"])
+AM_CONDITIONAL(ENABLE_X11, [test "x$have_x11" = "xyes"])
+
+if test "x$have_x11" != "xyes" -a "x$have_wayland" != "xyes"; then
+ AC_MSG_ERROR([At least one backend must be enabled (--enable-x11 or --enable-wayland)])
+fi
+
AC_SUBST(NOTIFICATION_DAEMON_CFLAGS)
AC_SUBST(NOTIFICATION_DAEMON_LIBS)
@@ -244,6 +303,8 @@ echo "
compiler: ${CC}
cflags: ${CFLAGS}
warning flags: ${WARN_CFLAGS}
+ Wayland support: ${have_wayland}
+ X11 support: ${have_x11}
dbus-1 system.d $DBUS_SYS_DIR
dbus-1 services $DBUS_SERVICES_DIR