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