Branch
Hash :
54ce3820
Author :
Date :
2025-09-10T22:53:35
langinfo-h: Remove support for IRIX. * lib/langinfo.in.h (T_FMT_AMPM, GNULIB_defined_T_FMT_AMPM, YESEXPR, NOEXPR, GNULIB_defined_YESEXPR): Remove macros. * m4/langinfo_h.m4 (gl_LANGINFO_H): Don't set HAVE_LANGINFO_T_FMT_AMPM, HAVE_LANGINFO_YESEXPR. * modules/langinfo-h (Makefile.am): Don't substitute HAVE_LANGINFO_T_FMT_AMPM, HAVE_LANGINFO_YESEXPR. * m4/nl_langinfo.m4 (gl_FUNC_NL_LANGINFO): Don't test against IRIX bug. * lib/nl_langinfo.c (rpl_nl_langinfo): Remove fallback code for T_FMT_AMPM, YESEXPR, NOEXPR. * m4/rpmatch.m4 (gl_PREREQ_RPMATCH): Just test for <langinfo.h>. Don't test for YESEXPR. * lib/rpmatch.c: Test HAVE_LANGINFO_H instead of HAVE_LANGINFO_YESEXPR.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125
# langinfo_h.m4
# serial 14
dnl Copyright (C) 2009-2025 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
dnl This file is offered as-is, without any warranty.
AC_DEFUN_ONCE([gl_LANGINFO_H],
[
AC_REQUIRE([gl_LANGINFO_H_DEFAULTS])
dnl Persuade glibc-2.0.6 <langinfo.h> to define CODESET.
AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
dnl <langinfo.h> is always overridden, because of GNULIB_POSIXCHECK.
gl_CHECK_NEXT_HEADERS([langinfo.h])
dnl Determine whether <langinfo.h> exists. It is missing on mingw and BeOS.
HAVE_LANGINFO_CODESET=0
HAVE_LANGINFO_ALTMON=0
HAVE_LANGINFO_ABALTMON=0
HAVE_LANGINFO_ERA=0
AC_CHECK_HEADERS_ONCE([langinfo.h])
if test $ac_cv_header_langinfo_h = yes; then
HAVE_LANGINFO_H=1
dnl Determine what <langinfo.h> defines.
dnl CODESET is missing on OpenBSD 3.8.
dnl ERA etc. are missing on OpenBSD 6.7.
dnl ALTMON_* are missing on glibc 2.26 and many other systems.
dnl ABALTMON_* are missing on glibc 2.41 and many other systems.
AC_CACHE_CHECK([whether langinfo.h defines CODESET],
[gl_cv_header_langinfo_codeset],
[AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([[#include <langinfo.h>
int a = CODESET;
]])],
[gl_cv_header_langinfo_codeset=yes],
[gl_cv_header_langinfo_codeset=no])
])
if test $gl_cv_header_langinfo_codeset = yes; then
HAVE_LANGINFO_CODESET=1
fi
AC_CACHE_CHECK([whether langinfo.h defines ALTMON_1],
[gl_cv_header_langinfo_altmon],
[AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([[#include <langinfo.h>
int a = ALTMON_1;
]])],
[gl_cv_header_langinfo_altmon=yes],
[gl_cv_header_langinfo_altmon=no])
])
if test $gl_cv_header_langinfo_altmon = yes; then
HAVE_LANGINFO_ALTMON=1
fi
AC_CACHE_CHECK([whether langinfo.h defines ABALTMON_1],
[gl_cv_header_langinfo_abaltmon],
[AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([[#include <langinfo.h>
int a = ABALTMON_1;
]])],
[gl_cv_header_langinfo_abaltmon=yes],
[gl_cv_header_langinfo_abaltmon=no])
])
if test $gl_cv_header_langinfo_abaltmon = yes; then
HAVE_LANGINFO_ABALTMON=1
fi
AC_CACHE_CHECK([whether langinfo.h defines ERA],
[gl_cv_header_langinfo_era],
[AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([[#include <langinfo.h>
int a = ERA;
]])],
[gl_cv_header_langinfo_era=yes],
[gl_cv_header_langinfo_era=no])
])
if test $gl_cv_header_langinfo_era = yes; then
HAVE_LANGINFO_ERA=1
fi
else
HAVE_LANGINFO_H=0
fi
AC_SUBST([HAVE_LANGINFO_H])
AC_SUBST([HAVE_LANGINFO_CODESET])
AC_SUBST([HAVE_LANGINFO_ALTMON])
AC_SUBST([HAVE_LANGINFO_ABALTMON])
AC_SUBST([HAVE_LANGINFO_ERA])
dnl Check for declarations of anything we want to poison if the
dnl corresponding gnulib module is not in use.
gl_WARN_ON_USE_PREPARE([[#include <langinfo.h>
]], [nl_langinfo])
])
# gl_LANGINFO_MODULE_INDICATOR([modulename])
# sets the shell variable that indicates the presence of the given module
# to a C preprocessor expression that will evaluate to 1.
# This macro invocation must not occur in macros that are AC_REQUIREd.
AC_DEFUN([gl_LANGINFO_MODULE_INDICATOR],
[
dnl Ensure to expand the default settings once only.
gl_LANGINFO_H_REQUIRE_DEFAULTS
gl_MODULE_INDICATOR_SET_VARIABLE([$1])
dnl Define it also as a C macro, for the benefit of the unit tests.
gl_MODULE_INDICATOR_FOR_TESTS([$1])
])
# Initializes the default values for AC_SUBSTed shell variables.
# This macro must not be AC_REQUIREd. It must only be invoked, and only
# outside of macros or in macros that are not AC_REQUIREd.
AC_DEFUN([gl_LANGINFO_H_REQUIRE_DEFAULTS],
[
m4_defun(GL_MODULE_INDICATOR_PREFIX[_LANGINFO_H_MODULE_INDICATOR_DEFAULTS], [
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_NL_LANGINFO])
])
m4_require(GL_MODULE_INDICATOR_PREFIX[_LANGINFO_H_MODULE_INDICATOR_DEFAULTS])
AC_REQUIRE([gl_LANGINFO_H_DEFAULTS])
])
AC_DEFUN([gl_LANGINFO_H_DEFAULTS],
[
dnl Assume proper GNU behavior unless another module says otherwise.
HAVE_NL_LANGINFO=1; AC_SUBST([HAVE_NL_LANGINFO])
REPLACE_NL_LANGINFO=0; AC_SUBST([REPLACE_NL_LANGINFO])
])