diff options
-rw-r--r-- | configure.ac | 8 | ||||
-rw-r--r-- | src/gpm-manager.c | 6 |
2 files changed, 9 insertions, 5 deletions
diff --git a/configure.ac b/configure.ac index 6e36106..748494b 100644 --- a/configure.ac +++ b/configure.ac @@ -280,10 +280,12 @@ AC_ARG_WITH(systemdinhibit, use_systemdinhibit=no if test "x$with_systemdinhibit" != "xno" ; then - use_systemdinhibit=yes - AC_DEFINE(WITH_SYSTEMD_INHIBIT, 1, [systemdinhibit support]) + PKG_CHECK_MODULES(SYSTEMD_INHIBIT, libsystemd-login libsystemd-daemon, use_systemdinhibit=yes, use_systemdinhibit=no) + + if test "x$use_systemdinhibit" = "xyes"; then + AC_DEFINE(WITH_SYSTEMD_INHIBIT, 1, [systemdinhibit support]) + fi - PKG_CHECK_MODULES(SYSTEMD_INHIBIT, libsystemd-login libsystemd-daemon) fi AM_CONDITIONAL(WITH_SYSTEMD_INHIBIT, test x$use_systemdinhibit = xyes) AC_SUBST(WITH_SYSTEMD_INHIBIT) diff --git a/src/gpm-manager.c b/src/gpm-manager.c index c6f4d79..f1be5d8 100644 --- a/src/gpm-manager.c +++ b/src/gpm-manager.c @@ -100,8 +100,10 @@ struct GpmManagerPrivate NotifyNotification *notification_warning_low; NotifyNotification *notification_discharging; NotifyNotification *notification_fully_charged; - gint32 systemd_inhibit; - GDBusProxy *systemd_inhibit_proxy; +#ifdef WITH_SYSTEMD_INHIBIT + gint32 systemd_inhibit; + GDBusProxy *systemd_inhibit_proxy; +#endif }; typedef enum { |