summaryrefslogtreecommitdiffstats
path: root/gl/m4/locale_h.m4
diff options
context:
space:
mode:
Diffstat (limited to 'gl/m4/locale_h.m4')
-rw-r--r--gl/m4/locale_h.m452
1 files changed, 40 insertions, 12 deletions
diff --git a/gl/m4/locale_h.m4 b/gl/m4/locale_h.m4
index cd1c81ec..e1afbc16 100644
--- a/gl/m4/locale_h.m4
+++ b/gl/m4/locale_h.m4
@@ -1,9 +1,10 @@
1# locale_h.m4 1# locale_h.m4
2# serial 31 2# serial 37
3dnl Copyright (C) 2007, 2009-2024 Free Software Foundation, Inc. 3dnl Copyright (C) 2007, 2009-2025 Free Software Foundation, Inc.
4dnl This file is free software; the Free Software Foundation 4dnl This file is free software; the Free Software Foundation
5dnl gives unlimited permission to copy and/or distribute it, 5dnl gives unlimited permission to copy and/or distribute it,
6dnl 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.
7 8
8AC_DEFUN_ONCE([gl_LOCALE_H], 9AC_DEFUN_ONCE([gl_LOCALE_H],
9[ 10[
@@ -19,6 +20,26 @@ AC_DEFUN_ONCE([gl_LOCALE_H],
19 AC_REQUIRE([gl_STDDEF_H]) 20 AC_REQUIRE([gl_STDDEF_H])
20 21
21 AC_REQUIRE([gl_LOCALE_T]) 22 AC_REQUIRE([gl_LOCALE_T])
23 dnl On native Windows, there is a type '_locale_t' that can be used to
24 dnl define locale_t.
25 AC_CACHE_CHECK([whether locale.h defines _locale_t],
26 [gl_cv_header_locale_has_windows_locale_t],
27 [AC_COMPILE_IFELSE(
28 [AC_LANG_PROGRAM(
29 [[#include <locale.h>
30 _locale_t x;]],
31 [[]])],
32 [gl_cv_header_locale_has_windows_locale_t=yes],
33 [gl_cv_header_locale_has_windows_locale_t=no])
34 ])
35 if test $gl_cv_header_locale_has_windows_locale_t = yes; then
36 HAVE_WINDOWS_LOCALE_T=1
37 AC_DEFINE([HAVE_WINDOWS_LOCALE_T], [1],
38 [Define to 1 if <locale.h> defines the _locale_t type.])
39 else
40 HAVE_WINDOWS_LOCALE_T=0
41 fi
42 AC_SUBST([HAVE_WINDOWS_LOCALE_T])
22 43
23 dnl Solaris 11.0 defines the int_p_*, int_n_* members of 'struct lconv' 44 dnl Solaris 11.0 defines the int_p_*, int_n_* members of 'struct lconv'
24 dnl only if _LCONV_C99 is defined. 45 dnl only if _LCONV_C99 is defined.
@@ -86,7 +107,7 @@ AC_DEFUN_ONCE([gl_LOCALE_H],
86# include <xlocale.h> 107# include <xlocale.h>
87#endif 108#endif
88 ]], 109 ]],
89 [setlocale newlocale duplocale freelocale]) 110 [setlocale newlocale duplocale freelocale getlocalename_l])
90]) 111])
91 112
92dnl Checks to determine whether the system has the locale_t type, 113dnl Checks to determine whether the system has the locale_t type,
@@ -130,6 +151,7 @@ AC_DEFUN([gl_LOCALE_T],
130 fi 151 fi
131 fi 152 fi
132 AC_SUBST([HAVE_XLOCALE_H]) 153 AC_SUBST([HAVE_XLOCALE_H])
154 AC_SUBST([HAVE_LOCALE_T])
133]) 155])
134 156
135# gl_LOCALE_MODULE_INDICATOR([modulename]) 157# gl_LOCALE_MODULE_INDICATOR([modulename])
@@ -154,7 +176,11 @@ AC_DEFUN([gl_LOCALE_H_REQUIRE_DEFAULTS],
154 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LOCALECONV]) 176 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LOCALECONV])
155 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SETLOCALE]) 177 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SETLOCALE])
156 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SETLOCALE_NULL]) 178 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SETLOCALE_NULL])
179 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_NEWLOCALE])
157 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_DUPLOCALE]) 180 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_DUPLOCALE])
181 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FREELOCALE])
182 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETLOCALENAME_L])
183 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETLOCALENAME_L_UNSAFE])
158 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LOCALENAME_UNSAFE]) 184 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LOCALENAME_UNSAFE])
159 ]) 185 ])
160 m4_require(GL_MODULE_INDICATOR_PREFIX[_LOCALE_H_MODULE_INDICATOR_DEFAULTS]) 186 m4_require(GL_MODULE_INDICATOR_PREFIX[_LOCALE_H_MODULE_INDICATOR_DEFAULTS])
@@ -164,14 +190,16 @@ AC_DEFUN([gl_LOCALE_H_REQUIRE_DEFAULTS],
164AC_DEFUN([gl_LOCALE_H_DEFAULTS], 190AC_DEFUN([gl_LOCALE_H_DEFAULTS],
165[ 191[
166 dnl Assume proper GNU behavior unless another module says otherwise. 192 dnl Assume proper GNU behavior unless another module says otherwise.
167 HAVE_NEWLOCALE=1; AC_SUBST([HAVE_NEWLOCALE]) 193 HAVE_NEWLOCALE=1; AC_SUBST([HAVE_NEWLOCALE])
168 HAVE_DUPLOCALE=1; AC_SUBST([HAVE_DUPLOCALE]) 194 HAVE_DUPLOCALE=1; AC_SUBST([HAVE_DUPLOCALE])
169 HAVE_FREELOCALE=1; AC_SUBST([HAVE_FREELOCALE]) 195 HAVE_FREELOCALE=1; AC_SUBST([HAVE_FREELOCALE])
170 REPLACE_LOCALECONV=0; AC_SUBST([REPLACE_LOCALECONV]) 196 HAVE_GETLOCALENAME_L=1; AC_SUBST([HAVE_GETLOCALENAME_L])
171 REPLACE_SETLOCALE=0; AC_SUBST([REPLACE_SETLOCALE]) 197 REPLACE_LOCALECONV=0; AC_SUBST([REPLACE_LOCALECONV])
172 REPLACE_NEWLOCALE=0; AC_SUBST([REPLACE_NEWLOCALE]) 198 REPLACE_SETLOCALE=0; AC_SUBST([REPLACE_SETLOCALE])
173 REPLACE_DUPLOCALE=0; AC_SUBST([REPLACE_DUPLOCALE]) 199 REPLACE_NEWLOCALE=0; AC_SUBST([REPLACE_NEWLOCALE])
174 REPLACE_FREELOCALE=0; AC_SUBST([REPLACE_FREELOCALE]) 200 REPLACE_DUPLOCALE=0; AC_SUBST([REPLACE_DUPLOCALE])
175 REPLACE_STRUCT_LCONV=0; AC_SUBST([REPLACE_STRUCT_LCONV]) 201 REPLACE_FREELOCALE=0; AC_SUBST([REPLACE_FREELOCALE])
202 REPLACE_GETLOCALENAME_L=0; AC_SUBST([REPLACE_GETLOCALENAME_L])
203 REPLACE_STRUCT_LCONV=0; AC_SUBST([REPLACE_STRUCT_LCONV])
176 LOCALENAME_ENHANCE_LOCALE_FUNCS=0; AC_SUBST([LOCALENAME_ENHANCE_LOCALE_FUNCS]) 204 LOCALENAME_ENHANCE_LOCALE_FUNCS=0; AC_SUBST([LOCALENAME_ENHANCE_LOCALE_FUNCS])
177]) 205])