CRUX-ARM : Home

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