2014-01-19 18:36:49 +04:00
|
|
|
AC_DEFUN([ZFS_AC_CONFIG_USER_SYSTEMD], [
|
|
|
|
AC_ARG_ENABLE(systemd,
|
|
|
|
AC_HELP_STRING([--enable-systemd],
|
|
|
|
[install systemd unit/preset files [[default: yes]]]),
|
2017-12-18 01:08:48 +03:00
|
|
|
[enable_systemd=$enableval],
|
|
|
|
[enable_systemd=check])
|
2014-01-19 18:36:49 +04:00
|
|
|
|
|
|
|
AC_ARG_WITH(systemdunitdir,
|
|
|
|
AC_HELP_STRING([--with-systemdunitdir=DIR],
|
|
|
|
[install systemd unit files in dir [[/usr/lib/systemd/system]]]),
|
|
|
|
systemdunitdir=$withval,systemdunitdir=/usr/lib/systemd/system)
|
|
|
|
|
|
|
|
AC_ARG_WITH(systemdpresetdir,
|
|
|
|
AC_HELP_STRING([--with-systemdpresetdir=DIR],
|
|
|
|
[install systemd preset files in dir [[/usr/lib/systemd/system-preset]]]),
|
|
|
|
systemdpresetdir=$withval,systemdpresetdir=/usr/lib/systemd/system-preset)
|
|
|
|
|
2014-09-18 17:47:16 +04:00
|
|
|
AC_ARG_WITH(systemdmodulesloaddir,
|
|
|
|
AC_HELP_STRING([--with-systemdmodulesloaddir=DIR],
|
|
|
|
[install systemd module load files into dir [[/usr/lib/modules-load.d]]]),
|
2018-11-12 05:06:36 +03:00
|
|
|
systemdmodulesloaddir=$withval,systemdmodulesloaddir=/usr/lib/modules-load.d)
|
2014-09-18 17:47:16 +04:00
|
|
|
|
2018-04-07 00:11:09 +03:00
|
|
|
AC_ARG_WITH(systemdgeneratordir,
|
|
|
|
AC_HELP_STRING([--with-systemdgeneratordir=DIR],
|
|
|
|
[install systemd generators in dir [[/usr/lib/systemd/system-generators]]]),
|
|
|
|
systemdgeneratordir=$withval,systemdgeneratordir=/usr/lib/systemd/system-generators)
|
|
|
|
|
2017-12-18 01:08:48 +03:00
|
|
|
AS_IF([test "x$enable_systemd" = xcheck], [
|
|
|
|
AS_IF([systemctl --version >/dev/null 2>&1],
|
|
|
|
[enable_systemd=yes],
|
|
|
|
[enable_systemd=no])
|
|
|
|
])
|
2014-09-18 17:47:16 +04:00
|
|
|
|
2017-12-18 01:08:48 +03:00
|
|
|
AC_MSG_CHECKING(for systemd support)
|
|
|
|
AC_MSG_RESULT([$enable_systemd])
|
|
|
|
|
|
|
|
AS_IF([test "x$enable_systemd" = xyes], [
|
2014-01-19 18:36:49 +04:00
|
|
|
ZFS_INIT_SYSTEMD=systemd
|
|
|
|
ZFS_MODULE_LOAD=modules-load.d
|
2018-04-07 00:11:09 +03:00
|
|
|
DEFINE_SYSTEMD='--with systemd --define "_unitdir $(systemdunitdir)" --define "_presetdir $(systemdpresetdir)" --define "_generatordir $(systemdgeneratordir)"'
|
2014-09-18 17:47:16 +04:00
|
|
|
modulesloaddir=$systemdmodulesloaddir
|
2017-12-18 01:08:48 +03:00
|
|
|
],[
|
|
|
|
DEFINE_SYSTEMD='--without systemd'
|
|
|
|
])
|
2014-01-19 18:36:49 +04:00
|
|
|
|
|
|
|
AC_SUBST(ZFS_INIT_SYSTEMD)
|
|
|
|
AC_SUBST(ZFS_MODULE_LOAD)
|
2017-12-18 01:08:48 +03:00
|
|
|
AC_SUBST(DEFINE_SYSTEMD)
|
2014-01-19 18:36:49 +04:00
|
|
|
AC_SUBST(systemdunitdir)
|
|
|
|
AC_SUBST(systemdpresetdir)
|
2018-04-07 00:11:09 +03:00
|
|
|
AC_SUBST(systemdgeneratordir)
|
2014-01-19 18:36:49 +04:00
|
|
|
AC_SUBST(modulesloaddir)
|
|
|
|
])
|