# Dirs of external packages
dbuspolicydir=@dbuspolicydir@
dbussystemservicedir=@dbussystemservicedir@
+systemdsystemunitdir = $(prefix)/lib/systemd/system
CLEANFILES =
DISTCLEANFILES =
DISTCHECK_CONFIGURE_FLAGS = \
--with-dbuspolicydir=$$dc_install_base/$(dbuspolicydir) \
- --with-dbussystemservicedir=$$dc_install_base/$(dbussystemservicedir) \
- --with-systemdsystemunitdir=$$dc_install_base/$(systemdsystemunitdir)
+ --with-dbussystemservicedir=$$dc_install_base/$(dbussystemservicedir)
# ------------------------------------------------------------------------------
PKG_CHECK_MODULES([OPING], [liboping])
+# systemd
+PKG_CHECK_MODULES(systemd, [libsystemd])
+
# Python
AM_PATH_PYTHON([3.9])
PKG_CHECK_MODULES([PYTHON], [python-${PYTHON_VERSION}])
# ------------------------------------------------------------------------------
-AC_ARG_WITH([systemd],
- AS_HELP_STRING([--with-systemd], [Enable systemd support.])
-)
-
AC_ARG_WITH([dbuspolicydir],
AS_HELP_STRING([--with-dbuspolicydir=DIR], [D-Bus policy directory]),
[],
[with_dbussystemservicedir=${datadir}/dbus-1/system-services]
)
-AS_IF([test "x$with_systemd" != "xno"],
- [PKG_CHECK_MODULES(systemd, [libsystemd],
- [have_systemd=yes], [have_systemd=no])],
- [have_systemd=no]
-)
-
-AS_IF([test "x$have_systemd" = "xyes"],
- [AC_MSG_CHECKING([for systemd system unit directory])
- AC_ARG_WITH([systemdsystemunitdir],
- AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd service files]),
- [], [with_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)]
- )
-
- AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir])
-
- if test -n "$systemdsystemunitdir" -a "x$systemdsystemunitdir" != xno; then
- AC_MSG_RESULT([$systemdsystemunitdir])
- else
- AC_MSG_ERROR([not found (try --with-systemdsystemunitdir)])
- fi
- ],
- [AS_IF([test "x$with_systemd" = "xyes"],
- [AC_MSG_ERROR([Systemd support is enabled but no systemd has been found.])
- ])
-])
-
-AM_CONDITIONAL(HAVE_SYSTEMD, [test "x$have_systemd" = "xyes"])
-
AC_SUBST([dbuspolicydir], [$with_dbuspolicydir])
AC_SUBST([dbussystemservicedir], [$with_dbussystemservicedir])
D-Bus policy dir: ${with_dbuspolicydir}
D-Bus system dir: ${with_dbussystemservicedir}
- Systemd support ${have_systemd}
Generate man-pages: ${have_manpages}
])