diff options
Diffstat (limited to 'gl/m4/langinfo_h.m4')
-rw-r--r-- | gl/m4/langinfo_h.m4 | 48 |
1 files changed, 40 insertions, 8 deletions
diff --git a/gl/m4/langinfo_h.m4 b/gl/m4/langinfo_h.m4 index 73bef8bc..b17a526a 100644 --- a/gl/m4/langinfo_h.m4 +++ b/gl/m4/langinfo_h.m4 | |||
@@ -1,10 +1,10 @@ | |||
1 | # langinfo_h.m4 serial 7 | 1 | # langinfo_h.m4 serial 12 |
2 | dnl Copyright (C) 2009-2013 Free Software Foundation, Inc. | 2 | dnl Copyright (C) 2009-2023 Free Software Foundation, Inc. |
3 | dnl This file is free software; the Free Software Foundation | 3 | dnl This file is free software; the Free Software Foundation |
4 | dnl gives unlimited permission to copy and/or distribute it, | 4 | dnl gives unlimited permission to copy and/or distribute it, |
5 | dnl with or without modifications, as long as this notice is preserved. | 5 | dnl with or without modifications, as long as this notice is preserved. |
6 | 6 | ||
7 | AC_DEFUN([gl_LANGINFO_H], | 7 | AC_DEFUN_ONCE([gl_LANGINFO_H], |
8 | [ | 8 | [ |
9 | AC_REQUIRE([gl_LANGINFO_H_DEFAULTS]) | 9 | AC_REQUIRE([gl_LANGINFO_H_DEFAULTS]) |
10 | 10 | ||
@@ -17,13 +17,17 @@ AC_DEFUN([gl_LANGINFO_H], | |||
17 | dnl Determine whether <langinfo.h> exists. It is missing on mingw and BeOS. | 17 | dnl Determine whether <langinfo.h> exists. It is missing on mingw and BeOS. |
18 | HAVE_LANGINFO_CODESET=0 | 18 | HAVE_LANGINFO_CODESET=0 |
19 | HAVE_LANGINFO_T_FMT_AMPM=0 | 19 | HAVE_LANGINFO_T_FMT_AMPM=0 |
20 | HAVE_LANGINFO_ALTMON=0 | ||
20 | HAVE_LANGINFO_ERA=0 | 21 | HAVE_LANGINFO_ERA=0 |
21 | HAVE_LANGINFO_YESEXPR=0 | 22 | HAVE_LANGINFO_YESEXPR=0 |
22 | AC_CHECK_HEADERS_ONCE([langinfo.h]) | 23 | AC_CHECK_HEADERS_ONCE([langinfo.h]) |
23 | if test $ac_cv_header_langinfo_h = yes; then | 24 | if test $ac_cv_header_langinfo_h = yes; then |
24 | HAVE_LANGINFO_H=1 | 25 | HAVE_LANGINFO_H=1 |
25 | dnl Determine what <langinfo.h> defines. CODESET and ERA etc. are missing | 26 | dnl Determine what <langinfo.h> defines. |
26 | dnl on OpenBSD 3.8. T_FMT_AMPM and YESEXPR, NOEXPR are missing on IRIX 5.3. | 27 | dnl CODESET is missing on OpenBSD 3.8. |
28 | dnl ERA etc. are missing on OpenBSD 6.7. | ||
29 | dnl T_FMT_AMPM and YESEXPR, NOEXPR are missing on IRIX 5.3. | ||
30 | dnl ALTMON_* are missing on glibc 2.26 and many other systems. | ||
27 | AC_CACHE_CHECK([whether langinfo.h defines CODESET], | 31 | AC_CACHE_CHECK([whether langinfo.h defines CODESET], |
28 | [gl_cv_header_langinfo_codeset], | 32 | [gl_cv_header_langinfo_codeset], |
29 | [AC_COMPILE_IFELSE( | 33 | [AC_COMPILE_IFELSE( |
@@ -48,6 +52,18 @@ int a = T_FMT_AMPM; | |||
48 | if test $gl_cv_header_langinfo_t_fmt_ampm = yes; then | 52 | if test $gl_cv_header_langinfo_t_fmt_ampm = yes; then |
49 | HAVE_LANGINFO_T_FMT_AMPM=1 | 53 | HAVE_LANGINFO_T_FMT_AMPM=1 |
50 | fi | 54 | fi |
55 | AC_CACHE_CHECK([whether langinfo.h defines ALTMON_1], | ||
56 | [gl_cv_header_langinfo_altmon], | ||
57 | [AC_COMPILE_IFELSE( | ||
58 | [AC_LANG_PROGRAM([[#include <langinfo.h> | ||
59 | int a = ALTMON_1; | ||
60 | ]])], | ||
61 | [gl_cv_header_langinfo_altmon=yes], | ||
62 | [gl_cv_header_langinfo_altmon=no]) | ||
63 | ]) | ||
64 | if test $gl_cv_header_langinfo_altmon = yes; then | ||
65 | HAVE_LANGINFO_ALTMON=1 | ||
66 | fi | ||
51 | AC_CACHE_CHECK([whether langinfo.h defines ERA], | 67 | AC_CACHE_CHECK([whether langinfo.h defines ERA], |
52 | [gl_cv_header_langinfo_era], | 68 | [gl_cv_header_langinfo_era], |
53 | [AC_COMPILE_IFELSE( | 69 | [AC_COMPILE_IFELSE( |
@@ -78,6 +94,7 @@ int a = YESEXPR; | |||
78 | AC_SUBST([HAVE_LANGINFO_H]) | 94 | AC_SUBST([HAVE_LANGINFO_H]) |
79 | AC_SUBST([HAVE_LANGINFO_CODESET]) | 95 | AC_SUBST([HAVE_LANGINFO_CODESET]) |
80 | AC_SUBST([HAVE_LANGINFO_T_FMT_AMPM]) | 96 | AC_SUBST([HAVE_LANGINFO_T_FMT_AMPM]) |
97 | AC_SUBST([HAVE_LANGINFO_ALTMON]) | ||
81 | AC_SUBST([HAVE_LANGINFO_ERA]) | 98 | AC_SUBST([HAVE_LANGINFO_ERA]) |
82 | AC_SUBST([HAVE_LANGINFO_YESEXPR]) | 99 | AC_SUBST([HAVE_LANGINFO_YESEXPR]) |
83 | 100 | ||
@@ -87,18 +104,33 @@ int a = YESEXPR; | |||
87 | ]], [nl_langinfo]) | 104 | ]], [nl_langinfo]) |
88 | ]) | 105 | ]) |
89 | 106 | ||
107 | # gl_LANGINFO_MODULE_INDICATOR([modulename]) | ||
108 | # sets the shell variable that indicates the presence of the given module | ||
109 | # to a C preprocessor expression that will evaluate to 1. | ||
110 | # This macro invocation must not occur in macros that are AC_REQUIREd. | ||
90 | AC_DEFUN([gl_LANGINFO_MODULE_INDICATOR], | 111 | AC_DEFUN([gl_LANGINFO_MODULE_INDICATOR], |
91 | [ | 112 | [ |
92 | dnl Use AC_REQUIRE here, so that the default settings are expanded once only. | 113 | dnl Ensure to expand the default settings once only. |
93 | AC_REQUIRE([gl_LANGINFO_H_DEFAULTS]) | 114 | gl_LANGINFO_H_REQUIRE_DEFAULTS |
94 | gl_MODULE_INDICATOR_SET_VARIABLE([$1]) | 115 | gl_MODULE_INDICATOR_SET_VARIABLE([$1]) |
95 | dnl Define it also as a C macro, for the benefit of the unit tests. | 116 | dnl Define it also as a C macro, for the benefit of the unit tests. |
96 | gl_MODULE_INDICATOR_FOR_TESTS([$1]) | 117 | gl_MODULE_INDICATOR_FOR_TESTS([$1]) |
97 | ]) | 118 | ]) |
98 | 119 | ||
120 | # Initializes the default values for AC_SUBSTed shell variables. | ||
121 | # This macro must not be AC_REQUIREd. It must only be invoked, and only | ||
122 | # outside of macros or in macros that are not AC_REQUIREd. | ||
123 | AC_DEFUN([gl_LANGINFO_H_REQUIRE_DEFAULTS], | ||
124 | [ | ||
125 | m4_defun(GL_MODULE_INDICATOR_PREFIX[_LANGINFO_H_MODULE_INDICATOR_DEFAULTS], [ | ||
126 | gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_NL_LANGINFO]) | ||
127 | ]) | ||
128 | m4_require(GL_MODULE_INDICATOR_PREFIX[_LANGINFO_H_MODULE_INDICATOR_DEFAULTS]) | ||
129 | AC_REQUIRE([gl_LANGINFO_H_DEFAULTS]) | ||
130 | ]) | ||
131 | |||
99 | AC_DEFUN([gl_LANGINFO_H_DEFAULTS], | 132 | AC_DEFUN([gl_LANGINFO_H_DEFAULTS], |
100 | [ | 133 | [ |
101 | GNULIB_NL_LANGINFO=0; AC_SUBST([GNULIB_NL_LANGINFO]) | ||
102 | dnl Assume proper GNU behavior unless another module says otherwise. | 134 | dnl Assume proper GNU behavior unless another module says otherwise. |
103 | HAVE_NL_LANGINFO=1; AC_SUBST([HAVE_NL_LANGINFO]) | 135 | HAVE_NL_LANGINFO=1; AC_SUBST([HAVE_NL_LANGINFO]) |
104 | REPLACE_NL_LANGINFO=0; AC_SUBST([REPLACE_NL_LANGINFO]) | 136 | REPLACE_NL_LANGINFO=0; AC_SUBST([REPLACE_NL_LANGINFO]) |