If build in a prefix, define the system as prefix.

This commit is contained in:
Roy Marples 2008-03-02 10:40:08 +00:00
parent a135d0d93b
commit 7c092fbc79
3 changed files with 8 additions and 2 deletions

View File

@ -10,14 +10,14 @@ include ${MK}/sys.mk
# so we should embed it if different # so we should embed it if different
# This is currently hardcoded for NetBSD which has two dynamic linkers # This is currently hardcoded for NetBSD which has two dynamic linkers
# and we need to use the one in /libexec instead of /usr/libexec # and we need to use the one in /libexec instead of /usr/libexec
_DYNLINK_SH= if test -e /libexec/ld.elf_so; then \ _DYNLINK_SH= if test "${PREFIX}" = "" && test -e /libexec/ld.elf_so; then \
echo "-Wl,-dynamic-linker=/libexec/ld.elf_so"; \ echo "-Wl,-dynamic-linker=/libexec/ld.elf_so"; \
else \ else \
echo ""; \ echo ""; \
fi fi
_DYNLINK!= ${_DYNLINK_SH} _DYNLINK!= ${_DYNLINK_SH}
LDFLAGS+= ${_DYNLINK}$(shell ${_DYNLINK_SH}) LDFLAGS+= ${_DYNLINK}$(shell ${_DYNLINK_SH})
LDFLAGS+= -Wl,-rpath=/${LIBNAME} -L/${LIBNAME} LDFLAGS+= -Wl,-rpath=${PREFIX}/${LIBNAME} -L${PREFIX}/${LIBNAME}
LDFLAGS+= ${PROGLDFLAGS} LDFLAGS+= ${PROGLDFLAGS}
all: depend ${PROG} all: depend ${PROG}

View File

@ -186,6 +186,10 @@ static bool file_regex (const char *file, const char *regex)
const char *rc_sys (void) const char *rc_sys (void)
{ {
#ifdef PREFIX
return (RC_SYS_PREFIX);
#else
#ifdef __FreeBSD__ #ifdef __FreeBSD__
int jailed = 0; int jailed = 0;
size_t len = sizeof (jailed); size_t len = sizeof (jailed);
@ -208,6 +212,7 @@ const char *rc_sys (void)
#endif #endif
return (NULL); return (NULL);
#endif /* PREFIX */
} }
static const char *rc_parse_service_state (rc_service_state_t state) static const char *rc_parse_service_state (rc_service_state_t state)

View File

@ -232,6 +232,7 @@ bool rc_service_daemons_crashed (const char *service);
* OpenRC can support some special sub system types, normally virtualization. * OpenRC can support some special sub system types, normally virtualization.
* Some services cannot work in these systems, or we do something else. */ * Some services cannot work in these systems, or we do something else. */
#define RC_SYS_JAIL "JAIL" #define RC_SYS_JAIL "JAIL"
#define RC_SYS_PREFIX "PREFIX"
#define RC_SYS_UML "UML" #define RC_SYS_UML "UML"
#define RC_SYS_VPS "VPS" #define RC_SYS_VPS "VPS"
#define RC_SYS_XEN0 "XEN0" #define RC_SYS_XEN0 "XEN0"