After changing LIBDIR to SHLIBDIR, because of dependencies problems,

new problem shows up: symblic links (<libname>.so) are created under
/usr/lib/ now, instead of under /lib/geom/ where geom(8) looks for them.
Introduce a workaround to fix this by teaching geom(8) to open libraries
via /lib/geom/<libname>.so.<major_number> instead of /lib/geom/<libname>.so.
This commit is contained in:
Pawel Jakub Dawidek 2004-08-01 22:24:07 +00:00
parent 4c22eb57f3
commit 32e7be7043
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=132982
4 changed files with 8 additions and 6 deletions

View File

@ -1,6 +1,7 @@
# $FreeBSD$
WARNS?= 6
CLASSDIR?=/lib/geom
CLASS_DIR?=/lib/geom
CLASS_MAJOR?=1
.include "../Makefile.inc"

View File

@ -1,8 +1,8 @@
# $FreeBSD$
SHLIB_MAJOR= 1
SHLIB_NAME?= geom_${CLASS}.so.${SHLIB_MAJOR}
SHLIBDIR?= ${CLASSDIR}
SHLIBDIR?=${CLASS_DIR}
SHLIB_MAJOR=${CLASS_MAJOR}
SHLIB_NAME?=geom_${CLASS}.so.${SHLIB_MAJOR}
LINKS= ${BINDIR}/geom ${BINDIR}/g${CLASS}
MAN= g${CLASS}.8
SRCS= geom_${CLASS}.c subr.c

View File

@ -6,7 +6,7 @@ PROG= geom
MAN= geom.8
SRCS= geom.c subr.c
CFLAGS+= -DCLASSDIR=\"${CLASSDIR}\"
CFLAGS+= -DCLASS_DIR=\"${CLASS_DIR}\" -DCLASS_MAJOR=${CLASS_MAJOR}
CFLAGS+= -I${.CURDIR}/../../../sys -I${.CURDIR} -I${.CURDIR}/..
DPADD= ${LIBGEOM} ${LIBSBUF} ${LIBBSDXML} ${LIBUTIL}

View File

@ -438,7 +438,8 @@ load_library(void)
uint32_t *lib_version;
void *dlh;
snprintf(path, sizeof(path), "%s/geom_%s.so", CLASSDIR, class_name);
snprintf(path, sizeof(path), "%s/geom_%s.so.%u", CLASS_DIR, class_name,
CLASS_MAJOR);
dlh = dlopen(path, RTLD_NOW);
if (dlh == NULL) {
#if 0