Add convenience target 'install-locale-files'.

The convenience install target 'install-locale-files' is created
to allow distributions to install all of the SUPPORTED locales as
files instead of into the locale-archive.

You invoke the new convenience target like this:
make localedata/install-locale-files DESTDIR=<prefix>
This commit is contained in:
Carlos O'Donell 2018-07-26 10:14:55 -04:00
parent d67d634bef
commit 08a5ee14c6
5 changed files with 88 additions and 20 deletions

View File

@ -1,3 +1,15 @@
2018-07-26 Carlos O'Donell <carlos@redhat.com>
* localedata/Makefile (INSTALL-SUPPORTED-LOCALES): Remove.
(INSTALL-SUPPORTED-LOCALE-ARCHIVE): Define.
(INSTALL-SUPPORTED-LOCALE-FILES): Define.
(install-locales): Depend on install-locale-archive.
(install-locale-archive): Define.
(install-lcoale-files): Define.
(build-one-locale): Define macro.
* manual/install.texi (Running make install): Document.
* manual/INSTALL: Regenerate.
2018-08-02 Siddhesh Poyarekar <siddhesh@sourceware.org>
* benchtests/scripts/compare_strings.py: Import traceback.

32
INSTALL
View File

@ -424,13 +424,33 @@ a pseudoterminal so it can be used by the calling process. If you are
using a Linux kernel with the 'devpts' filesystem enabled and mounted at
'/dev/pts', you don't need this program.
After installation you might want to configure the timezone and
locale installation of your system. The GNU C Library comes with a
locale database which gets configured with 'localedef'. For example, to
set up a German locale with name 'de_DE', simply issue the command
'localedef -i de_DE -f ISO-8859-1 de_DE'. To configure all locales that
After installation you should configure the timezone and install
locales for your system. The time zone configuration ensures that your
system time matches the time for your current timezone. The locales
ensure that the display of information on your system matches the
expectations of your language and geographic region.
The GNU C Library is able to use two kinds of localization
information sources, the first is a locale database named
'locale-archive' which is generally installed as
'/usr/lib/locale/locale-archive'. The locale archive has the benefit of
taking up less space and being very fast to load, but only if you plan
to install sixty or more locales. If you plan to install one or two
locales you can instead install individual locales into their self-named
directories e.g. '/usr/lib/locale/en_US.utf8'. For example to install
the German locale using the character set for UTF-8 with name 'de_DE'
into the locale archive issue the command 'localedef -i de_DE -f UTF-8
de_DE', and to install just the one locale issue the command 'localedef
--no-archive -i de_DE -f UTF-8 de_DE'. To configure all locales that
are supported by the GNU C Library, you can issue from your build
directory the command 'make localedata/install-locales'.
directory the command 'make localedata/install-locales' to install all
locales into the locale archive or 'make
localedata/install-locale-files' to install all locales as files in the
default configured locale installation directory (derived from
'--prefix' or '--localedir'). To install into an alternative system
root use 'DESTDIR' e.g. 'make localedata/install-locale-files
DESTDIR=/opt/glibc', but note that this does not change the configured
prefix.
To configure the locally used timezone, set the 'TZ' environment
variable. The script 'tzselect' helps you to select the right value.

7
NEWS
View File

@ -9,7 +9,12 @@ Version 2.29
Major new features:
[Add new features here]
* A new convenience target has been added for distribution maintainers
to build and install all locales as directories with files. The new
target is run by issuing the following command in your build tree:
'make localedata/install-locale-files', with an optional DESTDIR
to set the install root if you wish to install into a non-default
configured location.
Deprecated and removed features, and other changes affecting compatibility:

View File

@ -380,12 +380,18 @@ endif
include SUPPORTED
INSTALL-SUPPORTED-LOCALES=$(addprefix install-, $(SUPPORTED-LOCALES))
INSTALL-SUPPORTED-LOCALE-ARCHIVE=$(addprefix install-archive-, $(SUPPORTED-LOCALES))
INSTALL-SUPPORTED-LOCALE-FILES=$(addprefix install-files-, $(SUPPORTED-LOCALES))
# Sometimes the whole collection of locale files should be installed.
LOCALEDEF=I18NPATH=. GCONV_PATH=$(common-objpfx)iconvdata LC_ALL=C \
$(rtld-prefix) $(common-objpfx)locale/localedef
install-locales: $(INSTALL-SUPPORTED-LOCALES)
install-locales: install-locale-archive
# Create and install the locale-archive file.
install-locale-archive: $(INSTALL-SUPPORTED-LOCALE-ARCHIVE)
# Create and install the locales individually (no archive).
install-locale-files: $(INSTALL-SUPPORTED-LOCALE-FILES)
install-locales-dir:
$(..)./scripts/mkinstalldirs $(inst_complocaledir)
@ -393,11 +399,10 @@ install-locales-dir:
# The SHIFT_JIS and SHIFT_JISX0213 character maps are not ASCII compatible,
# therefore we have to use --no-warnings=ascii to disable the ASCII check.
# See localedata/gen-locale.sh for the same logic.
$(INSTALL-SUPPORTED-LOCALES): install-locales-dir
@locale=`echo $@ | sed -e 's/^install-//'`; \
define build-one-locale
locale=`echo $@ | sed -e 's/^install-[a-z]*-//'`; \
charset=`echo $$locale | sed -e 's,.*/,,'`; \
locale=`echo $$locale | sed -e 's,/[^/]*,,'`; \
flags="-c"; \
if [ "$$charset" = 'SHIFT_JIS' ] \
|| [ "$$charset" = 'SHIFT_JISX0213' ]; then \
flags="$$flags --no-warnings=ascii"; \
@ -410,7 +415,16 @@ $(INSTALL-SUPPORTED-LOCALES): install-locales-dir
$(LOCALEDEF) $$flags --alias-file=../intl/locale.alias \
-i locales/$$input -f charmaps/$$charset \
$(addprefix --prefix=,$(install_root)) $$locale \
&& echo ' done'; \
&& echo ' done';
endef
$(INSTALL-SUPPORTED-LOCALE-ARCHIVE): install-locales-dir
@flags="-c"; \
$(build-one-locale)
$(INSTALL-SUPPORTED-LOCALE-FILES): install-locales-dir
@flags="-c --no-archive"; \
$(build-one-locale)
tst-setlocale-ENV = LC_ALL=ja_JP.EUC-JP
tst-wctype-ENV = LC_ALL=ja_JP.EUC-JP

View File

@ -465,13 +465,30 @@ permissions on a pseudoterminal so it can be used by the calling process.
If you are using a Linux kernel with the @code{devpts} filesystem enabled
and mounted at @file{/dev/pts}, you don't need this program.
After installation you might want to configure the timezone and locale
installation of your system. @Theglibc{} comes with a locale
database which gets configured with @code{localedef}. For example, to
set up a German locale with name @code{de_DE}, simply issue the command
@samp{localedef -i de_DE -f ISO-8859-1 de_DE}. To configure all locales
that are supported by @theglibc{}, you can issue from your build directory the
command @samp{make localedata/install-locales}.
After installation you should configure the timezone and install locales
for your system. The time zone configuration ensures that your system
time matches the time for your current timezone. The locales ensure that
the display of information on your system matches the expectations of
your language and geographic region.
@Theglibc{} is able to use two kinds of localization information sources, the
first is a locale database named @file{locale-archive} which is generally
installed as @file{/usr/lib/locale/locale-archive}. The locale archive has the
benefit of taking up less space and being very fast to load, but only if you
plan to install sixty or more locales. If you plan to install one or two
locales you can instead install individual locales into their self-named
directories e.g.@: @file{/usr/lib/locale/en_US.utf8}. For example to install
the German locale using the character set for UTF-8 with name @code{de_DE} into
the locale archive issue the command @samp{localedef -i de_DE -f UTF-8 de_DE},
and to install just the one locale issue the command @samp{localedef
--no-archive -i de_DE -f UTF-8 de_DE}. To configure all locales that are
supported by @theglibc{}, you can issue from your build directory the command
@samp{make localedata/install-locales} to install all locales into the locale
archive or @samp{make localedata/install-locale-files} to install all locales
as files in the default configured locale installation directory (derived from
@samp{--prefix} or @code{--localedir}). To install into an alternative system
root use @samp{DESTDIR} e.g.@: @samp{make localedata/install-locale-files
DESTDIR=/opt/glibc}, but note that this does not change the configured prefix.
To configure the locally used timezone, set the @code{TZ} environment
variable. The script @code{tzselect} helps you to select the right value.