summaryrefslogtreecommitdiffstats
path: root/gl/m4/nl_langinfo.m4
diff options
context:
space:
mode:
Diffstat (limited to 'gl/m4/nl_langinfo.m4')
-rw-r--r--gl/m4/nl_langinfo.m440
1 files changed, 8 insertions, 32 deletions
diff --git a/gl/m4/nl_langinfo.m4 b/gl/m4/nl_langinfo.m4
index f38f11bb..a3ec57f7 100644
--- a/gl/m4/nl_langinfo.m4
+++ b/gl/m4/nl_langinfo.m4
@@ -1,9 +1,10 @@
1# nl_langinfo.m4 1# nl_langinfo.m4
2# serial 11 2# serial 14
3dnl Copyright (C) 2009-2024 Free Software Foundation, Inc. 3dnl Copyright (C) 2009-2026 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([gl_FUNC_NL_LANGINFO], 9AC_DEFUN([gl_FUNC_NL_LANGINFO],
9[ 10[
@@ -15,43 +16,18 @@ AC_DEFUN([gl_FUNC_NL_LANGINFO],
15 AC_REQUIRE([gl_PTHREADLIB]) 16 AC_REQUIRE([gl_PTHREADLIB])
16 AC_CHECK_HEADERS_ONCE([threads.h]) 17 AC_CHECK_HEADERS_ONCE([threads.h])
17 if test $ac_cv_func_nl_langinfo = yes; then 18 if test $ac_cv_func_nl_langinfo = yes; then
18 # On Irix 6.5, YESEXPR is defined, but nl_langinfo(YESEXPR) is broken. 19 # On macOS 26, Solaris 10, and Solaris 11.3, nl_langinfo is not
19 AC_CACHE_CHECK([whether YESEXPR works], 20 # multithread-safe.
20 [gl_cv_func_nl_langinfo_yesexpr_works],
21 [AC_RUN_IFELSE(
22 [AC_LANG_PROGRAM([[#include <langinfo.h>
23]], [[return !*nl_langinfo(YESEXPR);
24]])],
25 [gl_cv_func_nl_langinfo_yesexpr_works=yes],
26 [gl_cv_func_nl_langinfo_yesexpr_works=no],
27 [
28 case "$host_os" in
29 # Guess no on irix systems.
30 irix*) gl_cv_func_nl_langinfo_yesexpr_works="guessing no";;
31 # Guess yes elsewhere.
32 *) gl_cv_func_nl_langinfo_yesexpr_works="guessing yes";;
33 esac
34 ])
35 ])
36 case $gl_cv_func_nl_langinfo_yesexpr_works in
37 *yes) FUNC_NL_LANGINFO_YESEXPR_WORKS=1 ;;
38 *) FUNC_NL_LANGINFO_YESEXPR_WORKS=0 ;;
39 esac
40 AC_DEFINE_UNQUOTED([FUNC_NL_LANGINFO_YESEXPR_WORKS],
41 [$FUNC_NL_LANGINFO_YESEXPR_WORKS],
42 [Define to 1 if nl_langinfo (YESEXPR) returns a non-empty string.])
43 # On Solaris 10 and Solaris 11.3, nl_langinfo is not multithread-safe.
44 case "$host_os" in 21 case "$host_os" in
45 solaris*) NL_LANGINFO_MTSAFE=0 ;; 22 darwin* | solaris*) NL_LANGINFO_MTSAFE=0 ;;
46 *) NL_LANGINFO_MTSAFE=1 ;; 23 *) NL_LANGINFO_MTSAFE=1 ;;
47 esac 24 esac
48 AC_DEFINE_UNQUOTED([NL_LANGINFO_MTSAFE], [$NL_LANGINFO_MTSAFE], 25 AC_DEFINE_UNQUOTED([NL_LANGINFO_MTSAFE], [$NL_LANGINFO_MTSAFE],
49 [Define to 1 if nl_langinfo is multithread-safe.]) 26 [Define to 1 if nl_langinfo is multithread-safe.])
50 if test $HAVE_LANGINFO_CODESET = 1 \ 27 if test $HAVE_LANGINFO_CODESET = 1 \
51 && test $HAVE_LANGINFO_T_FMT_AMPM = 1 \
52 && test $HAVE_LANGINFO_ALTMON = 1 \ 28 && test $HAVE_LANGINFO_ALTMON = 1 \
29 && test $HAVE_LANGINFO_ABALTMON = 1 \
53 && test $HAVE_LANGINFO_ERA = 1 \ 30 && test $HAVE_LANGINFO_ERA = 1 \
54 && test $FUNC_NL_LANGINFO_YESEXPR_WORKS = 1 \
55 && test $NL_LANGINFO_MTSAFE = 1; then 31 && test $NL_LANGINFO_MTSAFE = 1; then
56 : 32 :
57 else 33 else