summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorraveit65 <[email protected]>2013-10-03 20:50:36 +0200
committerStefano Karapetsas <[email protected]>2014-01-14 11:03:26 +0100
commit891196bc95d9be45c446206407383b65454b404f (patch)
treea0882093430e536a35df1bf2b2c991392373fb33
parent0c3dd853a5c4c7bb5742f2ee3e58ccc7e633958b (diff)
downloadmate-screensaver-891196bc95d9be45c446206407383b65454b404f.tar.bz2
mate-screensaver-891196bc95d9be45c446206407383b65454b404f.tar.xz
configure: fix --with-systemd=auto
-rw-r--r--configure.ac32
1 files changed, 23 insertions, 9 deletions
diff --git a/configure.ac b/configure.ac
index 1d7c401..911f9c7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -936,18 +936,32 @@ dnl ---------------------------------------------------------------------------
AC_ARG_WITH(systemd,
AS_HELP_STRING([--with-systemd],
- [Add systemd support]),,
- with_systemd=auto)
+ [Add systemd support]),
+ [with_systemd=$withval], [with_systemd=auto])
+
+PKG_CHECK_MODULES(SYSTEMD,
+ [libsystemd-login libsystemd-daemon],
+ [have_systemd=yes], [have_systemd=no])
+
+if test "x$with_systemd" = "xauto" ; then
+ if test x$have_systemd = xno ; then
+ use_systemd=no
+ else
+ use_systemd=yes
+ fi
+else
+ use_systemd=$with_systemd
+fi
-use_systemd=no
-if test "x$with_systemd" != "xno" ; then
- use_systemd=yes
- AC_DEFINE(WITH_SYSTEMD, 1, [systemd support])
+if test "x$use_systemd" = "xyes"; then
+ if test "x$have_systemd" = "xno"; then
+ AC_MSG_ERROR([Systemd support explicitly required, but systemd not found])
+ fi
- PKG_CHECK_MODULES(SYSTEMD, libsystemd-login libsystemd-daemon)
+ AC_DEFINE(WITH_SYSTEMD, 1, [systemd support])
fi
-AM_CONDITIONAL(WITH_SYSTEMD, test x$use_systemd = xyes)
-AC_SUBST(WITH_SYSTEMD)
+AC_SUBST(SYSTEMD_CFLAGS)
+AC_SUBST(SYSTEMD_LIBS)
dnl ---------------------------------------------------------------------------
dnl libmatekbd