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.m437
1 files changed, 32 insertions, 5 deletions
diff --git a/gl/m4/nl_langinfo.m4 b/gl/m4/nl_langinfo.m4
index 25e2101..51e783c 100644
--- a/gl/m4/nl_langinfo.m4
+++ b/gl/m4/nl_langinfo.m4
@@ -1,5 +1,5 @@
1# nl_langinfo.m4 serial 5 1# nl_langinfo.m4 serial 8
2dnl Copyright (C) 2009-2013 Free Software Foundation, Inc. 2dnl Copyright (C) 2009-2023 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 3dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 4dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved. 5dnl with or without modifications, as long as this notice is preserved.
@@ -9,7 +9,10 @@ AC_DEFUN([gl_FUNC_NL_LANGINFO],
9 AC_REQUIRE([gl_LANGINFO_H_DEFAULTS]) 9 AC_REQUIRE([gl_LANGINFO_H_DEFAULTS])
10 AC_REQUIRE([gl_LANGINFO_H]) 10 AC_REQUIRE([gl_LANGINFO_H])
11 AC_CHECK_FUNCS_ONCE([nl_langinfo]) 11 AC_CHECK_FUNCS_ONCE([nl_langinfo])
12 AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles 12 AC_REQUIRE([AC_CANONICAL_HOST])
13 AC_REQUIRE([gl_FUNC_SETLOCALE_NULL])
14 AC_REQUIRE([gl_PTHREADLIB])
15 AC_CHECK_HEADERS_ONCE([threads.h])
13 if test $ac_cv_func_nl_langinfo = yes; then 16 if test $ac_cv_func_nl_langinfo = yes; then
14 # On Irix 6.5, YESEXPR is defined, but nl_langinfo(YESEXPR) is broken. 17 # On Irix 6.5, YESEXPR is defined, but nl_langinfo(YESEXPR) is broken.
15 AC_CACHE_CHECK([whether YESEXPR works], 18 AC_CACHE_CHECK([whether YESEXPR works],
@@ -36,8 +39,19 @@ AC_DEFUN([gl_FUNC_NL_LANGINFO],
36 AC_DEFINE_UNQUOTED([FUNC_NL_LANGINFO_YESEXPR_WORKS], 39 AC_DEFINE_UNQUOTED([FUNC_NL_LANGINFO_YESEXPR_WORKS],
37 [$FUNC_NL_LANGINFO_YESEXPR_WORKS], 40 [$FUNC_NL_LANGINFO_YESEXPR_WORKS],
38 [Define to 1 if nl_langinfo (YESEXPR) returns a non-empty string.]) 41 [Define to 1 if nl_langinfo (YESEXPR) returns a non-empty string.])
39 if test $HAVE_LANGINFO_CODESET = 1 && test $HAVE_LANGINFO_ERA = 1 \ 42 # On Solaris 10 and Solaris 11.3, nl_langinfo is not multithread-safe.
40 && test $FUNC_NL_LANGINFO_YESEXPR_WORKS = 1; then 43 case "$host_os" in
44 solaris*) NL_LANGINFO_MTSAFE=0 ;;
45 *) NL_LANGINFO_MTSAFE=1 ;;
46 esac
47 AC_DEFINE_UNQUOTED([NL_LANGINFO_MTSAFE], [$NL_LANGINFO_MTSAFE],
48 [Define to 1 if nl_langinfo is multithread-safe.])
49 if test $HAVE_LANGINFO_CODESET = 1 \
50 && test $HAVE_LANGINFO_T_FMT_AMPM = 1 \
51 && test $HAVE_LANGINFO_ALTMON = 1 \
52 && test $HAVE_LANGINFO_ERA = 1 \
53 && test $FUNC_NL_LANGINFO_YESEXPR_WORKS = 1 \
54 && test $NL_LANGINFO_MTSAFE = 1; then
41 : 55 :
42 else 56 else
43 REPLACE_NL_LANGINFO=1 57 REPLACE_NL_LANGINFO=1
@@ -47,4 +61,17 @@ AC_DEFUN([gl_FUNC_NL_LANGINFO],
47 else 61 else
48 HAVE_NL_LANGINFO=0 62 HAVE_NL_LANGINFO=0
49 fi 63 fi
64 if test $HAVE_NL_LANGINFO = 0 || test $HAVE_LANGINFO_CODESET = 0; then
65 LIB_NL_LANGINFO="$LIB_SETLOCALE_NULL"
66 else
67 LIB_NL_LANGINFO=
68 fi
69 dnl LIB_NL_LANGINFO is expected to be empty everywhere.
70 AC_SUBST([LIB_NL_LANGINFO])
71])
72
73# Prerequisites of lib/nl_langinfo-lock.c.
74AC_DEFUN([gl_PREREQ_NL_LANGINFO_LOCK],
75[
76 gl_VISIBILITY
50]) 77])