aboutsummaryrefslogtreecommitdiff
path: root/lib/libxo
diff options
context:
space:
mode:
authorPhil Shafer <phil@FreeBSD.org>2019-12-16 22:05:03 +0000
committerPhil Shafer <phil@FreeBSD.org>2019-12-16 22:05:03 +0000
commit2db46b45f432bd67610ac70f3e60afc72781a009 (patch)
treef01b427d8dd5bd06d5b950f9865369b3084466ee /lib/libxo
parent7f5499972e115cafc861ec438cd7237422cd9b7c (diff)
downloadsrc-2db46b45f432bd67610ac70f3e60afc72781a009.tar.gz
src-2db46b45f432bd67610ac70f3e60afc72781a009.zip
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
Notes
Notes: svn path=/head/; revision=355826
Diffstat (limited to 'lib/libxo')
-rw-r--r--lib/libxo/Makefile113
-rw-r--r--lib/libxo/encoder/csv/Makefile19
-rw-r--r--lib/libxo/libxo/Makefile114
-rw-r--r--lib/libxo/libxo/xo_config.h (renamed from lib/libxo/xo_config.h)2
-rw-r--r--lib/libxo/tests/Makefile2
-rw-r--r--lib/libxo/tests/encoder/Makefile2
6 files changed, 132 insertions, 120 deletions
diff --git a/lib/libxo/Makefile b/lib/libxo/Makefile
index e53e1d9c13e4..954e3d5ee4b6 100644
--- a/lib/libxo/Makefile
+++ b/lib/libxo/Makefile
@@ -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>
diff --git a/lib/libxo/encoder/csv/Makefile b/lib/libxo/encoder/csv/Makefile
index 594fd0efc871..ffde7210937d 100644
--- a/lib/libxo/encoder/csv/Makefile
+++ b/lib/libxo/encoder/csv/Makefile
@@ -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>
diff --git a/lib/libxo/libxo/Makefile b/lib/libxo/libxo/Makefile
new file mode 100644
index 000000000000..355f56f136c1
--- /dev/null
+++ b/lib/libxo/libxo/Makefile
@@ -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>
diff --git a/lib/libxo/xo_config.h b/lib/libxo/libxo/xo_config.h
index fd38c442b604..857af5356c57 100644
--- a/lib/libxo/xo_config.h
+++ b/lib/libxo/libxo/xo_config.h
@@ -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
diff --git a/lib/libxo/tests/Makefile b/lib/libxo/tests/Makefile
index 2c5f1a03ea73..5d42e0d9c34e 100644
--- a/lib/libxo/tests/Makefile
+++ b/lib/libxo/tests/Makefile
@@ -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
diff --git a/lib/libxo/tests/encoder/Makefile b/lib/libxo/tests/encoder/Makefile
index 2fe42457f2e8..6f657781a8e1 100644
--- a/lib/libxo/tests/encoder/Makefile
+++ b/lib/libxo/tests/encoder/Makefile
@@ -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