tz.patch 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. --- glibc-2.12.1/timezone/Makefile 2010-07-27 13:34:39.000000000 +0200
  2. +++ glibc-2.12.1.orig/timezone/Makefile 2011-01-10 15:20:02.576150764 +0100
  3. @@ -69,13 +69,10 @@
  4. $(addprefix $(inst_zonedir)/, \
  5. $(posixrules-file)))
  6. -ifeq ($(cross-compiling),no)
  7. -# Don't try to install the zoneinfo files since we can't run zic.
  8. install-others = $(addprefix $(inst_zonedir)/,$(zonenames) \
  9. $(zonenames:%=posix/%) \
  10. $(zonenames:%=right/%)) \
  11. $(installed-localtime-file) $(installed-posixrules-file)
  12. -endif
  13. ifeq ($(have-ksh),yes)
  14. install-others += $(inst_zonedir)/iso3166.tab $(inst_zonedir)/zone.tab
  15. @@ -106,18 +103,35 @@
  16. echo '$$(addprefix $$(inst_zonedir)/,$$($*-zones)): \' ;\
  17. echo '$$(foreach t,$$(tzbases),$$(addprefix $$(inst_zonedir)/,$$($$t-zones)))' ;\
  18. fi ;\
  19. - echo '$$(addprefix $$(dir $$(inst_zonedir))zone%/right/,$$($*-zones)): \' ;\
  20. - echo '$< $$(objpfx)zic leapseconds yearistype' ;\
  21. - echo ' $$(tzcompile)' ;\
  22. - echo '$$(addprefix $$(dir $$(inst_zonedir))zone%/posix/,$$($*-zones)): \' ;\
  23. - echo '$< $$(objpfx)zic /dev/null yearistype' ;\
  24. - echo ' $$(tzcompile)' ;\
  25. - echo '$$(addprefix $$(dir $$(inst_zonedir))zone%/,$$($*-zones)): \' ;\
  26. - echo '$< $$(objpfx)zic $$(leapseconds) yearistype' ;\
  27. - echo ' $$(tzcompile)' ;\
  28. + echo '$$(addprefix $$(dir $$(inst_zonedir))zone%/right/,$$($*-zones)): \' ;) > $@.new
  29. +
  30. +ifeq (no,$(cross-compiling))
  31. + (echo '$< $$(objpfx)zic leapseconds yearistype' ;) >> $@.new
  32. +else
  33. + (echo '$< $$(objpfx)cross-zic leapseconds yearistype' ;) >> $@.new
  34. +endif
  35. +
  36. + (echo ' $$(tzcompile)' ;\
  37. + echo '$$(addprefix $$(dir $$(inst_zonedir))zone%/posix/,$$($*-zones)): \' ;) >> $@.new
  38. +
  39. +ifeq (no,$(cross-compiling))
  40. + (echo '$< $$(objpfx)zic /dev/null yearistype' ;) >> $@.new
  41. +else
  42. + (echo '$< $$(objpfx)cross-zic /dev/null yearistype' ;) >> $@.new
  43. +endif
  44. +
  45. + (echo ' $$(tzcompile)' ;\
  46. + echo '$$(addprefix $$(dir $$(inst_zonedir))zone%/,$$($*-zones)): \' ;) >> $@.new
  47. +
  48. +ifeq (no,$(cross-compiling))
  49. + (echo '$< $$(objpfx)zic $$(leapseconds) yearistype' ;) >> $@.new
  50. +else
  51. + (echo '$< $$(objpfx)cross-zic $$(leapseconds) yearistype' ;) >> $@.new
  52. +endif
  53. +
  54. + (echo ' $$(tzcompile)' ;\
  55. echo 'endif' ;\
  56. - echo 'zonenames := $$(zonenames) $$($*-zones)' ;\
  57. - ) > $@.new
  58. + echo 'zonenames := $$(zonenames) $$($*-zones)' ;) >> $@.new
  59. mv $@.new $@
  60. .PHONY: echo-zonenames
  61. @@ -128,7 +142,11 @@
  62. # We have to use `-d $(inst_zonedir)' to explictly tell zic where to
  63. # place the output files although $(zonedir) is compiled in. But the
  64. # user might have set $(install_root) on the command line of `make install'.
  65. +ifeq (no,$(cross-compiling))
  66. zic-cmd = $(built-program-cmd) -d $(inst_zonedir)
  67. +else
  68. +zic-cmd = $(objpfx)cross-zic -d $(inst_zonedir)
  69. +endif
  70. tzcompile = $(zic-cmd)$(target-zone-flavor) -L $(word 3,$^) \
  71. -y $(dir $(word 4,$^))$(notdir $(word 4,$^)) $<
  72. @@ -158,8 +176,17 @@
  73. $(zic-cmd) -p $(posixrules)
  74. endif
  75. +zic-objs = zic.o ialloc.o scheck.o
  76. +
  77. +$(objpfx)zic: $(addprefix $(objpfx), $(zic-objs))
  78. +
  79. +$(addprefix $(objpfx)cross-,$(zic-objs)): $(objpfx)cross-%.o: %.c
  80. + gcc $< -c $(OUTPUT_OPTION) \
  81. + $(filter-out -DHAVE_GETTEXT,$(CFLAGS-$*.c)) \
  82. + $(CPPFLAGS-$*) -DCROSS_ZIC $(compile-mkdep-flags)
  83. -$(objpfx)zic: $(objpfx)scheck.o $(objpfx)ialloc.o
  84. +$(objpfx)cross-zic: $(addprefix $(objpfx)cross-,$(zic-objs))
  85. + gcc $(addprefix $(objpfx)cross-,$(zic-objs)) -o $@
  86. tz-cflags = -DTZDIR='"$(zonedir)"' \
  87. -DTZDEFAULT='"$(localtime-file)"' \
  88. @@ -176,10 +203,17 @@
  89. # Don't add leapseconds here since test-tz made checks that work only without
  90. # leapseconds.
  91. testdata = $(objpfx)testdata
  92. +ifeq (no,$(cross-compiling))
  93. define build-testdata
  94. GCONV_PATH=${common-objpfx}iconvdata LANGUAGE=C LC_ALL=C \
  95. $(built-program-cmd) -d $(testdata) -y ./yearistype $<
  96. endef
  97. +else
  98. +define build-testdata
  99. +LANGUAGE=C LC_ALL=C \
  100. + $(objpfx)cross-zic -d $(testdata) -y ./yearistype $<
  101. +endef
  102. +endif
  103. $(objpfx)test-tz.out: $(addprefix $(testdata)/, America/New_York Etc/UTC UTC)
  104. $(objpfx)tst-timezone.out: $(addprefix $(testdata)/, \
  105. @@ -192,7 +226,11 @@
  106. tst-timezone-ENV = TZDIR=$(testdata)
  107. # Note this must come second in the deps list for $(built-program-cmd) to work.
  108. +ifeq (no,$(cross-compiling))
  109. zic-deps = $(objpfx)zic $(leapseconds) yearistype
  110. +else
  111. +zic-deps = $(objpfx)cross-zic $(objpfx)zic $(leapseconds) yearistype
  112. +endif
  113. $(testdata)/America/New_York: northamerica $(zic-deps)
  114. $(build-testdata)
  115. @@ -214,7 +252,9 @@
  116. $(objpfx)tzselect: tzselect.ksh $(common-objpfx)config.make
  117. sed -e 's%@KSH@%$(KSH)%g' \
  118. - -e 's%@TZDIR@%$(zonedir)%g' < $< > $@.new
  119. + -e 's%@TZDIR@%$(zonedir)%g' \
  120. + -e 's%@PKGVERSION@%$(PKGVERSION)%g' \
  121. + -e 's%@REPORT_BUGS_TO@%$(REPORT_BUGS_TO)%g' < $< > $@.new
  122. chmod 555 $@.new
  123. mv -f $@.new $@