From d9fb67caf95bb2c68cd1e5ac3e400da3e194b49c Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Thu, 8 Jun 2017 19:01:58 -0700 Subject: [PATCH 1/2] Port to AIX 7.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Our localtime etc. functions did not interoperate well with the system strftime functions on AIX 7.1, presumably due to warring tzset implementations. So, use our strftime function too. Problem reported by Kees Dekker in: http://mm.icann.org/pipermail/tz/2017-June/025105.html Also, port ‘make check’ to systems that lack a UTF-8 locale or that have it under a name that differs from that of GNU/Linux. Also, port ‘make check’ to systems that lack nsgmls. * Makefile (UTF8_LOCALE): New macro. (VALIDATE): Mention that it can be ':'. (TZDOBJS): Add strftime.o. (check_character_set): Use UTF8_LOCALE, after testing it. * private.h (strftime, strftime_l) [TZ_TIME_T]: Define these to private names, too. --- Makefile | 16 +++++++++++++--- private.h | 6 ++++++ 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index e6d497d..05b40bb 100644 --- a/Makefile +++ b/Makefile @@ -117,6 +117,11 @@ BACKWARD= backward pacificnew PACKRATDATA= +# The name of a locale using the UTF-8 encoding, used during self-tests. +# The tests are skipped if the name does not appear to work on this system. + +UTF8_LOCALE= en_US.utf8 + # Since "." may not be in PATH... YEARISTYPE= ./yearistype @@ -331,6 +336,7 @@ SGML_CATALOG_FILES= \ # The name, arguments and environment of a program to validate your web pages. # See for a validator, and # for a validation library. +# Set VALIDATE=':' if you do not have such a program. VALIDATE = nsgmls VALIDATE_FLAGS = -s -B -wall -wno-unused-param VALIDATE_ENV = \ @@ -397,7 +403,7 @@ AR= ar RANLIB= : TZCOBJS= zic.o -TZDOBJS= zdump.o localtime.o asctime.o +TZDOBJS= zdump.o localtime.o asctime.o strftime.o DATEOBJS= date.o localtime.o strftime.o asctime.o LIBSRCS= localtime.c asctime.c difftime.c LIBOBJS= localtime.o asctime.o difftime.o @@ -615,7 +621,10 @@ check: check_character_set check_white_space check_links check_sorted \ check_tables check_web check_zishrink check_tzs check_character_set: $(ENCHILADA) - LC_ALL=en_US.utf8 && export LC_ALL && \ + test ! '$(UTF8_LOCALE)' || \ + ! printf 'A\304\200B\n' | \ + LC_ALL='$(UTF8_LOCALE)' grep -q '^A.B$$' >/dev/null 2>&1 || { \ + LC_ALL='$(UTF8_LOCALE)' && export LC_ALL && \ sharp='#' && \ ! grep -Env $(SAFE_LINE) $(MANS) date.1 $(MANTXTS) \ $(MISC) $(SOURCES) $(WEB_PAGES) \ @@ -623,7 +632,8 @@ check_character_set: $(ENCHILADA) version tzdata.zi && \ ! grep -Env $(SAFE_SHARP_LINE) $(TDATA) backzone \ leapseconds yearistype.sh zone.tab && \ - ! grep -Env $(OK_LINE) $(ENCHILADA) + ! grep -Env $(OK_LINE) $(ENCHILADA); \ + } check_white_space: $(ENCHILADA) patfmt=' \t|[\f\r\v]' && pat=`printf "$$patfmt\\n"` && \ diff --git a/private.h b/private.h index ad9fcb9..0e8cfda 100644 --- a/private.h +++ b/private.h @@ -393,6 +393,8 @@ typedef time_tz tz_time_t; # define posix2time tz_posix2time # undef posix2time_z # define posix2time_z tz_posix2time_z +# undef strftime +# define strftime tz_strftime # undef time # define time tz_time # undef time2posix @@ -415,6 +417,10 @@ typedef time_tz tz_time_t; # define tzset tz_tzset # undef tzsetwall # define tzsetwall tz_tzsetwall +# if HAVE_STRFTIME_L +# undef strftime_l +# define strftime_l tz_strftime_l +# endif # if HAVE_TZNAME # undef tzname # define tzname tz_tzname -- 2.9.4