@@ -53,7 +53,7 @@ DATAFORM= main
5353
5454LOCALTIME = Factory
5555
56- # The POSIXRULES macro controls interpretation of POSIX-like TZ
56+ # The POSIXRULES macro controls interpretation of POSIX-2017.1- like TZ
5757# settings like TZ='EET-2EEST' that lack DST transition rules.
5858# If POSIXRULES is '-', no template is installed; this is the default.
5959# Any other value for POSIXRULES is obsolete and should not be relied on, as:
@@ -274,7 +274,7 @@ LDLIBS=
274274# -DTZ_DOMAINDIR=\"/path\" to use "/path" for gettext directory;
275275# the default is system-supplied, typically "/usr/lib/locale"
276276# -DTZDEFRULESTRING=\",date/time,date/time\" to default to the specified
277- # DST transitions for POSIX-style TZ strings lacking them,
277+ # DST transitions for POSIX.1-2017 -style TZ strings lacking them,
278278# in the usual case where POSIXRULES is '-'. If not specified,
279279# TZDEFRULESTRING defaults to US rules for future DST transitions.
280280# This mishandles some past timestamps, as US DST rules have changed.
@@ -340,9 +340,10 @@ GCC_DEBUG_FLAGS = -DGCC_LINT -g3 -O3 -fno-common \
340340# guess TM_GMTOFF from other macros; define NO_TM_GMTOFF to suppress this.
341341# Similarly, if your system has a "zone abbreviation" field, define
342342# -DTM_ZONE=tm_zone
343- # and define NO_TM_ZONE to suppress any guessing. Although these two fields
344- # not required by POSIX, a future version of POSIX is planned to require them
345- # and they are widely available on GNU/Linux and BSD systems.
343+ # and define NO_TM_ZONE to suppress any guessing.
344+ # Although these two fields are not required by POSIX.1-2017,
345+ # POSIX 202x/D4 requires them and they are widely available
346+ # on GNU/Linux and BSD systems.
346347#
347348# The next batch of options control support for external variables
348349# exported by tzcode. In practice these variables are less useful
@@ -352,7 +353,7 @@ GCC_DEBUG_FLAGS = -DGCC_LINT -g3 -O3 -fno-common \
352353# # -DHAVE_TZNAME=0 # do not support "tzname"
353354# # -DHAVE_TZNAME=1 # support "tzname", which is defined by system library
354355# # -DHAVE_TZNAME=2 # support and define "tzname"
355- # # to the "CFLAGS=" line. "tzname" is required by POSIX 1988 and later.
356+ # # to the "CFLAGS=" line. "tzname" is required by POSIX.1- 1988 and later.
356357# # If not defined, the code attempts to guess HAVE_TZNAME from other macros.
357358# # Warning: unless time_tz is also defined, HAVE_TZNAME=1 can cause
358359# # crashes when combined with some platforms' standard libraries,
@@ -362,8 +363,8 @@ GCC_DEBUG_FLAGS = -DGCC_LINT -g3 -O3 -fno-common \
362363# # -DUSG_COMPAT=0 # do not support
363364# # -DUSG_COMPAT=1 # support, and variables are defined by system library
364365# # -DUSG_COMPAT=2 # support and define variables
365- # # to the "CFLAGS=" line; "timezone" and "daylight" are inspired by
366- # # Unix Systems Group code and are required by POSIX 2008 (with XSI) and later .
366+ # # to the "CFLAGS=" line; "timezone" and "daylight" are inspired by Unix
367+ # # Systems Group code and are required by POSIX.1- 2008 and later (with XSI).
367368# # If not defined, the code attempts to guess USG_COMPAT from other macros.
368369# #
369370# # To support the external variable "altzone", add
@@ -427,7 +428,7 @@ GCC_DEBUG_FLAGS = -DGCC_LINT -g3 -O3 -fno-common \
427428
428429# The name of a POSIX-like library archiver, its flags, C compiler,
429430# linker flags, and 'make' utility. Ordinarily the defaults suffice.
430- # The commented-out values are the defaults specified by POSIX 202x/D3 .
431+ # The commented-out values are the defaults specified by POSIX.1- 202x/D4 .
431432# AR = ar
432433# ARFLAGS = -rv
433434# CC = c17
@@ -439,6 +440,12 @@ GCC_DEBUG_FLAGS = -DGCC_LINT -g3 -O3 -fno-common \
439440
440441LEAPSECONDS =
441442
443+ # Where to fetch leap-seconds.list from.
444+ leaplist_URI = \
445+ https://hpiers.obspm.fr/iers/bul/bulc/ntp/leap-seconds.list
446+ # The file is generated by the IERS Earth Orientation Centre, in Paris.
447+ leaplist_TZ = Europe/Paris
448+
442449# The zic command and its arguments.
443450
444451zic = ./zic
@@ -471,7 +478,8 @@ AWK= awk
471478# is typically nicer if it works.
472479KSHELL = /bin/bash
473480
474- # Name of curl <https://curl.haxx.se/>, used for HTML validation.
481+ # Name of curl <https://curl.haxx.se/>, used for HTML validation
482+ # and to fetch leap-seconds.list from upstream.
475483CURL = curl
476484
477485# Name of GNU Privacy Guard <https://gnupg.org/>, used to sign distributions.
@@ -718,6 +726,28 @@ leapseconds: $(LEAP_DEPS)
718726 -f leapseconds.awk leap-seconds.list > $@ .out
719727 mv $@ .out $@
720728
729+ # Awk script to extract a Git-style author from leap-seconds.list comments.
730+ EXTRACT_AUTHOR = \
731+ author_line { sub(/^.[[:space:]]* /, " " ); \
732+ sub(/:[[:space:]]* /, " <" ); \
733+ printf " %s>\n" , $$ 0; \
734+ success = 1; \
735+ exit \
736+ } \
737+ /Questions or comments to:/ { author_line = 1 } \
738+ END { exit ! success }
739+
740+ # Fetch leap-seconds.list from upstream.
741+ fetch-leap-seconds.list:
742+ $( CURL) -OR $( leaplist_URI)
743+
744+ # Fetch leap-seconds.list from upstream and commit it to the local repository.
745+ commit-leap-seconds.list: fetch-leap-seconds.list
746+ author=$$ ($( AWK) ' $(EXTRACT_AUTHOR)' leap-seconds.list) && \
747+ date=$$ (TZ=$( leaplist_TZ) stat -c%y leap-seconds.list) && \
748+ git commit --author=" $$ author" --date=" $$ date" -m' make $@' \
749+ leap-seconds.list
750+
721751# Arguments to pass to submakes of install_data.
722752# They can be overridden by later submake arguments.
723753INSTALLARGS = \
@@ -1315,7 +1345,8 @@ zic.o: private.h tzfile.h tzdir.h version.h
13151345.PHONY: ALL INSTALL all
13161346.PHONY: check check_mild check_time_t_alternatives
13171347.PHONY: check_web check_zishrink
1318- .PHONY: clean clean_misc dummy.zd force_tzs
1348+ .PHONY: clean clean_misc commit-leap-seconds.list dummy.zd
1349+ .PHONY: fetch-leap-seconds.list force_tzs
13191350.PHONY: install install_data maintainer-clean names
13201351.PHONY: posix_only posix_right public
13211352.PHONY: rearguard_signatures rearguard_signatures_version
0 commit comments