[PROPOSED 1/5] * tz-link.html: Minor tweaks to citations.

--- tz-link.html | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tz-link.html b/tz-link.html index a29231d5..84bea935 100644 --- a/tz-link.html +++ b/tz-link.html @@ -994,9 +994,9 @@ are larger for countries farther away from the equator, while subtropical regions consume more electricity because of <abbr>DST</abbr>."</li> <li>Malow BA. It is time to abolish the clock change and adopt permanent standard time in the United States: a Sleep Research Society position statement. -<em>Sleep</em>. 2022;45(12):zsac236. +<em>Sleep.</em> 2022;45(12):zsac236. doi:<a href="https://doi.org/10.1093/sleep/zsac236">10.1093/sleep/zsac236</a>. -After reviewing of the scientific literature, the Sleep Research Society +After reviewing the scientific literature, the Sleep Research Society advocates permanent standard time due to its health benefits. <li>Rishi MA, Cheng JY, Strang AR <em>et al</em>. <a href="https://jcsm.aasm.org/doi/10.5664/jcsm.10898">Permanent standard time @@ -1004,15 +1004,15 @@ is the optimal choice for health and safety: an American Academy of Sleep Medicine position statement</a>. <em>J Clin Sleep Med.</em> 2023-10-31. doi:<a href="https://doi.org/10.5664/jcsm.10898">10.5664/jcsm.10898</a>. -This argues for permanent standard time due to health and safety risks +The AASM argues for permanent standard time due to health and safety risks and economic costs of both <abbr>DST</abbr> transitions and permanent <abbr>DST</abbr>.</li> <li>Roenneberg T, Wirz-Justice A, Skene DJ <em>et al</em>. <a href="https://www.ncbi.nlm.nih.gov/pmc/articles/PMC7205184/">Why should we abolish Daylight Saving Time?</a> -<em>J Biol Rhythms</em>. 2019;34(3):227–230. +<em>J Biol Rhythms.</em> 2019;34(3):227–230. doi:<a href="https://doi.org/10.1177/0748730419854197">10.1177/0748730419854197</a>. -This position paper of the Society for Research on Biological Rhythms +The Society for Research on Biological Rhythms opposes DST changes and permanent DST, and advocates that governments adopt "permanent Standard Time for the health and safety of their citizens".</li> </ul> -- 2.40.1

Change the relatively-rare instances of “Posix” to “POSIX”, in the interests of uniformity. --- Makefile | 8 ++++---- NEWS | 2 +- localtime.c | 4 ++-- northamerica | 2 +- tzselect.8 | 2 +- tzselect.ksh | 14 +++++++------- 6 files changed, 16 insertions(+), 16 deletions(-) diff --git a/Makefile b/Makefile index b3cc6702..a0f4f5ef 100644 --- a/Makefile +++ b/Makefile @@ -384,7 +384,7 @@ GCC_DEBUG_FLAGS = -DGCC_LINT -g3 -O3 -fno-common \ # # NIST-PCTS:151-2, Version 1.4, (1993-12-03) is a test suite put # out by the National Institute of Standards and Technology -# which claims to test C and Posix conformance. If you want to pass PCTS, add +# which claims to test C and POSIX conformance. If you want to pass PCTS, add # -DPCTS # to the end of the "CFLAGS=" line. # @@ -424,18 +424,18 @@ ZFLAGS= ZIC_INSTALL= $(ZIC) -d '$(DESTDIR)$(TZDIR)' $(LEAPSECONDS) -# The name of a Posix-compliant 'awk' on your system. +# The name of a POSIX-compliant 'awk' on your system. # mawk 1.3.3 and Solaris 10 /usr/bin/awk do not work. # Also, it is better (though not essential) if 'awk' supports UTF-8, # and unfortunately mawk and busybox awk do not support UTF-8. # Try AWK=gawk or AWK=nawk if your awk has the abovementioned problems. AWK= awk -# The full path name of a Posix-compliant shell, preferably one that supports +# The full path name of a POSIX-compliant shell, preferably one that supports # the Korn shell's 'select' statement as an extension. # These days, Bash is the most popular. # It should be OK to set this to /bin/sh, on platforms where /bin/sh -# lacks 'select' or doesn't completely conform to Posix, but /bin/bash +# lacks 'select' or doesn't completely conform to POSIX, but /bin/bash # is typically nicer if it works. KSHELL= /bin/bash diff --git a/NEWS b/NEWS index 295141f8..82cd5da1 100644 --- a/NEWS +++ b/NEWS @@ -4341,7 +4341,7 @@ Release 2012j - 2012-11-12 18:34:49 -0800 now uses tz@iana.org rather than the old elsie address. zic -v now complains about abbreviations that are less than 3 - or more than 6 characters, as per Posix. Formerly, it checked + or more than 6 characters, as per POSIX. Formerly, it checked for abbreviations that were more than 3. 'make public' no longer puts its temporary directory under /tmp, diff --git a/localtime.c b/localtime.c index a54d3ae4..1f6193a4 100644 --- a/localtime.c +++ b/localtime.c @@ -869,8 +869,8 @@ getsecs(register const char *strp, int_fast32_t *const secsp) int_fast32_t secsperhour = SECSPERHOUR; /* - ** 'HOURSPERDAY * DAYSPERWEEK - 1' allows quasi-Posix rules like - ** "M10.4.6/26", which does not conform to Posix, + ** 'HOURSPERDAY * DAYSPERWEEK - 1' allows quasi-POSIX rules like + ** "M10.4.6/26", which does not conform to POSIX, ** but which specifies the equivalent of ** "02:00 on the first Sunday on or after 23 Oct". */ diff --git a/northamerica b/northamerica index d8e3601c..8ac106ab 100644 --- a/northamerica +++ b/northamerica @@ -1453,7 +1453,7 @@ Rule StJohns 1989 2006 - Apr Sun>=1 0:01 1:00 D Rule StJohns 2007 2011 - Mar Sun>=8 0:01 1:00 D Rule StJohns 2007 2010 - Nov Sun>=1 0:01 0 S # -# St John's has an apostrophe, but Posix file names can't have apostrophes. +# St John's has an apostrophe, but POSIX file names can't have apostrophes. # Zone NAME STDOFF RULES FORMAT [UNTIL] Zone America/St_Johns -3:30:52 - LMT 1884 -3:30:52 StJohns N%sT 1918 diff --git a/tzselect.8 b/tzselect.8 index 4578090f..ee031614 100644 --- a/tzselect.8 +++ b/tzselect.8 @@ -95,7 +95,7 @@ Output version information and exit. .SH "ENVIRONMENT VARIABLES" .TP \f3AWK\fP -Name of a Posix-compliant +Name of a POSIX-compliant .B awk program (default: .BR awk ). diff --git a/tzselect.ksh b/tzselect.ksh index 98774c03..dac931d4 100644 --- a/tzselect.ksh +++ b/tzselect.ksh @@ -10,7 +10,7 @@ REPORT_BUGS_TO=tz@iana.org # Porting notes: # -# This script requires a Posix-like shell and prefers the extension of a +# This script requires a POSIX-like shell and prefers the extension of a # 'select' statement. The 'select' statement was introduced in the # Korn shell and is available in Bash and other shell implementations. # If your host lacks both Bash and the Korn shell, you can get their @@ -27,7 +27,7 @@ REPORT_BUGS_TO=tz@iana.org # # This script also uses several features of modern awk programs. -# If your host lacks awk, or has an old awk that does not conform to Posix, +# If your host lacks awk, or has an old awk that does not conform to POSIX, # you can use either of the following free programs instead: # # Gawk (GNU awk) <https://www.gnu.org/software/gawk/> @@ -45,10 +45,10 @@ say() { printf '%s\n' "$1" } -# Check for awk Posix compliance. +# Check for awk POSIX compliance. ($AWK -v x=y 'BEGIN { exit 123 }') </dev/null >/dev/null 2>&1 [ $? = 123 ] || { - say >&2 "$0: Sorry, your '$AWK' program is not Posix compatible." + say >&2 "$0: Sorry, your '$AWK' program is not POSIX compatible." exit 1 } @@ -397,7 +397,7 @@ while eval ' doselect '"$quoted_continents"' \ "coord - I want to use geographical coordinates." \ - "TZ - I want to specify the timezone using the Posix TZ format." \ + "TZ - I want to specify the timezone using the POSIX TZ format." \ "time - I know local time already." continent=$select_result case $continent in @@ -409,7 +409,7 @@ while case $continent in TZ) - # Ask the user for a Posix TZ string. Check that it conforms. + # Ask the user for a POSIX TZ string. Check that it conforms. while echo >&2 'Please enter the desired value' \ 'of the TZ environment variable.' @@ -433,7 +433,7 @@ while exit 0 }' do - say >&2 "'$TZ' is not a conforming Posix timezone string." + say >&2 "'$TZ' is not a conforming POSIX timezone string." done TZ_for_date=$TZ;; *) -- 2.40.1

* Makefile: Rearrange comments. --- Makefile | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index a0f4f5ef..4ebac475 100644 --- a/Makefile +++ b/Makefile @@ -1,9 +1,8 @@ # Make and install tzdb code and data. -# Request POSIX conformance; this must be the first non-comment line. -.POSIX: - # This file is in the public domain, so clarified as of # 2009-05-17 by Arthur David Olson. +# Request POSIX conformance; this must be the first non-comment line. +.POSIX: # Package name for the code distribution. PACKAGE= tzcode -- 2.40.1

This was initially motivated by a desire to have the Makefile be friendlier to new builders, so that the Makefile does not use CC in an unusual way, and so that builders can run commands like ‘make CC='gcc -std=gnu11'’ without messing up TZDIR. While I was at it, I fixed other ways that the Makefile is inconsistent with modern POSIX. * Makefile (CFLAGS, LDFLAGS, AR, CC): Do not define. Instead, rely on system-supplied defaults, which are specified by POSIX. (SHELL): Do not define or use, as POSIX prohibits that. (cc): Remove. All uses changed to use CC, which is where POSIX expects the C compiler to be. (DTZDIR): New macro, so that TZDIR is easily specified regardless of CC or CFLAGS. (zdump, zic, tzdir, check_public, $(TIME_T_ALTERNATIVES)) (typecheck_long_long, typecheck_unsigned): Use TZDIR and pass it along. (libtz.a): Use ARFLAGS rather than open-coding the default. * NEWS: Mention these changes. --- Makefile | 74 ++++++++++++++++++++++++++++++++++++++------------------ NEWS | 8 ++++++ 2 files changed, 59 insertions(+), 23 deletions(-) diff --git a/Makefile b/Makefile index 4ebac475..722abfa3 100644 --- a/Makefile +++ b/Makefile @@ -4,6 +4,20 @@ # Request POSIX conformance; this must be the first non-comment line. .POSIX: +# To affect how this Makefile works, you can run a shell script like this: +# +# #!/bin/sh +# make CC='gcc -std=gnu11' "$@" +# +# This example script is appropriate for a pre-2017 GNU/Linux system +# where a non-default setting is needed to support this package's use of C99. +# +# Alternatively, you can simply edit this Makefile to tailor the following +# macro definitions. + +############################################################################### +# Start of macros that one plausibly might want to tailor. + # Package name for the code distribution. PACKAGE= tzcode @@ -192,8 +206,9 @@ UTF8_LOCALE= en_US.utf8 # On some hosts, this should have -lintl unless CFLAGS has -DHAVE_GETTEXT=0. LDLIBS= -# Add the following to the end of the "CFLAGS=" line as needed to override -# defaults specified in the source code. "-DFOO" is equivalent to "-DFOO=1". +# Add the following to an uncommented "CFLAGS=" line as needed +# to override defaults specified in the source code or by the system. +# "-DFOO" is equivalent to "-DFOO=1". # -DDEPRECATE_TWO_DIGIT_YEARS for optional runtime warnings about strftime # formats that generate only the last two digits of year numbers # -DEPOCH_LOCAL if the 'time' function returns local time not UT @@ -273,6 +288,10 @@ LDLIBS= # -DZIC_MAX_ABBR_LEN_WO_WARN=3 # (or some other number) to set the maximum time zone abbreviation length # that zic will accept without a warning (the default is 6) +# -g to generate symbolic debugging info +# -Idir to include from directory 'dir' +# -O0 to disable optimization; other -O options to enable more optimization +# -Uname to remove any definition of the macro 'name' # $(GCC_DEBUG_FLAGS) if you are using recent GCC and want lots of checking # # * Options marked "*" can be omitted if your compiler is C23 compatible. @@ -393,13 +412,21 @@ GCC_DEBUG_FLAGS = -DGCC_LINT -g3 -O3 -fno-common \ # 53 as a week number (rather than 52 or 53) for January days before # January's first Monday when a "%V" format is used and January 1 # falls on a Friday, Saturday, or Sunday. +# +# POSIX says CFLAGS defaults to "-O 1". +# Uncomment the following line and edit its contents as needed. -CFLAGS= +#CFLAGS= -O 1 -# Linker flags. Default to $(LFLAGS) for backwards compatibility -# to release 2012h and earlier. -LDFLAGS= $(LFLAGS) +# The name of a POSIX-like library archiver, its flags, C compiler, +# linker flags, and 'make' utility. Ordinarily the defaults suffice. +# The commented-out values are the defaults specified by POSIX 202x/D3. +#AR = ar +#ARFLAGS = -rv +#CC = c17 +#LDFLAGS = +#MAKE = make # For leap seconds, this Makefile uses LEAPSECONDS='-L leapseconds' in # submake command lines. The default is no leap seconds. @@ -508,17 +535,20 @@ GZIPFLAGS= -9n DIFF_TZS= diff -u$$(! diff -u -F'^TZ=' - - <>/dev/null >&0 2>&1 \ || echo ' -F^TZ=') -############################################################################### +# ':' on typical hosts; 'ranlib' on the ancient hosts that still need ranlib. +RANLIB= : -#MAKE= make +# POSIX prohibits defining or using SHELL. However, csh users on systems +# that use the user shell for Makefile commands may need to define SHELL. +#SHELL= /bin/sh -cc= cc -CC= $(cc) -DTZDIR='"$(TZDIR)"' +# End of macros that one plausibly might want to tailor. +############################################################################### -AR= ar -# ':' on typical hosts; 'ranlib' on the ancient hosts that still need ranlib. -RANLIB= : +# $(CC) option to specify TZDIR, appropriately quoted. +# It is separate from CFLAGS so that CFLAGS and TZDIR can be set independently. +DTZDIR = -DTZDIR='"$(TZDIR)"' TZCOBJS= zic.o TZDOBJS= zdump.o localtime.o asctime.o strftime.o @@ -589,11 +619,6 @@ VERSION_DEPS= \ ziguard.awk zishrink.awk \ zone.tab zone1970.tab -# And for the benefit of csh users on systems that assume the user -# shell should be used to handle commands in Makefiles. . . - -SHELL= /bin/sh - all: tzselect zic zdump libtz.a $(TABDATA) \ vanguard.zi main.zi rearguard.zi @@ -671,10 +696,10 @@ version.h: version mv $@.out $@ zdump: $(TZDOBJS) - $(CC) -o $@ $(CFLAGS) $(LDFLAGS) $(TZDOBJS) $(LDLIBS) + $(CC) -o $@ $(DTZDIR) $(CFLAGS) $(LDFLAGS) $(TZDOBJS) $(LDLIBS) zic: $(TZCOBJS) - $(CC) -o $@ $(CFLAGS) $(LDFLAGS) $(TZCOBJS) $(LDLIBS) + $(CC) -o $@ $(DTZDIR) $(CFLAGS) $(LDFLAGS) $(TZCOBJS) $(LDLIBS) leapseconds: $(LEAP_DEPS) $(AWK) -v EXPIRES_LINE=$(EXPIRES_LINE) \ @@ -768,11 +793,11 @@ force_tzs: $(TZS_NEW) libtz.a: $(LIBOBJS) rm -f $@ - $(AR) -rc $@ $(LIBOBJS) + $(AR) $(ARFLAGS) $@ $(LIBOBJS) $(RANLIB) $@ date: $(DATEOBJS) - $(CC) -o $@ $(CFLAGS) $(LDFLAGS) $(DATEOBJS) $(LDLIBS) + $(CC) -o $@ $(DTZDIR) $(CFLAGS) $(LDFLAGS) $(DATEOBJS) $(LDLIBS) tzselect: tzselect.ksh version VERSION=`cat version` && sed \ @@ -1023,7 +1048,8 @@ check_public: $(VERSION_DEPS) rm -fr public.dir mkdir public.dir ln $(VERSION_DEPS) public.dir - cd public.dir && $(MAKE) CFLAGS='$(GCC_DEBUG_FLAGS)' ALL + cd public.dir \ + && $(MAKE) CFLAGS='$(GCC_DEBUG_FLAGS)' DTZDIR=$(DTZDIR) ALL for i in $(TDATA_TO_CHECK) public.dir/tzdata.zi \ public.dir/vanguard.zi public.dir/main.zi \ public.dir/rearguard.zi; \ @@ -1067,6 +1093,7 @@ $(TIME_T_ALTERNATIVES): $(VERSION_DEPS) (cd $@.dir && \ $(MAKE) TOPDIR="$$wd/$@.dir" \ CFLAGS='$(CFLAGS) -Dtime_tz='"'$@'" \ + DTZDIR=$(DTZDIR) \ REDO='$(REDO)' \ D=$$wd/$@.dir \ TZS_YEAR="$$range" TZS_CUTOFF_FLAG="-t $$range" \ @@ -1230,6 +1257,7 @@ typecheck_long_long typecheck_unsigned: $(VERSION_DEPS) typecheck_cflags='' && \ $(MAKE) \ CFLAGS="$(TYPECHECK_CFLAGS) \"-Dtime_t=$$i\"" \ + DTZDIR=$(DTZDIR) \ TOPDIR="`pwd`" \ install $@.dir/zdump -i -c 1970,1971 Europe/Rome diff --git a/NEWS b/NEWS index 82cd5da1..822f80f4 100644 --- a/NEWS +++ b/NEWS @@ -38,6 +38,14 @@ Unreleased, experimental changes zic now works again on Linux 2.6.16 and 2.6.17 (2006). (Problem reported by Rune Torgersen.) + Changes to build procedure + + The Makefile is now more compatible with POSIX: + * It no longer defines AR, CC, CFLAGS, LDFLAGS, and SHELL. + * It no longer uses its own 'cc' in place of CC. + * It now uses ARFLAGS, with default specified by POSIX. + * It does not use LFLAGS incompatibly with POSIX. + Release 2023c - 2023-03-28 12:42:14 -0700 -- 2.40.1

Emphasize reading Makefile comments a bit more, and say that the leading comments are the important ones. Give advice that works even if $HOME contains whitespace. --- README | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/README b/README index 145aacd4..edabd2e0 100644 --- a/README +++ b/README @@ -11,14 +11,17 @@ changes made by political bodies to time zone boundaries, UTC offsets, and daylight-saving rules. See <https://www.iana.org/time-zones/repository/tz-link.html> or the -file tz-link.html for how to acquire the code and data. Once acquired, -read the comments in the file 'Makefile' and make any changes needed -to make things right for your system, especially if you are using some -platform other than GNU/Linux. Then run the following commands, -substituting your desired installation directory for "$HOME/tzdir": - - make TOPDIR=$HOME/tzdir install - $HOME/tzdir/usr/bin/zdump -v America/Los_Angeles +file tz-link.html for how to acquire the code and data. + +Once acquired, read the leading comments in the file "Makefile" +and make any changes needed to make things right for your system, +especially when using a platform other than current GNU/Linux. + +Then run the following commands, substituting your desired +installation directory for "$HOME/tzdir": + + make TOPDIR="$HOME/tzdir" install + "$HOME/tzdir/usr/bin/zdump" -v America/Los_Angeles See the file tz-how-to.html for examples of how to read the data files. -- 2.40.1
participants (1)
-
Paul Eggert