2021-01-02 19:32:25 +00:00
|
|
|
|
# Copyright (C) 1996-2021 Free Software Foundation, Inc.
|
1996-05-08 03:31:04 +00:00
|
|
|
|
# This file is part of the GNU C Library.
|
|
|
|
|
|
|
|
|
|
# The GNU C Library is free software; you can redistribute it and/or
|
2001-07-06 04:58:11 +00:00
|
|
|
|
# modify it under the terms of the GNU Lesser General Public
|
|
|
|
|
# License as published by the Free Software Foundation; either
|
|
|
|
|
# version 2.1 of the License, or (at your option) any later version.
|
1996-05-08 03:31:04 +00:00
|
|
|
|
|
|
|
|
|
# The GNU C Library is distributed in the hope that it will be useful,
|
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
2001-07-06 04:58:11 +00:00
|
|
|
|
# Lesser General Public License for more details.
|
1996-05-08 03:31:04 +00:00
|
|
|
|
|
2001-07-06 04:58:11 +00:00
|
|
|
|
# You should have received a copy of the GNU Lesser General Public
|
2012-02-09 23:18:22 +00:00
|
|
|
|
# License along with the GNU C Library; if not, see
|
Prefer https to http for gnu.org and fsf.org URLs
Also, change sources.redhat.com to sourceware.org.
This patch was automatically generated by running the following shell
script, which uses GNU sed, and which avoids modifying files imported
from upstream:
sed -ri '
s,(http|ftp)(://(.*\.)?(gnu|fsf|sourceware)\.org($|[^.]|\.[^a-z])),https\2,g
s,(http|ftp)(://(.*\.)?)sources\.redhat\.com($|[^.]|\.[^a-z]),https\2sourceware.org\4,g
' \
$(find $(git ls-files) -prune -type f \
! -name '*.po' \
! -name 'ChangeLog*' \
! -path COPYING ! -path COPYING.LIB \
! -path manual/fdl-1.3.texi ! -path manual/lgpl-2.1.texi \
! -path manual/texinfo.tex ! -path scripts/config.guess \
! -path scripts/config.sub ! -path scripts/install-sh \
! -path scripts/mkinstalldirs ! -path scripts/move-if-change \
! -path INSTALL ! -path locale/programs/charmap-kw.h \
! -path po/libc.pot ! -path sysdeps/gnu/errlist.c \
! '(' -name configure \
-execdir test -f configure.ac -o -f configure.in ';' ')' \
! '(' -name preconfigure \
-execdir test -f preconfigure.ac ';' ')' \
-print)
and then by running 'make dist-prepare' to regenerate files built
from the altered files, and then executing the following to cleanup:
chmod a+x sysdeps/unix/sysv/linux/riscv/configure
# Omit irrelevant whitespace and comment-only changes,
# perhaps from a slightly-different Autoconf version.
git checkout -f \
sysdeps/csky/configure \
sysdeps/hppa/configure \
sysdeps/riscv/configure \
sysdeps/unix/sysv/linux/csky/configure
# Omit changes that caused a pre-commit check to fail like this:
# remote: *** error: sysdeps/powerpc/powerpc64/ppc-mcount.S: trailing lines
git checkout -f \
sysdeps/powerpc/powerpc64/ppc-mcount.S \
sysdeps/unix/sysv/linux/s390/s390-64/syscall.S
# Omit change that caused a pre-commit check to fail like this:
# remote: *** error: sysdeps/sparc/sparc64/multiarch/memcpy-ultra3.S: last line does not end in newline
git checkout -f sysdeps/sparc/sparc64/multiarch/memcpy-ultra3.S
2019-09-07 05:40:42 +00:00
|
|
|
|
# <https://www.gnu.org/licenses/>.
|
1997-01-20 02:49:49 +00:00
|
|
|
|
|
|
|
|
|
# Makefile for installing libc message catalogs.
|
1996-05-08 03:31:04 +00:00
|
|
|
|
|
|
|
|
|
subdir := po
|
|
|
|
|
|
2014-02-26 23:12:03 +00:00
|
|
|
|
include ../Makeconfig
|
|
|
|
|
|
2002-02-13 22:50:48 +00:00
|
|
|
|
# Add names of the languages with broken .po files here.
|
2006-01-08 06:46:10 +00:00
|
|
|
|
BROKEN_LINGUAS =
|
2001-04-20 04:45:54 +00:00
|
|
|
|
|
1996-05-08 03:31:04 +00:00
|
|
|
|
# List of languages for which we have message catalogs of translations.
|
2001-04-20 04:45:54 +00:00
|
|
|
|
ALL_LINGUAS := $(filter-out $(BROKEN_LINGUAS),$(basename $(wildcard *.po)))
|
1996-05-08 03:31:04 +00:00
|
|
|
|
|
|
|
|
|
# You can override this in configparms or the make command line to limit
|
|
|
|
|
# the languages which get installed.
|
|
|
|
|
ifdef LINGUAS
|
|
|
|
|
LINGUAS := $(filter $(addsuffix %,$(LINGUAS)),$(ALL_LINGUAS))
|
|
|
|
|
else
|
|
|
|
|
LINGUAS = $(ALL_LINGUAS)
|
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
# Text domain name to install under; must match ../locale/SYS_libc.c string.
|
1996-09-08 02:07:08 +00:00
|
|
|
|
domainname = libc
|
1996-05-08 03:31:04 +00:00
|
|
|
|
|
|
|
|
|
# Pattern for where message catalog object for language % gets installed.
|
2016-02-25 01:06:04 +00:00
|
|
|
|
mo-installed = $(inst_localedir)/%/LC_MESSAGES/$(domainname).mo
|
1996-05-08 03:31:04 +00:00
|
|
|
|
|
|
|
|
|
# Files to install: a $(domainname).mo file for each language.
|
|
|
|
|
install-others = $(LINGUAS:%=$(mo-installed))
|
|
|
|
|
|
Do not build .mo files in source directory (bug 14121).
Building and installing glibc leaves .mo files (compiled message
translations) behind in the source directory. Building those files in
the source directory may once have made sense, if they were included
in release tarballs; now that release tarballs are just the output of
"git archive", building any non-checked-in files in the source
directory does not make sense. This patch changes these files to be
built in the build directory instead. The realclean rule is changed
to simply adding the .mo files to the "generated" variable, since once
the files are in the build directory it make no sense to exclude them
from normal cleanup rules.
This is necessary but not sufficient to avoid build-many-glibcs.py
needing to copy the glibc source directory. Its list of files to
touch on checkout to avoid subsequent regeneration (configure,
preconfigure, *-kw.h) is incomplete (missing at least INSTALL,
sysdeps/gnu/errlist.c, posix/testcases.h, posix/ptestcases.h,
locale/C-translit.h, (only regenerated for Hurd builds)
sysdeps/mach/hurd/bits/errno.h, (only regenerated for 32-bit SPARC
builds) sysdeps/sparc/sparc32/{sdiv,udiv,rem,urem}.S) - the existing
list may be sufficient to prevent regeneration that actually changes
the file contents depending on the installed build tools, but not to
ensure there is no regeneration at all - and there might well be other
things writing into the source directory in the course of building and
testing (so needing appropriate testing with read-only source
directories with different timestamp orderings to find and eliminate
all such cases).
Tested for x86_64.
[BZ #14121]
* po/Makefile (generated): Add $(ALL_LINGUAS:%=%.mo).
(%.mo): Change to $(objpfx)%.mo. Use $(make-target-directory).
($(mo-installed)): Use $(objpfx)%.mo.
(realclean): Remove rule.
2017-12-15 14:27:20 +00:00
|
|
|
|
generated += $(ALL_LINGUAS:%=%.mo)
|
|
|
|
|
|
1996-05-08 03:31:04 +00:00
|
|
|
|
|
1996-05-08 16:18:27 +00:00
|
|
|
|
include ../Rules
|
1996-05-08 03:31:04 +00:00
|
|
|
|
|
2006-01-08 06:46:10 +00:00
|
|
|
|
# Generate the translation template from all the source files.
|
2014-01-08 22:09:48 +00:00
|
|
|
|
libc.pot: pot.header libc.pot.files
|
2006-01-08 06:46:10 +00:00
|
|
|
|
@rm -f $@.new
|
|
|
|
|
set `date -R`; disp="$$6"; \
|
|
|
|
|
sed -e 's/VERSION/$(version)/' \
|
|
|
|
|
-e "s/DATE/`date +'%Y-%m-%d %H:%M'$$disp`/" \
|
2012-06-13 23:50:29 +00:00
|
|
|
|
-e "s/CHARSET/UTF-8/" \
|
2006-01-08 06:46:10 +00:00
|
|
|
|
$< > $@.new
|
2011-05-31 04:09:03 +00:00
|
|
|
|
egrep -v '\.ksh$$' $(word 2,$^) > $(objdir)/tmp-libc.pot-files
|
2006-01-08 06:46:10 +00:00
|
|
|
|
cd ..; $(XGETTEXT) --keyword=_ --keyword=N_ \
|
|
|
|
|
--add-comments=TRANS --flag=error:3:c-format \
|
2009-02-06 20:42:21 +00:00
|
|
|
|
--flag=f_print:2:c-format \
|
2006-01-08 06:46:10 +00:00
|
|
|
|
--sort-by-file --omit-header -E -n -d - \
|
2011-05-31 04:09:03 +00:00
|
|
|
|
-f $(objdir)/tmp-libc.pot-files >> po/$@.new
|
|
|
|
|
egrep '\.ksh$$' $(word 2,$^) > $(objdir)/tmp-libc.pot-files
|
|
|
|
|
cd ..; $(XGETTEXT) --add-comments=TRANS --language=Shell \
|
|
|
|
|
--sort-by-file --omit-header -E -n -o po/$@.new -j \
|
|
|
|
|
-f $(objdir)/tmp-libc.pot-files po/$@.new
|
|
|
|
|
rm $(objdir)/tmp-libc.pot-files
|
2006-01-08 06:46:10 +00:00
|
|
|
|
mv -f $@.new $@
|
|
|
|
|
|
2007-05-29 18:08:41 +00:00
|
|
|
|
po-sed-cmd = \
|
2011-05-31 04:09:03 +00:00
|
|
|
|
'/\/tst-/d;$(foreach S,[ch] cxx sh ksh bash,$(subst .,\.,/.$S\(.in\)*$$/p;))'
|
2007-05-29 18:08:41 +00:00
|
|
|
|
|
2006-01-08 06:46:10 +00:00
|
|
|
|
# Omit tst-* files, and get only files with the given suffixes.
|
|
|
|
|
libc.pot.files: FORCE
|
2007-05-29 18:08:41 +00:00
|
|
|
|
$(..)scripts/list-sources.sh .. | sed -n $(po-sed-cmd) > $@.new
|
2006-01-08 06:46:10 +00:00
|
|
|
|
mv -f $@.new $@
|
1996-05-08 03:31:04 +00:00
|
|
|
|
|
|
|
|
|
.SUFFIXES: .mo .po .pot
|
|
|
|
|
|
|
|
|
|
# Compile the binary message object files from the portable object source
|
|
|
|
|
# files of translations for each language.
|
Do not build .mo files in source directory (bug 14121).
Building and installing glibc leaves .mo files (compiled message
translations) behind in the source directory. Building those files in
the source directory may once have made sense, if they were included
in release tarballs; now that release tarballs are just the output of
"git archive", building any non-checked-in files in the source
directory does not make sense. This patch changes these files to be
built in the build directory instead. The realclean rule is changed
to simply adding the .mo files to the "generated" variable, since once
the files are in the build directory it make no sense to exclude them
from normal cleanup rules.
This is necessary but not sufficient to avoid build-many-glibcs.py
needing to copy the glibc source directory. Its list of files to
touch on checkout to avoid subsequent regeneration (configure,
preconfigure, *-kw.h) is incomplete (missing at least INSTALL,
sysdeps/gnu/errlist.c, posix/testcases.h, posix/ptestcases.h,
locale/C-translit.h, (only regenerated for Hurd builds)
sysdeps/mach/hurd/bits/errno.h, (only regenerated for 32-bit SPARC
builds) sysdeps/sparc/sparc32/{sdiv,udiv,rem,urem}.S) - the existing
list may be sufficient to prevent regeneration that actually changes
the file contents depending on the installed build tools, but not to
ensure there is no regeneration at all - and there might well be other
things writing into the source directory in the course of building and
testing (so needing appropriate testing with read-only source
directories with different timestamp orderings to find and eliminate
all such cases).
Tested for x86_64.
[BZ #14121]
* po/Makefile (generated): Add $(ALL_LINGUAS:%=%.mo).
(%.mo): Change to $(objpfx)%.mo. Use $(make-target-directory).
($(mo-installed)): Use $(objpfx)%.mo.
(realclean): Remove rule.
2017-12-15 14:27:20 +00:00
|
|
|
|
$(objpfx)%.mo: %.po
|
|
|
|
|
$(make-target-directory)
|
1996-05-08 03:31:04 +00:00
|
|
|
|
$(MSGFMT) -o $@ $<
|
|
|
|
|
|
1996-09-08 02:07:08 +00:00
|
|
|
|
# Install the message object files as libc.po in the language directory.
|
Do not build .mo files in source directory (bug 14121).
Building and installing glibc leaves .mo files (compiled message
translations) behind in the source directory. Building those files in
the source directory may once have made sense, if they were included
in release tarballs; now that release tarballs are just the output of
"git archive", building any non-checked-in files in the source
directory does not make sense. This patch changes these files to be
built in the build directory instead. The realclean rule is changed
to simply adding the .mo files to the "generated" variable, since once
the files are in the build directory it make no sense to exclude them
from normal cleanup rules.
This is necessary but not sufficient to avoid build-many-glibcs.py
needing to copy the glibc source directory. Its list of files to
touch on checkout to avoid subsequent regeneration (configure,
preconfigure, *-kw.h) is incomplete (missing at least INSTALL,
sysdeps/gnu/errlist.c, posix/testcases.h, posix/ptestcases.h,
locale/C-translit.h, (only regenerated for Hurd builds)
sysdeps/mach/hurd/bits/errno.h, (only regenerated for 32-bit SPARC
builds) sysdeps/sparc/sparc32/{sdiv,udiv,rem,urem}.S) - the existing
list may be sufficient to prevent regeneration that actually changes
the file contents depending on the installed build tools, but not to
ensure there is no regeneration at all - and there might well be other
things writing into the source directory in the course of building and
testing (so needing appropriate testing with read-only source
directories with different timestamp orderings to find and eliminate
all such cases).
Tested for x86_64.
[BZ #14121]
* po/Makefile (generated): Add $(ALL_LINGUAS:%=%.mo).
(%.mo): Change to $(objpfx)%.mo. Use $(make-target-directory).
($(mo-installed)): Use $(objpfx)%.mo.
(realclean): Remove rule.
2017-12-15 14:27:20 +00:00
|
|
|
|
$(mo-installed): $(objpfx)%.mo $(+force); $(do-install) || exit 0
|
1996-05-08 03:31:04 +00:00
|
|
|
|
|
2017-01-20 06:54:46 +00:00
|
|
|
|
# Update translations from the translation project.
|
|
|
|
|
TRANSLATIONS_URL = https://translationproject.org/latest/libc
|
|
|
|
|
WGET = wget
|
|
|
|
|
|
|
|
|
|
update-translations:
|
|
|
|
|
$(WGET) -qO- $(TRANSLATIONS_URL) | sed -n 's|.*href="\([^"]\+po\)".*|\1|p' | \
|
|
|
|
|
while read f; do \
|
2020-01-17 16:36:01 +00:00
|
|
|
|
$(WGET) -O $(objdir)/$$f-tmp2 $(TRANSLATIONS_URL)/$$f && \
|
|
|
|
|
msgmerge --previous --no-wrap $(objdir)/$$f-tmp2 libc.pot > \
|
|
|
|
|
$(objdir)/$$f-tmp && \
|
2020-01-17 17:19:33 +00:00
|
|
|
|
msgattrib --translated --no-fuzzy --no-obsolete --no-wrap \
|
|
|
|
|
$(objdir)/$$f-tmp > $(objdir)/$$f-tmp0 && \
|
|
|
|
|
mv -f $(objdir)/$$f-tmp0 $$f; \
|
2017-01-20 06:54:46 +00:00
|
|
|
|
done
|