summaryrefslogtreecommitdiffstats
path: root/src/conf_macros.m4
diff options
context:
space:
mode:
authorJakub Hrozek <jhrozek@redhat.com>2011-04-05 15:42:13 +0200
committerStephen Gallagher <sgallagh@redhat.com>2011-04-12 09:26:26 -0400
commit2a5790216f57e9bdfb2930d52860bb5300366536 (patch)
tree41d9ad9913dcc3cda3aed38f64f5f1c6ef251d18 /src/conf_macros.m4
parent00e9f24707a2d221ed2be40289669e4fd731713e (diff)
downloadsssd_unused-2a5790216f57e9bdfb2930d52860bb5300366536.tar.gz
sssd_unused-2a5790216f57e9bdfb2930d52860bb5300366536.tar.xz
sssd_unused-2a5790216f57e9bdfb2930d52860bb5300366536.zip
Provide a configuration option to use systemd unit file
https://fedorahosted.org/sssd/ticket/837
Diffstat (limited to 'src/conf_macros.m4')
-rw-r--r--src/conf_macros.m444
1 files changed, 44 insertions, 0 deletions
diff --git a/src/conf_macros.m4 b/src/conf_macros.m4
index d759c48e..273a5270 100644
--- a/src/conf_macros.m4
+++ b/src/conf_macros.m4
@@ -100,6 +100,30 @@ AC_DEFUN([WITH_PIPE_PATH],
AC_DEFINE_UNQUOTED(PIPE_PATH, "$config_pipepath", [Where to store pipe files for the SSSD interconnects])
])
+AC_DEFUN([WITH_INITSCRIPT],
+ [ AC_ARG_WITH([initscript],
+ [AC_HELP_STRING([--with-initscript=INITSCRIPT_TYPE],
+ [Type of your init script (sysv|systemd). [sysv]]
+ )
+ ]
+ )
+ default_initscript=sysv
+ if test x"$with_initscript" = x; then
+ with_initscript=$default_initscript
+ fi
+
+ if test x"$with_initscript" = xsysv || \
+ test x"$with_initscript" = xsystemd; then
+ initscript=$with_initscript
+ else
+ AC_MSG_ERROR([Illegal value -$with_initscript- for option --with-initscript])
+ fi
+
+ AM_CONDITIONAL([HAVE_SYSV], [test x"$initscript" = xsysv])
+ AM_CONDITIONAL([HAVE_SYSTEMD_UNIT], [test x"$initscript" = xsystemd])
+ AC_MSG_NOTICE([Will use init script type: $initscript])
+ ])
+
AC_DEFUN([WITH_INIT_DIR],
[ AC_ARG_WITH([init-dir],
[AC_HELP_STRING([--with-init-dir=DIR],
@@ -117,6 +141,25 @@ AC_DEFUN([WITH_INIT_DIR],
AC_SUBST(initdir)
])
+dnl A macro to configure the directory to install the systemd unit files to
+AC_DEFUN([WITH_SYSTEMD_UNIT_DIR],
+ [ AC_ARG_WITH([systemdunitdir],
+ [ AC_HELP_STRING([--with-systemdunitdir=DIR],
+ [Directory for systemd service files [Auto]]
+ ),
+ ],
+ )
+ if test x"$with_systemdunitdir" != x; then
+ systemdunitdir=$with_systemdunitdir
+ else
+ systemdunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)
+ if test x"$systemdunitdir" = x; then
+ AC_MSG_ERROR([Could not detect systemd unit directory])
+ fi
+ fi
+ AC_SUBST(systemdunitdir)
+ ])
+
AC_DEFUN([WITH_MANPAGES],
[ AC_ARG_WITH([manpages],
[AC_HELP_STRING([--with-manpages],
@@ -251,3 +294,4 @@ AC_DEFUN([WITH_LIBNL],
AC_SUBST(BUILD_LIBNL)
fi
])
+