]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/blob - m4/package_services.m4
f2d888a099a1bbf3f24a2720a4b5588a54e9d58a
[thirdparty/xfsprogs-dev.git] / m4 / package_services.m4
1 #
2 # Figure out where to put systemd service units
3 #
4 AC_DEFUN([AC_CONFIG_SYSTEMD_SYSTEM_UNIT_DIR],
5 [
6 AC_REQUIRE([PKG_PROG_PKG_CONFIG])
7 AC_ARG_WITH([systemd_unit_dir],
8 [AS_HELP_STRING([--with-systemd-unit-dir@<:@=DIR@:>@],
9 [Install systemd system units into DIR.])],
10 [],
11 [with_systemd_unit_dir=yes])
12 AS_IF([test "x${with_systemd_unit_dir}" != "xno"],
13 [
14 AS_IF([test "x${with_systemd_unit_dir}" = "xyes"],
15 [
16 PKG_CHECK_MODULES([systemd], [systemd],
17 [
18 with_systemd_unit_dir="$($PKG_CONFIG --variable=systemdsystemunitdir systemd)"
19 ], [
20 with_systemd_unit_dir=""
21 ])
22 m4_pattern_allow([^PKG_(MAJOR|MINOR|BUILD|REVISION)$])
23 ])
24 AC_MSG_CHECKING([for systemd system unit dir])
25 systemd_system_unit_dir="${with_systemd_unit_dir}"
26 AS_IF([test -n "${systemd_system_unit_dir}"],
27 [
28 AC_MSG_RESULT(${systemd_system_unit_dir})
29 have_systemd="yes"
30 ],
31 [
32 AC_MSG_RESULT(no)
33 have_systemd="no"
34 ])
35 ],
36 [
37 have_systemd="disabled"
38 ])
39 AC_SUBST(have_systemd)
40 AC_SUBST(systemd_system_unit_dir)
41 ])
42
43 #
44 # Figure out where to install crontabs
45 #
46 AC_DEFUN([AC_CONFIG_CROND_DIR],
47 [
48 AC_ARG_WITH([crond_dir],
49 [AS_HELP_STRING([--with-crond-dir@<:@=DIR@:>@],
50 [Install system crontabs into DIR.])],
51 [],
52 [with_crond_dir=yes])
53 AS_IF([test "x${with_crond_dir}" != "xno"],
54 [
55 AS_IF([test "x${with_crond_dir}" = "xyes"],
56 [
57 AS_IF([test -d "/etc/cron.d"],
58 [with_crond_dir="/etc/cron.d"])
59 ])
60 AC_MSG_CHECKING([for system crontab dir])
61 crond_dir="${with_crond_dir}"
62 AS_IF([test -n "${crond_dir}"],
63 [
64 AC_MSG_RESULT(${crond_dir})
65 have_crond="yes"
66 ],
67 [
68 AC_MSG_RESULT(no)
69 have_crond="no"
70 ])
71 ],
72 [
73 have_crond="disabled"
74 ])
75 AC_SUBST(have_crond)
76 AC_SUBST(crond_dir)
77 ])