1 2011-08-14 Roland McGrath <roland@hack.frob.com>
3 * locale/Makefile (locale-CPPFLAGS): Renamed CPPFLAGS-locale-programs.
4 (locale-CPPFLAGS): New variable; put LOCALEDIR, LOCALE_ALIAS_PATH and
6 (cppflags-iterator.mk sequence): Use locale-programs in place of nonlib.
7 (localedef-modules): Add localedef.
8 (locale-modules): Add locale.
10 2011-08-13 Ulrich Drepper <drepper@gmail.com>
12 * intl/l10nflist.c (_nl_normalize_codeset): Make it compile outside
13 of libc. Make tolower call locale-independent. Optimize a bit by
14 using isdigit instead of isalnum.
15 * locale/Makefile (locale-CPPFLAGS): Add -DNOT_IN_libc.
17 2011-08-11 Ulrich Drepper <drepper@gmail.com>
19 * intl/l10nflist.c (_nl_make_l10nflist): Use locale-independent
22 Index: glibc-2.12-2-gc4ccff1/intl/l10nflist.c
23 ===================================================================
24 --- glibc-2.12-2-gc4ccff1.orig/intl/l10nflist.c
25 +++ glibc-2.12-2-gc4ccff1/intl/l10nflist.c
26 @@ -332,13 +332,18 @@ _nl_normalize_codeset (codeset, name_len
31 + locale_t locale = newlocale (0, "C", NULL);
33 +# define locale _nl_C_locobj_ptr
36 for (cnt = 0; cnt < name_len; ++cnt)
37 - if (isalnum ((unsigned char) codeset[cnt]))
38 + if (__isalnum_l ((unsigned char) codeset[cnt], locale))
42 - if (isalpha ((unsigned char) codeset[cnt]))
43 + if (! __isdigit_l ((unsigned char) codeset[cnt], locale))
47 @@ -346,15 +351,14 @@ _nl_normalize_codeset (codeset, name_len
53 - wp = stpcpy (retval, "iso");
56 + wp = stpcpy (wp, "iso");
58 for (cnt = 0; cnt < name_len; ++cnt)
59 - if (isalpha ((unsigned char) codeset[cnt]))
60 - *wp++ = tolower ((unsigned char) codeset[cnt]);
61 - else if (isdigit ((unsigned char) codeset[cnt]))
62 + if (__isalpha_l ((unsigned char) codeset[cnt], locale))
63 + *wp++ = __tolower_l ((unsigned char) codeset[cnt], locale);
64 + else if (__isdigit_l ((unsigned char) codeset[cnt], locale))
68 Index: glibc-2.12-2-gc4ccff1/locale/Makefile
69 ===================================================================
70 --- glibc-2.12-2-gc4ccff1.orig/locale/Makefile
71 +++ glibc-2.12-2-gc4ccff1/locale/Makefile
72 @@ -59,10 +59,11 @@ vpath %.c programs ../crypt
74 vpath %.gperf programs
76 -localedef-modules := $(categories:%=ld-%) charmap linereader locfile \
77 +localedef-modules := localedef $(categories:%=ld-%) \
78 + charmap linereader locfile \
81 -locale-modules := locale-spec
82 +locale-modules := locale locale-spec
83 lib-modules := charmap-dir simple-hash xmalloc xstrdup
86 @@ -90,22 +91,27 @@ endif
88 localepath = "$(localedir):$(i18ndir)"
90 -locale-CPPFLAGS := -DLOCALE_PATH='$(localepath)' \
91 - -DLOCALEDIR='"$(localedir)"' \
92 - -DLOCALE_ALIAS_PATH='"$(msgcatdir)"' \
93 - -DCHARMAP_PATH='"$(i18ndir)/charmaps"' \
94 - -DREPERTOIREMAP_PATH='"$(i18ndir)/repertoiremaps"' \
95 - -DLOCSRCDIR='"$(i18ndir)/locales"' -DHAVE_CONFIG_H \
97 +# -Iprograms doesn't really belong here, but this gets it at the head
98 +# of the list instead of the tail, where CPPFLAGS-$(lib) gets added.
99 +# We need it before the standard -I's to see programs/config.h first.
100 +locale-CPPFLAGS = -DLOCALEDIR='"$(localedir)"' \
101 + -DLOCALE_ALIAS_PATH='"$(msgcatdir)"' \
104 +CPPFLAGS-locale-programs = -DLOCALE_PATH='$(localepath)' \
105 + -DCHARMAP_PATH='"$(i18ndir)/charmaps"' \
106 + -DREPERTOIREMAP_PATH='"$(i18ndir)/repertoiremaps"' \
107 + -DLOCSRCDIR='"$(i18ndir)/locales"' \
108 + -DHAVE_CONFIG_H -DNOT_IN_libc
110 CFLAGS-charmap.c = -Wno-write-strings -Wno-char-subscripts
111 CFLAGS-locfile.c = -Wno-write-strings -Wno-char-subscripts
112 CFLAGS-charmap-dir.c = -Wno-write-strings
114 -# This makes sure -DNOT_IN_libc is passed for all these modules.
115 +# This makes sure -DNOT_IN_libc et al are passed for all these modules.
116 cpp-srcs-left := $(addsuffix .c,$(localedef-modules) $(localedef-aux) \
117 $(locale-modules) $(lib-modules))
119 +lib := locale-programs
120 include $(patsubst %,$(..)cppflags-iterator.mk,$(cpp-srcs-left))
122 # Depend on libc.so so a DT_NEEDED is generated in the shared objects.