mirror of
https://frontier.innolan.net/rainlance/amiga-tz.git
synced 2026-05-07 00:33:51 +00:00
zdump: use tz library unless USE_LTZ is 0
This fixes some schizophrenia in the build, which linked zdump to the tz library code but did not compile zdump with the tz library API. * zdump.c (USE_LTZ): New macro. Use it, not time_tz, to decide whether to include private.h. * Makefile, NEWS: Document this. * Makefile (CHECK_TIME_T_ALTERNATIVES): New macro. (public): Use it.
This commit is contained in:
8
Makefile
8
Makefile
@@ -136,6 +136,8 @@ LDLIBS=
|
||||
# DST transitions if the time zone files cannot be accessed
|
||||
# -DUNINIT_TRAP=1 if reading uninitialized storage can cause problems
|
||||
# other than simply getting garbage data
|
||||
# -DUSE_LTZ=0 to build zdump with the system time zone library
|
||||
# Also set TZDOBJS=zdump.o and CHECK_TIME_T_ALTERNATIVES= below.
|
||||
# -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)
|
||||
@@ -258,6 +260,10 @@ VALIDATE_ENV = \
|
||||
SP_CHARSET_FIXED=YES \
|
||||
SP_ENCODING=UTF-8
|
||||
|
||||
# This expensive test requires USE_LTZ.
|
||||
# To suppress it, define this macro to be empty.
|
||||
CHECK_TIME_T_ALTERNATIVES = check_time_t_alternatives
|
||||
|
||||
# SAFE_CHAR is a regular expression that matches a safe character.
|
||||
# Some parts of this distribution are limited to safe characters;
|
||||
# others can use any UTF-8 character.
|
||||
@@ -488,7 +494,7 @@ maintainer-clean: clean
|
||||
names:
|
||||
@echo $(ENCHILADA)
|
||||
|
||||
public: check check_public check_time_t_alternatives \
|
||||
public: check check_public $(CHECK_TIME_T_ALTERNATIVES) \
|
||||
tarballs signatures
|
||||
|
||||
date.1.txt: date.1
|
||||
|
||||
5
NEWS
5
NEWS
@@ -67,6 +67,11 @@ Unreleased, experimental changes
|
||||
more likely to guess right for ambiguous time stamps near
|
||||
transitions where tm_isdst does not change.
|
||||
|
||||
zdump now builds with the tz library unless USE_LTZ is defined to 0,
|
||||
This lets zdump use tz features even if the system library lacks them.
|
||||
To build zdump with the system library, use 'make CFLAGS=-DUSE_LTZ=0
|
||||
TZDOBJS=zdump.o CHECK_TIME_T_ALTERNATIVES='.
|
||||
|
||||
tzselect -c now uses a hybrid distance measure that works better
|
||||
in Africa. (Thanks to Alan Barrett for noting the problem.)
|
||||
|
||||
|
||||
10
zdump.c
10
zdump.c
@@ -9,12 +9,14 @@
|
||||
** This code has been made independent of the rest of the time
|
||||
** conversion package to increase confidence in the verification it provides.
|
||||
** You can use this code to help in verifying other implementations.
|
||||
**
|
||||
** However, include private.h when debugging, so that it overrides
|
||||
** time_t consistently with the rest of the package.
|
||||
** To do this, compile with -DUSE_LTZ=0 and link without the tz library.
|
||||
*/
|
||||
|
||||
#ifdef time_tz
|
||||
#ifndef USE_LTZ
|
||||
# define USE_LTZ 1
|
||||
#endif
|
||||
|
||||
#if USE_LTZ
|
||||
# include "private.h"
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user