]> git.ipfire.org Git - thirdparty/gnulib.git/commitdiff
newlocale, freelocale: Tweak configuration.
authorBruno Haible <bruno@clisp.org>
Fri, 14 Feb 2025 13:32:30 +0000 (14:32 +0100)
committerBruno Haible <bruno@clisp.org>
Fri, 14 Feb 2025 14:43:38 +0000 (15:43 +0100)
* m4/newlocale.m4 (gl_FUNC_NEWLOCALE): Make consistent with
m4/localename.m4.
* m4/freelocale.m4 (gl_FUNC_FREELOCALE): Likewise.

ChangeLog
m4/freelocale.m4
m4/newlocale.m4

index 50b6a1daf3c77910ec0cbeefd236378f7e51cb89..03cc2df88b773158e0d8b09e09d3515a661dba17 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2025-02-14  Bruno Haible  <bruno@clisp.org>
+
+       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  <bruno@clisp.org>
 
        duplocale: Support all platforms.
index 61fc0a93bda2ea6814900b34b6f0d789db367cf8..5c6a144a747fc25e969043df6196d139696be308 100644 (file)
@@ -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 <locale.h>]])
-  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 <locale.h>]])
+    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
 ])
 
index b2475eb16f4de8e89b443f2fe2a59f970213cd5d..13df13808ecfa25135300513e2aa5e55b716550c 100644 (file)
@@ -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 <locale.h>]])
-  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 <locale.h>]])
+    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
 ])