aboutsummaryrefslogtreecommitdiff
path: root/src/librc
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2008-02-28 11:08:49 +0000
committerRoy Marples <roy@marples.name>2008-02-28 11:08:49 +0000
commitf092045650faad778d25d000d80b3128664d2e2a (patch)
tree89188e92a4d01423ee59e33e5eaf5355fa14d103 /src/librc
parentaabf3976db5ffb41f8f8bbd47f5015b4158e095a (diff)
Support the use of PREFIX and PKG_PREFIX.
Diffstat (limited to 'src/librc')
-rw-r--r--src/librc/Makefile2
-rw-r--r--src/librc/librc-depend.c8
-rw-r--r--src/librc/librc.c12
3 files changed, 16 insertions, 6 deletions
diff --git a/src/librc/Makefile b/src/librc/Makefile
index 888155b8..880a56e7 100644
--- a/src/librc/Makefile
+++ b/src/librc/Makefile
@@ -13,7 +13,5 @@ LDADD+= ${LIBKVM}
CFLAGS+= -I../includes
-SHLIBDIR= /${LIBNAME}
-
include ${MK}/cc.mk
include ${MK}/lib.mk
diff --git a/src/librc/librc-depend.c b/src/librc/librc-depend.c
index cf978d63..1ab2b604 100644
--- a/src/librc/librc-depend.c
+++ b/src/librc/librc-depend.c
@@ -696,8 +696,12 @@ bool rc_deptree_update_needed (void)
if (! existss (RC_DEPTREE) ||
! rc_newer_than (RC_DEPTREE, RC_INITDIR) ||
! rc_newer_than (RC_DEPTREE, RC_CONFDIR) ||
- ! rc_newer_than (RC_DEPTREE, RC_INITDIR_LOCAL) ||
- ! rc_newer_than (RC_DEPTREE, RC_CONFDIR_LOCAL) ||
+#ifdef RC_PKG_INITDIR
+ ! rc_newer_than (RC_DEPTREE, RC_PKG_INITDIR) ||
+#endif
+#ifdef RC_PKG_CONFDIR
+ ! rc_newer_than (RC_DEPTREE, RC_PKG_CONFDIR) ||
+#endif
! rc_newer_than (RC_DEPTREE, "/etc/rc.conf"))
return (true);
diff --git a/src/librc/librc.c b/src/librc/librc.c
index 12d31348..552e083d 100644
--- a/src/librc/librc.c
+++ b/src/librc/librc.c
@@ -328,11 +328,13 @@ char *rc_service_resolve (const char *service)
snprintf (buffer, sizeof (buffer), RC_INITDIR "/%s", service);
/* So we don't exist in /etc/init.d - check /usr/local/etc/init.d */
+#ifdef RC_PKG_INITDIR
if (stat (buffer, &buf) != 0) {
- snprintf (buffer, sizeof (buffer), RC_INITDIR_LOCAL "/%s", service);
+ snprintf (buffer, sizeof (buffer), RC_PKG_INITDIR "/%s", service);
if (stat (buffer, &buf) != 0)
return (NULL);
}
+#endif
return (xstrdup (buffer));
}
@@ -781,12 +783,18 @@ char **rc_services_in_runlevel (const char *runlevel)
if (! runlevel) {
int i;
- char **local = ls_dir (RC_INITDIR_LOCAL, LS_INITD);
+#ifdef RC_PKG_INITDIR
+ char **local = ls_dir (RC_PKG_INITDIR, LS_INITD);
+#endif
list = ls_dir (RC_INITDIR, LS_INITD);
+
+#ifdef RC_PKG_INITDIR
STRLIST_FOREACH (local, dir, i)
rc_strlist_addsortu (&list, dir);
rc_strlist_free (local);
+#endif
+
return (list);
}