From: Bruno Haible Date: Fri, 14 Feb 2025 13:32:30 +0000 (+0100) Subject: newlocale, freelocale: Tweak configuration. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e8618f66fa25932f1121632b52044abb27a6ecec;p=thirdparty%2Fgnulib.git newlocale, freelocale: Tweak configuration. * m4/newlocale.m4 (gl_FUNC_NEWLOCALE): Make consistent with m4/localename.m4. * m4/freelocale.m4 (gl_FUNC_FREELOCALE): Likewise. --- diff --git a/ChangeLog b/ChangeLog index 50b6a1daf3..03cc2df88b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2025-02-14 Bruno Haible + + newlocale, freelocale: Tweak configuration. + * m4/newlocale.m4 (gl_FUNC_NEWLOCALE): Make consistent with + m4/localename.m4. + * m4/freelocale.m4 (gl_FUNC_FREELOCALE): Likewise. + 2025-02-14 Bruno Haible duplocale: Support all platforms. diff --git a/m4/freelocale.m4 b/m4/freelocale.m4 index 61fc0a93bd..5c6a144a74 100644 --- a/m4/freelocale.m4 +++ b/m4/freelocale.m4 @@ -1,5 +1,5 @@ # freelocale.m4 -# serial 1 +# serial 2 dnl Copyright (C) 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, @@ -9,9 +9,21 @@ dnl This file is offered as-is, without any warranty. AC_DEFUN([gl_FUNC_FREELOCALE], [ AC_REQUIRE([gl_LOCALE_H_DEFAULTS]) - gl_CHECK_FUNCS_ANDROID([freelocale], [[#include ]]) - if test $ac_cv_func_freelocale = no; then + AC_REQUIRE([gl_LOCALE_T]) + if test $HAVE_LOCALE_T = 1; then + gl_CHECK_FUNCS_ANDROID([freelocale], [[#include ]]) + gl_func_freelocale="$ac_cv_func_freelocale" + else + dnl In 2019, some versions of z/OS lack the locale_t type and have broken + dnl newlocale, duplocale, freelocale functions. + gl_cv_onwards_func_freelocale='future OS version' + gl_func_freelocale=no + fi + if test $gl_func_freelocale != yes; then HAVE_FREELOCALE=0 + case "$gl_cv_onwards_func_freelocale" in + future*) REPLACE_FREELOCALE=1 ;; + esac fi ]) diff --git a/m4/newlocale.m4 b/m4/newlocale.m4 index b2475eb16f..13df13808e 100644 --- a/m4/newlocale.m4 +++ b/m4/newlocale.m4 @@ -1,5 +1,5 @@ # newlocale.m4 -# serial 1 +# serial 2 dnl Copyright (C) 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, @@ -9,9 +9,21 @@ dnl This file is offered as-is, without any warranty. AC_DEFUN([gl_FUNC_NEWLOCALE], [ AC_REQUIRE([gl_LOCALE_H_DEFAULTS]) - gl_CHECK_FUNCS_ANDROID([newlocale], [[#include ]]) - if test $ac_cv_func_newlocale = no; then + AC_REQUIRE([gl_LOCALE_T]) + if test $HAVE_LOCALE_T = 1; then + gl_CHECK_FUNCS_ANDROID([newlocale], [[#include ]]) + gl_func_newlocale="$ac_cv_func_newlocale" + else + dnl In 2019, some versions of z/OS lack the locale_t type and have broken + dnl newlocale, duplocale, freelocale functions. + gl_cv_onwards_func_newlocale='future OS version' + gl_func_newlocale=no + fi + if test $gl_func_newlocale != yes; then HAVE_NEWLOCALE=0 + case "$gl_cv_onwards_func_newlocale" in + future*) REPLACE_NEWLOCALE=1 ;; + esac fi ])