Fix installation of libxo encoder modules.

Because the install location was hardcoded in the Makefile as
/usr/lib/libxo/encoder, the lib32 version was installed over the native
version.  Replace /usr/lib with ${LIBDIR}.

Also define SHLIB_NAME instead of LIB + FILES.  This prevents building a
static library.

MFC after:	2 weeks
This commit is contained in:
Tijl Coosemans 2020-05-31 17:20:17 +00:00
parent 796bf3133b
commit 3eee8f1cbb
3 changed files with 8 additions and 17 deletions

View File

@ -12,5 +12,9 @@
.. ..
i18n i18n
.. ..
libxo
encoder
..
..
.. ..
.. ..

View File

@ -8,30 +8,17 @@ LIBXOSRC= ${SRCTOP}/contrib/libxo
.PATH: ${LIBXOSRC}/encoder/csv .PATH: ${LIBXOSRC}/encoder/csv
# We use FILES to install the encoder library under the proper/magic SHLIBDIR= ${LIBDIR}/libxo/encoder
# name, in the proper/magic directory. libxo looks for encoders from SHLIB_NAME= csv.enc
# "--libxo encoder=name" as "${prefix}/lib/libxo/encoder/${name}.enc"
FILES = libenc_csv.so
FILESNAME_libenc_csv.so= csv.enc
FILESDIR = /usr/lib/libxo/encoder
LIB= enc_csv
SHLIB_MAJOR=0
SHLIB_NAME= lib${LIB}.so
SRCS= enc_csv.c SRCS= enc_csv.c
CFLAGS+=-I${LIBXOSRC}/libxo -I${.CURDIR} CFLAGS+=-I${LIBXOSRC}/libxo -I${.CURDIR}
CFLAGS+=-DXO_ENCODERDIR=\"/usr/lib/libxo/encoder\" CFLAGS+=-DXO_ENCODERDIR=\"${LIBDIR}/libxo/encoder\"
LIBADD= util xo LIBADD= util xo
LDFLAGS += -L${.OBJDIR:H:H}/libxo LDFLAGS += -L${.OBJDIR:H:H}/libxo
WARNS?= 5 WARNS?= 5
# Need to define a fake "install" target to block the one in bsd.lib.mk,
# since that one will install our lib in the wrong place (/usr/lib/).
install: realinstall
.include <bsd.lib.mk> .include <bsd.lib.mk>
.include <bsd.files.mk>

View File

@ -16,7 +16,7 @@ SHLIB_MAJOR=0
SRCS= libxo.c xo_encoder.c xo_syslog.c SRCS= libxo.c xo_encoder.c xo_syslog.c
CFLAGS+=-I${LIBXOSRC}/libxo -I${.CURDIR} CFLAGS+=-I${LIBXOSRC}/libxo -I${.CURDIR}
CFLAGS+=-DXO_ENCODERDIR=\"/usr/lib/libxo/encoder\" CFLAGS+=-DXO_ENCODERDIR=\"${LIBDIR}/libxo/encoder\"
INCS= xo.h xo_encoder.h INCS= xo.h xo_encoder.h
INCSDIR=${INCLUDEDIR}/libxo INCSDIR=${INCLUDEDIR}/libxo