1 Submitted By: Joe Ciccone <jciccone@gmail.com>
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
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.
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
20 others = iconv_prog iconvconfig
21 +ifneq ($(cross-compiling),no)
22 + others-native = iconvconfig-native
24 install-others-programs = $(inst_bindir)/iconv
25 install-sbin = iconvconfig
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)
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
40 headers: $(addprefix $(objpfx), $(generated-modules:=.h))
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
47 +iconvconfig-cmd = LC_ALL=C LANGUAGE=C \
48 + $(common-objpfx)iconv/iconvconfig-native
51 $(addprefix $(inst_gconvdir)/, $(modules.so)): \
52 $(inst_gconvdir)/%: $(objpfx)% $(+force)
54 $(inst_gconvdir)/gconv-modules: gconv-modules $(+force)
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)); \
67 - @echo '*@*@*@ You should recreate $(inst_gconvdir)/gconv-modules.cache'
70 endif # build-shared = yes
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
76 +#ifndef __libc_tsd_define
77 +#define __libc_tsd_define(A,B,C)
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
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
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
95 +struct loaded_l10nfile;
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
101 +#include_next <libintl.h>
111 +#ifndef _libc_intl_domainname
112 +#define _libc_intl_domainname "libc"
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
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
123 +#ifndef _include_tls_h
124 +#define _include_tls_h 1
126 +#if USE_TLS && HAVE___THREAD \
127 + && (!defined NOT_IN_libc || defined IS_IN_libpthread)
128 +# define USE___THREAD 1
130 +# define USE___THREAD 0
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
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
144 #others-static = localedef locale
145 install-bin = localedef locale
146 extra-objs = $(localedef-modules:=.o) $(localedef-aux:=.o) \
148 $(objpfx)locale: $(locale-modules:%=$(objpfx)%.o)
149 $(objpfx)localedef $(objpfx)locale: $(lib-modules:%=$(objpfx)%.o)
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)
157 C-translit.h: C-translit.h.in gen-translit.pl
158 $(PERL) gen-translit.pl < $< > $@.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
164 INSTALL-SUPPORTED-LOCALES=$(addprefix install-, $(SUPPORTED-LOCALES))
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
171 +LOCALEDEF=I18NPATH=. GCONV_PATH=$(common-objpfx)iconvdata LC_ALL=C \
172 +$(common-objpfx)locale/localedef-native
174 install-locales: $(INSTALL-SUPPORTED-LOCALES)
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
181 +# Copyright (C) 1996-2003, 2005, 2007, 2008 Free Software Foundation, Inc.
182 +# This file is part of the GNU C Library.
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.
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.
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
199 +# Makefile for installing locale data source files.
201 +subdir := localedata
203 +all: # Make this the default target; it will be defined in Rules.
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]*))
210 +# List with all available character set descriptions.
211 +locales := $(filter-out $(addprefix locales/, CVS RCS SCCS %~), \
212 + $(wildcard locales/*))
215 +subdir-dirs = tests-mbwc
216 +vpath %.c tests-mbwc
217 +vpath %.h tests-mbwc
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 \
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) \
235 +fmon-tests = n01y12 n02n40 n10y31 n11y41 n12y11 n20n32 n30y20 n41n00 \
236 + y01y10 y02n22 y22n42 y30y21 y32n31 y40y00 y42n21
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)) \
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 \
256 +# Get $(inst_i18ndir) defined.
257 +include ../Makeconfig
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
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))
280 +tests: $(objpfx)mtrace-tst-leaks
286 +install-others := $(addprefix $(inst_i18ndir)/, \
287 + $(addsuffix .gz, $(charmaps)) \
292 +# Install the charmap files in gzipped format.
293 +$(inst_i18ndir)/charmaps/%.gz: charmaps/% $(+force)
294 + $(make-target-directory)
296 + $(INSTALL_DATA) $< $(@:.gz=)
299 +# Install the locale source files in the appropriate directory.
300 +$(inst_i18ndir)/locales/%: locales/% $(+force); $(do-install)
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
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))
324 +generated-dirs += $(LOCALES)
326 +# Dependency for the locale files. We actually make it depend only on
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)' $@
333 +$(addsuffix .out,$(addprefix $(objpfx),$(tests))): %: \
334 + $(addprefix $(objpfx),$(CTYPE_FILES))
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
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) \
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 \
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 \
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))
388 +INSTALL-SUPPORTED-LOCALES=$(addprefix install-, $(SUPPORTED-LOCALES))
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)
395 +install-locales-dir:
396 + $(..)./scripts/mkinstalldirs $(inst_localedir)
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/'`; \
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; \
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)
471 +tst-setlocale-ENV = LOCPATH=$(common-objpfx)localedata LC_ALL=ja_JP.EUC-JP
473 +bug-iconv-trans-ENV = LOCPATH=$(common-objpfx)localedata
475 +tst-sscanf-ENV = LOCPATH=$(common-objpfx)localedata
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
485 $(common-objpfx)libc% $(+postinit),$^) \
486 $(link-extra-libs-static) $(link-libc-static) $(+postctor) $(+postinit)
488 +# Command for linking programs against the host system.
490 ++link-native = $(BUILD_CC) -static -g -o $@ $^ \
491 + $(LDFLAGS) $(LDFLAGS-$(@F)) \
492 + $(combreloc-LDFLAGS) $(relro-LDFLAGS) \
495 # Command for statically linking bounded-pointer programs with the C library.
497 +link-bounded = $(CC) -nostdlib -nostartfiles -static -fbounded-pointers -o $@ \
499 $(+sysdep-includes) $(includes) \
500 $(patsubst %/,-I%,$(..)) $(libio-include) -I. $(sysincludes)
502 ++includes-native = -I$(..)include-native -I$(objpfx) -I.
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)) \
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
527 object-suffixes-left := $(all-object-suffixes)
528 include $(o-iterator)
530 +$(objpfx)%-native.o: %.c $(before-compile)
531 + $(native-compile-command.c)
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.
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)
541 +native-compile-command.c = $(native-compile.c) $(OUTPUT_OPTION) $(compile-mkdep-flags)
543 # GCC can grok options after the file name, and it looks nicer that way.
544 compile.c = $(CC) $< -c $(CFLAGS) $(CPPFLAGS)
546 COMPILE.S = $(CC) -c $(CPPFLAGS) $(S-CPPFLAGS) \
547 $(ASFLAGS) $(ASFLAGS-$(suffix $@))
548 COMPILE.s = $(filter-out -pipe,$(CC)) -c $(ASFLAGS)
550 +native-compile.c = $(BUILD_CC) -g $< -c $(CFLAGS-native) $(CPPFLAGS-native)
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)
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
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
573 -ifneq ($(cross-compiling),yes)
574 # If the gd library is available we build the `memusagestat' program.
576 others: $(objpfx)memusage
578 # is to presume that the standard system headers will be ok for this file.
579 $(objpfx)memusagestat.o: sysincludes = # nothing
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
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))
595 others: $(addprefix $(objpfx),$(extra-objs))
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)
603 binaries-all = $(tests) $(xtests) $(test-srcs)
608 binaries-shared = $(filter-out $(binaries-static), $(binaries-all))
613 +ifneq "$(strip $(binaries-native))" ""
614 +$(addprefix $(objpfx),$(binaries-native)): %: %.o
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
625 clnt_unix svc_unix create_xid xdr_intXX_t
628 +ifneq ($(cross-compiling),no)
629 +others-native := rpcgen-native
631 install-bin := rpcgen
632 install-sbin := rpcinfo
633 rpcgen-objs = rpc_main.o rpc_hout.o rpc_cout.o rpc_parse.o \
635 $(resolvobjdir)/libresolv.a
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)
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)
654 +ifneq ($(cross-compiling),no)
658 +$(objpfx)rpcgen-native: $(addprefix $(objpfx),$(rpcgen-objs:%.o=%-native.o))
661 # This makes sure -DNOT_IN_libc is passed for all these modules.
662 cpp-srcs-left := $(rpcgen-objs:.o=.c)
664 include $(patsubst %,$(..)cppflags-iterator.mk,$(cpp-srcs-left))
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
671 +rpcgen-cmd = CPP='$(CC) -E -x c-header' $(objpfx)rpcgen-native -Y ../scripts
672 +rpcgen = $(objpfx)rpcgen-native
675 # Install the rpc data base file.
676 $(inst_sysconfdir)/rpc: etc.rpc $(+force)
679 $(rpcsvc:%.x=$(objpfx)rpcsvc/%.h): $(objpfx)rpcsvc/%.h: $(objpfx)rpcsvc/%.stmp
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}
687 # Generate the rpcsvc XDR functions with rpcgen.
688 $(rpcsvc:%.x=$(objpfx)x%.c): $(objpfx)x%.c: $(objpfx)x%.stmp
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
699 extra-objs := scheck.o ialloc.o
702 +ifneq ($(cross-compiling),no)
703 +others-native := zic-native
705 tests := test-tz tst-timezone
707 tzbases := africa antarctica asia australasia europe northamerica \
709 $(addprefix $(inst_zonedir)/, \
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)
720 ifeq ($(have-ksh),yes)
721 install-others += $(inst_zonedir)/iso3166.tab $(inst_zonedir)/zone.tab
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)
729 +zic-cmd = $(common-objpfx)/timezone/zic-native -d $(inst_zonedir)
731 tzcompile = $(zic-cmd)$(target-zone-flavor) -L $(word 3,$^) \
732 -y $(dir $(word 4,$^))$(notdir $(word 4,$^)) $<
735 $(zic-cmd) -p $(posixrules)
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
744 tz-cflags = -DTZDIR='"$(zonedir)"' \
745 -DTZDEFAULT='"$(localtime-file)"' \