| 1 |
# nl_langinfo.m4 |
| 2 |
# serial 14 |
| 3 |
dnl Copyright (C) 2009-2026 Free Software Foundation, Inc. |
| 4 |
dnl This file is free software; the Free Software Foundation |
| 5 |
dnl gives unlimited permission to copy and/or distribute it, |
| 6 |
dnl with or without modifications, as long as this notice is preserved. |
| 7 |
dnl This file is offered as-is, without any warranty. |
| 8 |
|
| 9 |
AC_DEFUN([gl_FUNC_NL_LANGINFO], |
| 10 |
[ |
| 11 |
AC_REQUIRE([gl_LANGINFO_H_DEFAULTS]) |
| 12 |
AC_REQUIRE([gl_LANGINFO_H]) |
| 13 |
gl_CHECK_FUNCS_ANDROID([nl_langinfo], [[#include <langinfo.h>]]) |
| 14 |
AC_REQUIRE([AC_CANONICAL_HOST]) |
| 15 |
AC_REQUIRE([gl_FUNC_SETLOCALE_NULL]) |
| 16 |
AC_REQUIRE([gl_PTHREADLIB]) |
| 17 |
AC_CHECK_HEADERS_ONCE([threads.h]) |
| 18 |
if test $ac_cv_func_nl_langinfo = yes; then |
| 19 |
# On macOS 26, Solaris 10, and Solaris 11.3, nl_langinfo is not |
| 20 |
# multithread-safe. |
| 21 |
case "$host_os" in |
| 22 |
darwin* | solaris*) NL_LANGINFO_MTSAFE=0 ;; |
| 23 |
*) NL_LANGINFO_MTSAFE=1 ;; |
| 24 |
esac |
| 25 |
AC_DEFINE_UNQUOTED([NL_LANGINFO_MTSAFE], [$NL_LANGINFO_MTSAFE], |
| 26 |
[Define to 1 if nl_langinfo is multithread-safe.]) |
| 27 |
if test $HAVE_LANGINFO_CODESET = 1 \ |
| 28 |
&& test $HAVE_LANGINFO_ALTMON = 1 \ |
| 29 |
&& test $HAVE_LANGINFO_ABALTMON = 1 \ |
| 30 |
&& test $HAVE_LANGINFO_ERA = 1 \ |
| 31 |
&& test $NL_LANGINFO_MTSAFE = 1; then |
| 32 |
: |
| 33 |
else |
| 34 |
REPLACE_NL_LANGINFO=1 |
| 35 |
AC_DEFINE([REPLACE_NL_LANGINFO], [1], |
| 36 |
[Define if nl_langinfo exists but is overridden by gnulib.]) |
| 37 |
fi |
| 38 |
else |
| 39 |
HAVE_NL_LANGINFO=0 |
| 40 |
case "$gl_cv_onwards_func_nl_langinfo" in |
| 41 |
future*) REPLACE_NL_LANGINFO=1 ;; |
| 42 |
esac |
| 43 |
fi |
| 44 |
if test $HAVE_NL_LANGINFO = 0 || test $HAVE_LANGINFO_CODESET = 0; then |
| 45 |
LIB_NL_LANGINFO="$SETLOCALE_NULL_LIB" |
| 46 |
else |
| 47 |
LIB_NL_LANGINFO= |
| 48 |
fi |
| 49 |
dnl LIB_NL_LANGINFO is expected to be empty everywhere. |
| 50 |
AC_SUBST([LIB_NL_LANGINFO]) |
| 51 |
]) |
| 52 |
|
| 53 |
# Prerequisites of lib/nl_langinfo-lock.c. |
| 54 |
AC_DEFUN([gl_PREREQ_NL_LANGINFO_LOCK], |
| 55 |
[ |
| 56 |
gl_VISIBILITY |
| 57 |
]) |