From c5cba0607997688e78928c6844e8f902f336af27 Mon Sep 17 00:00:00 2001 From: Enji Cooper Date: Thu, 6 Jul 2017 04:19:33 +0000 Subject: [PATCH] Formalize LEAPSECONDS and OLDTIMEZONES in share/zoneinfo/... as `MK_ZONEINFO_LEAPSECONDS_SUPPORT == yes` and `MK_ZONEINFO_OLD_TIMEZONES_SUPPORT == yes`. Keep `LEAPSECONDS` and `OLDTIMEZONES` for backwards compatibility, but print out a warning notifying users that they should use the new variables, in an effort to migrate them to the variables. This is being done mostly for automated build tools, etc, that might rely on these variables being set. The variables will be removed in the future on ^/head, e.g., after ^/stable/12 is cut. MFC after: 1 month Relnotes: yes Reviewed by: bdrewery Differential Revision: D11376 --- share/mk/src.opts.mk | 7 +++++++ share/zoneinfo/Makefile | 16 ++++++++++++++-- .../options/WITH_ZONEINFO_LEAPSECONDS_SUPPORT | 2 ++ .../options/WITH_ZONEINFO_OLD_TIMEZONES_SUPPORT | 3 +++ 4 files changed, 26 insertions(+), 2 deletions(-) create mode 100644 tools/build/options/WITH_ZONEINFO_LEAPSECONDS_SUPPORT create mode 100644 tools/build/options/WITH_ZONEINFO_OLD_TIMEZONES_SUPPORT diff --git a/share/mk/src.opts.mk b/share/mk/src.opts.mk index 1d7824f3081..925b23d14e8 100644 --- a/share/mk/src.opts.mk +++ b/share/mk/src.opts.mk @@ -190,6 +190,8 @@ __DEFAULT_NO_OPTIONS = \ SHARED_TOOLCHAIN \ SORT_THREADS \ SVN \ + ZONEINFO_LEAPSECONDS_SUPPORT \ + ZONEINFO_OLD_TIMEZONES_SUPPORT \ # @@ -387,6 +389,11 @@ MK_AUTHPF:= no MK_DTRACE_TESTS:= no .endif +.if ${MK_ZONEINFO} == "no" +MK_ZONEINFO_LEAPSECONDS_SUPPORT:= no +MK_ZONEINFO_OLD_TIMEZONES_SUPPORT:= no +.endif + .if ${MK_CROSS_COMPILER} == "no" MK_BINUTILS_BOOTSTRAP:= no MK_CLANG_BOOTSTRAP:= no diff --git a/share/zoneinfo/Makefile b/share/zoneinfo/Makefile index b83bbb6a730..f018fff120f 100644 --- a/share/zoneinfo/Makefile +++ b/share/zoneinfo/Makefile @@ -28,12 +28,24 @@ # $ svn commit # Commit message: "MFV of tzdata2008X" # +.include + CLEANFILES+= yearistype CLEANDIRS+= builddir CONTRIBDIR= ${SRCTOP}/contrib/tzdata/ .PATH: ${CONTRIBDIR} .if defined(LEAPSECONDS) +.warning "Using backwards compatibility variable for LEAPSECONDS; please use WITH_ZONEINFO_LEAPSECONDS_SUPPORT instead" +MK_ZONEINFO_LEAPSECONDS_SUPPORT= yes +.endif + +.if defined(OLDTIMEZONES) +.warning "Using backwards compatibility variable for OLDTIMEZONES; please use WITH_ZONEINFO_OLD_TIMEZONES_SUPPORT instead" +MK_ZONEINFO_OLD_TIMEZONES_SUPPORT= yes +.endif + +.if ${MK_ZONEINFO_LEAPSECONDS_SUPPORT} != "no" LEAPFILE= -L ${CONTRIBDIR}leapseconds .else LEAPFILE= @@ -43,7 +55,7 @@ TZFILES= africa antarctica asia australasia etcetera europe \ factory northamerica southamerica POSIXRULES= America/New_York -.if defined(OLDTIMEZONES) +.if ${MK_ZONEINFO_OLD_TIMEZONES_SUPPORT} != "no" TZFILES+= backward systemv .endif @@ -67,7 +79,7 @@ TZBUILDSUBDIRS= \ Pacific \ SystemV -.if defined(OLDTIMEZONES) +.if ${MK_ZONEINFO_OLD_TIMEZONES_SUPPORT} != "no" TZBUILDSUBDIRS+= US Mexico Chile Canada Brazil .endif diff --git a/tools/build/options/WITH_ZONEINFO_LEAPSECONDS_SUPPORT b/tools/build/options/WITH_ZONEINFO_LEAPSECONDS_SUPPORT new file mode 100644 index 00000000000..535f60365cf --- /dev/null +++ b/tools/build/options/WITH_ZONEINFO_LEAPSECONDS_SUPPORT @@ -0,0 +1,2 @@ +.\" $FreeBSD$ +Set to build leapsecond information in to the timezone database. diff --git a/tools/build/options/WITH_ZONEINFO_OLD_TIMEZONES_SUPPORT b/tools/build/options/WITH_ZONEINFO_OLD_TIMEZONES_SUPPORT new file mode 100644 index 00000000000..664b032886c --- /dev/null +++ b/tools/build/options/WITH_ZONEINFO_OLD_TIMEZONES_SUPPORT @@ -0,0 +1,3 @@ +.\" $FreeBSD$ +Set to build backward compatibility timezone aliases in to the timezone +database.