summaryrefslogtreecommitdiffstats
path: root/gl/m4/localeconv.m4
diff options
context:
space:
mode:
Diffstat (limited to 'gl/m4/localeconv.m4')
-rw-r--r--gl/m4/localeconv.m443
1 files changed, 41 insertions, 2 deletions
diff --git a/gl/m4/localeconv.m4 b/gl/m4/localeconv.m4
index ae225fed..55a669d0 100644
--- a/gl/m4/localeconv.m4
+++ b/gl/m4/localeconv.m4
@@ -1,17 +1,54 @@
1# localeconv.m4 serial 1 1# localeconv.m4
2dnl Copyright (C) 2012-2023 Free Software Foundation, Inc. 2# serial 3
3dnl Copyright (C) 2012-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
7AC_DEFUN([gl_FUNC_LOCALECONV], 9AC_DEFUN([gl_FUNC_LOCALECONV],
8[ 10[
9 AC_REQUIRE([gl_LOCALE_H_DEFAULTS]) 11 AC_REQUIRE([gl_LOCALE_H_DEFAULTS])
10 AC_REQUIRE([gl_LOCALE_H]) 12 AC_REQUIRE([gl_LOCALE_H])
13 AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
11 14
12 if test $REPLACE_STRUCT_LCONV = 1; then 15 if test $REPLACE_STRUCT_LCONV = 1; then
13 REPLACE_LOCALECONV=1 16 REPLACE_LOCALECONV=1
14 fi 17 fi
18 if test $REPLACE_LOCALECONV = 0; then
19 dnl Test whether fields of type 'char' are filled correctly.
20 dnl This test fails on mingw 5.0.3.
21 AC_CACHE_CHECK([whether localeconv works],
22 [gl_cv_func_localeconv_works],
23 [AC_RUN_IFELSE(
24 [AC_LANG_SOURCE([[
25 #include <locale.h>
26 #include <limits.h>
27 int main ()
28 {
29 struct lconv *l = localeconv ();
30 return l->frac_digits != CHAR_MAX && l->frac_digits < 0;
31 }
32 ]])],
33 [gl_cv_func_localeconv_works=yes],
34 [gl_cv_func_localeconv_works=no],
35 [case "$host_os" in
36 # Guess yes on glibc systems.
37 *-gnu* | gnu*) gl_cv_func_localeconv_works="guessing yes" ;;
38 # Guess yes on musl systems.
39 *-musl* | midipix*) gl_cv_func_localeconv_works="guessing yes" ;;
40 # Guess no on native Windows.
41 mingw* | windows*) gl_cv_func_localeconv_works="guessing no" ;;
42 # If we don't know, obey --enable-cross-guesses.
43 *) gl_cv_func_localeconv_works="$gl_cross_guess_normal" ;;
44 esac
45 ])
46 ])
47 case "$gl_cv_func_localeconv_works" in
48 *yes) ;;
49 *) REPLACE_LOCALECONV=1 ;;
50 esac
51 fi
15]) 52])
16 53
17# Prerequisites of lib/localeconv.c. 54# Prerequisites of lib/localeconv.c.
@@ -19,4 +56,6 @@ AC_DEFUN([gl_PREREQ_LOCALECONV],
19[ 56[
20 AC_CHECK_MEMBERS([struct lconv.decimal_point], [], [], 57 AC_CHECK_MEMBERS([struct lconv.decimal_point], [], [],
21 [[#include <locale.h>]]) 58 [[#include <locale.h>]])
59 AC_CHECK_MEMBERS([struct lconv.int_p_cs_precedes], [], [],
60 [[#include <locale.h>]])
22]) 61])