Allow proper builds of libxo's CSV encoder:

- Move libxo.a build to subdirectory (lib/libxo/libxo/Makefile)
- Add .WAIT target to delay encoder build til after libxo
- Use FILES to install encoder library as csv.enc
- Update import script to put xo_config.h in new location
This commit is contained in:
Phil Shafer 2019-12-16 22:05:03 +00:00
parent 7f5499972e
commit 2db46b45f4
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=355826
7 changed files with 133 additions and 121 deletions

View file

@ -1,119 +1,10 @@
# $FreeBSD$
SHLIBDIR?= /lib
.include <src.opts.mk>
PACKAGE= runtime
LIBXOSRC= ${SRCTOP}/contrib/libxo
.PATH: ${LIBXOSRC}/libxo
LIB= xo
SHLIB_MAJOR=0
SRCS= libxo.c xo_encoder.c xo_syslog.c
CFLAGS+=-I${LIBXOSRC}/libxo -I${.CURDIR}
CFLAGS+=-DXO_ENCODERDIR=\"/usr/lib/libxo/encoder\"
INCS= xo.h xo_encoder.h
INCSDIR=${INCLUDEDIR}/libxo
LIBADD= util
WARNS?= 5
MAN+= libxo.3
MAN+= xo_attr.3 \
xo_create.3 \
xo_emit.3 \
xo_emit_err.3 \
xo_err.3 \
xo_error.3 \
xo_finish.3 \
xo_flush.3 \
xo_message.3 \
xo_no_setlocale.3 \
xo_open_container.3 \
xo_open_list.3 \
xo_open_marker.3 \
xo_parse_args.3 \
xo_set_allocator.3 \
xo_set_flags.3 \
xo_set_info.3 \
xo_set_options.3 \
xo_set_style.3 \
xo_set_syslog_enterprise_id.3 \
xo_set_version.3 \
xo_set_writer.3 \
xo_syslog.3
MAN+= xo_format.5
MAN+= xo_options.7
MLINKS= xo_attr.3 xo_attr_h.3 \
xo_attr.3 xo_attr_hv.3 \
xo_create.3 xo_create_to_file.3 \
xo_create.3 xo_destroy.3 \
xo_emit.3 xo_emit_h.3 \
xo_emit.3 xo_emit_hv.3 \
xo_emit_err.3 xo_emit_errc.3 \
xo_emit_err.3 xo_emit_errx.3 \
xo_emit_err.3 xo_emit_warn.3 \
xo_emit_err.3 xo_emit_warnx.3 \
xo_emit_err.3 xo_emit_warn_c.3 \
xo_emit_err.3 xo_emit_warn_hc.3 \
xo_err.3 xo_errc.3 \
xo_err.3 xo_errx.3 \
xo_err.3 xo_warn.3 \
xo_err.3 xo_warnx.3 \
xo_err.3 xo_warn_c.3 \
xo_err.3 xo_warn_hc.3 \
xo_finish.3 xo_finish_h.3 \
xo_flush.3 xo_flush_h.3 \
xo_message.3 xo_message_c.3 \
xo_message.3 xo_message_hc.3 \
xo_message.3 xo_message_hcv.3 \
xo_open_container.3 xo_open_container_h.3 \
xo_open_container.3 xo_open_container_hd.3 \
xo_open_container.3 xo_open_container_d.3 \
xo_open_container.3 xo_close_container.3 \
xo_open_container.3 xo_close_container_h.3 \
xo_open_container.3 xo_close_container_hd.3 \
xo_open_container.3 xo_close_container_d.3 \
xo_open_list.3 xo_open_list_h.3 \
xo_open_list.3 xo_open_list_hd.3 \
xo_open_list.3 xo_open_list_d.3 \
xo_open_list.3 xo_open_instance.3 \
xo_open_list.3 xo_open_instance_h.3 \
xo_open_list.3 xo_open_instance_hd.3 \
xo_open_list.3 xo_open_instance_d.3 \
xo_open_list.3 xo_close_instance.3 \
xo_open_list.3 xo_close_instance_h.3 \
xo_open_list.3 xo_close_instance_hd.3 \
xo_open_list.3 xo_close_instance_d.3 \
xo_open_list.3 xo_close_list.3 \
xo_open_list.3 xo_close_list_h.3 \
xo_open_list.3 xo_close_list_hd.3 \
xo_open_list.3 xo_close_list_d.3 \
xo_open_marker.3 xo_open_marker_h.3 \
xo_open_marker.3 xo_close_marker.3 \
xo_open_marker.3 xo_close_marker_h.3 \
xo_parse_args.3 xo_set_program.3 \
xo_set_flags.3 xo_clear_flags.3 \
xo_set_style.3 xo_set_style_name.3 \
xo_set_version.3 xo_set_version_h.3 \
xo_syslog.3 xo_close_log.3 \
xo_syslog.3 xo_open_log.3 \
xo_syslog.3 xo_set_logmask.3 \
xo_syslog.3 xo_vsyslog.3
HAS_TESTS=
SUBDIR.${MK_TESTS}+= tests
#SUBDIR = encoder
SUBDIR = libxo .WAIT encoder
.include <bsd.lib.mk>
.include <bsd.subdir.mk>

View file

@ -1,9 +1,5 @@
# $FreeBSD$
LIBXODIR= ${STAGEDIR}${PREFIX}/usr/lib/libxo/encoder
SHLIBDIR?= ${LIBXODIR}
LIBDIR?= ${LIBXODIR}
.include <src.opts.mk>
PACKAGE= runtime
@ -12,8 +8,16 @@ LIBXOSRC= ${SRCTOP}/contrib/libxo
.PATH: ${LIBXOSRC}/encoder/csv
# We use FILES to install the encoder library under the proper/magic
# name, in the proper/magic directory. libxo looks for encoders from
# "--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
@ -21,10 +25,13 @@ CFLAGS+=-I${LIBXOSRC}/libxo -I${.CURDIR}
CFLAGS+=-DXO_ENCODERDIR=\"/usr/lib/libxo/encoder\"
LIBADD= util xo
LDFLAGS += -L${.OBJDIR}/../../wildebeast
LDFLAGS += -L${.OBJDIR:H:H}/libxo
WARNS?= 5
SYMLINKS+= ${SHLIB_NAME} ${LIBXODIR}/csv.enc
# 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.files.mk>

114
lib/libxo/libxo/Makefile Normal file
View file

@ -0,0 +1,114 @@
# $FreeBSD$
SHLIBDIR?= /lib
.include <src.opts.mk>
PACKAGE= runtime
LIBXOSRC= ${SRCTOP}/contrib/libxo
.PATH: ${LIBXOSRC}/libxo
LIB= xo
SHLIB_MAJOR=0
SRCS= libxo.c xo_encoder.c xo_syslog.c
CFLAGS+=-I${LIBXOSRC}/libxo -I${.CURDIR}
CFLAGS+=-DXO_ENCODERDIR=\"/usr/lib/libxo/encoder\"
INCS= xo.h xo_encoder.h
INCSDIR=${INCLUDEDIR}/libxo
LIBADD= util
WARNS?= 5
MAN+= libxo.3
MAN+= xo_attr.3 \
xo_create.3 \
xo_emit.3 \
xo_emit_err.3 \
xo_err.3 \
xo_error.3 \
xo_finish.3 \
xo_flush.3 \
xo_message.3 \
xo_no_setlocale.3 \
xo_open_container.3 \
xo_open_list.3 \
xo_open_marker.3 \
xo_parse_args.3 \
xo_set_allocator.3 \
xo_set_flags.3 \
xo_set_info.3 \
xo_set_options.3 \
xo_set_style.3 \
xo_set_syslog_enterprise_id.3 \
xo_set_version.3 \
xo_set_writer.3 \
xo_syslog.3
MAN+= xo_format.5
MAN+= xo_options.7
MLINKS= xo_attr.3 xo_attr_h.3 \
xo_attr.3 xo_attr_hv.3 \
xo_create.3 xo_create_to_file.3 \
xo_create.3 xo_destroy.3 \
xo_emit.3 xo_emit_h.3 \
xo_emit.3 xo_emit_hv.3 \
xo_emit_err.3 xo_emit_errc.3 \
xo_emit_err.3 xo_emit_errx.3 \
xo_emit_err.3 xo_emit_warn.3 \
xo_emit_err.3 xo_emit_warnx.3 \
xo_emit_err.3 xo_emit_warn_c.3 \
xo_emit_err.3 xo_emit_warn_hc.3 \
xo_err.3 xo_errc.3 \
xo_err.3 xo_errx.3 \
xo_err.3 xo_warn.3 \
xo_err.3 xo_warnx.3 \
xo_err.3 xo_warn_c.3 \
xo_err.3 xo_warn_hc.3 \
xo_finish.3 xo_finish_h.3 \
xo_flush.3 xo_flush_h.3 \
xo_message.3 xo_message_c.3 \
xo_message.3 xo_message_hc.3 \
xo_message.3 xo_message_hcv.3 \
xo_open_container.3 xo_open_container_h.3 \
xo_open_container.3 xo_open_container_hd.3 \
xo_open_container.3 xo_open_container_d.3 \
xo_open_container.3 xo_close_container.3 \
xo_open_container.3 xo_close_container_h.3 \
xo_open_container.3 xo_close_container_hd.3 \
xo_open_container.3 xo_close_container_d.3 \
xo_open_list.3 xo_open_list_h.3 \
xo_open_list.3 xo_open_list_hd.3 \
xo_open_list.3 xo_open_list_d.3 \
xo_open_list.3 xo_open_instance.3 \
xo_open_list.3 xo_open_instance_h.3 \
xo_open_list.3 xo_open_instance_hd.3 \
xo_open_list.3 xo_open_instance_d.3 \
xo_open_list.3 xo_close_instance.3 \
xo_open_list.3 xo_close_instance_h.3 \
xo_open_list.3 xo_close_instance_hd.3 \
xo_open_list.3 xo_close_instance_d.3 \
xo_open_list.3 xo_close_list.3 \
xo_open_list.3 xo_close_list_h.3 \
xo_open_list.3 xo_close_list_hd.3 \
xo_open_list.3 xo_close_list_d.3 \
xo_open_marker.3 xo_open_marker_h.3 \
xo_open_marker.3 xo_close_marker.3 \
xo_open_marker.3 xo_close_marker_h.3 \
xo_parse_args.3 xo_set_program.3 \
xo_set_flags.3 xo_clear_flags.3 \
xo_set_style.3 xo_set_style_name.3 \
xo_set_version.3 xo_set_version_h.3 \
xo_syslog.3 xo_close_log.3 \
xo_syslog.3 xo_open_log.3 \
xo_syslog.3 xo_set_logmask.3 \
xo_syslog.3 xo_vsyslog.3
.include <bsd.lib.mk>

View file

@ -102,7 +102,7 @@
#define HAVE_SRAND 1
/* Define to 1 if you have the `sranddev' function. */
/* #undef HAVE_SRANDDEV */
#define HAVE_SRANDDEV 1
/* Define to 1 if you have the <stdint.h> header file. */
#define HAVE_STDINT_H 1

View file

@ -240,7 +240,7 @@ PROGS+= test_09
PROGS+= test_10
PROGS+= test_11
CFLAGS+= -I${LIBXOSRC}/libxo -I${.CURDIR:H}
CFLAGS+= -I${LIBXOSRC}/libxo -I${.CURDIR:H}/libxo
LIBADD= xo util

View file

@ -12,7 +12,7 @@ SYMLINKS+= ${LIBDIR}/${SHLIB_NAME} /usr/lib/libxo/encoder/test.enc
SRCS= enc_test.c
CFLAGS+= -I${LIBXOSRC}/libxo
CFLAGS+= -I${LIBXOSRC}/libxo -I${.CURDIR:H:H}/libxo
LIBADD= xo

View file

@ -14,7 +14,7 @@ MAN= xo.1
CFLAGS+=-I${LIBXOSRC}/libxo
# XXX For xo_config.h
CFLAGS+=-I${SRCTOP}/lib/libxo
CFLAGS+=-I${SRCTOP}/lib/libxo/libxo
LIBADD= xo util