CRUX-ARM : Home

Home :: Documentation :: Download :: Development :: Community :: Ports :: Packages :: Bugs :: Links :: About :: Donors
glibc: Updated glibc-2.10.1-cross_hacks-2.patch.
[crossrootfs.git] / glibc / glibc-2.10.1-cross_hacks-2.patch
CommitLineData
6dca1d21
JB
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
624a0b95 7 Rediffed against 2.10.1 by crux-arm@mikeux.dyndns.org 2009-12-16
6dca1d21
JB
8Origin: Joe Ciccone
9Upstream Status: Unknown
10Description: Adds native compile support to the build system then uses that
11 support to build zic-native, for installing timezone info,
12 rpcgen-native, for building librpcsvc.a, and localedef-native,
13 for creating the locale-archive.
14
624a0b95
VM
15diff -Naur glibc-2.10.1.orig/iconv/Makefile glibc-2.10.1/iconv/Makefile
16--- glibc-2.10.1.orig/iconv/Makefile 2007-07-24 23:41:17.000000000 -0400
17+++ glibc-2.10.1/iconv/Makefile 2009-03-15 19:22:15.732837951 -0400
6dca1d21
JB
18@@ -57,6 +57,9 @@
19 iconvconfig.h
20
21 others = iconv_prog iconvconfig
22+ifneq ($(cross-compiling),no)
23+ others-native = iconvconfig-native
24+endif
25 install-others-programs = $(inst_bindir)/iconv
26 install-sbin = iconvconfig
27
28@@ -79,6 +82,7 @@
29
30 $(objpfx)iconv_prog: $(iconv_prog-modules:%=$(objpfx)%.o)
31 $(objpfx)iconvconfig: $(iconvconfig-modules:%=$(objpfx)%.o)
32+$(objpfx)iconvconfig-native: $(iconvconfig-modules:%=$(objpfx)%-native.o)
33
34 ifneq ($(cross-compiling),yes)
35 xtests: test-iconvconfig
624a0b95
VM
36diff -Naur glibc-2.10.1.orig/iconvdata/Makefile glibc-2.10.1/iconvdata/Makefile
37--- glibc-2.10.1.orig/iconvdata/Makefile 2008-05-14 21:54:31.000000000 -0400
38+++ glibc-2.10.1/iconvdata/Makefile 2009-03-15 19:22:15.753163155 -0400
6dca1d21
JB
39@@ -320,23 +320,25 @@
40
41 headers: $(addprefix $(objpfx), $(generated-modules:=.h))
42
43+ifeq ($(cross-compiling),no)
44+iconvconfig-cmd = LC_ALL=C LANGUAGE=C \
45+ $(common-objpfx)elf/ld.so --library-path $(rpath-link) \
46+ $(common-objpfx)iconv/iconvconfig
47+else
48+iconvconfig-cmd = LC_ALL=C LANGUAGE=C \
49+ $(common-objpfx)iconv/iconvconfig-native
50+endif
51+
52 $(addprefix $(inst_gconvdir)/, $(modules.so)): \
53 $(inst_gconvdir)/%: $(objpfx)% $(+force)
54 $(do-install-program)
55 $(inst_gconvdir)/gconv-modules: gconv-modules $(+force)
56 $(do-install)
57-ifeq (no,$(cross-compiling))
58 # Update the $(prefix)/lib/gconv/gconv-modules.cache file. This is necessary
59 # if this libc has more gconv modules than the previously installed one.
60 if test -f "$(inst_gconvdir)/gconv-modules.cache"; then \
61- LC_ALL=C LANGUAGE=C \
62- $(common-objpfx)elf/ld.so --library-path $(rpath-link) \
63- $(common-objpfx)iconv/iconvconfig \
64- $(addprefix --prefix=,$(install_root)); \
65+ $(iconvconfig-cmd) $(addprefix --prefix=,$(install_root)); \
66 fi
67-else
68- @echo '*@*@*@ You should recreate $(inst_gconvdir)/gconv-modules.cache'
69-endif
70
71 endif # build-shared = yes
72
624a0b95
VM
73diff -Naur glibc-2.10.1.orig/include-native/bits/libc-tsd.h glibc-2.10.1/include-native/bits/libc-tsd.h
74--- glibc-2.10.1.orig/include-native/bits/libc-tsd.h 1969-12-31 19:00:00.000000000 -0500
75+++ glibc-2.10.1/include-native/bits/libc-tsd.h 2009-03-15 19:22:15.788787576 -0400
6dca1d21
JB
76@@ -0,0 +1,3 @@
77+#ifndef __libc_tsd_define
78+#define __libc_tsd_define(A,B,C)
79+#endif
624a0b95
VM
80diff -Naur glibc-2.10.1.orig/include-native/config.h glibc-2.10.1/include-native/config.h
81--- glibc-2.10.1.orig/include-native/config.h 1969-12-31 19:00:00.000000000 -0500
82+++ glibc-2.10.1/include-native/config.h 2009-03-15 19:22:15.809829790 -0400
6dca1d21
JB
83@@ -0,0 +1 @@
84+/* Empty */
624a0b95
VM
85diff -Naur glibc-2.10.1.orig/include-native/gnu/stubs.h glibc-2.10.1/include-native/gnu/stubs.h
86--- glibc-2.10.1.orig/include-native/gnu/stubs.h 1969-12-31 19:00:00.000000000 -0500
87+++ glibc-2.10.1/include-native/gnu/stubs.h 2009-03-15 19:22:15.809829790 -0400
6dca1d21
JB
88@@ -0,0 +1 @@
89+/* Empty */
624a0b95
VM
90diff -Naur glibc-2.10.1.orig/include-native/intl/loadinfo.h glibc-2.10.1/include-native/intl/loadinfo.h
91--- glibc-2.10.1.orig/include-native/intl/loadinfo.h 1969-12-31 19:00:00.000000000 -0500
92+++ glibc-2.10.1/include-native/intl/loadinfo.h 2009-03-15 19:22:15.809829790 -0400
6dca1d21
JB
93@@ -0,0 +1,4 @@
94+#ifndef LOADINFO_H
95+#define LOADINFO_H
96+struct loaded_l10nfile;
97+#endif
624a0b95
VM
98diff -Naur glibc-2.10.1.orig/include-native/libintl.h glibc-2.10.1/include-native/libintl.h
99--- glibc-2.10.1.orig/include-native/libintl.h 1969-12-31 19:00:00.000000000 -0500
100+++ glibc-2.10.1/include-native/libintl.h 2009-03-15 19:22:15.838789367 -0400
6dca1d21
JB
101@@ -0,0 +1,13 @@
102+#include_next <libintl.h>
103+
104+#ifndef _
105+#define _(X) (X)
106+#endif
107+
108+#ifndef N_
109+#define N_(X) (X)
110+#endif
111+
112+#ifndef _libc_intl_domainname
113+#define _libc_intl_domainname "libc"
114+#endif
624a0b95
VM
115diff -Naur glibc-2.10.1.orig/include-native/symbol-hacks.h glibc-2.10.1/include-native/symbol-hacks.h
116--- glibc-2.10.1.orig/include-native/symbol-hacks.h 1969-12-31 19:00:00.000000000 -0500
117+++ glibc-2.10.1/include-native/symbol-hacks.h 2009-03-15 19:22:15.838789367 -0400
6dca1d21
JB
118@@ -0,0 +1 @@
119+/* Empty */
624a0b95
VM
120diff -Naur glibc-2.10.1.orig/include-native/tls.h glibc-2.10.1/include-native/tls.h
121--- glibc-2.10.1.orig/include-native/tls.h 1969-12-31 19:00:00.000000000 -0500
122+++ glibc-2.10.1/include-native/tls.h 2009-03-15 19:22:15.838789367 -0400
6dca1d21
JB
123@@ -0,0 +1,11 @@
124+#ifndef _include_tls_h
125+#define _include_tls_h 1
126+
127+#if USE_TLS && HAVE___THREAD \
128+ && (!defined NOT_IN_libc || defined IS_IN_libpthread)
129+# define USE___THREAD 1
130+#else
131+# define USE___THREAD 0
132+#endif
133+
134+#endif
624a0b95
VM
135diff -Naur glibc-2.10.1.orig/locale/Makefile glibc-2.10.1/locale/Makefile
136--- glibc-2.10.1.orig/locale/Makefile 2005-12-20 01:58:41.000000000 -0500
137+++ glibc-2.10.1/locale/Makefile 2009-03-15 19:22:15.838789367 -0400
6dca1d21
JB
138@@ -44,6 +44,9 @@
139 aux = $(categories:%=lc-%) $(categories:%=C-%) SYS_libc C_name \
140 xlocale localename global-locale coll-lookup
141 others = localedef locale
142+ifneq ($(cross-compiling),no)
143+others-native = localedef-native
144+endif
145 #others-static = localedef locale
146 install-bin = localedef locale
147 extra-objs = $(localedef-modules:=.o) $(localedef-aux:=.o) \
148@@ -81,6 +84,12 @@
149 $(objpfx)locale: $(locale-modules:%=$(objpfx)%.o)
150 $(objpfx)localedef $(objpfx)locale: $(lib-modules:%=$(objpfx)%.o)
151
152+ifneq ($(cross-compiling),no)
153+$(objpfx)localedef-native: $(localedef-modules:%=$(objpfx)%-native.o)
154+$(objpfx)localedef-native: $(localedef-aux:%=$(objpfx)%-native.o)
155+$(objpfx)localedef-native: $(lib-modules:%=$(objpfx)%-native.o)
156+endif
157+
158 C-translit.h: C-translit.h.in gen-translit.pl
159 $(PERL) gen-translit.pl < $< > $@.tmp
160 mv -f $@.tmp $@
624a0b95
VM
161diff -Naur glibc-2.10.1.orig/localedata/Makefile glibc-2.10.1/localedata/Makefile
162--- glibc-2.10.1.orig/localedata/Makefile 2008-11-27 19:05:08.000000000 -0500
163+++ glibc-2.10.1/localedata/Makefile 2009-03-15 19:22:15.939718625 -0400
6dca1d21
JB
164@@ -208,8 +208,13 @@
165 INSTALL-SUPPORTED-LOCALES=$(addprefix install-, $(SUPPORTED-LOCALES))
166
167 # Sometimes the whole collection of locale files should be installed.
168+ifeq ($(cross-compiling),no)
169 LOCALEDEF=I18NPATH=. GCONV_PATH=$(common-objpfx)iconvdata LC_ALL=C \
170 $(common-objpfx)elf/ld.so --library-path $(rpath-link) $(common-objpfx)locale/localedef
171+else
172+LOCALEDEF=I18NPATH=. GCONV_PATH=$(common-objpfx)iconvdata LC_ALL=C \
173+$(common-objpfx)locale/localedef-native
174+endif
175 install-locales: $(INSTALL-SUPPORTED-LOCALES)
176
177 install-locales-dir:
624a0b95
VM
178diff -Naur glibc-2.10.1.orig/localedata/Makefile.orig glibc-2.10.1/localedata/Makefile.orig
179--- glibc-2.10.1.orig/localedata/Makefile.orig 1969-12-31 19:00:00.000000000 -0500
180+++ glibc-2.10.1/localedata/Makefile.orig 2008-11-27 19:05:08.000000000 -0500
6dca1d21
JB
181@@ -0,0 +1,300 @@
182+# Copyright (C) 1996-2003, 2005, 2007, 2008 Free Software Foundation, Inc.
183+# This file is part of the GNU C Library.
184+
185+# The GNU C Library is free software; you can redistribute it and/or
186+# modify it under the terms of the GNU Lesser General Public
187+# License as published by the Free Software Foundation; either
188+# version 2.1 of the License, or (at your option) any later version.
189+
190+# The GNU C Library is distributed in the hope that it will be useful,
191+# but WITHOUT ANY WARRANTY; without even the implied warranty of
192+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
193+# Lesser General Public License for more details.
194+
195+# You should have received a copy of the GNU Lesser General Public
196+# License along with the GNU C Library; if not, write to the Free
197+# Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
198+# 02111-1307 USA.
199+
200+# Makefile for installing locale data source files.
201+
202+subdir := localedata
203+
204+all: # Make this the default target; it will be defined in Rules.
205+
206+# List with all available character set descriptions.
207+charmaps := $(filter-out $(addprefix charmaps/, CVS RCS SCCS %~), \
208+ $(wildcard charmaps/[A-I]*) \
209+ $(wildcard charmaps/[J-Z]*))
210+
211+# List with all available character set descriptions.
212+locales := $(filter-out $(addprefix locales/, CVS RCS SCCS %~), \
213+ $(wildcard locales/*))
214+
215+
216+subdir-dirs = tests-mbwc
217+vpath %.c tests-mbwc
218+vpath %.h tests-mbwc
219+
220+
221+test-srcs := collate-test xfrm-test tst-fmon tst-rpmatch tst-trans \
222+ tst-mbswcs1 tst-mbswcs2 tst-mbswcs3 tst-mbswcs4 tst-mbswcs5 \
223+ tst-ctype tst-wctype tst-langinfo tst-numeric
224+test-input := de_DE.ISO-8859-1 en_US.ISO-8859-1 da_DK.ISO-8859-1 \
225+ hr_HR.ISO-8859-2 sv_SE.ISO-8859-1 tr_TR.UTF-8 fr_FR.UTF-8 \
226+ si_LK.UTF-8
227+test-input-data = $(addsuffix .in, $(basename $(test-input)))
228+test-output := $(foreach s, .out .xout, \
229+ $(addsuffix $s, $(basename $(test-input))))
230+ld-test-names := test1 test2 test3 test4 test5 test6 test7
231+ld-test-srcs := $(addprefix tests/,$(addsuffix .cm,$(ld-test-names)) \
232+ $(addsuffix .def,$(ld-test-names)) \
233+ $(addsuffix .ds,test5 test6) \
234+ test6.c trans.def)
235+
236+fmon-tests = n01y12 n02n40 n10y31 n11y41 n12y11 n20n32 n30y20 n41n00 \
237+ y01y10 y02n22 y22n42 y30y21 y32n31 y40y00 y42n21
238+
239+generated := $(test-input) $(test-output) sort-test.out tst-locale.out \
240+ tst-mbswcs.out tst-leaks.mtrace mtrace-tst-leaks
241+generated-dirs := $(ld-test-names) tt_TT de_DE.437 \
242+ $(addprefix tstfmon_,$(fmon-tests)) \
243+
244+distribute := CHECKSUMS README SUPPORTED ChangeLog \
245+ $(charmaps) $(locales) \
246+ tst-rpmatch.sh tst-locale.sh tst-fmon.sh sort-test.sh \
247+ tst-fmon.data $(test-input-data) $(ld-test-srcs) \
248+ th_TH.in cs_CZ.in tst-mbswcs.sh tst-trans.sh tst-ctype.sh \
249+ tst-ctype-de_DE.ISO-8859-1.in \
250+ tst-numeric.sh tst-numeric.data \
251+ $(wildcard tests-mbwc/*.[ch]) \
252+ $(addprefix tst-fmon-locales/tstfmon_,$(fmon-tests)) \
253+ gen-locale.sh show-ucs-data.c tst-langinfo.sh \
254+ tst-wctype.sh tst-wctype.input gen-unicode-ctype.c \
255+ dump-ctype.c
256+
257+# Get $(inst_i18ndir) defined.
258+include ../Makeconfig
259+
260+ifeq (no,$(cross-compiling))
261+locale_test_suite := tst_iswalnum tst_iswalpha tst_iswcntrl \
262+ tst_iswctype tst_iswdigit tst_iswgraph \
263+ tst_iswlower tst_iswprint tst_iswpunct \
264+ tst_iswspace tst_iswupper tst_iswxdigit tst_mblen \
265+ tst_mbrlen tst_mbrtowc tst_mbsrtowcs tst_mbstowcs \
266+ tst_mbtowc tst_strcoll tst_strfmon tst_strxfrm \
267+ tst_swscanf tst_towctrans tst_towlower \
268+ tst_towupper tst_wcrtomb tst_wcscat tst_wcschr \
269+ tst_wcscmp tst_wcscoll tst_wcscpy tst_wcscspn \
270+ tst_wcslen tst_wcsncat tst_wcsncmp tst_wcsncpy \
271+ tst_wcspbrk tst_wcsrtombs tst_wcsspn tst_wcsstr \
272+ tst_wcstod tst_wcstok tst_wcstombs tst_wcswidth \
273+ tst_wcsxfrm tst_wctob tst_wctomb tst_wctrans \
274+ tst_wctype tst_wcwidth
275+
276+tests = $(locale_test_suite) tst-digits tst-setlocale bug-iconv-trans \
277+ tst-leaks tst-mbswcs6 tst-xlocale1 tst-xlocale2 bug-usesetlocale \
278+ tst-strfmon1 tst-sscanf tst-strptime
279+ifeq (yes,$(build-shared))
280+ifneq (no,$(PERL))
281+tests: $(objpfx)mtrace-tst-leaks
282+endif
283+endif
284+endif
285+
286+# Files to install.
287+install-others := $(addprefix $(inst_i18ndir)/, \
288+ $(addsuffix .gz, $(charmaps)) \
289+ $(locales))
290+
291+include ../Rules
292+
293+# Install the charmap files in gzipped format.
294+$(inst_i18ndir)/charmaps/%.gz: charmaps/% $(+force)
295+ $(make-target-directory)
296+ rm -f $(@:.gz=) $@
297+ $(INSTALL_DATA) $< $(@:.gz=)
298+ gzip -9 $(@:.gz=)
299+
300+# Install the locale source files in the appropriate directory.
301+$(inst_i18ndir)/locales/%: locales/% $(+force); $(do-install)
302+
303+# gcc does not know all the format specifiers we are using here.
304+CFLAGS-tst-mbswcs1.c = -Wno-format
305+CFLAGS-tst-mbswcs2.c = -Wno-format
306+CFLAGS-tst-mbswcs3.c = -Wno-format
307+CFLAGS-tst-mbswcs4.c = -Wno-format
308+CFLAGS-tst-mbswcs5.c = -Wno-format
309+CFLAGS-tst-trans.c = -Wno-format
310+
311+
312+ifeq (no,$(cross-compiling))
313+# We have to generate locales
314+LOCALES := de_DE.ISO-8859-1 de_DE.UTF-8 en_US.ANSI_X3.4-1968 \
315+ en_US.ISO-8859-1 ja_JP.EUC-JP da_DK.ISO-8859-1 \
316+ hr_HR.ISO-8859-2 sv_SE.ISO-8859-1 ja_JP.SJIS fr_FR.ISO-8859-1 \
317+ vi_VN.TCVN5712-1 nb_NO.ISO-8859-1 nn_NO.ISO-8859-1 \
318+ tr_TR.UTF-8 cs_CZ.UTF-8 zh_TW.EUC-TW fa_IR.UTF-8 fr_FR.UTF-8 \
319+ ja_JP.UTF-8 si_LK.UTF-8
320+LOCALE_SRCS := $(shell echo "$(LOCALES)"|sed 's/\([^ .]*\)[^ ]*/\1/g')
321+CHARMAPS := $(shell echo "$(LOCALES)" | \
322+ sed -e 's/[^ .]*[.]\([^ ]*\)/\1/g' -e s/SJIS/SHIFT_JIS/g)
323+CTYPE_FILES = $(addsuffix /LC_CTYPE,$(LOCALES))
324+
325+generated-dirs += $(LOCALES)
326+
327+# Dependency for the locale files. We actually make it depend only on
328+# one of the files.
329+$(addprefix $(objpfx),$(CTYPE_FILES)): %: \
330+ gen-locale.sh $(common-objpfx)locale/localedef Makefile \
331+ $(addprefix charmaps/,$(CHARMAPS)) $(addprefix locales/,$(LOCALE_SRCS))
332+ @$(SHELL) -e gen-locale.sh $(common-objpfx) '$(built-program-cmd)' $@
333+
334+$(addsuffix .out,$(addprefix $(objpfx),$(tests))): %: \
335+ $(addprefix $(objpfx),$(CTYPE_FILES))
336+
337+tests: $(objpfx)sort-test.out $(objpfx)tst-fmon.out $(objpfx)tst-locale.out \
338+ $(objpfx)tst-rpmatch.out $(objpfx)tst-trans.out \
339+ $(objpfx)tst-mbswcs.out $(objpfx)tst-ctype.out $(objpfx)tst-wctype.out \
340+ $(objpfx)tst-langinfo.out $(objpfx)tst-numeric.out
341+
342+$(objpfx)sort-test.out: sort-test.sh $(objpfx)collate-test $(objpfx)xfrm-test \
343+ $(test-input-data) $(addprefix $(objpfx),$(CTYPE_FILES))
344+ $(SHELL) -e $< $(common-objpfx) '$(run-program-prefix)' $(test-input) \
345+ > $@
346+$(objpfx)tst-fmon.out: tst-fmon.sh $(objpfx)tst-fmon tst-fmon.data \
347+ $(objpfx)sort-test.out \
348+ $(addprefix $(objpfx),$(CTYPE_FILES))
349+ $(SHELL) -e $< $(common-objpfx) '$(run-program-prefix)' tst-fmon.data \
350+ > $@
351+$(objpfx)tst-numeric.out: tst-numeric.sh $(objpfx)tst-numeric tst-numeric.data \
352+ $(objpfx)sort-test.out \
353+ $(addprefix $(objpfx),$(CTYPE_FILES))
354+ $(SHELL) -e $< $(common-objpfx) '$(run-program-prefix)' tst-numeric.data \
355+ > $@
356+$(objpfx)tst-locale.out: tst-locale.sh $(common-objpfx)locale/localedef \
357+ $(ld-test-srcs) $(addprefix $(objpfx),$(CTYPE_FILES))
358+ $(SHELL) -e $< $(common-objpfx) '$(built-program-cmd)' > $@
359+$(objpfx)tst-rpmatch.out: tst-rpmatch.sh $(objpfx)tst-rpmatch \
360+ $(objpfx)tst-fmon.out \
361+ $(addprefix $(objpfx),$(CTYPE_FILES))
362+ $(SHELL) -e $< $(common-objpfx) '$(built-program-cmd)' > $@
363+$(objpfx)tst-trans.out: tst-trans.sh $(objpfx)tst-trans \
364+ $(addprefix $(objpfx),$(CTYPE_FILES))
365+ $(SHELL) -e $< $(common-objpfx) '$(run-program-prefix)'
366+$(objpfx)tst-mbswcs.out: tst-mbswcs.sh $(objpfx)tst-mbswcs1 \
367+ $(objpfx)tst-mbswcs2 $(objpfx)tst-mbswcs3 \
368+ $(objpfx)tst-mbswcs4 $(objpfx)tst-mbswcs5 \
369+ $(addprefix $(objpfx),$(CTYPE_FILES))
370+ $(SHELL) -e $< $(common-objpfx) '$(run-program-prefix)'
371+$(objpfx)tst-ctype.out: tst-ctype.sh $(objpfx)tst-ctype \
372+ $(objpfx)sort-test.out \
373+ $(addprefix $(objpfx),$(CTYPE_FILES))
374+ $(SHELL) -e $< $(common-objpfx) '$(built-program-cmd)'
375+$(objpfx)tst-wctype.out: tst-wctype.sh $(objpfx)tst-wctype \
376+ $(objpfx)sort-test.out tst-wctype.input \
377+ $(addprefix $(objpfx),$(CTYPE_FILES))
378+ $(SHELL) -e $< $(common-objpfx) '$(built-program-cmd)'
379+$(objpfx)tst-langinfo.out: tst-langinfo.sh $(objpfx)tst-langinfo \
380+ $(objpfx)sort-test.out \
381+ $(addprefix $(objpfx),$(CTYPE_FILES))
382+ $(SHELL) -e $< $(common-objpfx) '$(built-program-cmd)'
383+$(objpfx)tst-digits.out: $(objpfx)tst-locale.out
384+$(objpfx)tst-mbswcs6.out: $(addprefix $(objpfx),$(CTYPE_FILES))
385+endif
386+
387+include SUPPORTED
388+
389+INSTALL-SUPPORTED-LOCALES=$(addprefix install-, $(SUPPORTED-LOCALES))
390+
391+# Sometimes the whole collection of locale files should be installed.
392+LOCALEDEF=I18NPATH=. GCONV_PATH=$(common-objpfx)iconvdata LC_ALL=C \
393+$(common-objpfx)elf/ld.so --library-path $(rpath-link) $(common-objpfx)locale/localedef
394+install-locales: $(INSTALL-SUPPORTED-LOCALES)
395+
396+install-locales-dir:
397+ $(..)./scripts/mkinstalldirs $(inst_localedir)
398+
399+$(INSTALL-SUPPORTED-LOCALES): install-locales-dir
400+ @locale=`echo $@ | sed -e 's/^install-//'`; \
401+ charset=`echo $$locale | sed -e 's,.*/,,'`; \
402+ locale=`echo $$locale | sed -e 's,/[^/]*,,'`; \
403+ echo -n `echo $$locale | sed 's/\([^.\@]*\).*/\1/'`; \
404+ echo -n ".$$charset"; \
405+ echo -n `echo $$locale | sed 's/\([^\@]*\)\(\@.*\)*/\2/'`; \
406+ echo -n '...'; \
407+ input=`echo $$locale | sed 's/\([^.]*\)[^@]*\(.*\)/\1\2/'`; \
408+ $(LOCALEDEF) --alias-file=../intl/locale.alias \
409+ -i locales/$$input -c -f charmaps/$$charset \
410+ $(addprefix --prefix=,$(install_root)) $$locale; \
411+ echo ' done'; \
412+
413+# The mbwc-tests need some environment setup to find the locale data files
414+TEST_MBWC_ENV:= LOCPATH=$(common-objpfx)localedata
415+tst_iswalnum-ENV = $(TEST_MBWC_ENV)
416+tst_iswalpha-ENV = $(TEST_MBWC_ENV)
417+tst_iswcntrl-ENV = $(TEST_MBWC_ENV)
418+tst_iswctype-ENV = $(TEST_MBWC_ENV)
419+tst_iswdigit-ENV = $(TEST_MBWC_ENV)
420+tst_iswgraph-ENV = $(TEST_MBWC_ENV)
421+tst_iswlower-ENV = $(TEST_MBWC_ENV)
422+tst_iswprint-ENV = $(TEST_MBWC_ENV)
423+tst_iswpunct-ENV = $(TEST_MBWC_ENV)
424+tst_iswspace-ENV = $(TEST_MBWC_ENV)
425+tst_iswupper-ENV = $(TEST_MBWC_ENV)
426+tst_iswxdigit-ENV = $(TEST_MBWC_ENV)
427+tst_mblen-ENV = $(TEST_MBWC_ENV)
428+tst_mbrlen-ENV = $(TEST_MBWC_ENV)
429+tst_mbrtowc-ENV = $(TEST_MBWC_ENV)
430+tst_mbsrtowcs-ENV = $(TEST_MBWC_ENV)
431+tst_mbstowcs-ENV = $(TEST_MBWC_ENV)
432+tst_mbtowc-ENV = $(TEST_MBWC_ENV)
433+tst_strcoll-ENV = $(TEST_MBWC_ENV)
434+tst_strfmon-ENV = $(TEST_MBWC_ENV)
435+tst_strxfrm-ENV = $(TEST_MBWC_ENV)
436+tst_swscanf-ENV = $(TEST_MBWC_ENV)
437+tst_towctrans-ENV = $(TEST_MBWC_ENV)
438+tst_towlower-ENV = $(TEST_MBWC_ENV)
439+tst_towupper-ENV = $(TEST_MBWC_ENV)
440+tst_wcrtomb-ENV = $(TEST_MBWC_ENV)
441+tst_wcscat-ENV = $(TEST_MBWC_ENV)
442+tst_wcschr-ENV = $(TEST_MBWC_ENV)
443+tst_wcscmp-ENV = $(TEST_MBWC_ENV)
444+tst_wcscoll-ENV = $(TEST_MBWC_ENV)
445+tst_wcscpy-ENV = $(TEST_MBWC_ENV)
446+tst_wcscspn-ENV = $(TEST_MBWC_ENV)
447+tst_wcslen-ENV = $(TEST_MBWC_ENV)
448+tst_wcsncat-ENV = $(TEST_MBWC_ENV)
449+tst_wcsncmp-ENV = $(TEST_MBWC_ENV)
450+tst_wcsncpy-ENV = $(TEST_MBWC_ENV)
451+tst_wcspbrk-ENV = $(TEST_MBWC_ENV)
452+tst_wcsrtombs-ENV = $(TEST_MBWC_ENV)
453+tst_wcsspn-ENV = $(TEST_MBWC_ENV)
454+tst_wcsstr-ENV = $(TEST_MBWC_ENV)
455+tst_wcstod-ENV = $(TEST_MBWC_ENV)
456+tst_wcstok-ENV = $(TEST_MBWC_ENV)
457+tst_wcstombs-ENV = $(TEST_MBWC_ENV)
458+tst_wcswidth-ENV = $(TEST_MBWC_ENV)
459+tst_wcsxfrm-ENV = $(TEST_MBWC_ENV)
460+tst_wctob-ENV = $(TEST_MBWC_ENV)
461+tst_wctomb-ENV = $(TEST_MBWC_ENV)
462+tst_wctrans-ENV = $(TEST_MBWC_ENV)
463+tst_wctype-ENV = $(TEST_MBWC_ENV)
464+tst_wcwidth-ENV = $(TEST_MBWC_ENV)
465+tst-digits-ENV = $(TEST_MBWC_ENV)
466+tst-mbswcs6-ENV = $(TEST_MBWC_ENV)
467+tst-xlocale1-ENV = $(TEST_MBWC_ENV)
468+tst-xlocale2-ENV = $(TEST_MBWC_ENV)
469+tst-strfmon1-ENV = $(TEST_MBWC_ENV)
470+tst-strptime-ENV = $(TEST_MBWC_ENV)
471+
472+tst-setlocale-ENV = LOCPATH=$(common-objpfx)localedata LC_ALL=ja_JP.EUC-JP
473+
474+bug-iconv-trans-ENV = LOCPATH=$(common-objpfx)localedata
475+
476+tst-sscanf-ENV = LOCPATH=$(common-objpfx)localedata
477+
478+tst-leaks-ENV = MALLOC_TRACE=$(objpfx)tst-leaks.mtrace \
479+ LOCPATH=$(common-objpfx)localedata
480+$(objpfx)mtrace-tst-leaks: $(objpfx)tst-leaks.out
481+ $(common-objpfx)malloc/mtrace $(objpfx)tst-leaks.mtrace > $@
624a0b95
VM
482diff -Naur glibc-2.10.1.orig/Makeconfig glibc-2.10.1/Makeconfig
483--- glibc-2.10.1.orig/Makeconfig 2008-08-18 05:42:17.000000000 -0400
484+++ glibc-2.10.1/Makeconfig 2009-03-15 19:22:15.939718625 -0400
6dca1d21
JB
485@@ -446,6 +446,13 @@
486 $(common-objpfx)libc% $(+postinit),$^) \
487 $(link-extra-libs-static) $(link-libc-static) $(+postctor) $(+postinit)
488 endif
489+# Command for linking programs against the host system.
490+ifndef +link-native
491++link-native = $(BUILD_CC) -static -g -o $@ $^ \
492+ $(LDFLAGS) $(LDFLAGS-$(@F)) \
493+ $(combreloc-LDFLAGS) $(relro-LDFLAGS) \
494+ $(link-extra-libs)
495+endif
496 # Command for statically linking bounded-pointer programs with the C library.
497 ifndef +link-bounded
498 +link-bounded = $(CC) -nostdlib -nostartfiles -static -fbounded-pointers -o $@ \
499@@ -659,6 +666,8 @@
500 $(+sysdep-includes) $(includes) \
501 $(patsubst %/,-I%,$(..)) $(libio-include) -I. $(sysincludes)
502
503++includes-native = -I$(..)include-native -I$(objpfx) -I.
504+
505 # Since libio has several internal header files, we use a -I instead
506 # of many little headers in the include directory.
507 libio-include = -I$(..)libio
508@@ -673,10 +682,15 @@
509 $(foreach lib,$(libof-$(basename $(@F))) \
510 $(libof-$(<F)) $(libof-$(@F)),$(CPPFLAGS-$(lib))) \
511 $(CPPFLAGS-$(<F)) $(CPPFLAGS-$(@F)) $(CPPFLAGS-$(basename $(@F)))
512+CPPFLAGS-native = -D_GNU_SOURCE $($(subdir)-CPPFLAGS) $(+includes-native) $(defines) \
513+ $(CPPFLAGS-$(suffix $@)) -include $(..)include/libc-symbols.h \
514+ $(CPPFLAGS-$(<F)) $(CPPFLAGS-$(@F)) $(CPPFLAGS-$(basename $(@F)))
515 override CFLAGS = -std=gnu99 $(gnu89-inline-CFLAGS) \
516 $(filter-out %frame-pointer,$(+cflags)) $(+gccwarn-c) \
517 $(sysdep-CFLAGS) $(CFLAGS-$(suffix $@)) $(CFLAGS-$(<F)) \
518 $(CFLAGS-$(@F))
519+override CFLAGS-native = -std=gnu99 $(gnu89-inline-CFLAGS) $(default_cflags) $(+gccwarn-c) \
520+ $(CFLAGS-$(suffix $@)) $(CFLAGS-$(<F)) $(CFLAGS-$(@F))
521 override CXXFLAGS = $(c++-sysincludes) \
522 $(filter-out %frame-pointer,$(+cflags)) $(sysdep-CFLAGS) \
523 $(CFLAGS-$(suffix $@)) $(CFLAGS-$(<F)) $(CFLAGS-$(@F))
624a0b95
VM
524diff -Naur glibc-2.10.1.orig/Makerules glibc-2.10.1/Makerules
525--- glibc-2.10.1.orig/Makerules 2008-02-06 19:39:18.000000000 -0500
526+++ glibc-2.10.1/Makerules 2009-03-15 19:22:15.975455420 -0400
6dca1d21
JB
527@@ -278,6 +278,9 @@
528 object-suffixes-left := $(all-object-suffixes)
529 include $(o-iterator)
530
531+$(objpfx)%-native.o: %.c $(before-compile)
532+ $(native-compile-command.c)
533+
534 # Omit the objpfx rules when building in the source tree, because
535 # objpfx is empty and so these rules just override the ones above.
536 ifdef objpfx
537@@ -354,6 +357,8 @@
538 compile-command.s = $(COMPILE.s) $< $(OUTPUT_OPTION) $(compile-mkdep-flags)
539 compile-command.c = $(compile.c) $(OUTPUT_OPTION) $(compile-mkdep-flags)
540 compile-command.cc = $(compile.cc) $(OUTPUT_OPTION) $(compile-mkdep-flags)
541+# Native commands
542+native-compile-command.c = $(native-compile.c) $(OUTPUT_OPTION) $(compile-mkdep-flags)
543
544 # GCC can grok options after the file name, and it looks nicer that way.
545 compile.c = $(CC) $< -c $(CFLAGS) $(CPPFLAGS)
546@@ -363,6 +368,8 @@
547 COMPILE.S = $(CC) -c $(CPPFLAGS) $(S-CPPFLAGS) \
548 $(ASFLAGS) $(ASFLAGS-$(suffix $@))
549 COMPILE.s = $(filter-out -pipe,$(CC)) -c $(ASFLAGS)
550+# Native commands
551+native-compile.c = $(BUILD_CC) -g $< -c $(CFLAGS-native) $(CPPFLAGS-native)
552
553 # We need this for the output to go in the right place. It will default to
554 # empty if make was configured to work with a cc that can't grok -c and -o
555@@ -1156,7 +1163,7 @@
556 $(make-target-directory)
557 $(patsubst %/,cd % &&,$(objpfx)) \
558 $(BUILD_CC) $($(basename $(<F))-CFLAGS) $(ALL_BUILD_CFLAGS) \
559- $(firstword $(filter /%,$< $(shell pwd)/$<)) -o $(@F)
560+ $(addprefix $(shell pwd)/, $^) -o $(@F)
561 endef
562
563 # Command to compile $< in $(common-objdir) using the native libraries.
624a0b95
VM
564diff -Naur glibc-2.10.1.orig/malloc/Makefile glibc-2.10.1/malloc/Makefile
565--- glibc-2.10.1.orig/malloc/Makefile 2007-12-16 17:57:50.000000000 -0500
566+++ glibc-2.10.1/malloc/Makefile 2009-03-15 19:22:15.975455420 -0400
6dca1d21
JB
567@@ -73,10 +73,6 @@
568 endif
569 endif
570
571-# Unless we get a test for the availability of libgd which also works
572-# for cross-compiling we disable the memusagestat generation in this
573-# situation.
574-ifneq ($(cross-compiling),yes)
575 # If the gd library is available we build the `memusagestat' program.
576 ifneq ($(LIBGD),no)
577 others: $(objpfx)memusage
578@@ -91,7 +87,6 @@
579 # is to presume that the standard system headers will be ok for this file.
580 $(objpfx)memusagestat.o: sysincludes = # nothing
581 endif
582-endif
583
584 # Another goal which can be used to override the configure decision.
585 .PHONY: do-memusagestat
624a0b95
VM
586diff -Naur glibc-2.10.1.orig/Rules glibc-2.10.1/Rules
587--- glibc-2.10.1.orig/Rules 2006-02-28 02:05:48.000000000 -0500
588+++ glibc-2.10.1/Rules 2009-03-15 19:22:15.975455420 -0400
6dca1d21
JB
589@@ -87,7 +87,7 @@
590
591 .PHONY: others tests
592 ifeq ($(build-programs),yes)
593-others: $(addprefix $(objpfx),$(others) $(sysdep-others) $(extra-objs))
594+others: $(addprefix $(objpfx),$(others) $(others-native) $(sysdep-others) $(extra-objs))
595 else
596 others: $(addprefix $(objpfx),$(extra-objs))
597 endif
598@@ -106,9 +106,11 @@
599 ifeq ($(build-programs),yes)
600 binaries-all = $(others) $(sysdep-others) $(tests) $(xtests) $(test-srcs)
601 binaries-static = $(others-static) $(tests-static) $(xtests-static)
602+binaries-native = $(others-native)
603 else
604 binaries-all = $(tests) $(xtests) $(test-srcs)
605 binaries-static =
606+binaries-native =
607 endif
608
609 binaries-shared = $(filter-out $(binaries-static), $(binaries-all))
610@@ -127,6 +129,11 @@
611 $(+link-static)
612 endif
613
614+ifneq "$(strip $(binaries-native))" ""
615+$(addprefix $(objpfx),$(binaries-native)): %: %.o
616+ $(+link-native)
617+endif
618+
619 ifeq ($(build-bounded),yes)
620 binaries-bounded = $(addsuffix -bp,$(tests) $(xtests) $(test-srcs))
621 $(addprefix $(objpfx),$(binaries-bounded)): %-bp: %.ob \
624a0b95
VM
622diff -Naur glibc-2.10.1.orig/sunrpc/Makefile glibc-2.10.1/sunrpc/Makefile
623--- glibc-2.10.1.orig/sunrpc/Makefile 2006-10-18 15:25:38.000000000 -0400
624+++ glibc-2.10.1/sunrpc/Makefile 2009-03-15 19:22:15.975455420 -0400
6dca1d21
JB
625@@ -70,6 +70,9 @@
626 clnt_unix svc_unix create_xid xdr_intXX_t
627
628 others := rpcinfo
629+ifneq ($(cross-compiling),no)
630+others-native := rpcgen-native
631+endif
632 install-bin := rpcgen
633 install-sbin := rpcinfo
634 rpcgen-objs = rpc_main.o rpc_hout.o rpc_cout.o rpc_parse.o \
635@@ -98,15 +101,12 @@
636 $(resolvobjdir)/libresolv.a
637 endif
638
639-ifeq (no,$(cross-compiling))
640-# We can only build this library if we can run the rpcgen we build.
641 headers += $(rpcsvc:%.x=rpcsvc/%.h)
642 extra-libs := librpcsvc
643 extra-libs-others := librpcsvc # Make it in `others' pass, not `lib' pass.
644 librpcsvc-routines = $(rpcsvc:%.x=x%)
645 librpcsvc-inhibit-o = .os # Build no shared rpcsvc library.
646 omit-deps = $(librpcsvc-routines)
647-endif
648
649 CFLAGS-xbootparam_prot.c = -Wno-unused $(PIC-ccflag)
650 CFLAGS-xnlm_prot.c = -Wno-unused $(PIC-ccflag)
651@@ -136,13 +136,26 @@
652 $(addprefix $(csu-objpfx),start.o) $(+preinit) $(+postinit)
653 $(+link)
654
655+ifneq ($(cross-compiling),no)
656+rpcgen.c:
657+ touch rpcgen.c
658+
659+$(objpfx)rpcgen-native: $(addprefix $(objpfx),$(rpcgen-objs:%.o=%-native.o))
660+endif
661+
662 # This makes sure -DNOT_IN_libc is passed for all these modules.
663 cpp-srcs-left := $(rpcgen-objs:.o=.c)
664 lib := nonlib
665 include $(patsubst %,$(..)cppflags-iterator.mk,$(cpp-srcs-left))
666
667 # Tell rpcgen where to find the C preprocessor.
668+ifeq ($(cross-compiling),no)
669 rpcgen-cmd = CPP='$(CC) -E -x c-header' $(built-program-cmd) -Y ../scripts
670+rpcgen = $(objpfx)rpcgen
671+else
672+rpcgen-cmd = CPP='$(CC) -E -x c-header' $(objpfx)rpcgen-native -Y ../scripts
673+rpcgen = $(objpfx)rpcgen-native
674+endif
675
676 # Install the rpc data base file.
677 $(inst_sysconfdir)/rpc: etc.rpc $(+force)
678@@ -153,7 +166,7 @@
679 # relinked.
680 $(rpcsvc:%.x=$(objpfx)rpcsvc/%.h): $(objpfx)rpcsvc/%.h: $(objpfx)rpcsvc/%.stmp
681 @:
682-$(objpfx)rpcsvc/%.stmp: rpcsvc/%.x $(objpfx)rpcgen
683+$(objpfx)rpcsvc/%.stmp: rpcsvc/%.x $(rpcgen)
684 $(make-target-directory)
685 -@rm -f ${@:stmp=T} $@
686 $(rpcgen-cmd) -h $< -o ${@:stmp=T}
687@@ -163,7 +176,7 @@
688 # Generate the rpcsvc XDR functions with rpcgen.
689 $(rpcsvc:%.x=$(objpfx)x%.c): $(objpfx)x%.c: $(objpfx)x%.stmp
690 @:
691-$(objpfx)x%.stmp: rpcsvc/%.x $(objpfx)rpcgen
692+$(objpfx)x%.stmp: rpcsvc/%.x $(rpcgen)
693 -@rm -f ${@:stmp=T} $@
694 $(rpcgen-cmd) -c $< -o ${@:stmp=T}
695 $(move-if-change) $(@:stmp=T) $(@:stmp=c)
624a0b95
VM
696diff -Naur glibc-2.10.1.orig/timezone/Makefile glibc-2.10.1/timezone/Makefile
697--- glibc-2.10.1.orig/timezone/Makefile 2007-07-28 16:33:11.000000000 -0400
698+++ glibc-2.10.1/timezone/Makefile 2009-03-15 19:22:16.056496560 -0400
6dca1d21
JB
699@@ -28,6 +28,9 @@
700 extra-objs := scheck.o ialloc.o
701
702 others := zdump zic
703+ifneq ($(cross-compiling),no)
704+others-native := zic-native
705+endif
706 tests := test-tz tst-timezone
707
708 tzbases := africa antarctica asia australasia europe northamerica \
709@@ -69,13 +72,10 @@
710 $(addprefix $(inst_zonedir)/, \
711 $(posixrules-file)))
712
713-ifeq ($(cross-compiling),no)
714-# Don't try to install the zoneinfo files since we can't run zic.
715 install-others = $(addprefix $(inst_zonedir)/,$(zonenames) \
716 $(zonenames:%=posix/%) \
717 $(zonenames:%=right/%)) \
718 $(installed-localtime-file) $(installed-posixrules-file)
719-endif
720
721 ifeq ($(have-ksh),yes)
722 install-others += $(inst_zonedir)/iso3166.tab $(inst_zonedir)/zone.tab
723@@ -128,7 +128,11 @@
724 # We have to use `-d $(inst_zonedir)' to explictly tell zic where to
725 # place the output files although $(zonedir) is compiled in. But the
726 # user might have set $(install_root) on the command line of `make install'.
727+ifeq ($(cross-compiling),no)
728 zic-cmd = $(built-program-cmd) -d $(inst_zonedir)
729+else
730+zic-cmd = $(common-objpfx)/timezone/zic-native -d $(inst_zonedir)
731+endif
732 tzcompile = $(zic-cmd)$(target-zone-flavor) -L $(word 3,$^) \
733 -y $(dir $(word 4,$^))$(notdir $(word 4,$^)) $<
734
735@@ -158,8 +162,10 @@
736 $(zic-cmd) -p $(posixrules)
737 endif
738
739-
740 $(objpfx)zic: $(objpfx)scheck.o $(objpfx)ialloc.o
741+ifneq ($(cross-compiling),no)
742+$(objpfx)zic-native: $(objpfx)scheck-native.o $(objpfx)ialloc-native.o
743+endif
744
745 tz-cflags = -DTZDIR='"$(zonedir)"' \
746 -DTZDEFAULT='"$(localtime-file)"' \