$prefix/share/locale/*/LC_MESSAGES/gettext-runtime.mo
$prefix/lib/libintl.* (not installed on glibc and Solaris 11 systems)
- $prefix/share/locale/locale.alias (not installed on glibc and Solaris 11 systems)
$prefix/include/libintl.h (not installed on glibc and Solaris 11 systems)
$prefix/share/man/man3/*
$prefix/share/doc/gettext/*.3.html
# -DBUILDING_DLL: Change expansion of RELOCATABLE_DLL_EXPORTED macro.
AM_CPPFLAGS = \
-Ignulib-lib -I$(srcdir)/gnulib-lib \
- -DLOCALEDIR=$(localedir_c_make) -DLOCALE_ALIAS_PATH=\"$(aliaspath)\" \
+ -DLOCALEDIR=$(localedir_c_make) \
-DLIBDIR=\"$(libdir)\" -DBUILDING_LIBINTL
if WOE32
endif
-# Installation of locale.alias.
-
-EXTRA_DIST += locale.alias ref-add.sin ref-del.sin
-
-if USE_INCLUDED_LIBINTL
-
-all-local: ref-add.sed ref-del.sed
-
-ref-add.sed: $(srcdir)/ref-add.sin
- sed -e '/^#/d' -e 's/@''PACKAGE''@/@PACKAGE@/g' $(srcdir)/ref-add.sin > t-ref-add.sed
- mv t-ref-add.sed ref-add.sed
-MOSTLYCLEANFILES += ref-add.sed
-
-ref-del.sed: $(srcdir)/ref-del.sin
- sed -e '/^#/d' -e 's/@''PACKAGE''@/@PACKAGE@/g' $(srcdir)/ref-del.sin > t-ref-del.sed
- mv t-ref-del.sed ref-del.sed
-MOSTLYCLEANFILES += ref-del.sed
-
-install-data-local: install-data-aliasfile
-install-data-aliasfile: ref-add.sed
- $(mkdir_p) $(DESTDIR)$(localedir)
- test -f $(DESTDIR)$(localedir)/locale.alias \
- && orig=$(DESTDIR)$(localedir)/locale.alias \
- || orig=$(srcdir)/locale.alias; \
- temp=$(DESTDIR)$(localedir)/t-locale.alias; \
- dest=$(DESTDIR)$(localedir)/locale.alias; \
- sed -f ref-add.sed $$orig > $$temp; \
- $(INSTALL_DATA) $$temp $$dest; \
- rm -f $$temp
-
-installdirs-local: installdirs-aliasfile
-installdirs-aliasfile:
- $(mkdir_p) $(DESTDIR)$(localedir)
-
-uninstall-local: uninstall-aliasfile
-uninstall-aliasfile: ref-del.sed
- if test -f $(DESTDIR)$(localedir)/locale.alias; then \
- temp=$(DESTDIR)$(localedir)/t-locale.alias; \
- dest=$(DESTDIR)$(localedir)/locale.alias; \
- sed -f ref-del.sed $$dest > $$temp; \
- if grep '^# Packages using this file: $$' $$temp > /dev/null; then \
- rm -f $$dest; \
- else \
- $(INSTALL_DATA) $$temp $$dest; \
- fi; \
- rm -f $$temp; \
- fi
-
-endif
-
-
# Allow users to use "gnulib-tool --update".
EXTRA_DIST += gnulib-m4/gnulib-cache.m4
+++ /dev/null
-# Locale name alias data base.
-# Copyright (C) 1996-2001, 2003, 2007, 2015 Free Software Foundation,
-# Inc.
-#
-# This program is free software: you can redistribute it and/or 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.
-#
-# This program 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 Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public License
-# along with this program. If not, see <https://www.gnu.org/licenses/>.
-
-# The format of this file is the same as for the corresponding file of
-# the X Window System, which normally can be found in
-# /usr/lib/X11/locale/locale.alias
-# A single line contains two fields: an alias and a substitution value.
-# All entries are case independent.
-
-# Note: This file is obsolete and is kept around for the time being for
-# backward compatibility. Nobody should rely on the names defined here.
-# Locales should always be specified by their full name.
-
-# Note: This file used to contain the following lines:
-# bokmaal nb_NO.ISO-8859-1
-# franc,ais fr_FR.ISO-8859-1
-# except that the "aa" was actually the byte '\0xE5' (the Latin-1
-# encoding for U+00E5 LATIN SMALL LETTER A WITH RING ABOVE) and the
-# "c," was actually the byte '\xE7' (the Latin-1 encoding for U+00E7
-# LATIN SMALL LETTER C WITH CEDILLA). These lines were removed
-# because they caused 'locale -a' to output text encoded in Latin-1,
-# which broke applications in UTF-8 locales. See:
-# https://sourceware.org/bugzilla/show_bug.cgi?id=18412
-
-# Packages using this file:
-
-bokmal nb_NO.ISO-8859-1
-catalan ca_ES.ISO-8859-1
-croatian hr_HR.ISO-8859-2
-czech cs_CZ.ISO-8859-2
-danish da_DK.ISO-8859-1
-dansk da_DK.ISO-8859-1
-deutsch de_DE.ISO-8859-1
-dutch nl_NL.ISO-8859-1
-eesti et_EE.ISO-8859-1
-estonian et_EE.ISO-8859-1
-finnish fi_FI.ISO-8859-1
-french fr_FR.ISO-8859-1
-galego gl_ES.ISO-8859-1
-galician gl_ES.ISO-8859-1
-german de_DE.ISO-8859-1
-greek el_GR.ISO-8859-7
-hebrew he_IL.ISO-8859-8
-hrvatski hr_HR.ISO-8859-2
-hungarian hu_HU.ISO-8859-2
-icelandic is_IS.ISO-8859-1
-italian it_IT.ISO-8859-1
-japanese ja_JP.eucJP
-japanese.euc ja_JP.eucJP
-ja_JP ja_JP.eucJP
-ja_JP.ujis ja_JP.eucJP
-japanese.sjis ja_JP.SJIS
-korean ko_KR.eucKR
-korean.euc ko_KR.eucKR
-ko_KR ko_KR.eucKR
-lithuanian lt_LT.ISO-8859-13
-no_NO nb_NO.ISO-8859-1
-no_NO.ISO-8859-1 nb_NO.ISO-8859-1
-norwegian nb_NO.ISO-8859-1
-nynorsk nn_NO.ISO-8859-1
-polish pl_PL.ISO-8859-2
-portuguese pt_PT.ISO-8859-1
-romanian ro_RO.ISO-8859-2
-russian ru_RU.ISO-8859-5
-slovak sk_SK.ISO-8859-2
-slovene sl_SI.ISO-8859-2
-slovenian sl_SI.ISO-8859-2
-spanish es_ES.ISO-8859-1
-swedish sv_SE.ISO-8859-1
-thai th_TH.TIS-620
-turkish tr_TR.ISO-8859-9
#include "gettextP.h"
-#ifdef ENABLE_RELOCATABLE
-# include "relocatable.h"
-#else
-# define relocate(pathname) (pathname)
-# define relocate2(pathname,allocatedp) (*(allocatedp) = NULL, (pathname))
-#endif
-
/* @@ end of prolog @@ */
#ifdef _LIBC
#endif
+/* We do the alias processing only on systems with glibc, because
+ - Its purpose (described above) is to let the user use locale names
+ that are not directly supported by libc, during transition periods.
+ - On systems without glibc, the use of these locale names would be
+ limited to the LC_MESSAGES and LANGUAGE environment variables,
+ because these systems don't use any alias file during setlocale().
+ This makes no sense: It would make the locale handling inconsistent
+ and users would still need to adjust their scripts when a locale
+ name supported by the system has changed. */
+
+#if defined _LIBC || __GLIBC__ >= 2
+
+# ifndef LOCALE_ALIAS_PATH
+# define LOCALE_ALIAS_PATH "/usr/share/locale"
+# endif
+
__libc_lock_define_initialized (static, lock)
};
-#ifndef _LIBC
-# define libc_freeres_ptr(decl) decl
-#endif
+# ifndef _LIBC
+# define libc_freeres_ptr(decl) decl
+# endif
libc_freeres_ptr (static char *string_space);
static size_t string_space_act;
static int alias_compare (const struct alias_map *map1,
const struct alias_map *map2);
+#endif
+
const char *
_nl_expand_alias (const char *name)
{
+ const char *result = NULL;
+
+#if defined _LIBC || __GLIBC__ >= 2
static const char *locale_alias_path;
struct alias_map *retval;
- const char *result = NULL;
size_t added;
__libc_lock_lock (lock);
while (added != 0);
__libc_lock_unlock (lock);
+#endif
return result;
}
+#if defined _LIBC || __GLIBC__ >= 2
+
/* Silence a bogus GCC warning.
<https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109990> */
-#if __GNUC__ >= 12
-# pragma GCC diagnostic ignored "-Wuse-after-free"
-#endif
+# if __GNUC__ >= 12
+# pragma GCC diagnostic ignored "-Wuse-after-free"
+# endif
static size_t
internal_function
{
FILE *fp;
char *full_fname;
- char *malloc_full_fname;
size_t added;
static const char aliasfile[] = "/locale.alias";
full_fname = (char *) alloca (fname_len + sizeof aliasfile);
-#ifdef HAVE_MEMPCPY
mempcpy (mempcpy (full_fname, fname, fname_len),
aliasfile, sizeof aliasfile);
-#else
- memcpy (full_fname, fname, fname_len);
- memcpy (&full_fname[fname_len], aliasfile, sizeof aliasfile);
-#endif
-#ifdef _LIBC
+# ifdef _LIBC
/* Note the file is opened with cancellation in the I/O functions
disabled. */
- fp = fopen (relocate2 (full_fname, &malloc_full_fname), "rce");
-#else
- fp = fopen (relocate2 (full_fname, &malloc_full_fname), "r");
-#endif
- free (malloc_full_fname);
+ fp = fopen (full_fname, "rce");
+# else
+ fp = fopen (full_fname, "r");
+# endif
freea (full_fname);
if (fp == NULL)
return 0;
-#ifdef HAVE___FSETLOCKING
+# ifdef HAVE___FSETLOCKING
/* No threads present. */
__fsetlocking (fp, FSETLOCKING_BYCALLER);
-#endif
+# endif
added = 0;
while (!FEOF (fp))
else if (cp[0] != '\0')
*cp++ = '\0';
-#ifdef IN_LIBGLOCALE
+# ifdef IN_LIBGLOCALE
/* glibc's locale.alias contains entries for ja_JP and ko_KR
that make it impossible to use a Japanese or Korean UTF-8
locale under the name "ja_JP" or "ko_KR". Ignore these
entries. */
if (strchr (alias, '_') == NULL)
-#endif
+# endif
{
size_t alias_len;
size_t value_len;
static int
alias_compare (const struct alias_map *map1, const struct alias_map *map2)
{
-#if defined _LIBC || defined HAVE_STRCASECMP
return strcasecmp (map1->alias, map2->alias);
-#else
- const unsigned char *p1 = (const unsigned char *) map1->alias;
- const unsigned char *p2 = (const unsigned char *) map2->alias;
- unsigned char c1, c2;
-
- if (p1 == p2)
- return 0;
-
- do
- {
- /* I know this seems to be odd but the tolower() function in
- some systems libc cannot handle nonalpha characters. */
- c1 = isupper (*p1) ? tolower (*p1) : *p1;
- c2 = isupper (*p2) ? tolower (*p2) : *p2;
- if (c1 == '\0')
- break;
- ++p1;
- ++p2;
- }
- while (c1 == c2);
+}
- return c1 - c2;
#endif
-}
+++ /dev/null
-# Add this package to a list of references stored in a text file.
-#
-# Copyright (C) 2000 Free Software Foundation, Inc.
-#
-# This program is free software: you can redistribute it and/or 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.
-#
-# This program 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 Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public License
-# along with this program. If not, see <https://www.gnu.org/licenses/>.
-#
-# Written by Bruno Haible <haible@clisp.cons.org>.
-#
-/^# Packages using this file: / {
- s/# Packages using this file://
- ta
- :a
- s/ @PACKAGE@ / @PACKAGE@ /
- tb
- s/ $/ @PACKAGE@ /
- :b
- s/^/# Packages using this file:/
-}
+++ /dev/null
-# Remove this package from a list of references stored in a text file.
-#
-# Copyright (C) 2000 Free Software Foundation, Inc.
-#
-# This program is free software: you can redistribute it and/or 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.
-#
-# This program 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 Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public License
-# along with this program. If not, see <https://www.gnu.org/licenses/>.
-#
-# Written by Bruno Haible <haible@clisp.cons.org>.
-#
-/^# Packages using this file: / {
- s/# Packages using this file://
- s/ @PACKAGE@ / /
- s/^/# Packages using this file:/
-}
EXTRA_DIST += FILES project-id
-aliaspath = $(localedir)
jardir = $(datadir)/gettext
pkgdatadir = $(datadir)/gettext
projectsdir = $(pkgdatadir)/projects
-I../../gettext-runtime/intl -I$(top_srcdir)/../gettext-runtime/intl
DEFS = \
-DLOCALEDIR=$(localedir_c_make) -DBISON_LOCALEDIR=\"$(BISON_LOCALEDIR)\" \
- -DLOCALE_ALIAS_PATH=\"$(aliaspath)\" \
-DUSEJAVA=$(USEJAVA) \
-DGETTEXTJAR=\"$(jardir)/gettext.jar\" \
-DLIBDIR=\"$(libdir)\" \