Debian Codegraph @

m4/localeconv.m4

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