From 891196bc95d9be45c446206407383b65454b404f Mon Sep 17 00:00:00 2001 From: raveit65 Date: Thu, 3 Oct 2013 20:50:36 +0200 Subject: configure: fix --with-systemd=auto --- configure.ac | 32 +++++++++++++++++++++++--------- 1 file changed, 23 insertions(+), 9 deletions(-) (limited to 'configure.ac') 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 -- cgit v1.2.1