source: clfs-sysroot/patches/glibc-2.9-cross_hacks-2.patch@ 12e6567

Last change on this file since 12e6567 was f79dced, checked in by Joe Ciccone <jciccone@…>, 16 years ago

Updated Glibc Cross Hacks patch to -2.

  • Property mode set to 100644
File size: 46.5 KB
RevLine 
[e184d2f]1Submitted By: Joe Ciccone <jciccone@gmail.com>
2Date: 2006-11-26
3Initial Package Version: 2.5
4 Rediffed against 2.6 by Joe Ciccone
5 Rediffed against 2.8 by Joe Ciccone on 2009-01-03
6 Rediffed against 2.9 by Joe Ciccone on 2009-03-15
7Origin: Joe Ciccone
8Upstream Status: Unknown
9Description: Adds native compile support to the build system then uses that
10 support to build zic-native, for installing timezone info,
11 rpcgen-native, for building librpcsvc.a, and localedef-native,
12 for creating the locale-archive.
13
14diff -Naur glibc-2.9.orig/iconv/Makefile glibc-2.9/iconv/Makefile
15--- glibc-2.9.orig/iconv/Makefile 2007-07-24 23:41:17.000000000 -0400
16+++ glibc-2.9/iconv/Makefile 2009-03-15 19:22:15.732837951 -0400
17@@ -57,6 +57,9 @@
18 iconvconfig.h
19
20 others = iconv_prog iconvconfig
21+ifneq ($(cross-compiling),no)
22+ others-native = iconvconfig-native
23+endif
24 install-others-programs = $(inst_bindir)/iconv
25 install-sbin = iconvconfig
26
27@@ -79,6 +82,7 @@
28
29 $(objpfx)iconv_prog: $(iconv_prog-modules:%=$(objpfx)%.o)
30 $(objpfx)iconvconfig: $(iconvconfig-modules:%=$(objpfx)%.o)
31+$(objpfx)iconvconfig-native: $(iconvconfig-modules:%=$(objpfx)%-native.o)
32
33 ifneq ($(cross-compiling),yes)
34 xtests: test-iconvconfig
35diff -Naur glibc-2.9.orig/iconvdata/Makefile glibc-2.9/iconvdata/Makefile
36--- glibc-2.9.orig/iconvdata/Makefile 2008-05-14 21:54:31.000000000 -0400
37+++ glibc-2.9/iconvdata/Makefile 2009-03-15 19:22:15.753163155 -0400
38@@ -320,23 +320,25 @@
39
40 headers: $(addprefix $(objpfx), $(generated-modules:=.h))
41
42+ifeq ($(cross-compiling),no)
43+iconvconfig-cmd = LC_ALL=C LANGUAGE=C \
44+ $(common-objpfx)elf/ld.so --library-path $(rpath-link) \
45+ $(common-objpfx)iconv/iconvconfig
46+else
47+iconvconfig-cmd = LC_ALL=C LANGUAGE=C \
48+ $(common-objpfx)iconv/iconvconfig-native
49+endif
50+
51 $(addprefix $(inst_gconvdir)/, $(modules.so)): \
52 $(inst_gconvdir)/%: $(objpfx)% $(+force)
53 $(do-install-program)
54 $(inst_gconvdir)/gconv-modules: gconv-modules $(+force)
55 $(do-install)
56-ifeq (no,$(cross-compiling))
57 # Update the $(prefix)/lib/gconv/gconv-modules.cache file. This is necessary
58 # if this libc has more gconv modules than the previously installed one.
59 if test -f "$(inst_gconvdir)/gconv-modules.cache"; then \
60- LC_ALL=C LANGUAGE=C \
61- $(common-objpfx)elf/ld.so --library-path $(rpath-link) \
62- $(common-objpfx)iconv/iconvconfig \
63- $(addprefix --prefix=,$(install_root)); \
64+ $(iconvconfig-cmd) $(addprefix --prefix=,$(install_root)); \
65 fi
66-else
67- @echo '*@*@*@ You should recreate $(inst_gconvdir)/gconv-modules.cache'
68-endif
69
70 endif # build-shared = yes
71
72diff -Naur glibc-2.9.orig/iconvdata/Makefile.orig glibc-2.9/iconvdata/Makefile.orig
73--- glibc-2.9.orig/iconvdata/Makefile.orig 1969-12-31 19:00:00.000000000 -0500
74+++ glibc-2.9/iconvdata/Makefile.orig 2008-05-14 21:54:31.000000000 -0400
75@@ -0,0 +1,393 @@
76+# Copyright (C) 1997-2004,2005,2006,2007,2008 Free Software Foundation, Inc.
77+# This file is part of the GNU C Library.
78+
79+# The GNU C Library is free software; you can redistribute it and/or
80+# modify it under the terms of the GNU Lesser General Public
81+# License as published by the Free Software Foundation; either
82+# version 2.1 of the License, or (at your option) any later version.
83+
84+# The GNU C Library is distributed in the hope that it will be useful,
85+# but WITHOUT ANY WARRANTY; without even the implied warranty of
86+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
87+# Lesser General Public License for more details.
88+
89+# You should have received a copy of the GNU Lesser General Public
90+# License along with the GNU C Library; if not, write to the Free
91+# Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
92+# 02111-1307 USA.
93+
94+#
95+# Makefile for iconv data and code.
96+#
97+subdir := iconvdata
98+
99+# Names of all the shared objects which implement the transformations.
100+modules := ISO8859-1 ISO8859-2 ISO8859-3 ISO8859-4 ISO8859-5 \
101+ ISO8859-6 ISO8859-7 ISO8859-8 ISO8859-9 ISO8859-10 \
102+ ISO8859-11 ISO8859-13 ISO8859-14 ISO8859-15 ISO8859-16 \
103+ T.61 ISO_6937 SJIS KOI-8 HP-ROMAN8 HP-ROMAN9 EBCDIC-AT-DE \
104+ EBCDIC-AT-DE-A EBCDIC-CA-FR EUC-KR UHC JOHAB libJIS libKSC \
105+ BIG5 EUC-JP libGB EUC-CN libCNS EUC-TW ISO646 EBCDIC-DK-NO \
106+ EBCDIC-DK-NO-A EBCDIC-ES EBCDIC-ES-A EBCDIC-ES-S EBCDIC-FI-SE \
107+ EBCDIC-FI-SE-A EBCDIC-FR EBCDIC-IS-FRISS EBCDIC-IT EBCDIC-PT \
108+ EBCDIC-UK EBCDIC-US IBM037 IBM038 IBM274 IBM275 IBM423 \
109+ IBM500 IBM870 IBM871 IBM891 IBM903 IBM904 IBM905 IBM1047 \
110+ IBM874 CP737 CP775 ISO-2022-KR HP-TURKISH8 HP-THAI8 HP-GREEK8 \
111+ KOI8-R LATIN-GREEK LATIN-GREEK-1 IBM256 IBM273 IBM277 IBM278 \
112+ IBM280 IBM281 IBM284 IBM285 IBM290 IBM297 IBM420 IBM424 \
113+ IBM437 IBM850 IBM851 IBM852 IBM855 IBM857 IBM860 IBM861 \
114+ IBM862 IBM863 IBM864 IBM865 IBM868 IBM869 IBM875 IBM880 \
115+ IBM866 CP1258 IBM922 IBM1124 IBM1129 IBM932 IBM943 \
116+ IBM856 IBM930 IBM933 IBM935 IBM937 IBM939 IBM1046 \
117+ IBM1132 IBM1133 IBM1160 IBM1161 IBM1162 IBM1163 IBM1164 \
118+ IBM918 IBM1004 IBM1026 CP1125 CP1250 CP1251 CP1252 CP1253 \
119+ CP1254 CP1255 CP1256 CP1257 ISO-2022-JP MACINTOSH IEC_P27-1 \
120+ ASMO_449 ANSI_X3.110 CSN_369103 CWI DEC-MCS ECMA-CYRILLIC \
121+ GOST_19768-74 GREEK-CCITT GREEK7 GREEK7-OLD INIS INIS-8 \
122+ INIS-CYRILLIC ISO_6937-2 ISO_2033 ISO_5427 ISO_5427-EXT \
123+ ISO_5428 ISO_10367-BOX MAC-IS MAC-UK NATS-DANO NATS-SEFI \
124+ SAMI-WS2 ISO-IR-197 TIS-620 KOI8-U GBK ISIRI-3342 GBGBK \
125+ ISO-2022-CN libISOIR165 UTF-16 UNICODE UTF-32 UTF-7 BIG5HKSCS \
126+ GB18030 ISO-2022-CN-EXT VISCII GBBIG5 CP10007 KOI8-T \
127+ GEORGIAN-PS GEORGIAN-ACADEMY ISO-IR-209 MAC-SAMI ARMSCII-8 \
128+ TCVN5712-1 libJISX0213 EUC-JISX0213 SHIFT_JISX0213 \
129+ ISO-2022-JP-3 TSCII IBM866NAV CP932 EUC-JP-MS PT154 RK1048 \
130+ IBM1025 IBM1122 IBM1137 IBM1153 IBM1154 IBM1155 IBM1156 \
131+ IBM1157 IBM1158 IBM803 IBM901 IBM902 IBM921 IBM1008 \
132+ IBM1008_420 IBM1097 IBM1112 IBM1123 IBM1130 IBM1140 IBM1141 \
133+ IBM1142 IBM1143 IBM1144 IBM1145 IBM1146 IBM1147 IBM1148 \
134+ IBM1149 IBM1166 IBM1167 IBM4517 IBM4899 IBM4909 IBM4971 \
135+ IBM5347 IBM9030 IBM9066 IBM9448 IBM12712 IBM16804 \
136+ IBM1364 IBM1371 IBM1388 IBM1390 IBM1399 ISO_11548-1 MIK BRF \
137+ MAC-CENTRALEUROPE KOI8-RU ISO8859-9E
138+
139+modules.so := $(addsuffix .so, $(modules))
140+
141+include ../Makeconfig
142+
143+ifeq (yes,$(build-shared))
144+tests = bug-iconv1 bug-iconv2 tst-loading tst-e2big tst-iconv4 bug-iconv4 \
145+ tst-iconv6 bug-iconv5 bug-iconv6 tst-iconv7
146+ifeq ($(have-thread-library),yes)
147+tests += bug-iconv3
148+endif
149+
150+test-srcs := tst-table-from tst-table-to
151+
152+bug-iconv6-ENV = LOCPATH=$(common-objpfx)localedata
153+tst-iconv7-ENV = LOCPATH=$(common-objpfx)localedata
154+endif
155+
156+# No code here is in libc.so.
157+CPPFLAGS += -DNOT_IN_libc
158+
159+libJIS-routines := jis0201 jis0208 jis0212
160+libKSC-routines := ksc5601
161+libGB-routines := gb2312
162+libCNS-routines := cns11643l1 cns11643
163+libISOIR165-routines := iso-ir-165
164+libJISX0213-routines := jisx0213
165+
166+LDFLAGS-EUC-KR.so = $(LDFLAGS-rpath-ORIGIN)
167+$(objpfx)EUC-KR.so: $(objpfx)libKSC.so
168+LDFLAGS-JOHAB.so = $(LDFLAGS-rpath-ORIGIN)
169+$(objpfx)JOHAB.so: $(objpfx)libKSC.so
170+LDFLAGS-UHC.so = $(LDFLAGS-rpath-ORIGIN)
171+$(objpfx)UHC.so: $(objpfx)libKSC.so
172+LDFLAGS-EUC-JP.so = $(LDFLAGS-rpath-ORIGIN)
173+$(objpfx)EUC-JP.so: $(objpfx)libJIS.so
174+LDFLAGS-EUC-JP-MS.so = $(LDFLAGS-rpath-ORIGIN)
175+$(objpfx)EUC-JP-MS.so: $(objpfx)libJIS.so
176+LDFLAGS-EUC-CN.so = $(LDFLAGS-rpath-ORIGIN)
177+$(objpfx)EUC-CN.so: $(objpfx)libGB.so
178+LDFLAGS-EUC-TW.so = $(LDFLAGS-rpath-ORIGIN)
179+$(objpfx)EUC-TW.so: $(objpfx)libCNS.so
180+LDFLAGS-EUC-JISX0213.so = $(LDFLAGS-rpath-ORIGIN)
181+$(objpfx)EUC-JISX0213.so: $(objpfx)libJISX0213.so
182+LDFLAGS-SHIFT_JISX0213.so = $(LDFLAGS-rpath-ORIGIN)
183+$(objpfx)SHIFT_JISX0213.so: $(objpfx)libJISX0213.so
184+
185+LDFLAGS-ISO-2022-JP.so = $(LDFLAGS-rpath-ORIGIN)
186+$(objpfx)ISO-2022-JP.so: $(objpfx)libJIS.so $(objpfx)libGB.so \
187+ $(objpfx)libCNS.so $(objpfx)libKSC.so
188+LDFLAGS-ISO-2022-JP-3.so = $(LDFLAGS-rpath-ORIGIN)
189+$(objpfx)ISO-2022-JP-3.so: $(objpfx)libJIS.so $(objpfx)libJISX0213.so
190+LDFLAGS-ISO-2022-KR.so = $(LDFLAGS-rpath-ORIGIN)
191+$(objpfx)ISO-2022-KR.so: $(objpfx)libKSC.so
192+LDFLAGS-ISO-2022-CN.so = $(LDFLAGS-rpath-ORIGIN)
193+$(objpfx)ISO-2022-CN.so: $(objpfx)libGB.so $(objpfx)libCNS.so
194+LDFLAGS-ISO-2022-CN-EXT.so = $(LDFLAGS-rpath-ORIGIN)
195+$(objpfx)ISO-2022-CN-EXT.so: $(objpfx)libGB.so $(objpfx)libCNS.so \
196+ $(objpfx)libISOIR165.so
197+
198+LDFLAGS-libJIS.so = $(LDFLAGS-soname-fname)
199+LDFLAGS-libKSC.so = $(LDFLAGS-soname-fname)
200+LDFLAGS-libGB.so = $(LDFLAGS-soname-fname)
201+LDFLAGS-libCNS.so = $(LDFLAGS-soname-fname)
202+LDFLAGS-libISOIR165.so = $(LDFLAGS-soname-fname)
203+LDFLAGS-libJISX0213.so = $(LDFLAGS-soname-fname)
204+
205+distribute := gconv-modules extra-module.mk gap.awk gaptab.awk gconv.map \
206+ gen-8bit.sh gen-8bit-gap.sh gen-8bit-gap-1.sh \
207+ TESTS $(filter-out testdata/CVS%, $(wildcard testdata/*)) \
208+ TESTS2 run-iconv-test.sh tst-tables.sh tst-table.sh \
209+ tst-table-charmap.sh tst-table-from.c tst-table-to.c \
210+ EUC-JP.irreversible ISIRI-3342.irreversible SJIS.irreversible \
211+ EUC-KR.irreversible BIG5HKSCS.irreversible BIG5.irreversible \
212+ CP1255.irreversible CP1258.irreversible EUC-TW.irreversible \
213+ IBM856.irreversible IBM922.irreversible IBM1132.irreversible \
214+ IBM1133.irreversible IBM1160.irreversible IBM1161.irreversible\
215+ IBM1163.irreversible IBM1164.irreversible \
216+ ARMSCII-8.irreversible TCVN5712-1.precomposed \
217+ JISX0213.TXT EUC-JISX0213.precomposed \
218+ SHIFT_JISX0213.precomposed SHIFT_JISX0213.irreversible \
219+ TSCII.irreversible TSCII.precomposed \
220+ 8bit-generic.c 8bit-gap.c \
221+ ansi_x3.110.c asmo_449.c big5.c cp737.c cp737.h \
222+ cp775.c cp775.h ibm874.c cns11643.c cns11643.h \
223+ cns11643l1.c cns11643l1.h cp1125.c cp1250.c cp1251.c cp1252.c \
224+ cp1253.c cp1254.c cp1255.c cp1256.c cp1257.c cp1258.c \
225+ csn_369103.c cwi.c dec-mcs.c ebcdic-at-de.c ebcdic-at-de-a.c \
226+ ebcdic-ca-fr.c ebcdic-dk-no.c ebcdic-dk-no-a.c ebcdic-es.c \
227+ ebcdic-es-a.c ebcdic-es-s.c ebcdic-fr.c ebcdic-fi-se.c \
228+ ebcdic-fi-se-a.c ebcdic-is-friss.c ebcdic-it.c ebcdic-pt.c \
229+ ebcdic-uk.c ebcdic-us.c ecma-cyrillic.c euc-cn.c euc-jp.c \
230+ euc-kr.c euc-tw.c gb2312.c gb2312.h gbk.c gost_19768-74.c \
231+ greek-ccitt.c greek7.c greek7-old.c hp-roman8.c ibm037.c \
232+ ibm038.c ibm256.c ibm273.c ibm274.c ibm275.c ibm277.c \
233+ ibm278.c ibm280.c ibm281.c ibm284.c ibm285.c ibm290.c \
234+ ibm297.c ibm420.c ibm423.c ibm424.c ibm437.c ibm500.c \
235+ ibm850.c ibm851.c ibm852.c ibm855.c ibm857.c ibm860.c \
236+ ibm861.c ibm862.c ibm863.c ibm864.c ibm865.c ibm866.c \
237+ ibm868.c ibm869.c ibm870.c ibm871.c ibm875.c ibm880.c \
238+ ibm891.c ibm903.c ibm904.c ibm905.c ibm918.c ibm1004.c \
239+ ibm856.c ibm930.c ibm933.c ibm935.c ibm937.c ibm939.c ibm1046.c \
240+ ibm856.h ibm930.h ibm933.h ibm935.h ibm937.h ibm939.h ibm1046.h \
241+ ibm922.c ibm922.h ibm1124.c ibm1124.h ibm1129.c ibm1129.h \
242+ ibm1132.c ibm1132.h ibm1133.c ibm1133.h ibm1162.c ibm1162.h \
243+ ibm1026.c ibm1047.c iec_p27-1.c inis.c inis-8.c viscii.c \
244+ inis-cyrillic.c iso-2022-jp.c iso-2022-kr.c iso646.c \
245+ iso8859-1.c iso8859-2.c iso8859-3.c iso8859-4.c iso8859-5.c \
246+ iso8859-6.c iso8859-7.c iso8859-8.c iso8859-9.c iso8859-10.c \
247+ iso8859-11.c iso8859-13.c iso8859-14.c iso8859-9e.c \
248+ iso8859-15.c iso_2033.c iso_5427-ext.c iso_5427.c iso_5428.c \
249+ iso_6937.c iso_6937-2.c iso_10367-box.c jis0201.c jis0201.h \
250+ jis0208.c jis0208.h jis0212.c jis0212.h johab.c koi-8.c \
251+ koi8-r.c ksc5601.c ksc5601.h latin-greek.c latin-greek-1.c \
252+ macintosh.c mac-is.c mac-uk.c nats-dano.c nats-sefi.c sjis.c \
253+ t.61.c uhc.c sami-ws2.c iso-ir-197.c tis-620.c koi8-u.c \
254+ isiri-3342.c isiri-3342.h gbgbk.c iso-2022-cn.c cns11643l2.h \
255+ iso8859-16.c utf-16.c unicode.c utf-32.c utf-7.c big5hkscs.c \
256+ iso-ir-165.c iso-ir-165.h gb18030.c iso-2022-cn-ext.c \
257+ ibm932.c ibm932.h ibm943.c ibm943.h gbbig5.c cp10007.c \
258+ koi8-t.c georgian-ps.c georgian-academy.c iso-ir-209.c \
259+ mac-sami.c ibm1160.c ibm1160.h ibm1161.c ibm1161.h \
260+ ibm1163.c ibm1163.h ibm1164.c ibm1164.h jisx0213.c jisx0213.h \
261+ euc-jisx0213.c shift_jisx0213.c iso-2022-jp-3.c \
262+ tcvn5712-1.c armscii-8.c tscii.c ibm866nav.c pt154.c rk1048.c \
263+ ibm1025.c ibm1025.h ibm1122.c ibm1122.h ibm1137.c ibm1137.h \
264+ ibm1153.c ibm1153.h ibm1154.c ibm1154.h ibm1155.c ibm1155.h \
265+ ibm1156.c ibm1156.h ibm1157.c ibm1157.h ibm1158.c ibm1158.h \
266+ ibm803.c ibm803.h ibm901.c ibm901.h ibm902.c ibm902.h \
267+ ibm921.c ibm921.h ibm1008.c ibm1008.h ibm1008_420.c \
268+ ibm1097.c ibm1097.h ibm1112.c ibm1112.h ibm1123.c ibm1123.h \
269+ ibm1130.c ibm1130.h ibm1140.c ibm1140.h ibm1141.c ibm1141.h \
270+ ibm1142.c ibm1142.h ibm1143.c ibm1143.h ibm1144.c ibm1144.h \
271+ ibm1145.c ibm1145.h ibm1146.c ibm1146.h ibm1147.c ibm1147.h \
272+ ibm1148.c ibm1148.h ibm1149.c ibm1149.h ibm1166.c ibm1166.h \
273+ ibm1167.c ibm1167.h ibm4517.c ibm4517.h ibm4899.c ibm4899.h \
274+ ibm4909.c ibm4909.h ibm4971.c ibm4971.h ibm5347.c ibm5347.h \
275+ ibm9030.c ibm9030.h ibm9066.c ibm9066.h ibm9448.c ibm9448.h \
276+ ibm12712.c ibm12712.h ibm16804.c ibm16804.h \
277+ ibm1364.c ibm1364.h ibm1371.c ibm1371.h ibm1388.c ibm1388.h \
278+ ibm1390.c ibm1390.h ibm1399.c ibm1399.h iso_11548-1.c mik.c \
279+ brf.c mac-centraleurope.c hp-roman9.c hp-turkish8.c \
280+ hp-thai8.c hp-greek8.c
281+
282+# We build the transformation modules only when we build shared libs.
283+ifeq (yes,$(build-shared))
284+
285+# Rule to generate the shared objects.
286+charmaps = ../localedata/charmaps
287+-include $(objpfx)iconv-rules
288+extra-modules-left := $(modules)
289+include extra-module.mk
290+
291+
292+extra-objs += $(modules.so)
293+install-others = $(addprefix $(inst_gconvdir)/, $(modules.so)) \
294+ $(inst_gconvdir)/gconv-modules
295+
296+# We can build the conversion tables for numerous charsets automatically.
297+
298+gen-8bit-modules := iso8859-2 iso8859-3 iso8859-4 iso8859-6 iso8859-9 koi-8 \
299+ ebcdic-at-de ebcdic-at-de-a ebcdic-ca-fr ebcdic-dk-no \
300+ ebcdic-dk-no-a ebcdic-es-s ebcdic-fi-se ebcdic-fi-se-a \
301+ ebcdic-fr ebcdic-it ebcdic-pt ebcdic-us \
302+ ibm037 ibm038 ibm274 ibm275 ibm423 ibm500 ibm870 ibm871 \
303+ ibm891 ibm903 ibm904 ibm905 ibm1047 \
304+
305+gen-8bit-gap-modules := koi8-r latin-greek latin-greek-1 ibm256 ibm273 \
306+ ibm277 ibm278 ibm280 ibm281 ibm284 ibm285 ibm290 \
307+ ibm297 ibm420 ibm424 ibm437 ibm850 ibm851 ibm852 \
308+ ibm855 ibm857 ibm860 ibm861 ibm862 ibm863 ibm864 \
309+ ibm865 ibm868 ibm869 ibm875 ibm880 ibm918 ibm1004 \
310+ ibm1026 cp1125 cp1250 cp1251 cp1252 cp1253 cp1254 \
311+ cp1256 cp1257 ibm866 iso8859-5 iso8859-7 iso8859-8 \
312+ iso8859-10 macintosh iec_p27-1 asmo_449 \
313+ csn_369103 cwi dec-mcs ecma-cyrillic gost_19768-74 \
314+ greek-ccitt greek7 greek7-old inis inis-8 \
315+ inis-cyrillic iso_2033 iso_5427 iso_5427-ext \
316+ iso_5428 iso_10367-box mac-is nats-dano nats-sefi \
317+ iso8859-13 iso8859-14 iso8859-15 mac-uk sami-ws2 \
318+ iso-ir-197 tis-620 koi8-u ibm874 cp10007 koi8-t \
319+ georgian-ps georgian-academy iso-ir-209 mac-sami \
320+ iso8859-11 ibm866nav pt154 rk1048 mik brf \
321+ mac-centraleurope koi8-ru hp-roman8 hp-roman9 \
322+ ebcdic-es ebcdic-es-a ebcdic-is-friss ebcdic-uk \
323+ iso8859-16 viscii iso8859-9e hp-turkish8 \
324+ hp-thai8 hp-greek8
325+
326+gen-special-modules := iso8859-7jp
327+
328+generated-modules := $(gen-8bit-modules) $(gen-8bit-gap-modules) \
329+ $(gen-special-modules)
330+
331+generated = $(generated-modules:=.h) $(generated-modules:=.stmp) \
332+ iconv-test.out iconv-rules tst-loading.mtrace \
333+ mtrace-tst-loading tst-tables.out iconv-test.xxx
334+ifdef objpfx
335+generated += gconv-modules
336+endif
337+
338+# Rules to generate the headers.
339+export AWK
340+
341+define generate-8bit-table
342+$(make-target-directory)
343+LC_ALL=C $(SHELL) ./gen-8bit.sh $< > $(@:stmp=T)
344+$(move-if-change) $(@:stmp=T) $(@:stmp=h)
345+touch $@
346+endef
347+
348+define generate-8bit-gap-table
349+$(make-target-directory)
350+LC_ALL=C $(SHELL) ./gen-8bit-gap.sh $< > $(@:stmp=T)
351+$(move-if-change) $(@:stmp=T) $(@:stmp=h)
352+touch $@
353+endef
354+
355+# The headers must be generated before the compilation.
356+before-compile = $(addprefix $(objpfx),$(generated-modules:=.h))
357+
358+ifndef avoid-generated
359+$(objpfx)iconv-rules: Makefile
360+ $(make-target-directory)
361+ { echo $(filter-out lib%, $(modules)); \
362+ echo 8bit $(gen-8bit-modules); \
363+ echo 8bit-gap $(gen-8bit-gap-modules); } | \
364+ $(AWK) 'NR == 1 { \
365+ for (i = 1; i <= NF; i++) { \
366+ printf "%s-routines := %s\n", $$i, tolower($$i); \
367+ printf "%s-map := gconv.map\n", $$i; \
368+ } \
369+ }; \
370+ NR > 1 { \
371+ for (i = 2; i <= NF; i++) { \
372+ printf "$$(objpfx)%s.stmp: ", $$i; \
373+ map = toupper($$i); \
374+ sub(/^ISO8859/, "ISO-8859", map); \
375+ if (map == "ISO_2033") map = map "-1983"; \
376+ printf "$$(charmaps)/%s ", map; \
377+ printf "gen-%s.sh\n", $$1; \
378+ printf "\t$$(generate-%s-table)\n", $$1; \
379+ } \
380+ }' > $@.new
381+ mv -f $@.new $@
382+endif
383+
384+$(generated-modules:%=$(objpfx)%.h): $(objpfx)%.h: $(objpfx)%.stmp
385+ @:
386+
387+$(gen-8bit-modules:%=$(objpfx)%.stmp): $(objpfx)%.stmp: $(objpfx)iconv-rules
388+$(gen-8bit-gap-modules:%=$(objpfx)%.stmp): $(objpfx)%.stmp: $(objpfx)iconv-rules
389+
390+$(objpfx)iso8859-7jp.stmp: $(charmaps)/ISO-8859-7 gen-8bit-gap-1.sh
391+ $(make-target-directory)
392+ LC_ALL=C $(SHELL) ./gen-8bit-gap-1.sh $< > $(@:stmp=T)
393+ $(move-if-change) $(@:stmp=T) $(@:stmp=h)
394+ touch $@
395+
396+headers: $(addprefix $(objpfx), $(generated-modules:=.h))
397+
398+$(addprefix $(inst_gconvdir)/, $(modules.so)): \
399+ $(inst_gconvdir)/%: $(objpfx)% $(+force)
400+ $(do-install-program)
401+$(inst_gconvdir)/gconv-modules: gconv-modules $(+force)
402+ $(do-install)
403+ifeq (no,$(cross-compiling))
404+# Update the $(prefix)/lib/gconv/gconv-modules.cache file. This is necessary
405+# if this libc has more gconv modules than the previously installed one.
406+ if test -f "$(inst_gconvdir)/gconv-modules.cache"; then \
407+ LC_ALL=C LANGUAGE=C \
408+ $(common-objpfx)elf/ld.so --library-path $(rpath-link) \
409+ $(common-objpfx)iconv/iconvconfig \
410+ $(addprefix --prefix=,$(install_root)); \
411+ fi
412+else
413+ @echo '*@*@*@ You should recreate $(inst_gconvdir)/gconv-modules.cache'
414+endif
415+
416+endif # build-shared = yes
417+
418+include ../Rules
419+
420+ifeq (no,$(cross-compiling))
421+ifeq (yes,$(build-shared))
422+tests: $(objpfx)iconv-test.out $(objpfx)tst-tables.out
423+ifneq (no,$(PERL))
424+tests: $(objpfx)mtrace-tst-loading
425+endif
426+endif
427+endif
428+
429+tst-loading-ENV = MALLOC_TRACE=$(objpfx)tst-loading.mtrace
430+$(objpfx)mtrace-tst-loading: $(objpfx)tst-loading.out
431+ $(common-objpfx)malloc/mtrace $(objpfx)tst-loading.mtrace > $@
432+
433+$(objpfx)bug-iconv1.out: $(objpfx)gconv-modules \
434+ $(addprefix $(objpfx),$(modules.so))
435+$(objpfx)bug-iconv2.out: $(objpfx)gconv-modules \
436+ $(addprefix $(objpfx),$(modules.so))
437+$(objpfx)bug-iconv3: $(libdl)
438+$(objpfx)bug-iconv3.out: $(objpfx)gconv-modules \
439+ $(addprefix $(objpfx),$(modules.so))
440+$(objpfx)bug-iconv5.out: $(objpfx)gconv-modules \
441+ $(addprefix $(objpfx),$(modules.so))
442+$(objpfx)tst-loading.out: $(objpfx)gconv-modules \
443+ $(addprefix $(objpfx),$(modules.so))
444+$(objpfx)tst-iconv4.out: $(objpfx)gconv-modules \
445+ $(addprefix $(objpfx),$(modules.so))
446+$(objpfx)tst-iconv7.out: $(objpfx)gconv-modules \
447+ $(addprefix $(objpfx),$(modules.so))
448+
449+$(objpfx)iconv-test.out: run-iconv-test.sh $(objpfx)gconv-modules \
450+ $(addprefix $(objpfx),$(modules.so)) \
451+ $(common-objdir)/iconv/iconv_prog TESTS
452+ $(SHELL) -e $< $(common-objdir) > $@
453+
454+$(objpfx)tst-tables.out: tst-tables.sh $(objpfx)gconv-modules \
455+ $(addprefix $(objpfx),$(modules.so)) \
456+ $(objpfx)tst-table-from $(objpfx)tst-table-to
457+ $(SHELL) $< $(common-objpfx) $(common-objpfx)iconvdata/ > $@
458+
459+do-tests-clean common-mostlyclean: tst-tables-clean
460+
461+.PHONY: tst-tables-clean
462+tst-tables-clean:
463+ -rm -f $(objpfx)tst-*.table $(objpfx)tst-EUC-TW.irreversible
464+
465+ifdef objpfx
466+$(objpfx)gconv-modules: gconv-modules
467+ cp $^ $@
468+endif
469diff -Naur glibc-2.9.orig/include-native/bits/libc-tsd.h glibc-2.9/include-native/bits/libc-tsd.h
470--- glibc-2.9.orig/include-native/bits/libc-tsd.h 1969-12-31 19:00:00.000000000 -0500
471+++ glibc-2.9/include-native/bits/libc-tsd.h 2009-03-15 19:22:15.788787576 -0400
472@@ -0,0 +1,3 @@
473+#ifndef __libc_tsd_define
[f79dced]474+#define __libc_tsd_define(A,B,C)
[e184d2f]475+#endif
476diff -Naur glibc-2.9.orig/include-native/config.h glibc-2.9/include-native/config.h
477--- glibc-2.9.orig/include-native/config.h 1969-12-31 19:00:00.000000000 -0500
478+++ glibc-2.9/include-native/config.h 2009-03-15 19:22:15.809829790 -0400
479@@ -0,0 +1 @@
480+/* Empty */
481diff -Naur glibc-2.9.orig/include-native/gnu/stubs.h glibc-2.9/include-native/gnu/stubs.h
482--- glibc-2.9.orig/include-native/gnu/stubs.h 1969-12-31 19:00:00.000000000 -0500
483+++ glibc-2.9/include-native/gnu/stubs.h 2009-03-15 19:22:15.809829790 -0400
484@@ -0,0 +1 @@
485+/* Empty */
486diff -Naur glibc-2.9.orig/include-native/intl/loadinfo.h glibc-2.9/include-native/intl/loadinfo.h
487--- glibc-2.9.orig/include-native/intl/loadinfo.h 1969-12-31 19:00:00.000000000 -0500
488+++ glibc-2.9/include-native/intl/loadinfo.h 2009-03-15 19:22:15.809829790 -0400
489@@ -0,0 +1,4 @@
490+#ifndef LOADINFO_H
491+#define LOADINFO_H
492+struct loaded_l10nfile;
493+#endif
494diff -Naur glibc-2.9.orig/include-native/libintl.h glibc-2.9/include-native/libintl.h
495--- glibc-2.9.orig/include-native/libintl.h 1969-12-31 19:00:00.000000000 -0500
496+++ glibc-2.9/include-native/libintl.h 2009-03-15 19:22:15.838789367 -0400
497@@ -0,0 +1,13 @@
498+#include_next <libintl.h>
499+
500+#ifndef _
501+#define _(X) (X)
502+#endif
503+
504+#ifndef N_
505+#define N_(X) (X)
506+#endif
507+
508+#ifndef _libc_intl_domainname
509+#define _libc_intl_domainname "libc"
510+#endif
511diff -Naur glibc-2.9.orig/include-native/symbol-hacks.h glibc-2.9/include-native/symbol-hacks.h
512--- glibc-2.9.orig/include-native/symbol-hacks.h 1969-12-31 19:00:00.000000000 -0500
513+++ glibc-2.9/include-native/symbol-hacks.h 2009-03-15 19:22:15.838789367 -0400
514@@ -0,0 +1 @@
515+/* Empty */
516diff -Naur glibc-2.9.orig/include-native/tls.h glibc-2.9/include-native/tls.h
517--- glibc-2.9.orig/include-native/tls.h 1969-12-31 19:00:00.000000000 -0500
518+++ glibc-2.9/include-native/tls.h 2009-03-15 19:22:15.838789367 -0400
519@@ -0,0 +1,11 @@
520+#ifndef _include_tls_h
521+#define _include_tls_h 1
522+
523+#if USE_TLS && HAVE___THREAD \
524+ && (!defined NOT_IN_libc || defined IS_IN_libpthread)
525+# define USE___THREAD 1
526+#else
527+# define USE___THREAD 0
528+#endif
529+
530+#endif
531diff -Naur glibc-2.9.orig/locale/Makefile glibc-2.9/locale/Makefile
532--- glibc-2.9.orig/locale/Makefile 2005-12-20 01:58:41.000000000 -0500
533+++ glibc-2.9/locale/Makefile 2009-03-15 19:22:15.838789367 -0400
534@@ -44,6 +44,9 @@
535 aux = $(categories:%=lc-%) $(categories:%=C-%) SYS_libc C_name \
536 xlocale localename global-locale coll-lookup
537 others = localedef locale
538+ifneq ($(cross-compiling),no)
539+others-native = localedef-native
540+endif
541 #others-static = localedef locale
542 install-bin = localedef locale
543 extra-objs = $(localedef-modules:=.o) $(localedef-aux:=.o) \
544@@ -81,6 +84,12 @@
545 $(objpfx)locale: $(locale-modules:%=$(objpfx)%.o)
546 $(objpfx)localedef $(objpfx)locale: $(lib-modules:%=$(objpfx)%.o)
547
548+ifneq ($(cross-compiling),no)
549+$(objpfx)localedef-native: $(localedef-modules:%=$(objpfx)%-native.o)
550+$(objpfx)localedef-native: $(localedef-aux:%=$(objpfx)%-native.o)
551+$(objpfx)localedef-native: $(lib-modules:%=$(objpfx)%-native.o)
552+endif
553+
554 C-translit.h: C-translit.h.in gen-translit.pl
555 $(PERL) gen-translit.pl < $< > $@.tmp
556 mv -f $@.tmp $@
557diff -Naur glibc-2.9.orig/localedata/Makefile glibc-2.9/localedata/Makefile
558--- glibc-2.9.orig/localedata/Makefile 2008-11-27 19:05:08.000000000 -0500
559+++ glibc-2.9/localedata/Makefile 2009-03-15 19:22:15.939718625 -0400
560@@ -208,8 +208,13 @@
561 INSTALL-SUPPORTED-LOCALES=$(addprefix install-, $(SUPPORTED-LOCALES))
562
563 # Sometimes the whole collection of locale files should be installed.
564+ifeq ($(cross-compiling),no)
565 LOCALEDEF=I18NPATH=. GCONV_PATH=$(common-objpfx)iconvdata LC_ALL=C \
566 $(common-objpfx)elf/ld.so --library-path $(rpath-link) $(common-objpfx)locale/localedef
567+else
568+LOCALEDEF=I18NPATH=. GCONV_PATH=$(common-objpfx)iconvdata LC_ALL=C \
569+$(common-objpfx)locale/localedef-native
570+endif
571 install-locales: $(INSTALL-SUPPORTED-LOCALES)
572
573 install-locales-dir:
574diff -Naur glibc-2.9.orig/localedata/Makefile.orig glibc-2.9/localedata/Makefile.orig
575--- glibc-2.9.orig/localedata/Makefile.orig 1969-12-31 19:00:00.000000000 -0500
576+++ glibc-2.9/localedata/Makefile.orig 2008-11-27 19:05:08.000000000 -0500
577@@ -0,0 +1,300 @@
578+# Copyright (C) 1996-2003, 2005, 2007, 2008 Free Software Foundation, Inc.
579+# This file is part of the GNU C Library.
580+
581+# The GNU C Library is free software; you can redistribute it and/or
582+# modify it under the terms of the GNU Lesser General Public
583+# License as published by the Free Software Foundation; either
584+# version 2.1 of the License, or (at your option) any later version.
585+
586+# The GNU C Library is distributed in the hope that it will be useful,
587+# but WITHOUT ANY WARRANTY; without even the implied warranty of
588+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
589+# Lesser General Public License for more details.
590+
591+# You should have received a copy of the GNU Lesser General Public
592+# License along with the GNU C Library; if not, write to the Free
593+# Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
594+# 02111-1307 USA.
595+
596+# Makefile for installing locale data source files.
597+
598+subdir := localedata
599+
600+all: # Make this the default target; it will be defined in Rules.
601+
602+# List with all available character set descriptions.
603+charmaps := $(filter-out $(addprefix charmaps/, CVS RCS SCCS %~), \
604+ $(wildcard charmaps/[A-I]*) \
605+ $(wildcard charmaps/[J-Z]*))
606+
607+# List with all available character set descriptions.
608+locales := $(filter-out $(addprefix locales/, CVS RCS SCCS %~), \
609+ $(wildcard locales/*))
610+
611+
612+subdir-dirs = tests-mbwc
613+vpath %.c tests-mbwc
614+vpath %.h tests-mbwc
615+
616+
617+test-srcs := collate-test xfrm-test tst-fmon tst-rpmatch tst-trans \
618+ tst-mbswcs1 tst-mbswcs2 tst-mbswcs3 tst-mbswcs4 tst-mbswcs5 \
619+ tst-ctype tst-wctype tst-langinfo tst-numeric
620+test-input := de_DE.ISO-8859-1 en_US.ISO-8859-1 da_DK.ISO-8859-1 \
621+ hr_HR.ISO-8859-2 sv_SE.ISO-8859-1 tr_TR.UTF-8 fr_FR.UTF-8 \
622+ si_LK.UTF-8
623+test-input-data = $(addsuffix .in, $(basename $(test-input)))
624+test-output := $(foreach s, .out .xout, \
625+ $(addsuffix $s, $(basename $(test-input))))
626+ld-test-names := test1 test2 test3 test4 test5 test6 test7
627+ld-test-srcs := $(addprefix tests/,$(addsuffix .cm,$(ld-test-names)) \
628+ $(addsuffix .def,$(ld-test-names)) \
629+ $(addsuffix .ds,test5 test6) \
630+ test6.c trans.def)
631+
632+fmon-tests = n01y12 n02n40 n10y31 n11y41 n12y11 n20n32 n30y20 n41n00 \
633+ y01y10 y02n22 y22n42 y30y21 y32n31 y40y00 y42n21
634+
635+generated := $(test-input) $(test-output) sort-test.out tst-locale.out \
636+ tst-mbswcs.out tst-leaks.mtrace mtrace-tst-leaks
637+generated-dirs := $(ld-test-names) tt_TT de_DE.437 \
638+ $(addprefix tstfmon_,$(fmon-tests)) \
639+
640+distribute := CHECKSUMS README SUPPORTED ChangeLog \
641+ $(charmaps) $(locales) \
642+ tst-rpmatch.sh tst-locale.sh tst-fmon.sh sort-test.sh \
643+ tst-fmon.data $(test-input-data) $(ld-test-srcs) \
644+ th_TH.in cs_CZ.in tst-mbswcs.sh tst-trans.sh tst-ctype.sh \
645+ tst-ctype-de_DE.ISO-8859-1.in \
646+ tst-numeric.sh tst-numeric.data \
647+ $(wildcard tests-mbwc/*.[ch]) \
648+ $(addprefix tst-fmon-locales/tstfmon_,$(fmon-tests)) \
649+ gen-locale.sh show-ucs-data.c tst-langinfo.sh \
650+ tst-wctype.sh tst-wctype.input gen-unicode-ctype.c \
651+ dump-ctype.c
652+
653+# Get $(inst_i18ndir) defined.
654+include ../Makeconfig
655+
656+ifeq (no,$(cross-compiling))
657+locale_test_suite := tst_iswalnum tst_iswalpha tst_iswcntrl \
658+ tst_iswctype tst_iswdigit tst_iswgraph \
659+ tst_iswlower tst_iswprint tst_iswpunct \
660+ tst_iswspace tst_iswupper tst_iswxdigit tst_mblen \
661+ tst_mbrlen tst_mbrtowc tst_mbsrtowcs tst_mbstowcs \
662+ tst_mbtowc tst_strcoll tst_strfmon tst_strxfrm \
663+ tst_swscanf tst_towctrans tst_towlower \
664+ tst_towupper tst_wcrtomb tst_wcscat tst_wcschr \
665+ tst_wcscmp tst_wcscoll tst_wcscpy tst_wcscspn \
666+ tst_wcslen tst_wcsncat tst_wcsncmp tst_wcsncpy \
667+ tst_wcspbrk tst_wcsrtombs tst_wcsspn tst_wcsstr \
668+ tst_wcstod tst_wcstok tst_wcstombs tst_wcswidth \
669+ tst_wcsxfrm tst_wctob tst_wctomb tst_wctrans \
670+ tst_wctype tst_wcwidth
671+
672+tests = $(locale_test_suite) tst-digits tst-setlocale bug-iconv-trans \
673+ tst-leaks tst-mbswcs6 tst-xlocale1 tst-xlocale2 bug-usesetlocale \
674+ tst-strfmon1 tst-sscanf tst-strptime
675+ifeq (yes,$(build-shared))
676+ifneq (no,$(PERL))
677+tests: $(objpfx)mtrace-tst-leaks
678+endif
679+endif
680+endif
681+
682+# Files to install.
683+install-others := $(addprefix $(inst_i18ndir)/, \
684+ $(addsuffix .gz, $(charmaps)) \
685+ $(locales))
686+
687+include ../Rules
688+
689+# Install the charmap files in gzipped format.
690+$(inst_i18ndir)/charmaps/%.gz: charmaps/% $(+force)
691+ $(make-target-directory)
692+ rm -f $(@:.gz=) $@
693+ $(INSTALL_DATA) $< $(@:.gz=)
694+ gzip -9 $(@:.gz=)
695+
696+# Install the locale source files in the appropriate directory.
697+$(inst_i18ndir)/locales/%: locales/% $(+force); $(do-install)
698+
699+# gcc does not know all the format specifiers we are using here.
700+CFLAGS-tst-mbswcs1.c = -Wno-format
701+CFLAGS-tst-mbswcs2.c = -Wno-format
702+CFLAGS-tst-mbswcs3.c = -Wno-format
703+CFLAGS-tst-mbswcs4.c = -Wno-format
704+CFLAGS-tst-mbswcs5.c = -Wno-format
705+CFLAGS-tst-trans.c = -Wno-format
706+
707+
708+ifeq (no,$(cross-compiling))
709+# We have to generate locales
710+LOCALES := de_DE.ISO-8859-1 de_DE.UTF-8 en_US.ANSI_X3.4-1968 \
711+ en_US.ISO-8859-1 ja_JP.EUC-JP da_DK.ISO-8859-1 \
712+ hr_HR.ISO-8859-2 sv_SE.ISO-8859-1 ja_JP.SJIS fr_FR.ISO-8859-1 \
713+ vi_VN.TCVN5712-1 nb_NO.ISO-8859-1 nn_NO.ISO-8859-1 \
714+ tr_TR.UTF-8 cs_CZ.UTF-8 zh_TW.EUC-TW fa_IR.UTF-8 fr_FR.UTF-8 \
715+ ja_JP.UTF-8 si_LK.UTF-8
716+LOCALE_SRCS := $(shell echo "$(LOCALES)"|sed 's/\([^ .]*\)[^ ]*/\1/g')
717+CHARMAPS := $(shell echo "$(LOCALES)" | \
718+ sed -e 's/[^ .]*[.]\([^ ]*\)/\1/g' -e s/SJIS/SHIFT_JIS/g)
719+CTYPE_FILES = $(addsuffix /LC_CTYPE,$(LOCALES))
720+
721+generated-dirs += $(LOCALES)
722+
723+# Dependency for the locale files. We actually make it depend only on
724+# one of the files.
725+$(addprefix $(objpfx),$(CTYPE_FILES)): %: \
726+ gen-locale.sh $(common-objpfx)locale/localedef Makefile \
727+ $(addprefix charmaps/,$(CHARMAPS)) $(addprefix locales/,$(LOCALE_SRCS))
728+ @$(SHELL) -e gen-locale.sh $(common-objpfx) '$(built-program-cmd)' $@
729+
730+$(addsuffix .out,$(addprefix $(objpfx),$(tests))): %: \
731+ $(addprefix $(objpfx),$(CTYPE_FILES))
732+
733+tests: $(objpfx)sort-test.out $(objpfx)tst-fmon.out $(objpfx)tst-locale.out \
734+ $(objpfx)tst-rpmatch.out $(objpfx)tst-trans.out \
735+ $(objpfx)tst-mbswcs.out $(objpfx)tst-ctype.out $(objpfx)tst-wctype.out \
736+ $(objpfx)tst-langinfo.out $(objpfx)tst-numeric.out
737+
738+$(objpfx)sort-test.out: sort-test.sh $(objpfx)collate-test $(objpfx)xfrm-test \
739+ $(test-input-data) $(addprefix $(objpfx),$(CTYPE_FILES))
740+ $(SHELL) -e $< $(common-objpfx) '$(run-program-prefix)' $(test-input) \
741+ > $@
742+$(objpfx)tst-fmon.out: tst-fmon.sh $(objpfx)tst-fmon tst-fmon.data \
743+ $(objpfx)sort-test.out \
744+ $(addprefix $(objpfx),$(CTYPE_FILES))
745+ $(SHELL) -e $< $(common-objpfx) '$(run-program-prefix)' tst-fmon.data \
746+ > $@
747+$(objpfx)tst-numeric.out: tst-numeric.sh $(objpfx)tst-numeric tst-numeric.data \
748+ $(objpfx)sort-test.out \
749+ $(addprefix $(objpfx),$(CTYPE_FILES))
750+ $(SHELL) -e $< $(common-objpfx) '$(run-program-prefix)' tst-numeric.data \
751+ > $@
752+$(objpfx)tst-locale.out: tst-locale.sh $(common-objpfx)locale/localedef \
753+ $(ld-test-srcs) $(addprefix $(objpfx),$(CTYPE_FILES))
754+ $(SHELL) -e $< $(common-objpfx) '$(built-program-cmd)' > $@
755+$(objpfx)tst-rpmatch.out: tst-rpmatch.sh $(objpfx)tst-rpmatch \
756+ $(objpfx)tst-fmon.out \
757+ $(addprefix $(objpfx),$(CTYPE_FILES))
758+ $(SHELL) -e $< $(common-objpfx) '$(built-program-cmd)' > $@
759+$(objpfx)tst-trans.out: tst-trans.sh $(objpfx)tst-trans \
760+ $(addprefix $(objpfx),$(CTYPE_FILES))
761+ $(SHELL) -e $< $(common-objpfx) '$(run-program-prefix)'
762+$(objpfx)tst-mbswcs.out: tst-mbswcs.sh $(objpfx)tst-mbswcs1 \
763+ $(objpfx)tst-mbswcs2 $(objpfx)tst-mbswcs3 \
764+ $(objpfx)tst-mbswcs4 $(objpfx)tst-mbswcs5 \
765+ $(addprefix $(objpfx),$(CTYPE_FILES))
766+ $(SHELL) -e $< $(common-objpfx) '$(run-program-prefix)'
767+$(objpfx)tst-ctype.out: tst-ctype.sh $(objpfx)tst-ctype \
768+ $(objpfx)sort-test.out \
769+ $(addprefix $(objpfx),$(CTYPE_FILES))
770+ $(SHELL) -e $< $(common-objpfx) '$(built-program-cmd)'
771+$(objpfx)tst-wctype.out: tst-wctype.sh $(objpfx)tst-wctype \
772+ $(objpfx)sort-test.out tst-wctype.input \
773+ $(addprefix $(objpfx),$(CTYPE_FILES))
774+ $(SHELL) -e $< $(common-objpfx) '$(built-program-cmd)'
775+$(objpfx)tst-langinfo.out: tst-langinfo.sh $(objpfx)tst-langinfo \
776+ $(objpfx)sort-test.out \
777+ $(addprefix $(objpfx),$(CTYPE_FILES))
778+ $(SHELL) -e $< $(common-objpfx) '$(built-program-cmd)'
779+$(objpfx)tst-digits.out: $(objpfx)tst-locale.out
780+$(objpfx)tst-mbswcs6.out: $(addprefix $(objpfx),$(CTYPE_FILES))
781+endif
782+
783+include SUPPORTED
784+
785+INSTALL-SUPPORTED-LOCALES=$(addprefix install-, $(SUPPORTED-LOCALES))
786+
787+# Sometimes the whole collection of locale files should be installed.
788+LOCALEDEF=I18NPATH=. GCONV_PATH=$(common-objpfx)iconvdata LC_ALL=C \
789+$(common-objpfx)elf/ld.so --library-path $(rpath-link) $(common-objpfx)locale/localedef
790+install-locales: $(INSTALL-SUPPORTED-LOCALES)
791+
792+install-locales-dir:
793+ $(..)./scripts/mkinstalldirs $(inst_localedir)
794+
795+$(INSTALL-SUPPORTED-LOCALES): install-locales-dir
796+ @locale=`echo $@ | sed -e 's/^install-//'`; \
797+ charset=`echo $$locale | sed -e 's,.*/,,'`; \
798+ locale=`echo $$locale | sed -e 's,/[^/]*,,'`; \
799+ echo -n `echo $$locale | sed 's/\([^.\@]*\).*/\1/'`; \
800+ echo -n ".$$charset"; \
801+ echo -n `echo $$locale | sed 's/\([^\@]*\)\(\@.*\)*/\2/'`; \
802+ echo -n '...'; \
803+ input=`echo $$locale | sed 's/\([^.]*\)[^@]*\(.*\)/\1\2/'`; \
804+ $(LOCALEDEF) --alias-file=../intl/locale.alias \
805+ -i locales/$$input -c -f charmaps/$$charset \
806+ $(addprefix --prefix=,$(install_root)) $$locale; \
807+ echo ' done'; \
808+
809+# The mbwc-tests need some environment setup to find the locale data files
810+TEST_MBWC_ENV:= LOCPATH=$(common-objpfx)localedata
811+tst_iswalnum-ENV = $(TEST_MBWC_ENV)
812+tst_iswalpha-ENV = $(TEST_MBWC_ENV)
813+tst_iswcntrl-ENV = $(TEST_MBWC_ENV)
814+tst_iswctype-ENV = $(TEST_MBWC_ENV)
815+tst_iswdigit-ENV = $(TEST_MBWC_ENV)
816+tst_iswgraph-ENV = $(TEST_MBWC_ENV)
817+tst_iswlower-ENV = $(TEST_MBWC_ENV)
818+tst_iswprint-ENV = $(TEST_MBWC_ENV)
819+tst_iswpunct-ENV = $(TEST_MBWC_ENV)
820+tst_iswspace-ENV = $(TEST_MBWC_ENV)
821+tst_iswupper-ENV = $(TEST_MBWC_ENV)
822+tst_iswxdigit-ENV = $(TEST_MBWC_ENV)
823+tst_mblen-ENV = $(TEST_MBWC_ENV)
824+tst_mbrlen-ENV = $(TEST_MBWC_ENV)
825+tst_mbrtowc-ENV = $(TEST_MBWC_ENV)
826+tst_mbsrtowcs-ENV = $(TEST_MBWC_ENV)
827+tst_mbstowcs-ENV = $(TEST_MBWC_ENV)
828+tst_mbtowc-ENV = $(TEST_MBWC_ENV)
829+tst_strcoll-ENV = $(TEST_MBWC_ENV)
830+tst_strfmon-ENV = $(TEST_MBWC_ENV)
831+tst_strxfrm-ENV = $(TEST_MBWC_ENV)
832+tst_swscanf-ENV = $(TEST_MBWC_ENV)
833+tst_towctrans-ENV = $(TEST_MBWC_ENV)
834+tst_towlower-ENV = $(TEST_MBWC_ENV)
835+tst_towupper-ENV = $(TEST_MBWC_ENV)
836+tst_wcrtomb-ENV = $(TEST_MBWC_ENV)
837+tst_wcscat-ENV = $(TEST_MBWC_ENV)
838+tst_wcschr-ENV = $(TEST_MBWC_ENV)
839+tst_wcscmp-ENV = $(TEST_MBWC_ENV)
840+tst_wcscoll-ENV = $(TEST_MBWC_ENV)
841+tst_wcscpy-ENV = $(TEST_MBWC_ENV)
842+tst_wcscspn-ENV = $(TEST_MBWC_ENV)
843+tst_wcslen-ENV = $(TEST_MBWC_ENV)
844+tst_wcsncat-ENV = $(TEST_MBWC_ENV)
845+tst_wcsncmp-ENV = $(TEST_MBWC_ENV)
846+tst_wcsncpy-ENV = $(TEST_MBWC_ENV)
847+tst_wcspbrk-ENV = $(TEST_MBWC_ENV)
848+tst_wcsrtombs-ENV = $(TEST_MBWC_ENV)
849+tst_wcsspn-ENV = $(TEST_MBWC_ENV)
850+tst_wcsstr-ENV = $(TEST_MBWC_ENV)
851+tst_wcstod-ENV = $(TEST_MBWC_ENV)
852+tst_wcstok-ENV = $(TEST_MBWC_ENV)
853+tst_wcstombs-ENV = $(TEST_MBWC_ENV)
854+tst_wcswidth-ENV = $(TEST_MBWC_ENV)
855+tst_wcsxfrm-ENV = $(TEST_MBWC_ENV)
856+tst_wctob-ENV = $(TEST_MBWC_ENV)
857+tst_wctomb-ENV = $(TEST_MBWC_ENV)
858+tst_wctrans-ENV = $(TEST_MBWC_ENV)
859+tst_wctype-ENV = $(TEST_MBWC_ENV)
860+tst_wcwidth-ENV = $(TEST_MBWC_ENV)
861+tst-digits-ENV = $(TEST_MBWC_ENV)
862+tst-mbswcs6-ENV = $(TEST_MBWC_ENV)
863+tst-xlocale1-ENV = $(TEST_MBWC_ENV)
864+tst-xlocale2-ENV = $(TEST_MBWC_ENV)
865+tst-strfmon1-ENV = $(TEST_MBWC_ENV)
866+tst-strptime-ENV = $(TEST_MBWC_ENV)
867+
868+tst-setlocale-ENV = LOCPATH=$(common-objpfx)localedata LC_ALL=ja_JP.EUC-JP
869+
870+bug-iconv-trans-ENV = LOCPATH=$(common-objpfx)localedata
871+
872+tst-sscanf-ENV = LOCPATH=$(common-objpfx)localedata
873+
874+tst-leaks-ENV = MALLOC_TRACE=$(objpfx)tst-leaks.mtrace \
875+ LOCPATH=$(common-objpfx)localedata
876+$(objpfx)mtrace-tst-leaks: $(objpfx)tst-leaks.out
877+ $(common-objpfx)malloc/mtrace $(objpfx)tst-leaks.mtrace > $@
878diff -Naur glibc-2.9.orig/Makeconfig glibc-2.9/Makeconfig
879--- glibc-2.9.orig/Makeconfig 2008-08-18 05:42:17.000000000 -0400
880+++ glibc-2.9/Makeconfig 2009-03-15 19:22:15.939718625 -0400
881@@ -446,6 +446,13 @@
882 $(common-objpfx)libc% $(+postinit),$^) \
883 $(link-extra-libs-static) $(link-libc-static) $(+postctor) $(+postinit)
884 endif
885+# Command for linking programs against the host system.
886+ifndef +link-native
887++link-native = $(BUILD_CC) -static -g -o $@ $^ \
888+ $(LDFLAGS) $(LDFLAGS-$(@F)) \
889+ $(combreloc-LDFLAGS) $(relro-LDFLAGS) \
890+ $(link-extra-libs)
891+endif
892 # Command for statically linking bounded-pointer programs with the C library.
893 ifndef +link-bounded
894 +link-bounded = $(CC) -nostdlib -nostartfiles -static -fbounded-pointers -o $@ \
895@@ -659,6 +666,8 @@
896 $(+sysdep-includes) $(includes) \
897 $(patsubst %/,-I%,$(..)) $(libio-include) -I. $(sysincludes)
898
899++includes-native = -I$(..)include-native -I$(objpfx) -I.
900+
901 # Since libio has several internal header files, we use a -I instead
902 # of many little headers in the include directory.
903 libio-include = -I$(..)libio
904@@ -673,10 +682,15 @@
905 $(foreach lib,$(libof-$(basename $(@F))) \
906 $(libof-$(<F)) $(libof-$(@F)),$(CPPFLAGS-$(lib))) \
907 $(CPPFLAGS-$(<F)) $(CPPFLAGS-$(@F)) $(CPPFLAGS-$(basename $(@F)))
908+CPPFLAGS-native = -D_GNU_SOURCE $($(subdir)-CPPFLAGS) $(+includes-native) $(defines) \
909+ $(CPPFLAGS-$(suffix $@)) -include $(..)include/libc-symbols.h \
910+ $(CPPFLAGS-$(<F)) $(CPPFLAGS-$(@F)) $(CPPFLAGS-$(basename $(@F)))
911 override CFLAGS = -std=gnu99 $(gnu89-inline-CFLAGS) \
912 $(filter-out %frame-pointer,$(+cflags)) $(+gccwarn-c) \
913 $(sysdep-CFLAGS) $(CFLAGS-$(suffix $@)) $(CFLAGS-$(<F)) \
914 $(CFLAGS-$(@F))
915+override CFLAGS-native = -std=gnu99 $(gnu89-inline-CFLAGS) $(default_cflags) $(+gccwarn-c) \
916+ $(CFLAGS-$(suffix $@)) $(CFLAGS-$(<F)) $(CFLAGS-$(@F))
917 override CXXFLAGS = $(c++-sysincludes) \
918 $(filter-out %frame-pointer,$(+cflags)) $(sysdep-CFLAGS) \
919 $(CFLAGS-$(suffix $@)) $(CFLAGS-$(<F)) $(CFLAGS-$(@F))
920diff -Naur glibc-2.9.orig/Makerules glibc-2.9/Makerules
921--- glibc-2.9.orig/Makerules 2008-02-06 19:39:18.000000000 -0500
922+++ glibc-2.9/Makerules 2009-03-15 19:22:15.975455420 -0400
923@@ -278,6 +278,9 @@
924 object-suffixes-left := $(all-object-suffixes)
925 include $(o-iterator)
926
927+$(objpfx)%-native.o: %.c $(before-compile)
928+ $(native-compile-command.c)
929+
930 # Omit the objpfx rules when building in the source tree, because
931 # objpfx is empty and so these rules just override the ones above.
932 ifdef objpfx
933@@ -354,6 +357,8 @@
934 compile-command.s = $(COMPILE.s) $< $(OUTPUT_OPTION) $(compile-mkdep-flags)
935 compile-command.c = $(compile.c) $(OUTPUT_OPTION) $(compile-mkdep-flags)
936 compile-command.cc = $(compile.cc) $(OUTPUT_OPTION) $(compile-mkdep-flags)
937+# Native commands
938+native-compile-command.c = $(native-compile.c) $(OUTPUT_OPTION) $(compile-mkdep-flags)
939
940 # GCC can grok options after the file name, and it looks nicer that way.
941 compile.c = $(CC) $< -c $(CFLAGS) $(CPPFLAGS)
942@@ -363,6 +368,8 @@
943 COMPILE.S = $(CC) -c $(CPPFLAGS) $(S-CPPFLAGS) \
944 $(ASFLAGS) $(ASFLAGS-$(suffix $@))
945 COMPILE.s = $(filter-out -pipe,$(CC)) -c $(ASFLAGS)
946+# Native commands
947+native-compile.c = $(BUILD_CC) -g $< -c $(CFLAGS-native) $(CPPFLAGS-native)
948
949 # We need this for the output to go in the right place. It will default to
950 # empty if make was configured to work with a cc that can't grok -c and -o
951@@ -1156,7 +1163,7 @@
952 $(make-target-directory)
953 $(patsubst %/,cd % &&,$(objpfx)) \
954 $(BUILD_CC) $($(basename $(<F))-CFLAGS) $(ALL_BUILD_CFLAGS) \
955- $(firstword $(filter /%,$< $(shell pwd)/$<)) -o $(@F)
956+ $(addprefix $(shell pwd)/, $^) -o $(@F)
957 endef
958
959 # Command to compile $< in $(common-objdir) using the native libraries.
960diff -Naur glibc-2.9.orig/malloc/Makefile glibc-2.9/malloc/Makefile
961--- glibc-2.9.orig/malloc/Makefile 2007-12-16 17:57:50.000000000 -0500
962+++ glibc-2.9/malloc/Makefile 2009-03-15 19:22:15.975455420 -0400
963@@ -73,10 +73,6 @@
964 endif
965 endif
966
967-# Unless we get a test for the availability of libgd which also works
968-# for cross-compiling we disable the memusagestat generation in this
969-# situation.
970-ifneq ($(cross-compiling),yes)
971 # If the gd library is available we build the `memusagestat' program.
972 ifneq ($(LIBGD),no)
973 others: $(objpfx)memusage
974@@ -91,7 +87,6 @@
975 # is to presume that the standard system headers will be ok for this file.
976 $(objpfx)memusagestat.o: sysincludes = # nothing
977 endif
978-endif
979
980 # Another goal which can be used to override the configure decision.
981 .PHONY: do-memusagestat
982diff -Naur glibc-2.9.orig/Rules glibc-2.9/Rules
983--- glibc-2.9.orig/Rules 2006-02-28 02:05:48.000000000 -0500
984+++ glibc-2.9/Rules 2009-03-15 19:22:15.975455420 -0400
985@@ -87,7 +87,7 @@
986
987 .PHONY: others tests
988 ifeq ($(build-programs),yes)
989-others: $(addprefix $(objpfx),$(others) $(sysdep-others) $(extra-objs))
990+others: $(addprefix $(objpfx),$(others) $(others-native) $(sysdep-others) $(extra-objs))
991 else
992 others: $(addprefix $(objpfx),$(extra-objs))
993 endif
994@@ -106,9 +106,11 @@
995 ifeq ($(build-programs),yes)
996 binaries-all = $(others) $(sysdep-others) $(tests) $(xtests) $(test-srcs)
997 binaries-static = $(others-static) $(tests-static) $(xtests-static)
998+binaries-native = $(others-native)
999 else
1000 binaries-all = $(tests) $(xtests) $(test-srcs)
1001 binaries-static =
1002+binaries-native =
1003 endif
1004
1005 binaries-shared = $(filter-out $(binaries-static), $(binaries-all))
1006@@ -127,6 +129,11 @@
1007 $(+link-static)
1008 endif
1009
1010+ifneq "$(strip $(binaries-native))" ""
1011+$(addprefix $(objpfx),$(binaries-native)): %: %.o
1012+ $(+link-native)
1013+endif
1014+
1015 ifeq ($(build-bounded),yes)
1016 binaries-bounded = $(addsuffix -bp,$(tests) $(xtests) $(test-srcs))
1017 $(addprefix $(objpfx),$(binaries-bounded)): %-bp: %.ob \
1018diff -Naur glibc-2.9.orig/sunrpc/Makefile glibc-2.9/sunrpc/Makefile
1019--- glibc-2.9.orig/sunrpc/Makefile 2006-10-18 15:25:38.000000000 -0400
1020+++ glibc-2.9/sunrpc/Makefile 2009-03-15 19:22:15.975455420 -0400
1021@@ -70,6 +70,9 @@
1022 clnt_unix svc_unix create_xid xdr_intXX_t
1023
1024 others := rpcinfo
1025+ifneq ($(cross-compiling),no)
1026+others-native := rpcgen-native
1027+endif
1028 install-bin := rpcgen
1029 install-sbin := rpcinfo
1030 rpcgen-objs = rpc_main.o rpc_hout.o rpc_cout.o rpc_parse.o \
1031@@ -98,15 +101,12 @@
1032 $(resolvobjdir)/libresolv.a
1033 endif
1034
1035-ifeq (no,$(cross-compiling))
1036-# We can only build this library if we can run the rpcgen we build.
1037 headers += $(rpcsvc:%.x=rpcsvc/%.h)
1038 extra-libs := librpcsvc
1039 extra-libs-others := librpcsvc # Make it in `others' pass, not `lib' pass.
1040 librpcsvc-routines = $(rpcsvc:%.x=x%)
1041 librpcsvc-inhibit-o = .os # Build no shared rpcsvc library.
1042 omit-deps = $(librpcsvc-routines)
1043-endif
1044
1045 CFLAGS-xbootparam_prot.c = -Wno-unused $(PIC-ccflag)
1046 CFLAGS-xnlm_prot.c = -Wno-unused $(PIC-ccflag)
1047@@ -136,13 +136,26 @@
1048 $(addprefix $(csu-objpfx),start.o) $(+preinit) $(+postinit)
1049 $(+link)
1050
1051+ifneq ($(cross-compiling),no)
1052+rpcgen.c:
1053+ touch rpcgen.c
1054+
1055+$(objpfx)rpcgen-native: $(addprefix $(objpfx),$(rpcgen-objs:%.o=%-native.o))
1056+endif
1057+
1058 # This makes sure -DNOT_IN_libc is passed for all these modules.
1059 cpp-srcs-left := $(rpcgen-objs:.o=.c)
1060 lib := nonlib
1061 include $(patsubst %,$(..)cppflags-iterator.mk,$(cpp-srcs-left))
1062
1063 # Tell rpcgen where to find the C preprocessor.
1064+ifeq ($(cross-compiling),no)
1065 rpcgen-cmd = CPP='$(CC) -E -x c-header' $(built-program-cmd) -Y ../scripts
1066+rpcgen = $(objpfx)rpcgen
1067+else
1068+rpcgen-cmd = CPP='$(CC) -E -x c-header' $(objpfx)rpcgen-native -Y ../scripts
1069+rpcgen = $(objpfx)rpcgen-native
1070+endif
1071
1072 # Install the rpc data base file.
1073 $(inst_sysconfdir)/rpc: etc.rpc $(+force)
1074@@ -153,7 +166,7 @@
1075 # relinked.
1076 $(rpcsvc:%.x=$(objpfx)rpcsvc/%.h): $(objpfx)rpcsvc/%.h: $(objpfx)rpcsvc/%.stmp
1077 @:
1078-$(objpfx)rpcsvc/%.stmp: rpcsvc/%.x $(objpfx)rpcgen
1079+$(objpfx)rpcsvc/%.stmp: rpcsvc/%.x $(rpcgen)
1080 $(make-target-directory)
1081 -@rm -f ${@:stmp=T} $@
1082 $(rpcgen-cmd) -h $< -o ${@:stmp=T}
1083@@ -163,7 +176,7 @@
1084 # Generate the rpcsvc XDR functions with rpcgen.
1085 $(rpcsvc:%.x=$(objpfx)x%.c): $(objpfx)x%.c: $(objpfx)x%.stmp
1086 @:
1087-$(objpfx)x%.stmp: rpcsvc/%.x $(objpfx)rpcgen
1088+$(objpfx)x%.stmp: rpcsvc/%.x $(rpcgen)
1089 -@rm -f ${@:stmp=T} $@
1090 $(rpcgen-cmd) -c $< -o ${@:stmp=T}
1091 $(move-if-change) $(@:stmp=T) $(@:stmp=c)
1092diff -Naur glibc-2.9.orig/timezone/Makefile glibc-2.9/timezone/Makefile
1093--- glibc-2.9.orig/timezone/Makefile 2007-07-28 16:33:11.000000000 -0400
1094+++ glibc-2.9/timezone/Makefile 2009-03-15 19:22:16.056496560 -0400
1095@@ -28,6 +28,9 @@
1096 extra-objs := scheck.o ialloc.o
1097
1098 others := zdump zic
1099+ifneq ($(cross-compiling),no)
1100+others-native := zic-native
1101+endif
1102 tests := test-tz tst-timezone
1103
1104 tzbases := africa antarctica asia australasia europe northamerica \
1105@@ -69,13 +72,10 @@
1106 $(addprefix $(inst_zonedir)/, \
1107 $(posixrules-file)))
1108
1109-ifeq ($(cross-compiling),no)
1110-# Don't try to install the zoneinfo files since we can't run zic.
1111 install-others = $(addprefix $(inst_zonedir)/,$(zonenames) \
1112 $(zonenames:%=posix/%) \
1113 $(zonenames:%=right/%)) \
1114 $(installed-localtime-file) $(installed-posixrules-file)
1115-endif
1116
1117 ifeq ($(have-ksh),yes)
1118 install-others += $(inst_zonedir)/iso3166.tab $(inst_zonedir)/zone.tab
1119@@ -128,7 +128,11 @@
1120 # We have to use `-d $(inst_zonedir)' to explictly tell zic where to
1121 # place the output files although $(zonedir) is compiled in. But the
1122 # user might have set $(install_root) on the command line of `make install'.
1123+ifeq ($(cross-compiling),no)
1124 zic-cmd = $(built-program-cmd) -d $(inst_zonedir)
1125+else
1126+zic-cmd = $(common-objpfx)/timezone/zic-native -d $(inst_zonedir)
1127+endif
1128 tzcompile = $(zic-cmd)$(target-zone-flavor) -L $(word 3,$^) \
1129 -y $(dir $(word 4,$^))$(notdir $(word 4,$^)) $<
1130
1131@@ -158,8 +162,10 @@
1132 $(zic-cmd) -p $(posixrules)
1133 endif
1134
1135-
1136 $(objpfx)zic: $(objpfx)scheck.o $(objpfx)ialloc.o
1137+ifneq ($(cross-compiling),no)
1138+$(objpfx)zic-native: $(objpfx)scheck-native.o $(objpfx)ialloc-native.o
1139+endif
1140
1141 tz-cflags = -DTZDIR='"$(zonedir)"' \
1142 -DTZDEFAULT='"$(localtime-file)"' \
Note: See TracBrowser for help on using the repository browser.