summaryrefslogtreecommitdiffstats
path: root/gl/m4/locale-fr.m4
diff options
context:
space:
mode:
Diffstat (limited to 'gl/m4/locale-fr.m4')
-rw-r--r--gl/m4/locale-fr.m443
1 files changed, 23 insertions, 20 deletions
diff --git a/gl/m4/locale-fr.m4 b/gl/m4/locale-fr.m4
index ef199e3..8c41fad 100644
--- a/gl/m4/locale-fr.m4
+++ b/gl/m4/locale-fr.m4
@@ -1,5 +1,5 @@
1# locale-fr.m4 serial 17 1# locale-fr.m4 serial 20
2dnl Copyright (C) 2003, 2005-2013 Free Software Foundation, Inc. 2dnl Copyright (C) 2003, 2005-2023 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 3dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 4dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved. 5dnl with or without modifications, as long as this notice is preserved.
@@ -12,8 +12,7 @@ AC_DEFUN([gt_LOCALE_FR],
12 AC_REQUIRE([AC_CANONICAL_HOST]) 12 AC_REQUIRE([AC_CANONICAL_HOST])
13 AC_REQUIRE([AM_LANGINFO_CODESET]) 13 AC_REQUIRE([AM_LANGINFO_CODESET])
14 AC_CACHE_CHECK([for a traditional french locale], [gt_cv_locale_fr], [ 14 AC_CACHE_CHECK([for a traditional french locale], [gt_cv_locale_fr], [
15 AC_LANG_CONFTEST([AC_LANG_SOURCE([ 15 AC_LANG_CONFTEST([AC_LANG_SOURCE([[
16changequote(,)dnl
17#include <locale.h> 16#include <locale.h>
18#include <time.h> 17#include <time.h>
19#if HAVE_LANGINFO_CODESET 18#if HAVE_LANGINFO_CODESET
@@ -24,8 +23,14 @@ changequote(,)dnl
24struct tm t; 23struct tm t;
25char buf[16]; 24char buf[16];
26int main () { 25int main () {
26 /* On BeOS and Haiku, locales are not implemented in libc. Rather, libintl
27 imitates locale dependent behaviour by looking at the environment
28 variables, and all locales use the UTF-8 encoding. */
29#if defined __BEOS__ || defined __HAIKU__
30 return 1;
31#else
27 /* Check whether the given locale name is recognized by the system. */ 32 /* Check whether the given locale name is recognized by the system. */
28#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ 33# if defined _WIN32 && !defined __CYGWIN__
29 /* On native Windows, setlocale(category, "") looks at the system settings, 34 /* On native Windows, setlocale(category, "") looks at the system settings,
30 not at the environment variables. Also, when an encoding suffix such 35 not at the environment variables. Also, when an encoding suffix such
31 as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE 36 as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE
@@ -33,9 +38,9 @@ int main () {
33 if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL 38 if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL
34 || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) 39 || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0)
35 return 1; 40 return 1;
36#else 41# else
37 if (setlocale (LC_ALL, "") == NULL) return 1; 42 if (setlocale (LC_ALL, "") == NULL) return 1;
38#endif 43# endif
39 /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". 44 /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646".
40 On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) 45 On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET)
41 is empty, and the behaviour of Tcl 8.4 in this locale is not useful. 46 is empty, and the behaviour of Tcl 8.4 in this locale is not useful.
@@ -44,35 +49,35 @@ int main () {
44 some unit tests fail. 49 some unit tests fail.
45 On MirBSD 10, when an unsupported locale is specified, setlocale() 50 On MirBSD 10, when an unsupported locale is specified, setlocale()
46 succeeds but then nl_langinfo(CODESET) is "UTF-8". */ 51 succeeds but then nl_langinfo(CODESET) is "UTF-8". */
47#if HAVE_LANGINFO_CODESET 52# if HAVE_LANGINFO_CODESET
48 { 53 {
49 const char *cs = nl_langinfo (CODESET); 54 const char *cs = nl_langinfo (CODESET);
50 if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0 55 if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0
51 || strcmp (cs, "UTF-8") == 0) 56 || strcmp (cs, "UTF-8") == 0)
52 return 1; 57 return 1;
53 } 58 }
54#endif 59# endif
55#ifdef __CYGWIN__ 60# ifdef __CYGWIN__
56 /* On Cygwin, avoid locale names without encoding suffix, because the 61 /* On Cygwin, avoid locale names without encoding suffix, because the
57 locale_charset() function relies on the encoding suffix. Note that 62 locale_charset() function relies on the encoding suffix. Note that
58 LC_ALL is set on the command line. */ 63 LC_ALL is set on the command line. */
59 if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; 64 if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1;
60#endif 65# endif
61 /* Check whether in the abbreviation of the second month, the second 66 /* Check whether in the abbreviation of the second month, the second
62 character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is only 67 character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is only
63 one byte long. This excludes the UTF-8 encoding. */ 68 one byte long. This excludes the UTF-8 encoding. */
64 t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; 69 t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4;
65 if (strftime (buf, sizeof (buf), "%b", &t) < 3 || buf[2] != 'v') return 1; 70 if (strftime (buf, sizeof (buf), "%b", &t) < 3 || buf[2] != 'v') return 1;
66#if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy. */ 71# if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy. */
67 /* Check whether the decimal separator is a comma. 72 /* Check whether the decimal separator is a comma.
68 On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point 73 On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point
69 are nl_langinfo(RADIXCHAR) are both ".". */ 74 are nl_langinfo(RADIXCHAR) are both ".". */
70 if (localeconv () ->decimal_point[0] != ',') return 1; 75 if (localeconv () ->decimal_point[0] != ',') return 1;
71#endif 76# endif
72 return 0; 77 return 0;
78#endif
73} 79}
74changequote([,])dnl 80 ]])])
75 ])])
76 if AC_TRY_EVAL([ac_link]) && test -s conftest$ac_exeext; then 81 if AC_TRY_EVAL([ac_link]) && test -s conftest$ac_exeext; then
77 case "$host_os" in 82 case "$host_os" in
78 # Handle native Windows specially, because there setlocale() interprets 83 # Handle native Windows specially, because there setlocale() interprets
@@ -136,8 +141,7 @@ AC_DEFUN([gt_LOCALE_FR_UTF8],
136[ 141[
137 AC_REQUIRE([AM_LANGINFO_CODESET]) 142 AC_REQUIRE([AM_LANGINFO_CODESET])
138 AC_CACHE_CHECK([for a french Unicode locale], [gt_cv_locale_fr_utf8], [ 143 AC_CACHE_CHECK([for a french Unicode locale], [gt_cv_locale_fr_utf8], [
139 AC_LANG_CONFTEST([AC_LANG_SOURCE([ 144 AC_LANG_CONFTEST([AC_LANG_SOURCE([[
140changequote(,)dnl
141#include <locale.h> 145#include <locale.h>
142#include <time.h> 146#include <time.h>
143#if HAVE_LANGINFO_CODESET 147#if HAVE_LANGINFO_CODESET
@@ -153,7 +157,7 @@ int main () {
153 variables, and all locales use the UTF-8 encoding. */ 157 variables, and all locales use the UTF-8 encoding. */
154#if !(defined __BEOS__ || defined __HAIKU__) 158#if !(defined __BEOS__ || defined __HAIKU__)
155 /* Check whether the given locale name is recognized by the system. */ 159 /* Check whether the given locale name is recognized by the system. */
156# if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ 160# if defined _WIN32 && !defined __CYGWIN__
157 /* On native Windows, setlocale(category, "") looks at the system settings, 161 /* On native Windows, setlocale(category, "") looks at the system settings,
158 not at the environment variables. Also, when an encoding suffix such 162 not at the environment variables. Also, when an encoding suffix such
159 as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE 163 as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE
@@ -199,8 +203,7 @@ int main () {
199#endif 203#endif
200 return 0; 204 return 0;
201} 205}
202changequote([,])dnl 206 ]])])
203 ])])
204 if AC_TRY_EVAL([ac_link]) && test -s conftest$ac_exeext; then 207 if AC_TRY_EVAL([ac_link]) && test -s conftest$ac_exeext; then
205 case "$host_os" in 208 case "$host_os" in
206 # Handle native Windows specially, because there setlocale() interprets 209 # Handle native Windows specially, because there setlocale() interprets