2025-09-10 Bruno Haible <bruno@clisp.org>
+ 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.
+
errno-iter, strerrorname_np: Remove support for IRIX.
* lib/errno-iter.c (errno_iterate): Remove cases for EBADFILT,
EBADRSPEC, EBADTSPEC, EBDHDL, EBUFSIZE, ECANTEXTENT, ECELLDOWN, ECKPT,
# define GNULIB_defined_CODESET 1
# endif
-# if !@HAVE_LANGINFO_T_FMT_AMPM@
-# define T_FMT_AMPM 10006
-# define GNULIB_defined_T_FMT_AMPM 1
-# endif
-
# if !@HAVE_LANGINFO_ALTMON@
# define ALTMON_1 10200
# define ALTMON_2 (ALTMON_1 + 1)
# define GNULIB_defined_ERA 1
# endif
-# if !@HAVE_LANGINFO_YESEXPR@
-# define YESEXPR 10053
-# define NOEXPR 10054
-# define GNULIB_defined_YESEXPR 1
-# endif
-
#endif
/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
case CODESET:
return ctype_codeset ();
# endif
-# if GNULIB_defined_T_FMT_AMPM
- case T_FMT_AMPM:
- return (char *) "%I:%M:%S %p";
-# endif
# if GNULIB_defined_ALTMON
case ALTMON_1:
case ALTMON_2:
/* The format is not standardized. In glibc it is a sequence of 10
strings, appended in memory. */
return (char *) "\0\0\0\0\0\0\0\0\0\0";
-# endif
-# if GNULIB_defined_YESEXPR || !FUNC_NL_LANGINFO_YESEXPR_WORKS
- case YESEXPR:
- return (char *) "^[yY]";
- case NOEXPR:
- return (char *) "^[nN]";
# endif
default:
break;
# include <sys/types.h>
# include <limits.h>
# include <string.h>
-# if HAVE_LANGINFO_YESEXPR
+# if HAVE_LANGINFO_H
# include <langinfo.h>
# endif
# include <regex.h>
# define _(msgid) dgettext (GNULIB_TEXT_DOMAIN, msgid)
# define N_(msgid) gettext_noop (msgid)
-# if HAVE_LANGINFO_YESEXPR
+# if HAVE_LANGINFO_H
/* Return the localized regular expression pattern corresponding to
ENGLISH_PATTERN. NL_INDEX can be used with nl_langinfo.
The resulting string may only be used until the next nl_langinfo call. */
static char *last_yesexpr, *last_noexpr;
static regex_t cached_yesre, cached_nore;
-# if HAVE_LANGINFO_YESEXPR
+# if HAVE_LANGINFO_H
bool posixly_correct = (getenv ("POSIXLY_CORRECT") != NULL);
# endif
# langinfo_h.m4
-# serial 13
+# 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 Determine whether <langinfo.h> exists. It is missing on mingw and BeOS.
HAVE_LANGINFO_CODESET=0
- HAVE_LANGINFO_T_FMT_AMPM=0
HAVE_LANGINFO_ALTMON=0
HAVE_LANGINFO_ABALTMON=0
HAVE_LANGINFO_ERA=0
- HAVE_LANGINFO_YESEXPR=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 T_FMT_AMPM and YESEXPR, NOEXPR are missing on IRIX 5.3.
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],
if test $gl_cv_header_langinfo_codeset = yes; then
HAVE_LANGINFO_CODESET=1
fi
- AC_CACHE_CHECK([whether langinfo.h defines T_FMT_AMPM],
- [gl_cv_header_langinfo_t_fmt_ampm],
- [AC_COMPILE_IFELSE(
- [AC_LANG_PROGRAM([[#include <langinfo.h>
-int a = T_FMT_AMPM;
-]])],
- [gl_cv_header_langinfo_t_fmt_ampm=yes],
- [gl_cv_header_langinfo_t_fmt_ampm=no])
- ])
- if test $gl_cv_header_langinfo_t_fmt_ampm = yes; then
- HAVE_LANGINFO_T_FMT_AMPM=1
- fi
AC_CACHE_CHECK([whether langinfo.h defines ALTMON_1],
[gl_cv_header_langinfo_altmon],
[AC_COMPILE_IFELSE(
if test $gl_cv_header_langinfo_era = yes; then
HAVE_LANGINFO_ERA=1
fi
- AC_CACHE_CHECK([whether langinfo.h defines YESEXPR],
- [gl_cv_header_langinfo_yesexpr],
- [AC_COMPILE_IFELSE(
- [AC_LANG_PROGRAM([[#include <langinfo.h>
-int a = YESEXPR;
-]])],
- [gl_cv_header_langinfo_yesexpr=yes],
- [gl_cv_header_langinfo_yesexpr=no])
- ])
- if test $gl_cv_header_langinfo_yesexpr = yes; then
- HAVE_LANGINFO_YESEXPR=1
- fi
else
HAVE_LANGINFO_H=0
fi
AC_SUBST([HAVE_LANGINFO_H])
AC_SUBST([HAVE_LANGINFO_CODESET])
- AC_SUBST([HAVE_LANGINFO_T_FMT_AMPM])
AC_SUBST([HAVE_LANGINFO_ALTMON])
AC_SUBST([HAVE_LANGINFO_ABALTMON])
AC_SUBST([HAVE_LANGINFO_ERA])
- AC_SUBST([HAVE_LANGINFO_YESEXPR])
dnl Check for declarations of anything we want to poison if the
dnl corresponding gnulib module is not in use.
# nl_langinfo.m4
-# serial 12
+# serial 13
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,
AC_REQUIRE([gl_PTHREADLIB])
AC_CHECK_HEADERS_ONCE([threads.h])
if test $ac_cv_func_nl_langinfo = yes; then
- # On Irix 6.5, YESEXPR is defined, but nl_langinfo(YESEXPR) is broken.
- AC_CACHE_CHECK([whether YESEXPR works],
- [gl_cv_func_nl_langinfo_yesexpr_works],
- [AC_RUN_IFELSE(
- [AC_LANG_PROGRAM([[#include <langinfo.h>
-]], [[return !*nl_langinfo(YESEXPR);
-]])],
- [gl_cv_func_nl_langinfo_yesexpr_works=yes],
- [gl_cv_func_nl_langinfo_yesexpr_works=no],
- [
- case "$host_os" in
- # Guess no on irix systems.
- irix*) gl_cv_func_nl_langinfo_yesexpr_works="guessing no";;
- # Guess yes elsewhere.
- *) gl_cv_func_nl_langinfo_yesexpr_works="guessing yes";;
- esac
- ])
- ])
- case $gl_cv_func_nl_langinfo_yesexpr_works in
- *yes) FUNC_NL_LANGINFO_YESEXPR_WORKS=1 ;;
- *) FUNC_NL_LANGINFO_YESEXPR_WORKS=0 ;;
- esac
- AC_DEFINE_UNQUOTED([FUNC_NL_LANGINFO_YESEXPR_WORKS],
- [$FUNC_NL_LANGINFO_YESEXPR_WORKS],
- [Define to 1 if nl_langinfo (YESEXPR) returns a non-empty string.])
# On Solaris 10 and Solaris 11.3, nl_langinfo is not multithread-safe.
case "$host_os" in
solaris*) NL_LANGINFO_MTSAFE=0 ;;
AC_DEFINE_UNQUOTED([NL_LANGINFO_MTSAFE], [$NL_LANGINFO_MTSAFE],
[Define to 1 if nl_langinfo is multithread-safe.])
if test $HAVE_LANGINFO_CODESET = 1 \
- && test $HAVE_LANGINFO_T_FMT_AMPM = 1 \
&& test $HAVE_LANGINFO_ALTMON = 1 \
&& test $HAVE_LANGINFO_ABALTMON = 1 \
&& test $HAVE_LANGINFO_ERA = 1 \
- && test $FUNC_NL_LANGINFO_YESEXPR_WORKS = 1 \
&& test $NL_LANGINFO_MTSAFE = 1; then
:
else
# rpmatch.m4
-# serial 10
+# serial 11
dnl Copyright (C) 2002-2003, 2007-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,
# Prerequisites of lib/rpmatch.c.
AC_DEFUN([gl_PREREQ_RPMATCH], [
- AC_CACHE_CHECK([for nl_langinfo and YESEXPR], [gl_cv_langinfo_yesexpr],
- [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <langinfo.h>]],
- [[char* cs = nl_langinfo(YESEXPR); return !cs;]])],
- [gl_cv_langinfo_yesexpr=yes],
- [gl_cv_langinfo_yesexpr=no])
- ])
- if test $gl_cv_langinfo_yesexpr = yes; then
- AC_DEFINE([HAVE_LANGINFO_YESEXPR], [1],
- [Define if you have <langinfo.h> and nl_langinfo(YESEXPR).])
- fi
+ AC_CHECK_HEADERS_ONCE([langinfo.h])
])
-e 's|@''NEXT_LANGINFO_H''@|$(NEXT_LANGINFO_H)|g' \
-e 's/@''GNULIB_NL_LANGINFO''@/$(GNULIB_NL_LANGINFO)/g' \
-e 's|@''HAVE_LANGINFO_CODESET''@|$(HAVE_LANGINFO_CODESET)|g' \
- -e 's|@''HAVE_LANGINFO_T_FMT_AMPM''@|$(HAVE_LANGINFO_T_FMT_AMPM)|g' \
-e 's|@''HAVE_LANGINFO_ALTMON''@|$(HAVE_LANGINFO_ALTMON)|g' \
-e 's|@''HAVE_LANGINFO_ABALTMON''@|$(HAVE_LANGINFO_ABALTMON)|g' \
-e 's|@''HAVE_LANGINFO_ERA''@|$(HAVE_LANGINFO_ERA)|g' \
- -e 's|@''HAVE_LANGINFO_YESEXPR''@|$(HAVE_LANGINFO_YESEXPR)|g' \
-e 's|@''HAVE_NL_LANGINFO''@|$(HAVE_NL_LANGINFO)|g' \
-e 's|@''REPLACE_NL_LANGINFO''@|$(REPLACE_NL_LANGINFO)|g' \
-e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \