55PACKAGE = tzcode
66
77# Version numbers of the code and data distributions.
8- VERSION = 2014f
8+ VERSION = 2014g
99
1010# Email address for bug reports.
1111@@ -84,9 +84,11 @@ LIBDIR= $(TOPDIR)/lib
8484# below. If you want both sets of data available, with leap seconds counted
8585# normally, use
8686# REDO= right_posix
87- # below.
87+ # below. If you want just POSIX-compatible time values, but with
88+ # out-of-scope and often-wrong data from the file 'backzone', use
89+ # REDO= posix_packrat
8890# POSIX mandates that leap seconds not be counted; for compatibility with it,
89- # use either "posix_only" or "posix_right ".
91+ # use "posix_only", "posix_right", or "posix_packrat ".
9092
9193REDO = posix_right
9294
@@ -107,26 +109,39 @@ LDLIBS=
107109# ctime_r and asctime_r incompatibly with the POSIX standard (Solaris 8).
108110# -DHAVE_INTTYPES_H=1 if you have a pre-C99 compiler with "inttypes.h"
109111# -DHAVE_LINK=0 if your system lacks a link function
112+ # -DHAVE_LOCALTIME_R=0 if your system lacks a localtime_r function
113+ # -DHAVE_LOCALTIME_RZ=0 if you do not want zdump to use localtime_rz
114+ # This defaults to 1 if a working localtime_rz seems to be available.
115+ # localtime_rz can make zdump significantly faster, but is nonstandard.
110116# -DHAVE_SETTIMEOFDAY=0 if settimeofday does not exist (SVR0?)
111117# -DHAVE_SETTIMEOFDAY=1 if settimeofday has just 1 arg (SVR4)
112118# -DHAVE_SETTIMEOFDAY=2 if settimeofday uses 2nd arg (4.3BSD)
113119# -DHAVE_SETTIMEOFDAY=3 if settimeofday ignores 2nd arg (4.4BSD)
114120# -DHAVE_STDINT_H=1 if you have a pre-C99 compiler with "stdint.h"
121+ # -DHAVE_STRFTIME_L=1 if <time.h> declares locale_t and strftime_l
122+ # This defaults to 0 if _POSIX_VERSION < 200809, 1 otherwise.
115123# -DHAVE_SYMLINK=0 if your system lacks the symlink function
116124# -DHAVE_SYS_STAT_H=0 if your compiler lacks a "sys/stat.h"
117125# -DHAVE_SYS_WAIT_H=0 if your compiler lacks a "sys/wait.h"
126+ # -DHAVE_TZSET=0 if your system lacks a tzset function
118127# -DHAVE_UNISTD_H=0 if your compiler lacks a "unistd.h" (Microsoft C++ 7?)
119128# -DHAVE_UTMPX_H=1 if your compiler has a "utmpx.h"
120- # -DLOCALE_HOME=\"path\" if locales are in "path", not "/usr/lib/locale"
121129# -DNO_RUN_TIME_WARNINGS_ABOUT_YEAR_2000_PROBLEMS_THANK_YOU=1
122130# if you do not want run time warnings about formats that may cause
123131# year 2000 grief
132+ # -DTHREAD_SAFE=1 to make localtime.c thread-safe, as POSIX requires;
133+ # not needed by the main-program tz code, which is single-threaded.
134+ # Append other compiler flags as needed, e.g., -pthread on GNU/Linux.
124135# -Dtime_tz=\"T\" to use T as the time_t type, rather than the system time_t
125136# -DTZ_DOMAIN=\"foo\" to use "foo" for gettext domain name; default is "tz"
126137# -DTZ_DOMAINDIR=\"/path\" to use "/path" for gettext directory;
127138# the default is system-supplied, typically "/usr/lib/locale"
128139# -DTZDEFRULESTRING=\",date/time,date/time\" to default to the specified
129140# DST transitions if the time zone files cannot be accessed
141+ # -DUNINIT_TRAP=1 if reading uninitialized storage can cause problems
142+ # other than simply getting garbage data
143+ # -DUSE_LTZ=0 to build zdump with the system time zone library
144+ # Also set TZDOBJS=zdump.o and CHECK_TIME_T_ALTERNATIVES= below.
130145# -DZIC_MAX_ABBR_LEN_WO_WARN=3
131146# (or some other number) to set the maximum time zone abbreviation length
132147# that zic will accept without a warning (the default is 6)
@@ -156,25 +171,12 @@ GCC_DEBUG_FLAGS = -Dlint -g3 -O3 -fno-common -fstrict-aliasing \
156171# (or if you decide to add such a field in your system's "time.h" file),
157172# add the name to a define such as
158173# -DTM_GMTOFF=tm_gmtoff
159- # or
160- # -DTM_GMTOFF=_tm_gmtoff
161- # to the end of the "CFLAGS=" line.
162- # Neither tm_gmtoff nor _tm_gmtoff is described in X3J11's work;
163- # in its work, use of "tm_gmtoff" is described as non-conforming.
164- # Both Linux and BSD have done the equivalent of defining TM_GMTOFF in
165- # their recent releases.
166- #
167- # If your system has a "zone abbreviation" field in its "struct tm"s
168- # (or if you decide to add such a field in your system's "time.h" file),
169- # add the name to a define such as
174+ # to the end of the "CFLAGS=" line. If not defined, the code attempts to
175+ # guess TM_GMTOFF from other macros; define NO_TM_GMTOFF to suppress this.
176+ # Similarly, if your system has a "zone abbreviation" field, define
170177# -DTM_ZONE=tm_zone
171- # or
172- # -DTM_ZONE=_tm_zone
173- # to the end of the "CFLAGS=" line.
174- # Neither tm_zone nor _tm_zone is described in X3J11's work;
175- # in its work, use of "tm_zone" is described as non-conforming.
176- # Both UCB and Sun have done the equivalent of defining TM_ZONE in
177- # their recent releases.
178+ # and define NO_TM_ZONE to suppress any guessing. These two fields are not
179+ # required by POSIX, but are widely available on GNU/Linux and BSD systems.
178180#
179181# If you want functions that were inspired by early versions of X3J11's work,
180182# add
@@ -198,6 +200,17 @@ GCC_DEBUG_FLAGS = -Dlint -g3 -O3 -fno-common -fstrict-aliasing \
198200# These functions may well disappear in future releases of the time
199201# conversion package.
200202#
203+ # If you don't want functions that were inspired by NetBSD, add
204+ # -DNETBSD_INSPIRED=0
205+ # to the end of the "CFLAGS=" line. Otherwise, the functions
206+ # "localtime_rz", "mktime_z", "tzalloc", and "tzfree" are added to the
207+ # time library, and if STD_INSPIRED is also defined the functions
208+ # "posix2time_z" and "time2posix_z" are added as well.
209+ # The functions ending in "_z" (or "_rz") are like their unsuffixed
210+ # (or suffixed-by-"_r") counterparts, except with an extra first
211+ # argument of opaque type timezone_t that specifies the time zone.
212+ # "tzalloc" allocates a timezone_t value, and "tzfree" frees it.
213+ #
201214# If you want to allocate state structures in localtime, add
202215# -DALL_STATE
203216# to the end of the "CFLAGS=" line. Storage is obtained by calling malloc.
@@ -207,11 +220,6 @@ GCC_DEBUG_FLAGS = -Dlint -g3 -O3 -fno-common -fstrict-aliasing \
207220# to the end of the "CFLAGS=" line.
208221# This variable is not described in X3J11's work.
209222#
210- # If you want a "gtime" function (a la MACH), add
211- # -DCMUCS
212- # to the end of the "CFLAGS=" line
213- # This function is not described in X3J11's work.
214- #
215223# NIST-PCTS:151-2, Version 1.4, (1993-12-03) is a test suite put
216224# out by the National Institute of Standards and Technology
217225# which claims to test C and Posix conformance. If you want to pass PCTS, add
@@ -267,6 +275,10 @@ VALIDATE_ENV = \
267275 SP_CHARSET_FIXED=YES \
268276 SP_ENCODING=UTF-8
269277
278+ # This expensive test requires USE_LTZ.
279+ # To suppress it, define this macro to be empty.
280+ CHECK_TIME_T_ALTERNATIVES = check_time_t_alternatives
281+
270282# SAFE_CHAR is a regular expression that matches a safe character.
271283# Some parts of this distribution are limited to safe characters;
272284# others can use any UTF-8 character.
@@ -318,23 +330,24 @@ AR= ar
318330RANLIB= :
319331
320332TZCOBJS= zic.o scheck.o ialloc.o
321- TZDOBJS= zdump.o localtime.o ialloc.o asctime.o
333+ TZDOBJS= zdump.o localtime.o asctime.o
322334DATEOBJS= date.o localtime.o strftime.o asctime.o
323335LIBSRCS= localtime.c asctime.c difftime.c
324336LIBOBJS= localtime.o asctime.o difftime.o
325337HEADERS= tzfile.h private.h
326338NONLIBSRCS= zic.c zdump.c scheck.c ialloc.c
327339NEWUCBSRCS= date.c strftime.c
328- SOURCES= $( HEADERS) $( LIBSRCS) $( NONLIBSRCS) $( NEWUCBSRCS) tzselect.ksh
340+ SOURCES= $( HEADERS) $( LIBSRCS) $( NONLIBSRCS) $( NEWUCBSRCS) \
341+ tzselect.ksh workman.sh
329342MANS= newctime.3 newstrftime.3 newtzset.3 time2posix.3 \
330343 tzfile.5 tzselect.8 zic.8 zdump.8
331344MANTXTS= newctime.3.txt newstrftime.3.txt newtzset.3.txt \
332345 time2posix.3.txt \
333346 tzfile.5.txt tzselect.8.txt zic.8.txt zdump.8.txt \
334347 date.1.txt
335- COMMON= Makefile README
348+ COMMON= CONTRIBUTING Makefile NEWS README Theory
336349WEB_PAGES= tz-art.htm tz-link.htm
337- DOCS= NEWS Theory $( MANS) date.1 $( MANTXTS) $( WEB_PAGES)
350+ DOCS= $( MANS) date.1 $( MANTXTS) $( WEB_PAGES)
338351PRIMARY_YDATA= africa antarctica asia australasia \
339352 europe northamerica southamerica
340353YDATA= $( PRIMARY_YDATA) pacificnew etcetera backward
@@ -343,10 +356,10 @@ TDATA= $(YDATA) $(NDATA)
343356ZONETABLES= zone1970.tab zone.tab
344357TABDATA= iso3166.tab leapseconds $( ZONETABLES)
345358LEAP_DEPS= leapseconds.awk leap-seconds.list
346- DATA= $( YDATA) $( NDATA) $( TABDATA) \
347- $( LEAP_DEPS ) yearistype.sh
359+ DATA= $( YDATA) $( NDATA) backzone $( TABDATA) \
360+ leap-seconds.list yearistype.sh
348361AWK_SCRIPTS= checktab.awk leapseconds.awk
349- MISC= $( AWK_SCRIPTS) workman.sh zoneinfo2tdf.pl
362+ MISC= $( AWK_SCRIPTS) zoneinfo2tdf.pl
350363ENCHILADA= $( COMMON) $( DOCS) $( SOURCES) $( DATA) $( MISC)
351364
352365# And for the benefit of csh users on systems that assume the user
@@ -429,6 +442,11 @@ posix_right: posix_only leapseconds
429442 $( ZIC) -y $( YEARISTYPE) -d $( DESTDIR) $( TZDIR) -leaps \
430443 -L leapseconds $( TDATA)
431444
445+ posix_packrat: posix_only backzone
446+ $( AWK) ' /^Rule/' $( TDATA) | \
447+ $( ZIC) -y $( YEARISTYPE) -d $( DESTDIR) $( TZDIR) \
448+ -L /dev/null - backzone
449+
432450zones: $( REDO)
433451
434452libtz.a: $( LIBOBJS)
@@ -449,20 +467,25 @@ tzselect: tzselect.ksh
449467 < $? > $@
450468 chmod +x $@
451469
452- check: check_character_set check_tables check_web
470+ check: check_character_set check_white_space check_tables check_web
453471
454472check_character_set: $( ENCHILADA)
455473 LC_ALL=en_US.utf8 && export LC_ALL && \
456474 sharp=' #' && \
457475 ! grep -Env $( SAFE_LINE) $( MANS) date.1 $( MANTXTS) \
458476 $( MISC) $( SOURCES) $( WEB_PAGES) && \
459- ! grep -Env $( SAFE_SHARP_LINE) $( YDATA ) $( NDATA ) iso3166.tab \
460- zone .tab leapseconds $( LEAP_DEPS ) yearistype.sh && \
477+ ! grep -Env $( SAFE_SHARP_LINE) $( TDATA ) backzone \
478+ iso3166 .tab leapseconds yearistype.sh zone.tab && \
461479 test $$ (grep -Ecv $( SAFE_SHARP_LINE) Makefile) -eq 1 && \
462- ! grep -Env $( NONSYM_LINE) README NEWS Theory $( MANS ) date.1 \
463- zone1970.tab && \
480+ ! grep -Env $( NONSYM_LINE) CONTRIBUTING NEWS README Theory \
481+ $( MANS ) date.1 zone1970.tab && \
464482 ! grep -Env $( VALID_LINE) $( ENCHILADA)
465483
484+ check_white_space: $( ENCHILADA)
485+ ! grep -n ' ' $( TAB_CHAR) $( ENCHILADA)
486+ ! grep -n ' [[:space:]]$$' $( ENCHILADA)
487+ ! grep -n " $$ (printf '[\f\r\v]\n')" $( ENCHILADA)
488+
466489check_tables: checktab.awk $( PRIMARY_YDATA) $( ZONETABLES)
467490 for tab in $( ZONETABLES) ; do \
468491 $( AWK) -f checktab.awk -v zone_table=$$ tab $( PRIMARY_YDATA) \
@@ -486,7 +509,7 @@ maintainer-clean: clean
486509names:
487510 @echo $( ENCHILADA)
488511
489- public: check check_public check_time_t_alternatives \
512+ public: check check_public $( CHECK_TIME_T_ALTERNATIVES ) \
490513 tarballs signatures
491514
492515date.1.txt: date.1
@@ -546,14 +569,22 @@ check_public: $(ENCHILADA)
546569# Check that the code works under various alternative
547570# implementations of time_t.
548571check_time_t_alternatives:
572+ if diff -q Makefile Makefile 2> /dev/null; then \
573+ quiet_option=' -q' ; \
574+ else \
575+ quiet_option=' ' ; \
576+ fi && \
549577 zones= ` $(AWK ) '/^[^# ]/ { print $$3 }' <zone1970.tab` && \
550578 for type in $(TIME_T_ALTERNATIVES); do \
551579 mkdir -p tzpublic/$$type && \
552580 make clean_misc && \
553581 make TOPDIR=`pwd`/tzpublic/$$type \
554582 CFLAGS='$(CFLAGS) -Dtime_tz='"'$$type'" \
583+ REDO='$(REDO)' \
555584 install && \
556- diff -qr tzpublic/int64_t/etc/zoneinfo tzpublic/$$type/etc/zoneinfo && \
585+ diff $$quiet_option -r \
586+ tzpublic/int64_t/etc/zoneinfo \
587+ tzpublic/$$type/etc/zoneinfo && \
557588 case $$type in \
558589 int32_t) range=-2147483648,2147483647;; \
559590 uint32_t) range=0,4294967296;; \
@@ -576,12 +607,12 @@ tarballs: tzcode$(VERSION).tar.gz tzdata$(VERSION).tar.gz
576607tzcode$(VERSION ) .tar.gz : set-timestamps.out
577608 LC_ALL=C && export LC_ALL && \
578609 tar $(TARFLAGS ) -cf - \
579- $(COMMON ) $(DOCS ) $(SOURCES ) $( MISC ) | \
610+ $(COMMON ) $(DOCS ) $(SOURCES ) | \
580611 gzip $(GZIPFLAGS ) > $@
581612
582613tzdata$(VERSION ) .tar.gz : set-timestamps.out
583614 LC_ALL=C && export LC_ALL && \
584- tar $(TARFLAGS ) -cf - $(COMMON ) $(DATA ) | \
615+ tar $(TARFLAGS ) -cf - $(COMMON ) $(DATA ) $( MISC ) | \
585616 gzip $(GZIPFLAGS ) > $@
586617
587618signatures : tzcode$(VERSION ) .tar.gz.asc tzdata$(VERSION ) .tar.gz.asc
@@ -610,15 +641,15 @@ difftime.o: private.h
610641ialloc.o : private.h
611642localtime.o : private.h tzfile.h
612643scheck.o : private.h
613- strftime.o : tzfile.h
644+ strftime.o : private.h tzfile.h
614645zdump.o : version.h
615646zic.o : private.h tzfile.h version.h
616647
617648.KEEP_STATE :
618649
619650.PHONY : ALL INSTALL all
620651.PHONY : check check_character_set check_public check_tables
621- .PHONY : check_time_t_alternatives check_web clean clean_misc
622- .PHONY : install maintainer-clean names posix_only posix_right
652+ .PHONY : check_time_t_alternatives check_web check_white_space clean clean_misc
653+ .PHONY : install maintainer-clean names posix_packrat posix_only posix_right
623654.PHONY : public right_only right_posix signatures tarballs typecheck
624655.PHONY : zonenames zones
0 commit comments