diff options
author | Roy Marples <roy@marples.name> | 2008-03-05 12:27:11 +0000 |
---|---|---|
committer | Roy Marples <roy@marples.name> | 2008-03-05 12:27:11 +0000 |
commit | a689b66023ad7b3da179b02c9e473cbc49f295e6 (patch) | |
tree | c1e6baad98bdfde3c36f1105b8fe6f15534b30c4 /src | |
parent | 7aa231de2e784b00267cb618b728cf0f754c9573 (diff) |
Add tunable SYSCONFDIR
Diffstat (limited to 'src')
-rw-r--r-- | src/includes/rc-misc.h | 18 | ||||
-rw-r--r-- | src/librc/Makefile | 1 | ||||
-rw-r--r-- | src/rc/Makefile | 1 | ||||
-rw-r--r-- | src/rc/rc-misc.c | 8 |
4 files changed, 17 insertions, 11 deletions
diff --git a/src/includes/rc-misc.h b/src/includes/rc-misc.h index 56cfcfe0..fafbc49c 100644 --- a/src/includes/rc-misc.h +++ b/src/includes/rc-misc.h @@ -41,6 +41,10 @@ # define LIB "lib" #endif +#ifndef SYSCONFDIR +# define SYSCONFDIR "/etc" +#endif + #ifdef PREFIX # define RC_PREFIX PREFIX #else @@ -53,23 +57,23 @@ #define RC_LIBDIR RC_PREFIX "/" LIB "/rc" #define RC_SVCDIR RC_LIBDIR "/init.d" #define RC_DEPTREE RC_SVCDIR "/deptree" -#define RC_RUNLEVELDIR RC_PREFIX "/etc/runlevels" -#define RC_INITDIR RC_PREFIX "/etc/init.d" -#define RC_CONFDIR RC_PREFIX "/etc/conf.d" +#define RC_RUNLEVELDIR RC_PREFIX SYSCONFDIR "/runlevels" +#define RC_INITDIR RC_PREFIX SYSCONFDIR "/init.d" +#define RC_CONFDIR RC_PREFIX SYSCONFDIR "/conf.d" /* PKG_PREFIX is where packages are installed if different from the base OS * On Gentoo this is normally unset, on FreeBSD /usr/local and on NetBSD * /usr/pkg. */ #ifdef PKG_PREFIX -# define RC_PKG_INITDIR PKG_PREFIX "/etc/init.d" -# define RC_PKG_CONFDIR PKG_PREFIX "/etc/conf.d" +# define RC_PKG_INITDIR PKG_PREFIX SYSCONFDIR "/init.d" +# define RC_PKG_CONFDIR PKG_PREFIX SYSCONFDIR "/conf.d" #endif /* LOCAL_PREFIX is for user written stuff, which the base OS and package * manger don't touch. */ #ifdef LOCAL_PREFIX -# define RC_LOCAL_INITDIR LOCAL_PREFIX "/etc/init.d" -# define RC_LOCAL_CONFDIR LOCAL_PREFIX "/etc/conf.d" +# define RC_LOCAL_INITDIR LOCAL_PREFIX SYSCONFDIR "/init.d" +# define RC_LOCAL_CONFDIR LOCAL_PREFIX SYSCONFDIR "/conf.d" #endif #define RC_KSOFTLEVEL RC_SVCDIR "/ksoftlevel" diff --git a/src/librc/Makefile b/src/librc/Makefile index 880a56e7..78c97ce8 100644 --- a/src/librc/Makefile +++ b/src/librc/Makefile @@ -9,6 +9,7 @@ INCS= rc.h VERSION_MAP= rc.map CFLAGS+= -DLIB=\"${LIBNAME}\" +CFLAGS+= -DSYSCONFDIR=\"${SYSCONFDIR}\" LDADD+= ${LIBKVM} CFLAGS+= -I../includes diff --git a/src/rc/Makefile b/src/rc/Makefile index 26ee1312..6e0ca8d3 100644 --- a/src/rc/Makefile +++ b/src/rc/Makefile @@ -40,6 +40,7 @@ include ${MK}/prog.mk CFLAGS+= -I../includes -I../librc -I../libeinfo CFLAGS+= -DLIB=\"${LIBNAME}\" +CFLAGS+= -DSYSCONFDIR=\"${SYSCONFDIR}\" include ${MK}/${MKTERMCAP}.mk LDADD+= ${LIBDL} ${LIBKVM} diff --git a/src/rc/rc-misc.c b/src/rc/rc-misc.c index 78c1ddca..343a1534 100644 --- a/src/rc/rc-misc.c +++ b/src/rc/rc-misc.c @@ -49,11 +49,11 @@ #include "rc-misc.h" #include "strlist.h" -#define PROFILE_ENV "/etc/profile.env" +#define PROFILE_ENV SYSCONFDIR "/profile.env" #define SYS_WHITELIST RC_LIBDIR "/conf.d/env_whitelist" -#define USR_WHITELIST "/etc/conf.d/env_whitelist" -#define RC_CONF "/etc/rc.conf" -#define RC_CONF_OLD "/etc/conf.d/rc" +#define USR_WHITELIST SYSCONFDIR "/conf.d/env_whitelist" +#define RC_CONF SYSCONFDIR "/rc.conf" +#define RC_CONF_OLD SYSCONFDIR "/conf.d/rc" #define PATH_PREFIX RC_LIBDIR "/bin:/bin:/sbin:/usr/bin:/usr/sbin" |