From 805729e206b7586c57483aa0f4a90f7e0e2c9661 Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Wed, 14 Oct 2015 22:54:08 +0000 Subject: - Remove /etc/leapsecs.dat - Publish tools to create the leap second table as a .c - Simplify functions using leap seconds - rc for 2.3.8.0 --- tools/make-leapsecs_table | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100755 tools/make-leapsecs_table (limited to 'tools/make-leapsecs_table') diff --git a/tools/make-leapsecs_table b/tools/make-leapsecs_table new file mode 100755 index 0000000..c62fdde --- /dev/null +++ b/tools/make-leapsecs_table @@ -0,0 +1,39 @@ +#!/command/execlineb -P + +# Compile convert-leapsecs.c, then use this to create +# src/libstddjb/leapsecs_table.c + +define PREFIX ./tools + +backtick -n N +{ + pipeline + { + redirfd -r 0 ${PREFIX}/leapsecs.txt + ${PREFIX}/convert-leapsecs + } + wc -l +} +import -u N + +if +{ + s6-echo "/* ISC license. */ + +/* MT-unsafe */ + +#include +#include +#include \"djbtime-internal.h\" + +unsigned int const leapsecs_table_len = ${N} ; +static uint64 const leapsecs_table_[${N}] =\n{" +} + +if +{ + redirfd -r 0 ${PREFIX}/leapsecs.txt + ${PREFIX}/convert-leapsecs +} + +s6-echo "} ;\nuint64 const *const leapsecs_table = leapsecs_table_ ;" -- cgit v1.2.3