summaryrefslogtreecommitdiffstats
path: root/gl/m4/locale-fr.m4
diff options
context:
space:
mode:
authorLorenz Kästle <12514511+RincewindsHat@users.noreply.github.com>2024-10-31 15:27:12 (GMT)
committerLorenz Kästle <12514511+RincewindsHat@users.noreply.github.com>2024-10-31 15:27:12 (GMT)
commit5be04ec2ceb1df77afbca4fcbf9e92a712612d6f (patch)
tree2b2e1c71dffae827c8e45cd4cccc375093d03486 /gl/m4/locale-fr.m4
parent6d1d1dac32841d5ca6ee51bb09b30a6c604b17e2 (diff)
downloadmonitoring-plugins-5be04ec2ceb1df77afbca4fcbf9e92a712612d6f.tar.gz
Sync with the latest Gnulib code (d4ec02b3cc)refs/pull/2037/head
Diffstat (limited to 'gl/m4/locale-fr.m4')
-rw-r--r--gl/m4/locale-fr.m4142
1 files changed, 95 insertions, 47 deletions
diff --git a/gl/m4/locale-fr.m4 b/gl/m4/locale-fr.m4
index 8c41fad..f8d7c54 100644
--- a/gl/m4/locale-fr.m4
+++ b/gl/m4/locale-fr.m4
@@ -1,5 +1,6 @@
1# locale-fr.m4 serial 20 1# locale-fr.m4
2dnl Copyright (C) 2003, 2005-2023 Free Software Foundation, Inc. 2# serial 23
3dnl Copyright (C) 2003, 2005-2024 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.
@@ -7,7 +8,7 @@ dnl with or without modifications, as long as this notice is preserved.
7dnl From Bruno Haible. 8dnl From Bruno Haible.
8 9
9dnl Determine the name of a french locale with traditional encoding. 10dnl Determine the name of a french locale with traditional encoding.
10AC_DEFUN([gt_LOCALE_FR], 11AC_DEFUN_ONCE([gt_LOCALE_FR],
11[ 12[
12 AC_REQUIRE([AC_CANONICAL_HOST]) 13 AC_REQUIRE([AC_CANONICAL_HOST])
13 AC_REQUIRE([AM_LANGINFO_CODESET]) 14 AC_REQUIRE([AM_LANGINFO_CODESET])
@@ -86,7 +87,7 @@ int main () {
86 # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", 87 # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252",
87 # "ja" as "Japanese" or "Japanese_Japan.932", 88 # "ja" as "Japanese" or "Japanese_Japan.932",
88 # and similar. 89 # and similar.
89 mingw*) 90 mingw* | windows*)
90 # Test for the native Windows locale name. 91 # Test for the native Windows locale name.
91 if (LC_ALL=French_France.1252 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then 92 if (LC_ALL=French_France.1252 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
92 gt_cv_locale_fr=French_France.1252 93 gt_cv_locale_fr=French_France.1252
@@ -116,7 +117,7 @@ int main () {
116 if (LC_ALL=fr_FR.iso88591 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then 117 if (LC_ALL=fr_FR.iso88591 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
117 gt_cv_locale_fr=fr_FR.iso88591 118 gt_cv_locale_fr=fr_FR.iso88591
118 else 119 else
119 # Test for the Solaris 7 locale name. 120 # Test for the Solaris 10 locale name.
120 if (LC_ALL=fr LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then 121 if (LC_ALL=fr LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
121 gt_cv_locale_fr=fr 122 gt_cv_locale_fr=fr
122 else 123 else
@@ -133,15 +134,31 @@ int main () {
133 rm -fr conftest* 134 rm -fr conftest*
134 ]) 135 ])
135 LOCALE_FR=$gt_cv_locale_fr 136 LOCALE_FR=$gt_cv_locale_fr
137 case $LOCALE_FR in #(
138 '' | *[[[:space:]\"\$\'*@<:@]]*)
139 dnl This locale name might cause trouble with sh or make.
140 AC_MSG_WARN([invalid locale "$LOCALE_FR"; assuming "none"])
141 LOCALE_FR=none;;
142 esac
136 AC_SUBST([LOCALE_FR]) 143 AC_SUBST([LOCALE_FR])
137]) 144])
138 145
139dnl Determine the name of a french locale with UTF-8 encoding. 146dnl Determine the name of a french locale with UTF-8 encoding.
140AC_DEFUN([gt_LOCALE_FR_UTF8], 147AC_DEFUN_ONCE([gt_LOCALE_FR_UTF8],
141[ 148[
149 AC_REQUIRE([AC_CANONICAL_HOST])
142 AC_REQUIRE([AM_LANGINFO_CODESET]) 150 AC_REQUIRE([AM_LANGINFO_CODESET])
143 AC_CACHE_CHECK([for a french Unicode locale], [gt_cv_locale_fr_utf8], [ 151 AC_CACHE_CHECK([for a french Unicode locale], [gt_cv_locale_fr_utf8], [
144 AC_LANG_CONFTEST([AC_LANG_SOURCE([[ 152 case "$host_os" in
153 *-musl* | midipix*)
154 dnl On musl libc, all kinds of ll_CC.UTF-8 locales exist, even without
155 dnl any locale file on disk. But they are effectively equivalent to the
156 dnl C.UTF-8 locale, except for locale categories (such as LC_MESSSAGES)
157 dnl for which localizations (.mo files) have been installed.
158 gt_cv_locale_fr_utf8=fr_FR.UTF-8
159 ;;
160 *)
161 AC_LANG_CONFTEST([AC_LANG_SOURCE([[
145#include <locale.h> 162#include <locale.h>
146#include <time.h> 163#include <time.h>
147#if HAVE_LANGINFO_CODESET 164#if HAVE_LANGINFO_CODESET
@@ -203,51 +220,82 @@ int main () {
203#endif 220#endif
204 return 0; 221 return 0;
205} 222}
206 ]])]) 223 ]])])
207 if AC_TRY_EVAL([ac_link]) && test -s conftest$ac_exeext; then 224 if AC_TRY_EVAL([ac_link]) && test -s conftest$ac_exeext; then
208 case "$host_os" in 225 case "$host_os" in
209 # Handle native Windows specially, because there setlocale() interprets 226 # Handle native Windows specially, because there setlocale() interprets
210 # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", 227 # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256",
211 # "fr" or "fra" as "French" or "French_France.1252", 228 # "fr" or "fra" as "French" or "French_France.1252",
212 # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", 229 # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252",
213 # "ja" as "Japanese" or "Japanese_Japan.932", 230 # "ja" as "Japanese" or "Japanese_Japan.932",
214 # and similar. 231 # and similar.
215 mingw*) 232 mingw* | windows*)
216 # Test for the hypothetical native Windows locale name. 233 # Test for the hypothetical native Windows locale name.
217 if (LC_ALL=French_France.65001 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then 234 if (LC_ALL=French_France.65001 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
218 gt_cv_locale_fr_utf8=French_France.65001 235 gt_cv_locale_fr_utf8=French_France.65001
219 else
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 236 else
241 # None found. 237 # None found.
242 gt_cv_locale_fr_utf8=none 238 gt_cv_locale_fr_utf8=none
243 fi 239 fi
244 fi 240 ;;
245 fi 241 *)
246 ;; 242 # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
247 esac 243 # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the
248 fi 244 # configure script would override the LC_ALL setting. Likewise for
249 rm -fr conftest* 245 # LC_CTYPE, which is also set at the beginning of the configure script.
246 # Test for the usual locale name.
247 if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
248 gt_cv_locale_fr_utf8=fr_FR
249 else
250 # Test for the locale name with explicit encoding suffix.
251 if (LC_ALL=fr_FR.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
252 gt_cv_locale_fr_utf8=fr_FR.UTF-8
253 else
254 # Test for the Solaris 10 locale name.
255 if (LC_ALL=fr.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
256 gt_cv_locale_fr_utf8=fr.UTF-8
257 else
258 # None found.
259 gt_cv_locale_fr_utf8=none
260 fi
261 fi
262 fi
263 ;;
264 esac
265 fi
266 rm -fr conftest*
267 ;;
268 esac
250 ]) 269 ])
251 LOCALE_FR_UTF8=$gt_cv_locale_fr_utf8 270 LOCALE_FR_UTF8=$gt_cv_locale_fr_utf8
271 case $LOCALE_FR_UTF8 in #(
272 '' | *[[[:space:]\"\$\'*@<:@]]*)
273 dnl This locale name might cause trouble with sh or make.
274 AC_MSG_WARN([invalid locale "$LOCALE_FR_UTF8"; assuming "none"])
275 LOCALE_FR_UTF8=none;;
276 esac
252 AC_SUBST([LOCALE_FR_UTF8]) 277 AC_SUBST([LOCALE_FR_UTF8])
278
279 dnl Users of $LOCALE_FR_UTF8 need to know which of the locale categories they
280 dnl can rely on.
281 case "$host_os" in
282 *-musl* | midipix*)
283 dnl On musl libc, locale categories other than LC_CTYPE and LC_MESSAGES
284 dnl are effectively unimplemented.
285 LC_COLLATE_IMPLEMENTED=false
286 LC_NUMERIC_IMPLEMENTED=false
287 LC_TIME_IMPLEMENTED=false
288 LC_MONETARY_IMPLEMENTED=false
289 ;;
290 *)
291 LC_COLLATE_IMPLEMENTED=true
292 LC_NUMERIC_IMPLEMENTED=true
293 LC_TIME_IMPLEMENTED=true
294 LC_MONETARY_IMPLEMENTED=true
295 ;;
296 esac
297 AC_SUBST([LC_COLLATE_IMPLEMENTED])
298 AC_SUBST([LC_NUMERIC_IMPLEMENTED])
299 AC_SUBST([LC_TIME_IMPLEMENTED])
300 AC_SUBST([LC_MONETARY_IMPLEMENTED])
253]) 301])