[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[patches] RFC: Locale option group
- To: patches@xxxxxxxxxx
- Subject: [patches] RFC: Locale option group
- From: Jim Blandy <jimb@xxxxxxxxxxxxxxxx>
- Date: Tue, 26 Dec 2006 17:59:11 -0800
Here's a patch to create a new option group, OPTION_EGLIBC_LOCALES,
containing EGLIBC's locale data files. Disabling this option group
reduces the size of an ARM eglibc installation by about 90%, from
262MiB to 25MiB (for one multilib).
One thing I suspect is wrong off the bat: the locale source files,
installed compressed under $sysroot/usr/share/i18n/locales, probably
ought to also be placed in the OPTION_EGLIBC_LOCALES option group too
(except for the POSIX locale, which is always present). I don't see
any use for installing sources for locales the system doesn't
support. I think doing so would reduce the increase the savings to
around 92% (20MiB per multilib).
Should the character maps in localedata/charmaps also be in this
option group? Alternatively, I'd been planning on creating an option
group for the gconv character set conversion libraries, installed in
/usr/lib/gconv; should the character maps be grouped with those
instead?
And there may be other ways to better reflect the logical structure of
the locale data in the option groups; suggestions are welcome.
The patch is in two parts, one for libc and one for localedef.
ChangeLog.eglibc:
2006-12-26 Jim Blandy <jimb@xxxxxxxxxxxxxxxx>
* option-groups.def, option-groups.defaults (OPTION_EGLIBC_LOCALES):
New option group.
* localedata/Makefile: Trim locale list if
OPTION_EGLIBC_LOCALES is not enabled.
Index: option-groups.def
===================================================================
--- option-groups.def (revision 158625)
+++ option-groups.def (working copy)
@@ -42,3 +42,10 @@
help
This option group includes functions for accessing message
catalogs: catopen, catclose, and catgets.
+
+config OPTION_EGLIBC_LOCALES
+ bool "Locale definitions"
+ help
+ This option group includes all locale definitions other than
+ that for the "C" locale. If this option group is omitted, then
+ only the "C" locale is supported.
Index: localedata/Makefile
===================================================================
--- localedata/Makefile (revision 158625)
+++ localedata/Makefile (working copy)
@@ -22,6 +22,8 @@
all: # Make this the default target; it will be defined in Rules.
+include ../option-groups.mak
+
# List with all available character set descriptions.
charmaps := $(filter-out $(addprefix charmaps/, CVS RCS SCCS %~), \
$(wildcard charmaps/[A-I]*) \
@@ -203,6 +205,11 @@
include SUPPORTED
+# Only install locale data if OPTION_EGLIBC_LOCALES is selected.
+ifneq ($(OPTION_EGLIBC_LOCALES),y)
+SUPPORTED-LOCALES :=
+endif
+
INSTALL-SUPPORTED-LOCALES=$(addprefix install-, $(SUPPORTED-LOCALES))
# Sometimes the whole collection of locale files should be installed.
Index: option-groups.defaults
===================================================================
--- option-groups.defaults (revision 158625)
+++ option-groups.defaults (working copy)
@@ -9,3 +9,4 @@
#
# By default, all option groups are enabled.
OPTION_EGLIBC_CATGETS = y
+OPTION_EGLIBC_LOCALES = y
ChangeLog.eglibc:
2006-12-26 Jim Blandy <jimb@xxxxxxxxxxxxxxxx>
* Makefile.in: Include option-groups.mak from glibc. Trim
locale list if OPTION_EGLIBC_LOCALES is not enabled.
Index: Makefile.in
===================================================================
--- Makefile.in (revision 158625)
+++ Makefile.in (working copy)
@@ -118,8 +118,15 @@
#----------------------------------------------------------------------------
# Based on localedata/Makefile
#----------------------------------------------------------------------------
+.. = glibc/
+include glibc/option-groups.mak
include glibc/localedata/SUPPORTED
+# Only install locale data if OPTION_EGLIBC_LOCALES is selected.
+ifneq ($(OPTION_EGLIBC_LOCALES),y)
+SUPPORTED-LOCALES :=
+endif
+
INSTALL-SUPPORTED-LOCALES=$(addprefix install-, $(SUPPORTED-LOCALES))
LOCALEDEF=\