ICU-4716 initial checkin of zic utilities

X-SVN-Rev: 19972
This commit is contained in:
Steven R. Loomis 2006-08-04 01:18:19 +00:00
parent a2fb7c3c42
commit df8d3e4ed3
3 changed files with 42 additions and 35 deletions

View File

@ -497,6 +497,23 @@ $(BUILDDIR)/%.res: $(LOCSRCDIR)/%.txt $(BINDIR)/genrb$(EXEEXT) $(DAT_FILES)
$(BUILDDIR)/%.res: $(MISCSRCDIR)/%.txt $(BINDIR)/genrb$(EXEEXT)
$(INVOKE) $(BINDIR)/genrb $(GENRBOPTS) -q -i $(BUILDDIR) -s $(MISCSRCDIR) -d $(BUILDDIR) $(<F)
# if the 'in' directory contains a new tzdata*.tar.gz file, use it for zoneinfo.txt
TZDATA = $(firstword $(wildcard $(srcdir)/in/tzdata*.tar.gz))
ifneq ($(TZDATA),)
$(MISCSRCDIR)/zoneinfo.txt: $(TZDATA)
@echo "******* Updating zoneinfo.txt from $(TZDATA) ..."
cd $(top_builddir) \
&& CONFIG_FILES=tools/tzcode/Makefile CONFIG_HEADERS= $(SHELL) ./config.status
cp $(TZDATA) $(top_builddir)/tools/tzcode
gunzip -d < $(TZDATA) | ( cd $(top_builddir)/tools/tzcode ; tar xf - )
$(MAKE) -C $(top_builddir)/tools/tzcode icu_data
mv $(top_builddir)/tools/tzcode/zoneinfo.txt $@
$(MAKE) -C $(top_builddir)/tools/tzcode dataclean
$(RMV) $(top_builddir)/tools/tzcode/tzdata*.tar.gz
@echo "******* Done building $@ from $< **********"
endif
$(OUTTMPDIR)/$(INDEX_NAME).txt: $(SRCLISTDEPS)
@echo "generating $@ (list of installed locales)"; \
$(RMV) $@; \

View File

@ -8,9 +8,10 @@ top_builddir = ../..
include ../../icudefs.mk
TZCOBJS= zic.o localtime.o asctime.o scheck.o ialloc.o
CFLAGS+=-D_POSIX_C_SOURCE
PRIMARY_YDATA= africa antarctica asia australasia \
europe northamerica southamerica
@ -18,20 +19,28 @@ YDATA= $(PRIMARY_YDATA) pacificnew etcetera factory backward
NDATA= systemv
SDATA= solar87 solar88 solar89
TDATA= $(YDATA) $(NDATA) $(SDATA)
YEARISTYPE= ./yearistype
ZIC = ./zic
TZDIR=zoneinfo
CFLAGS+=-D_POSIX_C_SOURCE
CPPFLAGS+= -DTZDIR=\"$(TZDIR)\"
# more data
XDATA=zone.tab yearistype.sh leapseconds iso3166.tab
ICUDATA=ZoneMetaData.java icu_zone.txt tz2icu zoneinfo.txt
all: tz2icu zic
@echo use $(MAKE) icu_data to build icu data
all:
@echo This code is intended to be run by the icu/source/data makefile only.
false
zic: $(TZCOBJS) yearistype tz2icu.h
$(CC) $(CFLAGS) $(LFLAGS) $(TZCOBJS) $(LDLIBS) -o $@
tz2icu: tz2icu.cpp tz2icu.h
$(CPP) -W -Wall -pedantic tz2icu.cpp -o $@
$(CXX) -W -Wall -pedantic tz2icu.cpp -o $@
yearistype: yearistype.sh
cp yearistype.sh yearistype
@ -42,13 +51,13 @@ posix_only: zic $(TDATA)
icu_data: tz2icu posix_only
./tz2icu zoneinfo zone.tab `ls tzdata*.tar.gz | sed -e "s/^tzdata//;s/\.tar\.gz$$//"`
./tz2icu $(TZDIR) zone.tab `ls tzdata*.tar.gz | sed -e "s/^tzdata//;s/\.tar\.gz$$//"`
clean:
-rm -f core *.o *.out tzselect zdump zic yearistype date
-rm -f core *.o *.out zdump zic yearistype date
@echo ICU specific cleanup:
-rm -f $(ICUDATA)
-rm -rf zoneinfo
-rm -rf $(TZDIR)
dataclean: clean
-rm -f $(TDATA) $(XDATA)

View File

@ -9,7 +9,6 @@
Note: this directory currently contains tzcode as of tzcode2006h.tar.gz
----------------------------------------------------------------------
OVERVIEW
@ -59,47 +58,29 @@ several parts. E.g.:
tzcode2003a.tar.gz 98 KB 3/24/2003 2:32:00 PM
tzdata2003a.tar.gz 132 KB 3/24/2003 2:32:00 PM
ICU only uses the tzcodeYYYYV.tar.gz and tzdataYYYYV.tar.gz files,
ICU only uses the tzdataYYYYV.tar.gz files,
where YYYY is the year and V is the version letter ('a'...'z').
This directory has partial contents of tzcode checked into ICU
----------------------------------------------------------------------
HOWTO
0. Generate Makefile
( cd ../.. ; CONFIG_FILES=tools/tzcode/Makefile CONFIG_HEADERS= sh config.status )
0. Note, these instructions will only work on POSIX type systems.
1. Obtain the current versions of tzdataYYYYV.tar.gz (aka `tzdata') from the FTP site given
above. Either manually download or use wget:
$ cd {path_to}/icu/source/tools/tzcode
$ wget "ftp://elsie.nci.nih.gov/pub/tz*.tar.gz"
$ wget "ftp://elsie.nci.nih.gov/pub/tzdata*.tar.gz"
2. Unpack tzdata directly into the directory tzcode:
$ tar xzvf tzdata*.tar.gz
2. copy only one tzdata*.tar.gz file into the icu/source/data/in/ directory (you may have to create this directory)
*** Make sure you only have ONE FILE named tzdata*.tar.gz in the
directory.
*** Do NOT delete the tzdata*.tar.gz file.
The Makefile looks in the current directory to determine the
version of Olson data it is building by looking for tzdata*.tar.gz.
3. Build ICU normally. You will see a notice "updating zoneinfo.txt..."
3. Build:
$ make icu_data
4. Copy the data files to the correct location in the ICU4C/ICU4J
source trees:
$ cp zoneinfo.txt ../../data/misc/
$ cp ZoneMetaData.java {path_to}/icu4j/src/com/ibm/icu/impl
5. Rebuild ICU:
$ cd ../..
$ {*make}
6. Don't forget to check in the new zoneinfo.txt (from its location at
4. For ICU maintainers, don't forget to check in the new
zoneinfo.txt (from its location at
{path_to}/icu/source/data/misc/zoneinfo.txt) into CVS.