|
|
b9ba6d |
2011-08-14 Roland McGrath <roland@hack.frob.com>
|
|
|
b9ba6d |
|
|
|
b9ba6d |
* locale/Makefile (locale-CPPFLAGS): Renamed CPPFLAGS-locale-programs.
|
|
|
b9ba6d |
(locale-CPPFLAGS): New variable; put LOCALEDIR, LOCALE_ALIAS_PATH and
|
|
|
b9ba6d |
-Iprograms here.
|
|
|
b9ba6d |
(cppflags-iterator.mk sequence): Use locale-programs in place of nonlib.
|
|
|
b9ba6d |
(localedef-modules): Add localedef.
|
|
|
b9ba6d |
(locale-modules): Add locale.
|
|
|
b9ba6d |
|
|
|
b9ba6d |
2011-08-13 Ulrich Drepper <drepper@gmail.com>
|
|
|
b9ba6d |
|
|
|
b9ba6d |
* intl/l10nflist.c (_nl_normalize_codeset): Make it compile outside
|
|
|
b9ba6d |
of libc. Make tolower call locale-independent. Optimize a bit by
|
|
|
b9ba6d |
using isdigit instead of isalnum.
|
|
|
b9ba6d |
* locale/Makefile (locale-CPPFLAGS): Add -DNOT_IN_libc.
|
|
|
b9ba6d |
|
|
|
b9ba6d |
2011-08-11 Ulrich Drepper <drepper@gmail.com>
|
|
|
b9ba6d |
|
|
|
b9ba6d |
* intl/l10nflist.c (_nl_make_l10nflist): Use locale-independent
|
|
|
b9ba6d |
classification.
|
|
|
b9ba6d |
|
|
|
b9ba6d |
Index: glibc-2.12-2-gc4ccff1/intl/l10nflist.c
|
|
|
b9ba6d |
===================================================================
|
|
|
b9ba6d |
--- glibc-2.12-2-gc4ccff1.orig/intl/l10nflist.c
|
|
|
b9ba6d |
+++ glibc-2.12-2-gc4ccff1/intl/l10nflist.c
|
|
|
b9ba6d |
@@ -332,13 +332,18 @@ _nl_normalize_codeset (codeset, name_len
|
|
|
b9ba6d |
char *retval;
|
|
|
b9ba6d |
char *wp;
|
|
|
b9ba6d |
size_t cnt;
|
|
|
b9ba6d |
+#ifdef NOT_IN_libc
|
|
|
b9ba6d |
+ locale_t locale = newlocale (0, "C", NULL);
|
|
|
b9ba6d |
+#else
|
|
|
b9ba6d |
+# define locale _nl_C_locobj_ptr
|
|
|
b9ba6d |
+#endif
|
|
|
b9ba6d |
|
|
|
b9ba6d |
for (cnt = 0; cnt < name_len; ++cnt)
|
|
|
b9ba6d |
- if (isalnum ((unsigned char) codeset[cnt]))
|
|
|
b9ba6d |
+ if (__isalnum_l ((unsigned char) codeset[cnt], locale))
|
|
|
b9ba6d |
{
|
|
|
b9ba6d |
++len;
|
|
|
b9ba6d |
|
|
|
b9ba6d |
- if (isalpha ((unsigned char) codeset[cnt]))
|
|
|
b9ba6d |
+ if (! __isdigit_l ((unsigned char) codeset[cnt], locale))
|
|
|
b9ba6d |
only_digit = 0;
|
|
|
b9ba6d |
}
|
|
|
b9ba6d |
|
|
|
b9ba6d |
@@ -346,15 +351,14 @@ _nl_normalize_codeset (codeset, name_len
|
|
|
b9ba6d |
|
|
|
b9ba6d |
if (retval != NULL)
|
|
|
b9ba6d |
{
|
|
|
b9ba6d |
+ wp = retval;
|
|
|
b9ba6d |
if (only_digit)
|
|
|
b9ba6d |
- wp = stpcpy (retval, "iso");
|
|
|
b9ba6d |
- else
|
|
|
b9ba6d |
- wp = retval;
|
|
|
b9ba6d |
+ wp = stpcpy (wp, "iso");
|
|
|
b9ba6d |
|
|
|
b9ba6d |
for (cnt = 0; cnt < name_len; ++cnt)
|
|
|
b9ba6d |
- if (isalpha ((unsigned char) codeset[cnt]))
|
|
|
b9ba6d |
- *wp++ = tolower ((unsigned char) codeset[cnt]);
|
|
|
b9ba6d |
- else if (isdigit ((unsigned char) codeset[cnt]))
|
|
|
b9ba6d |
+ if (__isalpha_l ((unsigned char) codeset[cnt], locale))
|
|
|
b9ba6d |
+ *wp++ = __tolower_l ((unsigned char) codeset[cnt], locale);
|
|
|
b9ba6d |
+ else if (__isdigit_l ((unsigned char) codeset[cnt], locale))
|
|
|
b9ba6d |
*wp++ = codeset[cnt];
|
|
|
b9ba6d |
|
|
|
b9ba6d |
*wp = '\0';
|
|
|
b9ba6d |
Index: glibc-2.12-2-gc4ccff1/locale/Makefile
|
|
|
b9ba6d |
===================================================================
|
|
|
b9ba6d |
--- glibc-2.12-2-gc4ccff1.orig/locale/Makefile
|
|
|
b9ba6d |
+++ glibc-2.12-2-gc4ccff1/locale/Makefile
|
|
|
b9ba6d |
@@ -59,10 +59,11 @@ vpath %.c programs ../crypt
|
|
|
b9ba6d |
vpath %.h programs
|
|
|
b9ba6d |
vpath %.gperf programs
|
|
|
b9ba6d |
|
|
|
b9ba6d |
-localedef-modules := $(categories:%=ld-%) charmap linereader locfile \
|
|
|
b9ba6d |
+localedef-modules := localedef $(categories:%=ld-%) \
|
|
|
b9ba6d |
+ charmap linereader locfile \
|
|
|
b9ba6d |
repertoire locarchive
|
|
|
b9ba6d |
localedef-aux := md5
|
|
|
b9ba6d |
-locale-modules := locale-spec
|
|
|
b9ba6d |
+locale-modules := locale locale-spec
|
|
|
b9ba6d |
lib-modules := charmap-dir simple-hash xmalloc xstrdup
|
|
|
b9ba6d |
|
|
|
b9ba6d |
|
|
|
b9ba6d |
@@ -90,22 +91,27 @@ endif
|
|
|
b9ba6d |
|
|
|
b9ba6d |
localepath = "$(localedir):$(i18ndir)"
|
|
|
b9ba6d |
|
|
|
b9ba6d |
-locale-CPPFLAGS := -DLOCALE_PATH='$(localepath)' \
|
|
|
b9ba6d |
- -DLOCALEDIR='"$(localedir)"' \
|
|
|
b9ba6d |
- -DLOCALE_ALIAS_PATH='"$(msgcatdir)"' \
|
|
|
b9ba6d |
- -DCHARMAP_PATH='"$(i18ndir)/charmaps"' \
|
|
|
b9ba6d |
- -DREPERTOIREMAP_PATH='"$(i18ndir)/repertoiremaps"' \
|
|
|
b9ba6d |
- -DLOCSRCDIR='"$(i18ndir)/locales"' -DHAVE_CONFIG_H \
|
|
|
b9ba6d |
- -Iprograms
|
|
|
b9ba6d |
+# -Iprograms doesn't really belong here, but this gets it at the head
|
|
|
b9ba6d |
+# of the list instead of the tail, where CPPFLAGS-$(lib) gets added.
|
|
|
b9ba6d |
+# We need it before the standard -I's to see programs/config.h first.
|
|
|
b9ba6d |
+locale-CPPFLAGS = -DLOCALEDIR='"$(localedir)"' \
|
|
|
b9ba6d |
+ -DLOCALE_ALIAS_PATH='"$(msgcatdir)"' \
|
|
|
b9ba6d |
+ -Iprograms
|
|
|
b9ba6d |
+
|
|
|
b9ba6d |
+CPPFLAGS-locale-programs = -DLOCALE_PATH='$(localepath)' \
|
|
|
b9ba6d |
+ -DCHARMAP_PATH='"$(i18ndir)/charmaps"' \
|
|
|
b9ba6d |
+ -DREPERTOIREMAP_PATH='"$(i18ndir)/repertoiremaps"' \
|
|
|
b9ba6d |
+ -DLOCSRCDIR='"$(i18ndir)/locales"' \
|
|
|
b9ba6d |
+ -DHAVE_CONFIG_H -DNOT_IN_libc
|
|
|
b9ba6d |
|
|
|
b9ba6d |
CFLAGS-charmap.c = -Wno-write-strings -Wno-char-subscripts
|
|
|
b9ba6d |
CFLAGS-locfile.c = -Wno-write-strings -Wno-char-subscripts
|
|
|
b9ba6d |
CFLAGS-charmap-dir.c = -Wno-write-strings
|
|
|
b9ba6d |
|
|
|
b9ba6d |
-# This makes sure -DNOT_IN_libc is passed for all these modules.
|
|
|
b9ba6d |
+# This makes sure -DNOT_IN_libc et al are passed for all these modules.
|
|
|
b9ba6d |
cpp-srcs-left := $(addsuffix .c,$(localedef-modules) $(localedef-aux) \
|
|
|
b9ba6d |
$(locale-modules) $(lib-modules))
|
|
|
b9ba6d |
-lib := nonlib
|
|
|
b9ba6d |
+lib := locale-programs
|
|
|
b9ba6d |
include $(patsubst %,$(..)cppflags-iterator.mk,$(cpp-srcs-left))
|
|
|
b9ba6d |
|
|
|
b9ba6d |
# Depend on libc.so so a DT_NEEDED is generated in the shared objects.
|