diff options
author | Jakub Hrozek <jhrozek@redhat.com> | 2011-04-05 15:42:13 +0200 |
---|---|---|
committer | Stephen Gallagher <sgallagh@redhat.com> | 2011-04-12 09:26:26 -0400 |
commit | 2a5790216f57e9bdfb2930d52860bb5300366536 (patch) | |
tree | 41d9ad9913dcc3cda3aed38f64f5f1c6ef251d18 /src | |
parent | 00e9f24707a2d221ed2be40289669e4fd731713e (diff) | |
download | sssd-2a5790216f57e9bdfb2930d52860bb5300366536.tar.gz sssd-2a5790216f57e9bdfb2930d52860bb5300366536.tar.bz2 sssd-2a5790216f57e9bdfb2930d52860bb5300366536.zip |
Provide a configuration option to use systemd unit file
https://fedorahosted.org/sssd/ticket/837
Diffstat (limited to 'src')
-rw-r--r-- | src/conf_macros.m4 | 44 | ||||
-rw-r--r-- | src/external/systemd.m4 | 8 |
2 files changed, 52 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 ]) + diff --git a/src/external/systemd.m4 b/src/external/systemd.m4 new file mode 100644 index 00000000..2c26dc19 --- /dev/null +++ b/src/external/systemd.m4 @@ -0,0 +1,8 @@ +dnl A macro to check presence of systemd on the system +AC_DEFUN([AM_CHECK_SYSTEMD], +[ + PKG_CHECK_EXISTS(systemd, + [ HAVE_SYSTEMD=1, AC_SUBST(HAVE_SYSTEMD) ], + [AC_MSG_ERROR([Could not detect systemd presence])] + ) +]) |