]>
Commit | Line | Data |
---|---|---|
12788f63 MT |
1 | 2011-08-14 Roland McGrath <roland@hack.frob.com> |
2 | ||
3 | * locale/Makefile (locale-CPPFLAGS): Renamed CPPFLAGS-locale-programs. | |
4 | (locale-CPPFLAGS): New variable; put LOCALEDIR, LOCALE_ALIAS_PATH and | |
5 | -Iprograms here. | |
6 | (cppflags-iterator.mk sequence): Use locale-programs in place of nonlib. | |
7 | (localedef-modules): Add localedef. | |
8 | (locale-modules): Add locale. | |
9 | ||
10 | 2011-08-13 Ulrich Drepper <drepper@gmail.com> | |
11 | ||
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. | |
16 | ||
17 | 2011-08-11 Ulrich Drepper <drepper@gmail.com> | |
18 | ||
19 | * intl/l10nflist.c (_nl_make_l10nflist): Use locale-independent | |
20 | classification. | |
21 | ||
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 | |
27 | char *retval; | |
28 | char *wp; | |
29 | size_t cnt; | |
30 | +#ifdef NOT_IN_libc | |
31 | + locale_t locale = newlocale (0, "C", NULL); | |
32 | +#else | |
33 | +# define locale _nl_C_locobj_ptr | |
34 | +#endif | |
35 | ||
36 | for (cnt = 0; cnt < name_len; ++cnt) | |
37 | - if (isalnum ((unsigned char) codeset[cnt])) | |
38 | + if (__isalnum_l ((unsigned char) codeset[cnt], locale)) | |
39 | { | |
40 | ++len; | |
41 | ||
42 | - if (isalpha ((unsigned char) codeset[cnt])) | |
43 | + if (! __isdigit_l ((unsigned char) codeset[cnt], locale)) | |
44 | only_digit = 0; | |
45 | } | |
46 | ||
47 | @@ -346,15 +351,14 @@ _nl_normalize_codeset (codeset, name_len | |
48 | ||
49 | if (retval != NULL) | |
50 | { | |
51 | + wp = retval; | |
52 | if (only_digit) | |
53 | - wp = stpcpy (retval, "iso"); | |
54 | - else | |
55 | - wp = retval; | |
56 | + wp = stpcpy (wp, "iso"); | |
57 | ||
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)) | |
65 | *wp++ = codeset[cnt]; | |
66 | ||
67 | *wp = '\0'; | |
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 | |
73 | vpath %.h programs | |
74 | vpath %.gperf programs | |
75 | ||
76 | -localedef-modules := $(categories:%=ld-%) charmap linereader locfile \ | |
77 | +localedef-modules := localedef $(categories:%=ld-%) \ | |
78 | + charmap linereader locfile \ | |
79 | repertoire locarchive | |
80 | localedef-aux := md5 | |
81 | -locale-modules := locale-spec | |
82 | +locale-modules := locale locale-spec | |
83 | lib-modules := charmap-dir simple-hash xmalloc xstrdup | |
84 | ||
85 | ||
86 | @@ -90,22 +91,27 @@ endif | |
87 | ||
88 | localepath = "$(localedir):$(i18ndir)" | |
89 | ||
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 \ | |
96 | - -Iprograms | |
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)"' \ | |
102 | + -Iprograms | |
103 | + | |
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 | |
109 | ||
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 | |
113 | ||
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)) | |
118 | -lib := nonlib | |
119 | +lib := locale-programs | |
120 | include $(patsubst %,$(..)cppflags-iterator.mk,$(cpp-srcs-left)) | |
121 | ||
122 | # Depend on libc.so so a DT_NEEDED is generated in the shared objects. |