summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorFabiano Fidencio <fidencio@profusion.mobi>2010-09-21 00:23:12 -0300
committerLennart Poettering <lennart@poettering.net>2010-09-27 03:25:05 +0200
commit07459bb6b92268beb2599f65cf195708d88c51cc (patch)
treef533168f2e656f3de37a53293b60b1a27b8580be /configure.ac
parent66d9b3b59551a33398b2201662af5c8c17a367c9 (diff)
sysv: optionally disable of SysV init/rcN.d support at compile time
This patch adds a cpp definition HAVE_SYSV_COMPAT that is used to isolate code dealing with /etc/init.d and /etc/rcN.d for systems where it does not make sense (one that does not use sysv or one that is fully systemd native). The patch tries to be as little intrusive as possible, however in order to minimize the number of #ifdef'ed regions I've reordered some code in path-lookup.c:lookup_paths_init() where all code dealing with sysv is now isolated under running_as == MANAGER_SYSTEM as well. Moreover, In struct Service, some fields were rearranged to reduce the number of ifdefs. Lennart's suggestions were fixed and squashed with the original patch, that was sent by Gustavo Sverzut Barbieri (barbieri@profusion.mobi).
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac17
1 files changed, 12 insertions, 5 deletions
diff --git a/configure.ac b/configure.ac
index da627a0028..753adc5096 100644
--- a/configure.ac
+++ b/configure.ac
@@ -311,7 +311,8 @@ case $with_distro in
M4_DISTRO_FLAG=-DTARGET_ARCH=1
;;
gentoo)
- SYSTEM_SYSVRCND_PATH=/etc
+ SYSTEM_SYSVINIT_PATH=
+ SYSTEM_SYSVRCND_PATH=
SPECIAL_SYSLOG_SERVICE=syslog-ng.service
AC_DEFINE(TARGET_GENTOO, [], [Target is Gentoo])
M4_DISTRO_FLAG=-DTARGET_GENTOO=1
@@ -323,10 +324,6 @@ case $with_distro in
M4_DISTRO_FLAG=-DTARGET_SLACKWARE=1
;;
other)
- AS_IF([test "x$with_sysvinit_path" = "x"],
- [AC_MSG_ERROR([With --distro=other, you must pass --with-sysvinit-path= to configure])])
- AS_IF([test "x$with_sysvrcd_path" = "x"],
- [AC_MSG_ERROR([With --distro=other, you must pass --with-sysvrcd-path= to configure])])
AS_IF([test "x$with_syslog_service" = "x"],
[AC_MSG_ERROR([With --distro=other, you must pass --with-syslog-service= to configure])])
;;
@@ -358,6 +355,15 @@ AC_SUBST(SYSTEM_SYSVRCND_PATH)
AC_SUBST(SPECIAL_SYSLOG_SERVICE)
AC_SUBST(M4_DISTRO_FLAG)
+if test "x${SYSTEM_SYSVINIT_PATH}" != "x" -a "x${SYSTEM_SYSVRCND_PATH}" != "x"; then
+ AC_DEFINE(HAVE_SYSV_COMPAT, [], [SysV init scripts and rcN.d links are supported.])
+ SYSTEM_SYSV_COMPAT="yes"
+elif test "x${SYSTEM_SYSVINIT_PATH}" != "x" -o "x${SYSTEM_SYSVRCND_PATH}" != "x"; then
+ AC_MSG_ERROR([*** You need both --with-sysvinit-path=PATH and --with-sysvrcd-path=PATH to enable SysV compatibility support, or both empty to disable it.])
+else
+ SYSTEM_SYSV_COMPAT="no"
+fi
+
AM_CONDITIONAL(TARGET_FEDORA, test x"$with_distro" = xfedora)
AM_CONDITIONAL(TARGET_SUSE, test x"$with_distro" = xsuse)
AM_CONDITIONAL(TARGET_DEBIAN, test x"$with_distro" = xdebian)
@@ -417,6 +423,7 @@ echo "
$PACKAGE_NAME $VERSION
Distribution: ${with_distro}
+ SysV compatibility: ${SYSTEM_SYSV_COMPAT}
SysV init scripts: ${SYSTEM_SYSVINIT_PATH}
SysV rc?.d directories: ${SYSTEM_SYSVRCND_PATH}
Syslog service: ${SPECIAL_SYSLOG_SERVICE}