From c38e25ccb5f77ae4bfca9a43e54b4554220bdba9 Mon Sep 17 00:00:00 2001 From: Stefano Karapetsas Date: Thu, 7 Nov 2013 19:38:44 +0100 Subject: Make upower optional This commit is just an improved version of the pull request by Wolfgang Ulbrich at https://github.com/mate-desktop/mate-session-manager/pull/38 making it working with both upower and systemd, and improving configure part --- configure.ac | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 88a669b..b706409 100644 --- a/configure.ac +++ b/configure.ac @@ -70,7 +70,6 @@ PKG_CHECK_MODULES(MATE_SESSION, gio-2.0 >= $GIO_REQUIRED gtk+-$GTK_API_VERSION >= $GTK_REQUIRED dbus-glib-1 >= $DBUS_GLIB_REQUIRED - upower-glib >= $UPOWER_REQUIRED ) PKG_CHECK_MODULES(SESSION_PROPERTIES, @@ -127,6 +126,24 @@ fi AM_CONDITIONAL(HAVE_SYSTEMD, test "x$use_systemd" = "xyes") AC_SUBST(HAVE_SYSTEMD) +dnl ==================================================================== +dnl UPOWER +dnl ==================================================================== + +AC_ARG_ENABLE(upower, + AS_HELP_STRING([--enable-upower], + [Use upower to suspend/hibernate]), + enable_upower=$enableval, + enable_upower=yes) +if test "x$enable_upower" = "xyes"; then + PKG_CHECK_MODULES(UPOWER, upower-glib >= $UPOWER_REQUIRED, has_upower=yes, has_upower=no) + AC_DEFINE(HAVE_UPOWER, 1, [upower support]) + AC_SUBST(UPOWER_CFLAGS) + AC_SUBST(UPOWER_LIBS) +fi +AM_CONDITIONAL(HAVE_UPOWER, test "x$enable_upower" = "xyes") +AC_SUBST(HAVE_UPOWER) + dnl ==================================================================== dnl X development libraries check dnl ==================================================================== @@ -385,6 +402,7 @@ echo " GTK+ version: ${with_gtk} Default WM: ${with_default_wm} Systemd support: ${use_systemd} + Upower support: ${enable_upower} IPv6 support: ${have_full_ipv6} Backtrace support: ${have_backtrace} XRender support: ${have_xrender} -- cgit v1.2.1