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.m4159
1 files changed, 106 insertions, 53 deletions
diff --git a/gl/m4/locale-fr.m4 b/gl/m4/locale-fr.m4
index 8c41fadf..f504d5b5 100644
--- a/gl/m4/locale-fr.m4
+++ b/gl/m4/locale-fr.m4
@@ -1,13 +1,15 @@
1# locale-fr.m4 serial 20 1# locale-fr.m4
2dnl Copyright (C) 2003, 2005-2023 Free Software Foundation, Inc. 2# serial 24
3dnl Copyright (C) 2003, 2005-2025 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 4dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 5dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved. 6dnl with or without modifications, as long as this notice is preserved.
7dnl This file is offered as-is, without any warranty.
6 8
7dnl From Bruno Haible. 9dnl From Bruno Haible.
8 10
9dnl Determine the name of a french locale with traditional encoding. 11dnl Determine the name of a french locale with traditional encoding.
10AC_DEFUN([gt_LOCALE_FR], 12AC_DEFUN_ONCE([gt_LOCALE_FR],
11[ 13[
12 AC_REQUIRE([AC_CANONICAL_HOST]) 14 AC_REQUIRE([AC_CANONICAL_HOST])
13 AC_REQUIRE([AM_LANGINFO_CODESET]) 15 AC_REQUIRE([AM_LANGINFO_CODESET])
@@ -70,8 +72,9 @@ int main () {
70 if (strftime (buf, sizeof (buf), "%b", &t) < 3 || buf[2] != 'v') return 1; 72 if (strftime (buf, sizeof (buf), "%b", &t) < 3 || buf[2] != 'v') return 1;
71# if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy. */ 73# if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy. */
72 /* Check whether the decimal separator is a comma. 74 /* Check whether the decimal separator is a comma.
73 On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point 75 On NetBSD 3.0 in the fr_FR.ISO8859-1 locale
74 are nl_langinfo(RADIXCHAR) are both ".". */ 76 and on Haiku in the fr_FR.UTF-8 locale,
77 localeconv()->decimal_point are nl_langinfo(RADIXCHAR) are both ".". */
75 if (localeconv () ->decimal_point[0] != ',') return 1; 78 if (localeconv () ->decimal_point[0] != ',') return 1;
76# endif 79# endif
77 return 0; 80 return 0;
@@ -81,12 +84,13 @@ int main () {
81 if AC_TRY_EVAL([ac_link]) && test -s conftest$ac_exeext; then 84 if AC_TRY_EVAL([ac_link]) && test -s conftest$ac_exeext; then
82 case "$host_os" in 85 case "$host_os" in
83 # Handle native Windows specially, because there setlocale() interprets 86 # Handle native Windows specially, because there setlocale() interprets
84 # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", 87 # "ar" or "ara" as "Arabic" or "Arabic_Saudi Arabia.1256",
88 # "en" or "eng" as "English" or "English_United States.1252",
85 # "fr" or "fra" as "French" or "French_France.1252", 89 # "fr" or "fra" as "French" or "French_France.1252",
86 # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", 90 # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252",
87 # "ja" as "Japanese" or "Japanese_Japan.932", 91 # "ja" or "jpn" as "Japanese" or "Japanese_Japan.932",
88 # and similar. 92 # and similar.
89 mingw*) 93 mingw* | windows*)
90 # Test for the native Windows locale name. 94 # Test for the native Windows locale name.
91 if (LC_ALL=French_France.1252 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then 95 if (LC_ALL=French_France.1252 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
92 gt_cv_locale_fr=French_France.1252 96 gt_cv_locale_fr=French_France.1252
@@ -116,7 +120,7 @@ int main () {
116 if (LC_ALL=fr_FR.iso88591 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then 120 if (LC_ALL=fr_FR.iso88591 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
117 gt_cv_locale_fr=fr_FR.iso88591 121 gt_cv_locale_fr=fr_FR.iso88591
118 else 122 else
119 # Test for the Solaris 7 locale name. 123 # Test for the Solaris 10 locale name.
120 if (LC_ALL=fr LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then 124 if (LC_ALL=fr LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
121 gt_cv_locale_fr=fr 125 gt_cv_locale_fr=fr
122 else 126 else
@@ -133,15 +137,31 @@ int main () {
133 rm -fr conftest* 137 rm -fr conftest*
134 ]) 138 ])
135 LOCALE_FR=$gt_cv_locale_fr 139 LOCALE_FR=$gt_cv_locale_fr
140 case $LOCALE_FR in #(
141 '' | *[[[:space:]\"\$\'*@<:@]]*)
142 dnl This locale name might cause trouble with sh or make.
143 AC_MSG_WARN([invalid locale "$LOCALE_FR"; assuming "none"])
144 LOCALE_FR=none;;
145 esac
136 AC_SUBST([LOCALE_FR]) 146 AC_SUBST([LOCALE_FR])
137]) 147])
138 148
139dnl Determine the name of a french locale with UTF-8 encoding. 149dnl Determine the name of a french locale with UTF-8 encoding.
140AC_DEFUN([gt_LOCALE_FR_UTF8], 150AC_DEFUN_ONCE([gt_LOCALE_FR_UTF8],
141[ 151[
152 AC_REQUIRE([AC_CANONICAL_HOST])
142 AC_REQUIRE([AM_LANGINFO_CODESET]) 153 AC_REQUIRE([AM_LANGINFO_CODESET])
143 AC_CACHE_CHECK([for a french Unicode locale], [gt_cv_locale_fr_utf8], [ 154 AC_CACHE_CHECK([for a french Unicode locale], [gt_cv_locale_fr_utf8], [
144 AC_LANG_CONFTEST([AC_LANG_SOURCE([[ 155 case "$host_os" in
156 *-musl* | midipix*)
157 dnl On musl libc, all kinds of ll_CC.UTF-8 locales exist, even without
158 dnl any locale file on disk. But they are effectively equivalent to the
159 dnl C.UTF-8 locale, except for locale categories (such as LC_MESSSAGES)
160 dnl for which localizations (.mo files) have been installed.
161 gt_cv_locale_fr_utf8=fr_FR.UTF-8
162 ;;
163 *)
164 AC_LANG_CONFTEST([AC_LANG_SOURCE([[
145#include <locale.h> 165#include <locale.h>
146#include <time.h> 166#include <time.h>
147#if HAVE_LANGINFO_CODESET 167#if HAVE_LANGINFO_CODESET
@@ -197,57 +217,90 @@ int main () {
197#endif 217#endif
198#if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy. */ 218#if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy. */
199 /* Check whether the decimal separator is a comma. 219 /* Check whether the decimal separator is a comma.
200 On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point 220 On NetBSD 3.0 in the fr_FR.ISO8859-1 locale
201 are nl_langinfo(RADIXCHAR) are both ".". */ 221 and on Haiku in the fr_FR.UTF-8 locale,
222 localeconv()->decimal_point are nl_langinfo(RADIXCHAR) are both ".". */
202 if (localeconv () ->decimal_point[0] != ',') return 1; 223 if (localeconv () ->decimal_point[0] != ',') return 1;
203#endif 224#endif
204 return 0; 225 return 0;
205} 226}
206 ]])]) 227 ]])])
207 if AC_TRY_EVAL([ac_link]) && test -s conftest$ac_exeext; then 228 if AC_TRY_EVAL([ac_link]) && test -s conftest$ac_exeext; then
208 case "$host_os" in 229 case "$host_os" in
209 # Handle native Windows specially, because there setlocale() interprets 230 # Handle native Windows specially, because there setlocale() interprets
210 # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", 231 # "ar" or "ara" as "Arabic" or "Arabic_Saudi Arabia.1256",
211 # "fr" or "fra" as "French" or "French_France.1252", 232 # "en" or "eng" as "English" or "English_United States.1252",
212 # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", 233 # "fr" or "fra" as "French" or "French_France.1252",
213 # "ja" as "Japanese" or "Japanese_Japan.932", 234 # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252",
214 # and similar. 235 # "ja" or "jpn" as "Japanese" or "Japanese_Japan.932",
215 mingw*) 236 # and similar.
216 # Test for the hypothetical native Windows locale name. 237 mingw* | windows*)
217 if (LC_ALL=French_France.65001 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then 238 # Test for the hypothetical native Windows locale name.
218 gt_cv_locale_fr_utf8=French_France.65001 239 if (LC_ALL=French_France.65001 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
219 else 240 gt_cv_locale_fr_utf8=French_France.65001
220 # None found.
221 gt_cv_locale_fr_utf8=none
222 fi
223 ;;
224 *)
225 # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
226 # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the
227 # configure script would override the LC_ALL setting. Likewise for
228 # LC_CTYPE, which is also set at the beginning of the configure script.
229 # Test for the usual locale name.
230 if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
231 gt_cv_locale_fr_utf8=fr_FR
232 else
233 # Test for the locale name with explicit encoding suffix.
234 if (LC_ALL=fr_FR.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
235 gt_cv_locale_fr_utf8=fr_FR.UTF-8
236 else
237 # Test for the Solaris 7 locale name.
238 if (LC_ALL=fr.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
239 gt_cv_locale_fr_utf8=fr.UTF-8
240 else 241 else
241 # None found. 242 # None found.
242 gt_cv_locale_fr_utf8=none 243 gt_cv_locale_fr_utf8=none
243 fi 244 fi
244 fi 245 ;;
245 fi 246 *)
246 ;; 247 # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
247 esac 248 # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the
248 fi 249 # configure script would override the LC_ALL setting. Likewise for
249 rm -fr conftest* 250 # LC_CTYPE, which is also set at the beginning of the configure script.
251 # Test for the usual locale name.
252 if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
253 gt_cv_locale_fr_utf8=fr_FR
254 else
255 # Test for the locale name with explicit encoding suffix.
256 if (LC_ALL=fr_FR.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
257 gt_cv_locale_fr_utf8=fr_FR.UTF-8
258 else
259 # Test for the Solaris 10 locale name.
260 if (LC_ALL=fr.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
261 gt_cv_locale_fr_utf8=fr.UTF-8
262 else
263 # None found.
264 gt_cv_locale_fr_utf8=none
265 fi
266 fi
267 fi
268 ;;
269 esac
270 fi
271 rm -fr conftest*
272 ;;
273 esac
250 ]) 274 ])
251 LOCALE_FR_UTF8=$gt_cv_locale_fr_utf8 275 LOCALE_FR_UTF8=$gt_cv_locale_fr_utf8
276 case $LOCALE_FR_UTF8 in #(
277 '' | *[[[:space:]\"\$\'*@<:@]]*)
278 dnl This locale name might cause trouble with sh or make.
279 AC_MSG_WARN([invalid locale "$LOCALE_FR_UTF8"; assuming "none"])
280 LOCALE_FR_UTF8=none;;
281 esac
252 AC_SUBST([LOCALE_FR_UTF8]) 282 AC_SUBST([LOCALE_FR_UTF8])
283
284 dnl Users of $LOCALE_FR_UTF8 need to know which of the locale categories they
285 dnl can rely on.
286 case "$host_os" in
287 *-musl* | midipix*)
288 dnl On musl libc, locale categories other than LC_CTYPE and LC_MESSAGES
289 dnl are effectively unimplemented.
290 LC_COLLATE_IMPLEMENTED=false
291 LC_NUMERIC_IMPLEMENTED=false
292 LC_TIME_IMPLEMENTED=false
293 LC_MONETARY_IMPLEMENTED=false
294 ;;
295 *)
296 LC_COLLATE_IMPLEMENTED=true
297 LC_NUMERIC_IMPLEMENTED=true
298 LC_TIME_IMPLEMENTED=true
299 LC_MONETARY_IMPLEMENTED=true
300 ;;
301 esac
302 AC_SUBST([LC_COLLATE_IMPLEMENTED])
303 AC_SUBST([LC_NUMERIC_IMPLEMENTED])
304 AC_SUBST([LC_TIME_IMPLEMENTED])
305 AC_SUBST([LC_MONETARY_IMPLEMENTED])
253]) 306])