From 32e7be7043b962f004dc412716243fb80febf603 Mon Sep 17 00:00:00 2001 From: Pawel Jakub Dawidek Date: Sun, 1 Aug 2004 22:24:07 +0000 Subject: [PATCH] After changing LIBDIR to SHLIBDIR, because of dependencies problems, new problem shows up: symblic links (.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/.so. instead of /lib/geom/.so. --- sbin/geom/Makefile.inc | 3 ++- sbin/geom/class/Makefile.inc | 6 +++--- sbin/geom/core/Makefile | 2 +- sbin/geom/core/geom.c | 3 ++- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/sbin/geom/Makefile.inc b/sbin/geom/Makefile.inc index ac8d315b8c50..d3914abe0b28 100644 --- a/sbin/geom/Makefile.inc +++ b/sbin/geom/Makefile.inc @@ -1,6 +1,7 @@ # $FreeBSD$ WARNS?= 6 -CLASSDIR?=/lib/geom +CLASS_DIR?=/lib/geom +CLASS_MAJOR?=1 .include "../Makefile.inc" diff --git a/sbin/geom/class/Makefile.inc b/sbin/geom/class/Makefile.inc index 6102b0562bf9..aeb0dcdea5bf 100644 --- a/sbin/geom/class/Makefile.inc +++ b/sbin/geom/class/Makefile.inc @@ -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 diff --git a/sbin/geom/core/Makefile b/sbin/geom/core/Makefile index 053dbd0da3dd..6ee6c39c82b3 100644 --- a/sbin/geom/core/Makefile +++ b/sbin/geom/core/Makefile @@ -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} diff --git a/sbin/geom/core/geom.c b/sbin/geom/core/geom.c index 12959a335c80..dcc663139005 100644 --- a/sbin/geom/core/geom.c +++ b/sbin/geom/core/geom.c @@ -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