@@ -53,7 +53,7 @@ DATAFORM= main
53
53
54
54
LOCALTIME = Factory
55
55
56
- # The POSIXRULES macro controls interpretation of POSIX-like TZ
56
+ # The POSIXRULES macro controls interpretation of POSIX-2017.1- like TZ
57
57
# settings like TZ='EET-2EEST' that lack DST transition rules.
58
58
# If POSIXRULES is '-', no template is installed; this is the default.
59
59
# Any other value for POSIXRULES is obsolete and should not be relied on, as:
@@ -274,7 +274,7 @@ LDLIBS=
274
274
# -DTZ_DOMAINDIR=\"/path\" to use "/path" for gettext directory;
275
275
# the default is system-supplied, typically "/usr/lib/locale"
276
276
# -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,
278
278
# in the usual case where POSIXRULES is '-'. If not specified,
279
279
# TZDEFRULESTRING defaults to US rules for future DST transitions.
280
280
# This mishandles some past timestamps, as US DST rules have changed.
@@ -340,9 +340,10 @@ GCC_DEBUG_FLAGS = -DGCC_LINT -g3 -O3 -fno-common \
340
340
# guess TM_GMTOFF from other macros; define NO_TM_GMTOFF to suppress this.
341
341
# Similarly, if your system has a "zone abbreviation" field, define
342
342
# -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.
346
347
#
347
348
# The next batch of options control support for external variables
348
349
# exported by tzcode. In practice these variables are less useful
@@ -352,7 +353,7 @@ GCC_DEBUG_FLAGS = -DGCC_LINT -g3 -O3 -fno-common \
352
353
# # -DHAVE_TZNAME=0 # do not support "tzname"
353
354
# # -DHAVE_TZNAME=1 # support "tzname", which is defined by system library
354
355
# # -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.
356
357
# # If not defined, the code attempts to guess HAVE_TZNAME from other macros.
357
358
# # Warning: unless time_tz is also defined, HAVE_TZNAME=1 can cause
358
359
# # crashes when combined with some platforms' standard libraries,
@@ -362,8 +363,8 @@ GCC_DEBUG_FLAGS = -DGCC_LINT -g3 -O3 -fno-common \
362
363
# # -DUSG_COMPAT=0 # do not support
363
364
# # -DUSG_COMPAT=1 # support, and variables are defined by system library
364
365
# # -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).
367
368
# # If not defined, the code attempts to guess USG_COMPAT from other macros.
368
369
# #
369
370
# # To support the external variable "altzone", add
@@ -427,7 +428,7 @@ GCC_DEBUG_FLAGS = -DGCC_LINT -g3 -O3 -fno-common \
427
428
428
429
# The name of a POSIX-like library archiver, its flags, C compiler,
429
430
# 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 .
431
432
# AR = ar
432
433
# ARFLAGS = -rv
433
434
# CC = c17
@@ -439,6 +440,12 @@ GCC_DEBUG_FLAGS = -DGCC_LINT -g3 -O3 -fno-common \
439
440
440
441
LEAPSECONDS =
441
442
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
+
442
449
# The zic command and its arguments.
443
450
444
451
zic = ./zic
@@ -471,7 +478,8 @@ AWK= awk
471
478
# is typically nicer if it works.
472
479
KSHELL = /bin/bash
473
480
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.
475
483
CURL = curl
476
484
477
485
# Name of GNU Privacy Guard <https://gnupg.org/>, used to sign distributions.
@@ -718,6 +726,28 @@ leapseconds: $(LEAP_DEPS)
718
726
-f leapseconds.awk leap-seconds.list > $@ .out
719
727
mv $@ .out $@
720
728
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
+
721
751
# Arguments to pass to submakes of install_data.
722
752
# They can be overridden by later submake arguments.
723
753
INSTALLARGS = \
@@ -1315,7 +1345,8 @@ zic.o: private.h tzfile.h tzdir.h version.h
1315
1345
.PHONY: ALL INSTALL all
1316
1346
.PHONY: check check_mild check_time_t_alternatives
1317
1347
.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
1319
1350
.PHONY: install install_data maintainer-clean names
1320
1351
.PHONY: posix_only posix_right public
1321
1352
.PHONY: rearguard_signatures rearguard_signatures_version
0 commit comments