Hello again,

I tried this approach and it was only a single place I had to change in
the toolchain. The attached patch is for glibc-2.8 and enables use of
local zic compiler. These files are automatically installed as part of the
toolchain.
In ptxdist I've removed the BROKEN tag from the time zone section.
Furthermore the files zone.tab and iso3166.tab have been added as they
are very practical when making a list for the user to choose timezone.
Perhaps also the script tzselect should be added?

Best regards,
Bo


Luotao Fu wrote:
Hi,

On Fri, Mar 20, 2009 at 02:21:42PM +0000, Bo Hansen wrote:
Hi,

I am about to fix the time zone feature and would like an opinion before I go ahead.

great. There has been some efforts integrating timezone features back in the 1.x
time. We did some customer solution to solve this too. To be very honest, I
can't remember the problems we face integrating to generic ptxdist anymore. ;-)
(we did have several, though)

As for now when the toolchain is built the /usr/share/zoneinfo-files for each country is not generated which I suppose is because we are cross-compiling and do not want to install the files to the local machine.

Reading the manual for tzfiles I understand that the files are portable, which mean we could just run the local "zic"-command to generate the zoneinfo-directory tree and then copy to the "/opt" directory of the toolchain
and make timezone.make install these files on the target.


AFAIR The timezone files for themselves are actually platform independent.
(perhaps endinaess dependt though). We actually don't have any problems with
installing them to the host machine since we take for grant that the host
machine has endless storage. ;-) So I think your approach will be a possible
solution.

Cheers
Luotao Fu
------------------------------------------------------------------------

--
ptxdist mailing list
[email protected]

--

Med venlig hilsen/ Best regards

Bo Hansen

Newtec A/S
Stærmosegårdsvej 18
5230 Odense M
Denmark

Index: ptxdist/rules/timezone.make
diff -u ptxdist/rules/timezone.make:1.1.1.1 ptxdist/rules/timezone.make:1.2
--- ptxdist/rules/timezone.make:1.1.1.1	Mon Feb  9 11:38:42 2009
+++ ptxdist/rules/timezone.make	Thu Apr  2 13:10:07 2009
@@ -146,6 +146,9 @@
 		$(call add_zoneinfo, $$target, $(TIMEZONE_DIR)); \
 	done
 
+	$(call add_zoneinfo, zone.tab, $(TIMEZONE_DIR))
+	$(call add_zoneinfo, iso3166.tab, $(TIMEZONE_DIR))
+
 	@$(call install_copy, timezone, 0, 0, 0755, /usr/share/zoneinfo)
 	@for d in `find ${TIMEZONE_DIR}/zoneinfo/ -type d | awk -v FS="zoneinfo/" '{print $$2}'`; do \
 		$(call install_copy, timezone, 0, 0, 0755, /usr/share/zoneinfo/$$d); \
Index: ptxtoolchain/patches/glibc-2.8/generic/series
diff -u ptxtoolchain/patches/glibc-2.8/generic/series:1.1.1.1 ptxtoolchain/patches/glibc-2.8/generic/series:1.2
--- ptxtoolchain/patches/glibc-2.8/generic/series:1.1.1.1	Thu Feb  5 10:14:12 2009
+++ ptxtoolchain/patches/glibc-2.8/generic/series	Thu Apr  2 13:21:44 2009
@@ -29,3 +29,4 @@
 gentoo/6415_all_sh-glibc-2.5-no-asm-user-header.patch
 gentoo/6416_all_sh-glibc-2.5-no-asm-elf-header.patch
 gentoo/6645_all_glibc-mips_shn_undef-hack.patch
+timezone-fix.patch
Index: ptxtoolchain/patches/glibc-2.8/generic/timezone-fix.patch
diff -u /dev/null ptxtoolchain/patches/glibc-2.8/generic/timezone-fix.patch:1.2
--- /dev/null	Tue Apr  7 12:58:06 2009
+++ ptxtoolchain/patches/glibc-2.8/generic/timezone-fix.patch	Tue Apr  7 12:55:51 2009
@@ -0,0 +1,29 @@
+
+This patch enables compilation of timezone files using the local zic-compiler
+of the build machine.
+
+
+ timezone/Makefile |    5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+Index: glibc-2.8/timezone/Makefile
+===================================================================
+--- glibc-2.8.orig/timezone/Makefile	2009-03-23 13:36:20.000000000 +0100
++++ glibc-2.8/timezone/Makefile	2009-03-23 13:37:07.000000000 +0100
+@@ -69,13 +69,14 @@
+ 					 $(addprefix $(inst_zonedir)/, \
+ 						     $(posixrules-file)))
+ 
+-ifeq ($(cross-compiling),no)
++## PTXDIST - running local zic to generate zone files
++##ifeq ($(cross-compiling),no)
+ # Don't try to install the zoneinfo files since we can't run zic.
+ install-others = $(addprefix $(inst_zonedir)/,$(zonenames) \
+ 					      $(zonenames:%=posix/%) \
+ 					      $(zonenames:%=right/%)) \
+ 		 $(installed-localtime-file) $(installed-posixrules-file)
+-endif
++##endif
+ 
+ ifeq ($(have-ksh),yes)
+ install-others += $(inst_zonedir)/iso3166.tab $(inst_zonedir)/zone.tab
--
ptxdist mailing list
[email protected]

Reply via email to