Pádraig Brady wrote:
> I don't think it's related, but just in case
> in config.log I see the following due to CXX being unset:
> 
> configure:13319: checking whether the C++ compiler has 
> <uchar.h>configure:13328:    -c conftest.cpp
> ../configure: line 13329: eval: -c: invalid option
> eval: usage: eval [arg ...]
> configure:13331: $? = 2
> configure:13340: result: no

Fixed as follows:


2026-05-06  Bruno Haible  <[email protected]>

        stdckdint-h, stdcountof-h, uchar-h: Simplify for when C++ is not used.
        Reported by Pádraig Brady in
        <https://lists.gnu.org/archive/html/bug-gnulib/2026-05/msg00032.html>.
        * m4/stdckdint_h.m4 (gl_STDCKDINT_H): When $CXX is empty, don't run C++
        specific tests.
        * m4/stdcountof_h.m4 (gl_STDCOUNTOF_H): Likewise.
        * m4/uchar_h.m4 (gl_UCHAR_H): Likewise.

diff --git a/m4/stdckdint_h.m4 b/m4/stdckdint_h.m4
index eb8c858a2d..0abeb982b4 100644
--- a/m4/stdckdint_h.m4
+++ b/m4/stdckdint_h.m4
@@ -1,5 +1,5 @@
 # stdckdint_h.m4
-# serial 1
+# serial 2
 dnl Copyright 2025-2026 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -52,7 +52,7 @@ AC_DEFUN_ONCE([gl_STDCKDINT_H]
       HAVE_C_STDCKDINT_H=0
       HAVE_WORKING_C_STDCKDINT_H=0
     fi
-    if test "$CXX" != no; then
+    if test -n "$CXX" && test "$CXX" != no; then
       AC_CACHE_CHECK([whether stdckdint.h can be included in C++],
         [gl_cv_header_cxx_stdckdint_h],
         [dnl We can't use AC_LANG_PUSH([C++]) and AC_LANG_POP([C++]) here, due 
to
@@ -114,7 +114,7 @@ AC_DEFUN_ONCE([gl_STDCKDINT_H]
   AC_SUBST([HAVE_CXX_STDCKDINT_H])
   AC_SUBST([HAVE_WORKING_CXX_STDCKDINT_H])
 
-  if test "$CXX" != no; then
+  if test -n "$CXX" && test "$CXX" != no; then
     dnl We might need the header for C or C++.
     if test $HAVE_C_STDCKDINT_H = 1 \
        && test $HAVE_WORKING_C_STDCKDINT_H = 1 \
diff --git a/m4/stdcountof_h.m4 b/m4/stdcountof_h.m4
index 74fa626088..6a888e2d97 100644
--- a/m4/stdcountof_h.m4
+++ b/m4/stdcountof_h.m4
@@ -1,5 +1,5 @@
 # stdcountof_h.m4
-# serial 2
+# serial 3
 dnl Copyright 2025-2026 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -21,7 +21,7 @@ AC_DEFUN_ONCE([gl_STDCOUNTOF_H]
   dnl it uses _Countof, which is not a compiler built-in in C++ mode.
   m4_ifdef([gl_ANSI_CXX], [AC_REQUIRE([gl_ANSI_CXX])])
   CXX_HAVE_STDCOUNTOF_H=1
-  if test "$CXX" != no; then
+  if test -n "$CXX" && test "$CXX" != no; then
     AC_CACHE_CHECK([whether the C++ compiler has <stdcountof.h>],
       [gl_cv_cxx_have_stdcountof_h],
       [dnl We can't use AC_LANG_PUSH([C++]) and AC_LANG_POP([C++]) here, due to
diff --git a/m4/uchar_h.m4 b/m4/uchar_h.m4
index 20b63b6cdf..508f544c3d 100644
--- a/m4/uchar_h.m4
+++ b/m4/uchar_h.m4
@@ -1,5 +1,5 @@
 # uchar_h.m4
-# serial 32
+# serial 33
 dnl Copyright (C) 2019-2026 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -27,7 +27,7 @@ AC_DEFUN_ONCE([gl_UCHAR_H]
   dnl  header."
   m4_ifdef([gl_ANSI_CXX], [AC_REQUIRE([gl_ANSI_CXX])])
   CXX_HAVE_UCHAR_H=0
-  if test "$CXX" != no; then
+  if test -n "$CXX" && test "$CXX" != no; then
     AC_CACHE_CHECK([whether the C++ compiler has <uchar.h>],
       [gl_cv_cxx_have_uchar_h],
       [dnl We can't use AC_LANG_PUSH([C++]) and AC_LANG_POP([C++]) here, due to
@@ -61,7 +61,7 @@ AC_DEFUN_ONCE([gl_UCHAR_H]
   m4_ifdef([gl_ANSI_CXX], [AC_REQUIRE([gl_ANSI_CXX])])
   CXX_HAS_UCHAR_TYPES=0
   if test $HAVE_UCHAR_H = 0; then
-    if test "$CXX" != no; then
+    if test -n "$CXX" && test "$CXX" != no; then
       AC_CACHE_CHECK([whether the C++ compiler predefines the <uchar.h> types],
         [gl_cv_cxx_has_uchar_types],
         [dnl We can't use AC_LANG_PUSH([C++]) and AC_LANG_POP([C++]) here, due 
to
@@ -87,7 +87,7 @@ AC_DEFUN_ONCE([gl_UCHAR_H]
   AC_SUBST([CXX_HAS_UCHAR_TYPES])
   CXX_HAS_CHAR8_TYPE=0
   if test $HAVE_UCHAR_H = 0; then
-    if test "$CXX" != no; then
+    if test -n "$CXX" && test "$CXX" != no; then
       AC_CACHE_CHECK([whether the C++ compiler predefines the char8_t type],
         [gl_cv_cxx_has_char8_type],
         [dnl We can't use AC_LANG_PUSH([C++]) and AC_LANG_POP([C++]) here, due 
to




Reply via email to