[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [patches] RFC: Locale option group
- To: patches@xxxxxxxxxx
- Subject: Re: [patches] RFC: Locale option group
- From: Jim Blandy <jimb@xxxxxxxxxxxxxxxx>
- Date: Tue, 02 Jan 2007 13:06:13 -0800
I've committed this patch, revised so that OPTION_EGLIBC_LOCALES
includes the compiled locale data, the locale sources, and the charmap
files, for an overall savings of 93% on an ARM EGLIBC installation.
Here are the committed patches.
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 lists if
OPTION_EGLIBC_LOCALES is not enabled.
* option-groups.mak: Allow includer to override the option
group config file name.
Index: option-groups.def
===================================================================
--- option-groups.def (revision 158677)
+++ 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 158677)
+++ localedata/Makefile (working copy)
@@ -22,15 +22,26 @@
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]*) \
- $(wildcard charmaps/[J-Z]*))
+all-charmaps := $(filter-out $(addprefix charmaps/, CVS RCS SCCS %~), \
+ $(wildcard charmaps/[A-I]*) \
+ $(wildcard charmaps/[J-Z]*))
# List with all available character set descriptions.
-locales := $(filter-out $(addprefix locales/, CVS RCS SCCS %~), \
- $(wildcard locales/*))
+all-locales := $(filter-out $(addprefix locales/, CVS RCS SCCS %~), \
+ $(wildcard locales/*))
+# If the EGLIBC_LOCALES option group is not enabled, trim the
+# list of charmap and locale source files.
+ifeq ($(OPTION_EGLIBC_LOCALES),y)
+charmaps := $(all-charmaps)
+locales := $(all-locales)
+else
+charmaps :=
+locales := locales/POSIX
+endif
subdir-dirs = tests-mbwc
vpath %.c tests-mbwc
@@ -60,7 +71,7 @@
$(addprefix tstfmon_,$(fmon-tests)) \
distribute := CHECKSUMS README SUPPORTED ChangeLog \
- $(charmaps) $(locales) \
+ $(all-charmaps) $(all-locales) \
tst-rpmatch.sh tst-locale.sh tst-fmon.sh sort-test.sh \
tst-fmon.data $(test-input-data) $(ld-test-srcs) \
th_TH.in cs_CZ.in tst-mbswcs.sh tst-trans.sh tst-ctype.sh \
@@ -203,6 +214,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.mak
===================================================================
--- option-groups.mak (revision 158677)
+++ option-groups.mak (working copy)
@@ -1,11 +1,18 @@
# Setup file for subdirectory Makefiles that define EGLIBC option groups.
+# EGLIBC shouldn't need to override this. However, the
+# cross-build-friendly localedef includes this makefile to get option
+# group variable definitions; it uses a single build tree for all the
+# multilibs, and needs to be able to specify a different option group
+# configuration file for each multilib.
+option_group_config_file ?= $(objdir)/option-groups.config
+
# Read the default settings for all options.
include $(..)option-groups.defaults
# Read the developer's option group selections, overriding the
# defaults from option-groups.defaults.
--include $(objdir)/option-groups.config
+-include $(option_group_config_file)
# Establish 'routines-y', etc. as simply expanded variables.
routines-y :=
Index: option-groups.defaults
===================================================================
--- option-groups.defaults (revision 158677)
+++ 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 158677)
+++ Makefile.in (working copy)
@@ -118,8 +118,22 @@
#----------------------------------------------------------------------------
# Based on localedata/Makefile
#----------------------------------------------------------------------------
+.. = glibc/
+
+# Get EGLIBC's option group variable definitions. By default, this
+# will look for an 'option-groups.config' file in localedef's top
+# build directory. If you are using a single localedef build tree
+# with several different option group configurations, set
+# option_group_config_file on the make command line to the name of the
+# option group config file to use.
+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=\