bug-gnulib@gnu.org mirror (unofficial)
 help / color / mirror / Atom feed
* Interference between two installations of gnulib
@ 2021-04-10  7:38 Reuben Thomas
  2021-04-11 19:32 ` Bruno Haible
  0 siblings, 1 reply; 8+ messages in thread
From: Reuben Thomas @ 2021-04-10  7:38 UTC (permalink / raw)
  To: bug-gnulib

[-- Attachment #1: Type: text/plain, Size: 764 bytes --]

I have made two installations of gnulib in a project, because I am using
both relocatable-prog and relocatable-lib-lgpl.

I have different modules installed for each, of course.

I just had a problem where my library would not compile, because it was
missing setlocale_null.h. GNULIB_SETLOCALE_NULL was indeed set to 1 by
configure.

The "library gnulib" uses only "locale", which does not depend on
setloacle-null, while the "program gnulib" uses "quote", which does.

I was able to work around this by adding "setlocale" to the library gnulib
(I could not use "quote", as that is a GPL module); but have I done
something wrong here? I can't see how I would fix this in general without
having two configure scripts…

-- 
https://rrt.sc3d.org

[-- Attachment #2: Type: text/html, Size: 1894 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Interference between two installations of gnulib
  2021-04-10  7:38 Interference between two installations of gnulib Reuben Thomas
@ 2021-04-11 19:32 ` Bruno Haible
  2021-04-12  7:50   ` Reuben Thomas
                     ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Bruno Haible @ 2021-04-11 19:32 UTC (permalink / raw)
  To: bug-gnulib; +Cc: Reuben Thomas

[-- Attachment #1: Type: text/plain, Size: 1172 bytes --]

Hi Reuben,

> I have made two installations of gnulib in a project, because I am using
> both relocatable-prog and relocatable-lib-lgpl.
> 
> I have different modules installed for each, of course.
> 
> I just had a problem where my library would not compile, because it was
> missing setlocale_null.h. GNULIB_SETLOCALE_NULL was indeed set to 1 by
> configure.
> 
> The "library gnulib" uses only "locale", which does not depend on
> setloacle-null, while the "program gnulib" uses "quote", which does.
> 
> I was able to work around this by adding "setlocale" to the library gnulib
> (I could not use "quote", as that is a GPL module); but have I done
> something wrong here? I can't see how I would fix this in general without
> having two configure scripts…

Having two separate configure scripts is undesirable, because that would
increase the total configure time of the package (and people have already
complained about the configure time).

The same problem is seen also in GNU gettext and in GNU poke. I'm fixing it
through the attached patch set.

So, you can now remove 'setlocale' from the modules of your library again.

Bruno


[-- Attachment #2: 0001-Rename-GNULIB_OVERRIDES_WINT_T.patch --]
[-- Type: text/x-patch, Size: 8855 bytes --]

From db16856ae761bc213942c17f6fc2b7e9655014b4 Mon Sep 17 00:00:00 2001
From: Bruno Haible <bruno@clisp.org>
Date: Sun, 11 Apr 2021 15:50:35 +0200
Subject: [PATCH 1/3] Rename GNULIB_OVERRIDES_WINT_T.

* GNULIBHEADERS_OVERRIDE_WINT_T: Renamed from GNULIB_OVERRIDES_WINT_T.
---
 ChangeLog        |  5 +++++
 lib/stdint.in.h  |  4 ++--
 lib/wchar.in.h   |  2 +-
 lib/wctype.in.h  | 10 +++++-----
 m4/stdint.m4     |  4 ++--
 m4/wctype_h.m4   |  4 ++--
 m4/wint_t.m4     | 10 +++++-----
 modules/iswctype |  2 +-
 modules/stdint   |  2 +-
 modules/wchar    |  2 +-
 modules/wctype-h |  2 +-
 11 files changed, 26 insertions(+), 21 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 9a46d74..303747d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2021-04-11  Bruno Haible  <bruno@clisp.org>
 
+	Rename GNULIB_OVERRIDES_WINT_T.
+	* GNULIBHEADERS_OVERRIDE_WINT_T: Renamed from GNULIB_OVERRIDES_WINT_T.
+
+2021-04-11  Bruno Haible  <bruno@clisp.org>
+
 	increment-serial: New program.
 	* build-aux/increment-serial: New file.
 
diff --git a/lib/stdint.in.h b/lib/stdint.in.h
index 60f0b4b..c7b00da 100644
--- a/lib/stdint.in.h
+++ b/lib/stdint.in.h
@@ -85,7 +85,7 @@
 
 /* Override WINT_MIN and WINT_MAX if gnulib's <wchar.h> or <wctype.h> overrides
    wint_t.  */
-#if @GNULIB_OVERRIDES_WINT_T@
+#if @GNULIBHEADERS_OVERRIDE_WINT_T@
 # undef WINT_MIN
 # undef WINT_MAX
 # define WINT_MIN 0x0U
@@ -598,7 +598,7 @@ typedef int _verify_intmax_size[sizeof (intmax_t) == sizeof (uintmax_t)
 /* wint_t limits */
 /* If gnulib's <wchar.h> or <wctype.h> overrides wint_t, @WINT_T_SUFFIX@ is not
    accurate, therefore use the definitions from above.  */
-# if !@GNULIB_OVERRIDES_WINT_T@
+# if !@GNULIBHEADERS_OVERRIDE_WINT_T@
 #  undef WINT_MIN
 #  undef WINT_MAX
 #  if @HAVE_SIGNED_WINT_T@
diff --git a/lib/wchar.in.h b/lib/wchar.in.h
index 4f1239e..cc68c0c 100644
--- a/lib/wchar.in.h
+++ b/lib/wchar.in.h
@@ -111,7 +111,7 @@
 /* mingw and MSVC define wint_t as 'unsigned short' in <crtdefs.h> or
    <stddef.h>.  This is too small: ISO C 99 section 7.24.1.(2) says that
    wint_t must be "unchanged by default argument promotions".  Override it.  */
-# if @GNULIB_OVERRIDES_WINT_T@
+# if @GNULIBHEADERS_OVERRIDE_WINT_T@
 #  if !GNULIB_defined_wint_t
 #   if @HAVE_CRTDEFS_H@
 #    include <crtdefs.h>
diff --git a/lib/wctype.in.h b/lib/wctype.in.h
index 82f0977..08b608f 100644
--- a/lib/wctype.in.h
+++ b/lib/wctype.in.h
@@ -103,7 +103,7 @@ _GL_INLINE_HEADER_BEGIN
 /* mingw and MSVC define wint_t as 'unsigned short' in <crtdefs.h> or
    <stddef.h>.  This is too small: ISO C 99 section 7.24.1.(2) says that
    wint_t must be "unchanged by default argument promotions".  Override it.  */
-# if @GNULIB_OVERRIDES_WINT_T@
+# if @GNULIBHEADERS_OVERRIDE_WINT_T@
 #  if !GNULIB_defined_wint_t
 #   if @HAVE_CRTDEFS_H@
 #    include <crtdefs.h>
@@ -132,7 +132,7 @@ typedef unsigned int rpl_wint_t;
    same way, or not at all.  */
 # if ! @HAVE_ISWCNTRL@ || @REPLACE_ISWCNTRL@
 
-#  if @GNULIB_OVERRIDES_WINT_T@ /* implies @REPLACE_ISWCNTRL@ */
+#  if @GNULIBHEADERS_OVERRIDE_WINT_T@ /* implies @REPLACE_ISWCNTRL@ */
 
 _GL_WCTYPE_INLINE int
 rpl_iswalnum (wint_t wc)
@@ -496,7 +496,7 @@ _GL_FUNCDECL_RPL (iswxdigit, int, (wint_t wc));
 
 # endif
 
-# if defined __MINGW32__ && !@GNULIB_OVERRIDES_WINT_T@
+# if defined __MINGW32__ && !@GNULIBHEADERS_OVERRIDE_WINT_T@
 
 /* On native Windows, wchar_t is uint16_t, and wint_t is uint32_t.
    The functions towlower and towupper are implemented in the MSVCRT library
@@ -529,7 +529,7 @@ rpl_towupper (wint_t wc)
 #   define towupper rpl_towupper
 #  endif
 
-# endif /* __MINGW32__ && !@GNULIB_OVERRIDES_WINT_T@ */
+# endif /* __MINGW32__ && !@GNULIBHEADERS_OVERRIDE_WINT_T@ */
 
 # define GNULIB_defined_wctype_functions 1
 #endif
@@ -646,7 +646,7 @@ _GL_WARN_ON_USE (wctype, "wctype is unportable - "
    The argument WC must be either a wchar_t value or WEOF.
    The argument DESC must have been returned by the wctype() function.  */
 #if @GNULIB_ISWCTYPE@
-# if @GNULIB_OVERRIDES_WINT_T@
+# if @GNULIBHEADERS_OVERRIDE_WINT_T@
 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 #   undef iswctype
 #   define iswctype rpl_iswctype
diff --git a/m4/stdint.m4 b/m4/stdint.m4
index a785b44..3406445 100644
--- a/m4/stdint.m4
+++ b/m4/stdint.m4
@@ -1,4 +1,4 @@
-# stdint.m4 serial 58
+# stdint.m4 serial 59
 dnl Copyright (C) 2001-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -527,7 +527,7 @@ AC_DEFUN([gl_STDINT_TYPE_PROPERTIES],
   dnl requirement that wint_t is "unchanged by default argument promotions".
   dnl In this case gnulib's <wchar.h> and <wctype.h> override wint_t.
   dnl Set the variable BITSIZEOF_WINT_T accordingly.
-  if test $GNULIB_OVERRIDES_WINT_T = 1; then
+  if test $GNULIBHEADERS_OVERRIDE_WINT_T = 1; then
     BITSIZEOF_WINT_T=32
   fi
 ])
diff --git a/m4/wctype_h.m4 b/m4/wctype_h.m4
index ea5274c..3ac5e64 100644
--- a/m4/wctype_h.m4
+++ b/m4/wctype_h.m4
@@ -1,4 +1,4 @@
-# wctype_h.m4 serial 27
+# wctype_h.m4 serial 28
 
 dnl A placeholder for ISO C99 <wctype.h>, for platforms that lack it.
 
@@ -62,7 +62,7 @@ AC_DEFUN([gl_WCTYPE_H],
   fi
   AC_SUBST([HAVE_WCTYPE_H])
 
-  if test $GNULIB_OVERRIDES_WINT_T = 1; then
+  if test $GNULIBHEADERS_OVERRIDE_WINT_T = 1; then
     REPLACE_ISWCNTRL=1
   else
     case "$gl_cv_func_iswcntrl_works" in
diff --git a/m4/wint_t.m4 b/m4/wint_t.m4
index 2fc7467..a49c508 100644
--- a/m4/wint_t.m4
+++ b/m4/wint_t.m4
@@ -1,4 +1,4 @@
-# wint_t.m4 serial 10
+# wint_t.m4 serial 11
 dnl Copyright (C) 2003, 2007-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -34,14 +34,14 @@ AC_DEFUN([gt_TYPE_WINT_T],
          [gl_cv_type_wint_t_large_enough=yes],
          [gl_cv_type_wint_t_large_enough=no])])
     if test $gl_cv_type_wint_t_large_enough = no; then
-      GNULIB_OVERRIDES_WINT_T=1
+      GNULIBHEADERS_OVERRIDE_WINT_T=1
     else
-      GNULIB_OVERRIDES_WINT_T=0
+      GNULIBHEADERS_OVERRIDE_WINT_T=0
     fi
   else
-    GNULIB_OVERRIDES_WINT_T=0
+    GNULIBHEADERS_OVERRIDE_WINT_T=0
   fi
-  AC_SUBST([GNULIB_OVERRIDES_WINT_T])
+  AC_SUBST([GNULIBHEADERS_OVERRIDE_WINT_T])
 ])
 
 dnl Prerequisites of the 'wint_t' override.
diff --git a/modules/iswctype b/modules/iswctype
index 9fce684..8a8343d 100644
--- a/modules/iswctype
+++ b/modules/iswctype
@@ -17,7 +17,7 @@ wctype-h
 
 configure.ac:
 gl_FUNC_ISWCTYPE
-if test $HAVE_WCTYPE_T = 0 || test $GNULIB_OVERRIDES_WINT_T = 1; then
+if test $HAVE_WCTYPE_T = 0 || test $GNULIBHEADERS_OVERRIDE_WINT_T = 1; then
   AC_LIBOBJ([iswctype])
 fi
 gl_WCTYPE_MODULE_INDICATOR([iswctype])
diff --git a/modules/stdint b/modules/stdint
index 25b9d7f..0c7e878 100644
--- a/modules/stdint
+++ b/modules/stdint
@@ -56,7 +56,7 @@ stdint.h: stdint.in.h $(top_builddir)/config.status
 	      -e 's/@''BITSIZEOF_WINT_T''@/$(BITSIZEOF_WINT_T)/g' \
 	      -e 's/@''HAVE_SIGNED_WINT_T''@/$(HAVE_SIGNED_WINT_T)/g' \
 	      -e 's/@''WINT_T_SUFFIX''@/$(WINT_T_SUFFIX)/g' \
-	      -e 's/@''GNULIB_OVERRIDES_WINT_T''@/$(GNULIB_OVERRIDES_WINT_T)/g' \
+	      -e 's/@''GNULIBHEADERS_OVERRIDE_WINT_T''@/$(GNULIBHEADERS_OVERRIDE_WINT_T)/g' \
 	      < $(srcdir)/stdint.in.h; \
 	} > $@-t && \
 	mv $@-t $@
diff --git a/modules/wchar b/modules/wchar
index e5c0da3..7ec1c02 100644
--- a/modules/wchar
+++ b/modules/wchar
@@ -34,7 +34,7 @@ wchar.h: wchar.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H)
 	      -e 's|@''NEXT_WCHAR_H''@|$(NEXT_WCHAR_H)|g' \
 	      -e 's|@''HAVE_WCHAR_H''@|$(HAVE_WCHAR_H)|g' \
 	      -e 's/@''HAVE_CRTDEFS_H''@/$(HAVE_CRTDEFS_H)/g' \
-	      -e 's/@''GNULIB_OVERRIDES_WINT_T''@/$(GNULIB_OVERRIDES_WINT_T)/g' \
+	      -e 's/@''GNULIBHEADERS_OVERRIDE_WINT_T''@/$(GNULIBHEADERS_OVERRIDE_WINT_T)/g' \
 	      -e 's/@''GNULIB_BTOWC''@/$(GNULIB_BTOWC)/g' \
 	      -e 's/@''GNULIB_WCTOB''@/$(GNULIB_WCTOB)/g' \
 	      -e 's/@''GNULIB_MBSINIT''@/$(GNULIB_MBSINIT)/g' \
diff --git a/modules/wctype-h b/modules/wctype-h
index b7aef46..8da4b8f 100644
--- a/modules/wctype-h
+++ b/modules/wctype-h
@@ -32,7 +32,7 @@ wctype.h: wctype.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_USE_H
 	      -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
 	      -e 's|@''NEXT_WCTYPE_H''@|$(NEXT_WCTYPE_H)|g' \
 	      -e 's/@''HAVE_CRTDEFS_H''@/$(HAVE_CRTDEFS_H)/g' \
-	      -e 's/@''GNULIB_OVERRIDES_WINT_T''@/$(GNULIB_OVERRIDES_WINT_T)/g' \
+	      -e 's/@''GNULIBHEADERS_OVERRIDE_WINT_T''@/$(GNULIBHEADERS_OVERRIDE_WINT_T)/g' \
 	      -e 's/@''GNULIB_ISWBLANK''@/$(GNULIB_ISWBLANK)/g' \
 	      -e 's/@''GNULIB_ISWDIGIT''@/$(GNULIB_ISWDIGIT)/g' \
 	      -e 's/@''GNULIB_ISWXDIGIT''@/$(GNULIB_ISWXDIGIT)/g' \
-- 
2.7.4


[-- Attachment #3: 0002-Rename-GNULIB_OVERRIDES_CHAR16_T-GNULIB_OVERRIDES_CH.patch --]
[-- Type: text/x-patch, Size: 5186 bytes --]

From 8b857ed1ad1cbbf265d43016ee7ee93c7b7c6cb4 Mon Sep 17 00:00:00 2001
From: Bruno Haible <bruno@clisp.org>
Date: Sun, 11 Apr 2021 15:54:18 +0200
Subject: [PATCH 2/3] Rename GNULIB_OVERRIDES_CHAR16_T,
 GNULIB_OVERRIDES_CHAR32_T.

* GNULIBHEADERS_OVERRIDE_CHAR16_T: Renamed from
GNULIB_OVERRIDES_CHAR16_T.
* GNULIBHEADERS_OVERRIDE_CHAR32_T: Renamed from
GNULIB_OVERRIDES_CHAR32_T.
---
 ChangeLog      |  6 ++++++
 lib/uchar.in.h |  4 ++--
 m4/mbrtoc32.m4 |  6 +++---
 m4/uchar.m4    | 10 +++++-----
 modules/uchar  |  4 ++--
 5 files changed, 18 insertions(+), 12 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 303747d..aeb2476 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2021-04-11  Bruno Haible  <bruno@clisp.org>
 
+	Rename GNULIB_OVERRIDES_CHAR16_T, GNULIB_OVERRIDES_CHAR32_T.
+	* GNULIBHEADERS_OVERRIDE_CHAR16_T: Renamed from
+	GNULIB_OVERRIDES_CHAR16_T.
+	* GNULIBHEADERS_OVERRIDE_CHAR32_T: Renamed from
+	GNULIB_OVERRIDES_CHAR32_T.
+
 	Rename GNULIB_OVERRIDES_WINT_T.
 	* GNULIBHEADERS_OVERRIDE_WINT_T: Renamed from GNULIB_OVERRIDES_WINT_T.
 
diff --git a/lib/uchar.in.h b/lib/uchar.in.h
index ba96335..f52535a 100644
--- a/lib/uchar.in.h
+++ b/lib/uchar.in.h
@@ -47,7 +47,7 @@
    on which __STDC_UTF_16__ is defined.)  */
 typedef uint_least16_t char16_t;
 
-#elif @GNULIB_OVERRIDES_CHAR16_T@
+#elif @GNULIBHEADERS_OVERRIDE_CHAR16_T@
 
 typedef uint_least16_t gl_char16_t;
 # define char16_t gl_char16_t
@@ -61,7 +61,7 @@ typedef uint_least16_t gl_char16_t;
    on which __STDC_UTF_32__ is defined.)  */
 typedef uint_least32_t char32_t;
 
-#elif @GNULIB_OVERRIDES_CHAR32_T@
+#elif @GNULIBHEADERS_OVERRIDE_CHAR32_T@
 
 typedef uint_least32_t gl_char32_t;
 # define char32_t gl_char32_t
diff --git a/m4/mbrtoc32.m4 b/m4/mbrtoc32.m4
index ba0397b..0966ea1 100644
--- a/m4/mbrtoc32.m4
+++ b/m4/mbrtoc32.m4
@@ -1,4 +1,4 @@
-# mbrtoc32.m4 serial 7
+# mbrtoc32.m4 serial 8
 dnl Copyright (C) 2014-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -18,7 +18,7 @@ AC_DEFUN([gl_FUNC_MBRTOC32],
   if test $gl_cv_func_mbrtoc32 = no; then
     HAVE_MBRTOC32=0
   else
-    if test $GNULIB_OVERRIDES_CHAR32_T = 1 || test $REPLACE_MBSTATE_T = 1; then
+    if test $GNULIBHEADERS_OVERRIDE_CHAR32_T = 1 || test $REPLACE_MBSTATE_T = 1; then
       REPLACE_MBRTOC32=1
     else
       gl_MBRTOC32_EMPTY_INPUT
@@ -147,7 +147,7 @@ AC_DEFUN([gl_MBRTOC32_SANITYCHECK],
   AC_REQUIRE([gt_LOCALE_FR])
   AC_REQUIRE([gt_LOCALE_ZH_CN])
   AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
-  if test $GNULIB_OVERRIDES_CHAR32_T = 1 || test $gl_cv_func_mbrtoc32 = no; then
+  if test $GNULIBHEADERS_OVERRIDE_CHAR32_T = 1 || test $gl_cv_func_mbrtoc32 = no; then
     HAVE_WORKING_MBRTOC32=0
   else
     AC_CACHE_CHECK([whether mbrtoc32 works as well as mbrtowc],
diff --git a/m4/uchar.m4 b/m4/uchar.m4
index 0729541..62c6e06 100644
--- a/m4/uchar.m4
+++ b/m4/uchar.m4
@@ -1,4 +1,4 @@
-# uchar.m4 serial 17
+# uchar.m4 serial 18
 dnl Copyright (C) 2019-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -91,7 +91,7 @@ AC_DEFUN_ONCE([gl_TYPE_CHAR16_T],
        [gl_cv_type_char16_t_works=no])
     ])
   if test $gl_cv_type_char16_t_works = no; then
-    GNULIB_OVERRIDES_CHAR16_T=1
+    GNULIBHEADERS_OVERRIDE_CHAR16_T=1
   fi
 ])
 AC_DEFUN_ONCE([gl_TYPE_CHAR32_T],
@@ -112,7 +112,7 @@ AC_DEFUN_ONCE([gl_TYPE_CHAR32_T],
        [gl_cv_type_char32_t_works=no])
     ])
   if test $gl_cv_type_char32_t_works = no; then
-    GNULIB_OVERRIDES_CHAR32_T=1
+    GNULIBHEADERS_OVERRIDE_CHAR32_T=1
   fi
 ])
 
@@ -127,8 +127,8 @@ AC_DEFUN([gl_UCHAR_MODULE_INDICATOR],
 
 AC_DEFUN([gl_UCHAR_H_DEFAULTS],
 [
-  gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_OVERRIDES_CHAR16_T])
-  gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_OVERRIDES_CHAR32_T])
+  gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIBHEADERS_OVERRIDE_CHAR16_T])
+  gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIBHEADERS_OVERRIDE_CHAR32_T])
   gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_BTOC32])
   gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_C32ISALNUM])
   gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_C32ISALPHA])
diff --git a/modules/uchar b/modules/uchar
index 7cddcad..e449dd9 100644
--- a/modules/uchar
+++ b/modules/uchar
@@ -29,8 +29,8 @@ uchar.h: uchar.in.h $(top_builddir)/config.status $(CXXDEFS_H)
 	      -e 's|@''NEXT_UCHAR_H''@|$(NEXT_UCHAR_H)|g' \
 	      -e 's|@''CXX_HAS_UCHAR_TYPES''@|$(CXX_HAS_UCHAR_TYPES)|g' \
 	      -e 's|@''SMALL_WCHAR_T''@|$(SMALL_WCHAR_T)|g' \
-	      -e 's|@''GNULIB_OVERRIDES_CHAR16_T''@|$(GNULIB_OVERRIDES_CHAR16_T)|g' \
-	      -e 's|@''GNULIB_OVERRIDES_CHAR32_T''@|$(GNULIB_OVERRIDES_CHAR32_T)|g' \
+	      -e 's|@''GNULIBHEADERS_OVERRIDE_CHAR16_T''@|$(GNULIBHEADERS_OVERRIDE_CHAR16_T)|g' \
+	      -e 's|@''GNULIBHEADERS_OVERRIDE_CHAR32_T''@|$(GNULIBHEADERS_OVERRIDE_CHAR32_T)|g' \
 	      -e 's/@''GNULIB_BTOC32''@/$(GNULIB_BTOC32)/g' \
 	      -e 's/@''GNULIB_C32ISALNUM''@/$(GNULIB_C32ISALNUM)/g' \
 	      -e 's/@''GNULIB_C32ISALPHA''@/$(GNULIB_C32ISALPHA)/g' \
-- 
2.7.4


[-- Attachment #4: 0003-Support-several-gnulib-tool-invocations-under-the-sa.patch.gz --]
[-- Type: application/gzip, Size: 31786 bytes --]

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: Interference between two installations of gnulib
  2021-04-11 19:32 ` Bruno Haible
@ 2021-04-12  7:50   ` Reuben Thomas
  2021-04-17 15:17   ` Bruno Haible
  2021-06-13 17:41   ` Paul Eggert
  2 siblings, 0 replies; 8+ messages in thread
From: Reuben Thomas @ 2021-04-12  7:50 UTC (permalink / raw)
  To: Bruno Haible; +Cc: bug-gnulib

[-- Attachment #1: Type: text/plain, Size: 492 bytes --]

On Sun, 11 Apr 2021 at 20:32, Bruno Haible <bruno@clisp.org> wrote:

>
> Having two separate configure scripts is undesirable, because that would
> increase the total configure time of the package (and people have already
> complained about the configure time).
>
> The same problem is seen also in GNU gettext and in GNU poke. I'm fixing it
> through the attached patch set.
>
> So, you can now remove 'setlocale' from the modules of your library again.
>

Thanks!

-- 
https://rrt.sc3d.org

[-- Attachment #2: Type: text/html, Size: 1094 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Interference between two installations of gnulib
  2021-04-11 19:32 ` Bruno Haible
  2021-04-12  7:50   ` Reuben Thomas
@ 2021-04-17 15:17   ` Bruno Haible
  2021-04-18 11:16     ` Bruno Haible
  2021-06-13 17:41   ` Paul Eggert
  2 siblings, 1 reply; 8+ messages in thread
From: Bruno Haible @ 2021-04-17 15:17 UTC (permalink / raw)
  To: bug-gnulib; +Cc: Reuben Thomas

These patches caused a build failure in GNU libunistring:

gcc -DHAVE_CONFIG_H -DEXEEXT=\"\" -I. -I../../../sources/libunistring/tests -I../lib -I..  -DIN_LIBUNISTRING_GNULIB_TESTS=1 -I. -I../../../sources/libunistring/tests -I.. -I../../../sources/libunistring/tests/.. -I../lib -I../../../sources/libunistring/tests/../lib -Wall  -g -O2 -MT locale.o -MD -MP -MF $depbase.Tpo -c -o locale.o ../../../sources/libunistring/tests/locale.c &&\
mv -f $depbase.Tpo $depbase.Po
In file included from ../../../sources/libunistring/tests/locale.c:22:0:
./stdio.h:830:5: error: #if with no expression
./stdio.h:846:5: error: #if with no expression
...

The problem is that the macro gl_STDIO_H_REQUIRE_DEFAULTS must only be invoked,
never AC_REQUIREd. Hence all gl_STDIO_MODULE_INDICATOR invocations must also
only be invoked, never AC_REQUIREd. But gl_STDIO_H is automatically AC_REQUIREd,
since it is defined through AC_DEFUN_ONCE.

This patch fixes it.


2021-04-17  Bruno Haible  <bruno@clisp.org>

	stdio: Fix build error in some configurations (regression 2021-04-11).
	* m4/stdio_h.m4 (gl_STDIO_H): Move gl_STDIO_MODULE_INDICATOR and
	gl_MODULE_INDICATOR invocations from here...
	* modules/stdio (configure.ac): ... to here.

diff --git a/m4/stdio_h.m4 b/m4/stdio_h.m4
index 6846ca6..d9820e4 100644
--- a/m4/stdio_h.m4
+++ b/m4/stdio_h.m4
@@ -1,4 +1,4 @@
-# stdio_h.m4 serial 54
+# stdio_h.m4 serial 55
 dnl Copyright (C) 2007-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -40,17 +40,6 @@ AC_DEFUN_ONCE([gl_STDIO_H],
        attribute "__gnu_printf__" instead of "__printf__"])
   fi
 
-  dnl No need to create extra modules for these functions. Everyone who uses
-  dnl <stdio.h> likely needs them.
-  gl_STDIO_MODULE_INDICATOR([fscanf])
-  gl_MODULE_INDICATOR([fscanf])
-  gl_STDIO_MODULE_INDICATOR([scanf])
-  gl_MODULE_INDICATOR([scanf])
-  gl_STDIO_MODULE_INDICATOR([fgetc])
-  gl_STDIO_MODULE_INDICATOR([getc])
-  gl_STDIO_MODULE_INDICATOR([getchar])
-  gl_STDIO_MODULE_INDICATOR([fgets])
-  gl_STDIO_MODULE_INDICATOR([fread])
   dnl This ifdef is necessary to avoid an error "missing file lib/stdio-read.c"
   dnl "expected source file, required through AC_LIBSOURCES, not found". It is
   dnl also an optimization, to avoid performing a configure check whose result
@@ -64,18 +53,6 @@ AC_DEFUN_ONCE([gl_STDIO_H],
     fi
   ])
 
-  dnl No need to create extra modules for these functions. Everyone who uses
-  dnl <stdio.h> likely needs them.
-  gl_STDIO_MODULE_INDICATOR([fprintf])
-  gl_STDIO_MODULE_INDICATOR([printf])
-  gl_STDIO_MODULE_INDICATOR([vfprintf])
-  gl_STDIO_MODULE_INDICATOR([vprintf])
-  gl_STDIO_MODULE_INDICATOR([fputc])
-  gl_STDIO_MODULE_INDICATOR([putc])
-  gl_STDIO_MODULE_INDICATOR([putchar])
-  gl_STDIO_MODULE_INDICATOR([fputs])
-  gl_STDIO_MODULE_INDICATOR([puts])
-  gl_STDIO_MODULE_INDICATOR([fwrite])
   dnl This ifdef is necessary to avoid an error "missing file lib/stdio-write.c"
   dnl "expected source file, required through AC_LIBSOURCES, not found". It is
   dnl also an optimization, to avoid performing a configure check whose result
diff --git a/modules/stdio b/modules/stdio
index 18c24d7..e13b689 100644
--- a/modules/stdio
+++ b/modules/stdio
@@ -19,6 +19,31 @@ configure.ac:
 gl_STDIO_H
 gl_STDIO_H_REQUIRE_DEFAULTS
 
+dnl No need to create extra modules for these functions. Everyone who uses
+dnl <stdio.h> likely needs them.
+gl_STDIO_MODULE_INDICATOR([fscanf])
+gl_MODULE_INDICATOR([fscanf])
+gl_STDIO_MODULE_INDICATOR([scanf])
+gl_MODULE_INDICATOR([scanf])
+gl_STDIO_MODULE_INDICATOR([fgetc])
+gl_STDIO_MODULE_INDICATOR([getc])
+gl_STDIO_MODULE_INDICATOR([getchar])
+gl_STDIO_MODULE_INDICATOR([fgets])
+gl_STDIO_MODULE_INDICATOR([fread])
+
+dnl No need to create extra modules for these functions. Everyone who uses
+dnl <stdio.h> likely needs them.
+gl_STDIO_MODULE_INDICATOR([fprintf])
+gl_STDIO_MODULE_INDICATOR([printf])
+gl_STDIO_MODULE_INDICATOR([vfprintf])
+gl_STDIO_MODULE_INDICATOR([vprintf])
+gl_STDIO_MODULE_INDICATOR([fputc])
+gl_STDIO_MODULE_INDICATOR([putc])
+gl_STDIO_MODULE_INDICATOR([putchar])
+gl_STDIO_MODULE_INDICATOR([fputs])
+gl_STDIO_MODULE_INDICATOR([puts])
+gl_STDIO_MODULE_INDICATOR([fwrite])
+
 Makefile.am:
 BUILT_SOURCES += stdio.h
 



^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: Interference between two installations of gnulib
  2021-04-17 15:17   ` Bruno Haible
@ 2021-04-18 11:16     ` Bruno Haible
  0 siblings, 0 replies; 8+ messages in thread
From: Bruno Haible @ 2021-04-18 11:16 UTC (permalink / raw)
  To: bug-gnulib; +Cc: Reuben Thomas

I wrote:
> The problem is that the macro gl_STDIO_H_REQUIRE_DEFAULTS must only be invoked,
> never AC_REQUIREd. Hence all gl_STDIO_MODULE_INDICATOR invocations must also
> only be invoked, never AC_REQUIREd.

This deserves to be documented.


2021-04-18  Bruno Haible  <bruno@clisp.org>

	Add comments after 2021-04-11 change.
	* m4/*_h.m4: Add comments regarding *_REQUIRE_DEFAULTS and
	*_MODULE_INDICATOR macros.

diff --git a/m4/arpa_inet_h.m4 b/m4/arpa_inet_h.m4
index 868ebdf..a3ba256 100644
--- a/m4/arpa_inet_h.m4
+++ b/m4/arpa_inet_h.m4
@@ -1,4 +1,4 @@
-# arpa_inet_h.m4 serial 16
+# arpa_inet_h.m4 serial 17
 dnl Copyright (C) 2006, 2008-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -40,6 +40,10 @@ AC_DEFUN_ONCE([gl_ARPA_INET_H],
     ]], [inet_ntop inet_pton])
 ])
 
+# gl_ARPA_INET_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_ARPA_INET_MODULE_INDICATOR],
 [
   dnl Ensure to expand the default settings once only.
@@ -47,6 +51,9 @@ AC_DEFUN([gl_ARPA_INET_MODULE_INDICATOR],
   gl_MODULE_INDICATOR_SET_VARIABLE([$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_ARPA_INET_H_REQUIRE_DEFAULTS],
 [
   m4_defun(GL_MODULE_INDICATOR_PREFIX[_ARPA_INET_H_MODULE_INDICATOR_DEFAULTS], [
diff --git a/m4/ctype.m4 b/m4/ctype.m4
index d48847a..efdae45 100644
--- a/m4/ctype.m4
+++ b/m4/ctype.m4
@@ -1,4 +1,4 @@
-# ctype_h.m4 serial 8
+# ctype_h.m4 serial 9
 dnl Copyright (C) 2009-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -17,6 +17,10 @@ AC_DEFUN_ONCE([gl_CTYPE_H],
     ]], [isblank])
 ])
 
+# gl_CTYPE_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_CTYPE_MODULE_INDICATOR],
 [
   dnl Ensure to expand the default settings once only.
@@ -24,6 +28,9 @@ AC_DEFUN([gl_CTYPE_MODULE_INDICATOR],
   gl_MODULE_INDICATOR_SET_VARIABLE([$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_CTYPE_H_REQUIRE_DEFAULTS],
 [
   m4_defun(GL_MODULE_INDICATOR_PREFIX[_CTYPE_H_MODULE_INDICATOR_DEFAULTS], [
diff --git a/m4/dirent_h.m4 b/m4/dirent_h.m4
index 3bcf34b..17e2a20 100644
--- a/m4/dirent_h.m4
+++ b/m4/dirent_h.m4
@@ -1,4 +1,4 @@
-# dirent_h.m4 serial 18
+# dirent_h.m4 serial 19
 dnl Copyright (C) 2008-2021 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,6 +27,10 @@ AC_DEFUN_ONCE([gl_DIRENT_H],
     ]], [alphasort closedir dirfd fdopendir opendir readdir rewinddir scandir])
 ])
 
+# gl_DIRENT_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_DIRENT_MODULE_INDICATOR],
 [
   dnl Ensure to expand the default settings once only.
@@ -36,6 +40,9 @@ AC_DEFUN([gl_DIRENT_MODULE_INDICATOR],
   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_DIRENT_H_REQUIRE_DEFAULTS],
 [
   m4_defun(GL_MODULE_INDICATOR_PREFIX[_DIRENT_H_MODULE_INDICATOR_DEFAULTS], [
diff --git a/m4/fcntl_h.m4 b/m4/fcntl_h.m4
index 822bf02..aba4473 100644
--- a/m4/fcntl_h.m4
+++ b/m4/fcntl_h.m4
@@ -1,4 +1,4 @@
-# serial 19
+# serial 20
 # Configure fcntl.h.
 dnl Copyright (C) 2006-2007, 2009-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
@@ -26,6 +26,10 @@ AC_DEFUN_ONCE([gl_FCNTL_H],
     ]], [fcntl openat])
 ])
 
+# gl_FCNTL_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_FCNTL_MODULE_INDICATOR],
 [
   dnl Ensure to expand the default settings once only.
@@ -35,6 +39,9 @@ AC_DEFUN([gl_FCNTL_MODULE_INDICATOR],
   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_FCNTL_H_REQUIRE_DEFAULTS],
 [
   m4_defun(GL_MODULE_INDICATOR_PREFIX[_FCNTL_H_MODULE_INDICATOR_DEFAULTS], [
diff --git a/m4/fnmatch_h.m4 b/m4/fnmatch_h.m4
index d12c698..e9bcb66 100644
--- a/m4/fnmatch_h.m4
+++ b/m4/fnmatch_h.m4
@@ -1,4 +1,4 @@
-# fnmatch_h.m4 serial 6
+# fnmatch_h.m4 serial 7
 dnl Copyright (C) 2009-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -57,6 +57,10 @@ AC_DEFUN([gl_REPLACE_FNMATCH_H],
   AM_CONDITIONAL([GL_GENERATE_FNMATCH_H], [test -n "$FNMATCH_H"])
 ])
 
+# gl_FNMATCH_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_FNMATCH_MODULE_INDICATOR],
 [
   dnl Ensure to expand the default settings once only.
@@ -66,6 +70,9 @@ AC_DEFUN([gl_FNMATCH_MODULE_INDICATOR],
   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_FNMATCH_H_REQUIRE_DEFAULTS],
 [
   m4_defun(GL_MODULE_INDICATOR_PREFIX[_FNMATCH_H_MODULE_INDICATOR_DEFAULTS], [
diff --git a/m4/glob_h.m4 b/m4/glob_h.m4
index 68e7b4d..5332c81 100644
--- a/m4/glob_h.m4
+++ b/m4/glob_h.m4
@@ -1,4 +1,4 @@
-# glob_h.m4 serial 7
+# glob_h.m4 serial 8
 dnl Copyright (C) 2018-2021 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,6 +52,10 @@ AC_DEFUN([gl_REPLACE_GLOB_H],
   AM_CONDITIONAL([GL_GENERATE_GLOB_H], [test -n "$GLOB_H"])
 ])
 
+# gl_GLOB_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_GLOB_MODULE_INDICATOR],
 [
   dnl Ensure to expand the default settings once only.
@@ -61,6 +65,9 @@ AC_DEFUN([gl_GLOB_MODULE_INDICATOR],
   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_GLOB_H_REQUIRE_DEFAULTS],
 [
   m4_defun(GL_MODULE_INDICATOR_PREFIX[_GLOB_H_MODULE_INDICATOR_DEFAULTS], [
diff --git a/m4/iconv_h.m4 b/m4/iconv_h.m4
index e4fccc0..2940988 100644
--- a/m4/iconv_h.m4
+++ b/m4/iconv_h.m4
@@ -1,4 +1,4 @@
-# iconv_h.m4 serial 14
+# iconv_h.m4 serial 15
 dnl Copyright (C) 2007-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -29,6 +29,10 @@ AC_DEFUN([gl_REPLACE_ICONV_H],
   AM_CONDITIONAL([GL_GENERATE_ICONV_H], [test -n "$ICONV_H"])
 ])
 
+# gl_ICONV_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_ICONV_MODULE_INDICATOR],
 [
   dnl Ensure to expand the default settings once only.
@@ -36,6 +40,9 @@ AC_DEFUN([gl_ICONV_MODULE_INDICATOR],
   gl_MODULE_INDICATOR_SET_VARIABLE([$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_ICONV_H_REQUIRE_DEFAULTS],
 [
   m4_defun(GL_MODULE_INDICATOR_PREFIX[_ICONV_H_MODULE_INDICATOR_DEFAULTS], [
diff --git a/m4/inttypes.m4 b/m4/inttypes.m4
index 4e81446..64b1de5 100644
--- a/m4/inttypes.m4
+++ b/m4/inttypes.m4
@@ -1,4 +1,4 @@
-# inttypes.m4 serial 34
+# inttypes.m4 serial 35
 dnl Copyright (C) 2006-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -136,6 +136,10 @@ AC_DEFUN([gl_INTTYPES_CHECK_LONG_LONG_INT_CONDITION],
   AC_SUBST([$1])
 ])
 
+# gl_INTTYPES_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_INTTYPES_MODULE_INDICATOR],
 [
   dnl Ensure to expand the default settings once only.
@@ -143,6 +147,9 @@ AC_DEFUN([gl_INTTYPES_MODULE_INDICATOR],
   gl_MODULE_INDICATOR_SET_VARIABLE([$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_INTTYPES_H_REQUIRE_DEFAULTS],
 [
   m4_defun(GL_MODULE_INDICATOR_PREFIX[_INTTYPES_H_MODULE_INDICATOR_DEFAULTS], [
diff --git a/m4/langinfo_h.m4 b/m4/langinfo_h.m4
index 8e199db..87959f7 100644
--- a/m4/langinfo_h.m4
+++ b/m4/langinfo_h.m4
@@ -1,4 +1,4 @@
-# langinfo_h.m4 serial 11
+# langinfo_h.m4 serial 12
 dnl Copyright (C) 2009-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -104,6 +104,10 @@ int a = YESEXPR;
     ]], [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.
@@ -113,6 +117,9 @@ AC_DEFUN([gl_LANGINFO_MODULE_INDICATOR],
   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], [
diff --git a/m4/locale_h.m4 b/m4/locale_h.m4
index 44f0b49..444a381 100644
--- a/m4/locale_h.m4
+++ b/m4/locale_h.m4
@@ -1,4 +1,4 @@
-# locale_h.m4 serial 27
+# locale_h.m4 serial 28
 dnl Copyright (C) 2007, 2009-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -129,6 +129,10 @@ AC_DEFUN([gl_LOCALE_T],
   AC_SUBST([HAVE_XLOCALE_H])
 ])
 
+# gl_LOCALE_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_LOCALE_MODULE_INDICATOR],
 [
   dnl Ensure to expand the default settings once only.
@@ -138,6 +142,9 @@ AC_DEFUN([gl_LOCALE_MODULE_INDICATOR],
   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_LOCALE_H_REQUIRE_DEFAULTS],
 [
   m4_defun(GL_MODULE_INDICATOR_PREFIX[_LOCALE_H_MODULE_INDICATOR_DEFAULTS], [
diff --git a/m4/malloc_h.m4 b/m4/malloc_h.m4
index 6144ce5..fe7ca09 100644
--- a/m4/malloc_h.m4
+++ b/m4/malloc_h.m4
@@ -1,4 +1,4 @@
-# malloc_h.m4 serial 3
+# malloc_h.m4 serial 4
 dnl Copyright (C) 2020-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -29,6 +29,10 @@ AC_DEFUN_ONCE([gl_MALLOC_H],
     ]], [memalign])
 ])
 
+# gl_MALLOC_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_MALLOC_MODULE_INDICATOR],
 [
   dnl Ensure to expand the default settings once only.
@@ -38,6 +42,9 @@ AC_DEFUN([gl_MALLOC_MODULE_INDICATOR],
   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_MALLOC_H_REQUIRE_DEFAULTS],
 [
   m4_defun(GL_MODULE_INDICATOR_PREFIX[_MALLOC_H_MODULE_INDICATOR_DEFAULTS], [
diff --git a/m4/math_h.m4 b/m4/math_h.m4
index 384aa9c..b3a10c3 100644
--- a/m4/math_h.m4
+++ b/m4/math_h.m4
@@ -1,4 +1,4 @@
-# math_h.m4 serial 124
+# math_h.m4 serial 125
 dnl Copyright (C) 2007-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -53,6 +53,10 @@ AC_DEFUN_ONCE([gl_MATH_H],
      tanf tanl tanhf trunc truncf truncl])
 ])
 
+# gl_MATH_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_MATH_MODULE_INDICATOR],
 [
   dnl Ensure to expand the default settings once only.
@@ -62,6 +66,9 @@ AC_DEFUN([gl_MATH_MODULE_INDICATOR],
   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_MATH_H_REQUIRE_DEFAULTS],
 [
   m4_defun(GL_MODULE_INDICATOR_PREFIX[_MATH_H_MODULE_INDICATOR_DEFAULTS], [
diff --git a/m4/monetary_h.m4 b/m4/monetary_h.m4
index dc56c1b..8ffa2af 100644
--- a/m4/monetary_h.m4
+++ b/m4/monetary_h.m4
@@ -1,4 +1,4 @@
-# monetary_h.m4 serial 7
+# monetary_h.m4 serial 8
 dnl Copyright (C) 2017-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -47,6 +47,10 @@ AC_DEFUN_ONCE([gl_MONETARY_H],
   AM_CONDITIONAL([GL_GENERATE_MONETARY_H], [test -n "$MONETARY_H"])
 ])
 
+# gl_MONETARY_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_MONETARY_MODULE_INDICATOR],
 [
   dnl Ensure to expand the default settings once only.
@@ -54,6 +58,9 @@ AC_DEFUN([gl_MONETARY_MODULE_INDICATOR],
   gl_MODULE_INDICATOR_SET_VARIABLE([$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_MONETARY_H_REQUIRE_DEFAULTS],
 [
   m4_defun(GL_MODULE_INDICATOR_PREFIX[_MONETARY_H_MODULE_INDICATOR_DEFAULTS], [
diff --git a/m4/netdb_h.m4 b/m4/netdb_h.m4
index 69f7b78..eb7c3b8 100644
--- a/m4/netdb_h.m4
+++ b/m4/netdb_h.m4
@@ -1,4 +1,4 @@
-# netdb_h.m4 serial 14
+# netdb_h.m4 serial 15
 dnl Copyright (C) 2008-2021 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,6 +21,10 @@ AC_DEFUN_ONCE([gl_NETDB_H],
     [getaddrinfo freeaddrinfo gai_strerror getnameinfo])
 ])
 
+# gl_NETDB_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_NETDB_MODULE_INDICATOR],
 [
   dnl Ensure to expand the default settings once only.
@@ -30,6 +34,9 @@ AC_DEFUN([gl_NETDB_MODULE_INDICATOR],
   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_NETDB_H_REQUIRE_DEFAULTS],
 [
   m4_defun(GL_MODULE_INDICATOR_PREFIX[_NETDB_H_MODULE_INDICATOR_DEFAULTS], [
diff --git a/m4/poll_h.m4 b/m4/poll_h.m4
index 3037676..1f0d796 100644
--- a/m4/poll_h.m4
+++ b/m4/poll_h.m4
@@ -1,4 +1,4 @@
-# poll_h.m4 serial 5
+# poll_h.m4 serial 6
 dnl Copyright (C) 2010-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -31,6 +31,10 @@ AC_DEFUN_ONCE([gl_POLL_H],
     [poll])
 ])
 
+# gl_POLL_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_POLL_MODULE_INDICATOR],
 [
   dnl Ensure to expand the default settings once only.
@@ -40,6 +44,9 @@ AC_DEFUN([gl_POLL_MODULE_INDICATOR],
   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_POLL_H_REQUIRE_DEFAULTS],
 [
   m4_defun(GL_MODULE_INDICATOR_PREFIX[_POLL_H_MODULE_INDICATOR_DEFAULTS], [
diff --git a/m4/pthread_h.m4 b/m4/pthread_h.m4
index d07d85d..62a6ca8 100644
--- a/m4/pthread_h.m4
+++ b/m4/pthread_h.m4
@@ -1,4 +1,4 @@
-# pthread_h.m4 serial 7
+# pthread_h.m4 serial 8
 dnl Copyright (C) 2009-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -137,6 +137,10 @@ AC_DEFUN_ONCE([gl_PTHREAD_H],
   AC_SUBST([LIB_PTHREAD])
 ])
 
+# gl_PTHREAD_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_PTHREAD_MODULE_INDICATOR],
 [
   dnl Ensure to expand the default settings once only.
@@ -146,6 +150,9 @@ AC_DEFUN([gl_PTHREAD_MODULE_INDICATOR],
   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_PTHREAD_H_REQUIRE_DEFAULTS],
 [
   m4_defun(GL_MODULE_INDICATOR_PREFIX[_PTHREAD_H_MODULE_INDICATOR_DEFAULTS], [
diff --git a/m4/pty_h.m4 b/m4/pty_h.m4
index 8fe5465..172e6d6 100644
--- a/m4/pty_h.m4
+++ b/m4/pty_h.m4
@@ -1,4 +1,4 @@
-# pty_h.m4 serial 13
+# pty_h.m4 serial 14
 dnl Copyright (C) 2009-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -50,6 +50,10 @@ AC_DEFUN_ONCE([gl_PTY_H],
     ]], [forkpty openpty])
 ])
 
+# gl_PTY_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_PTY_MODULE_INDICATOR],
 [
   dnl Ensure to expand the default settings once only.
@@ -59,6 +63,9 @@ AC_DEFUN([gl_PTY_MODULE_INDICATOR],
   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_PTY_H_REQUIRE_DEFAULTS],
 [
   m4_defun(GL_MODULE_INDICATOR_PREFIX[_PTY_H_MODULE_INDICATOR_DEFAULTS], [
diff --git a/m4/sched_h.m4 b/m4/sched_h.m4
index 03377aa..a840e3d 100644
--- a/m4/sched_h.m4
+++ b/m4/sched_h.m4
@@ -1,4 +1,4 @@
-# sched_h.m4 serial 14
+# sched_h.m4 serial 15
 dnl Copyright (C) 2008-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -73,6 +73,10 @@ AC_DEFUN_ONCE([gl_SCHED_H],
     ]], [sched_yield])
 ])
 
+# gl_SCHED_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_SCHED_MODULE_INDICATOR],
 [
   dnl Ensure to expand the default settings once only.
@@ -82,6 +86,9 @@ AC_DEFUN([gl_SCHED_MODULE_INDICATOR],
   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_SCHED_H_REQUIRE_DEFAULTS],
 [
   m4_defun(GL_MODULE_INDICATOR_PREFIX[_SCHED_H_MODULE_INDICATOR_DEFAULTS], [
diff --git a/m4/search_h.m4 b/m4/search_h.m4
index 6cdcfdf..1d1e8bf 100644
--- a/m4/search_h.m4
+++ b/m4/search_h.m4
@@ -1,4 +1,4 @@
-# search_h.m4 serial 14
+# search_h.m4 serial 15
 dnl Copyright (C) 2007-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -44,6 +44,10 @@ AC_DEFUN_ONCE([gl_SEARCH_H],
   AC_REQUIRE([AC_C_RESTRICT])
 ])
 
+# gl_SEARCH_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_SEARCH_MODULE_INDICATOR],
 [
   dnl Ensure to expand the default settings once only.
@@ -53,6 +57,9 @@ AC_DEFUN([gl_SEARCH_MODULE_INDICATOR],
   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_SEARCH_H_REQUIRE_DEFAULTS],
 [
   m4_defun(GL_MODULE_INDICATOR_PREFIX[_SEARCH_H_MODULE_INDICATOR_DEFAULTS], [
diff --git a/m4/signal_h.m4 b/m4/signal_h.m4
index f68e890..8b93880 100644
--- a/m4/signal_h.m4
+++ b/m4/signal_h.m4
@@ -1,4 +1,4 @@
-# signal_h.m4 serial 21
+# signal_h.m4 serial 22
 dnl Copyright (C) 2007-2021 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,6 +52,10 @@ AC_DEFUN([gl_CHECK_TYPE_SIGSET_T],
   fi
 ])
 
+# gl_SIGNAL_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_SIGNAL_MODULE_INDICATOR],
 [
   dnl Ensure to expand the default settings once only.
@@ -61,6 +65,9 @@ AC_DEFUN([gl_SIGNAL_MODULE_INDICATOR],
   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_SIGNAL_H_REQUIRE_DEFAULTS],
 [
   m4_defun(GL_MODULE_INDICATOR_PREFIX[_SIGNAL_H_MODULE_INDICATOR_DEFAULTS], [
diff --git a/m4/spawn_h.m4 b/m4/spawn_h.m4
index 7dc515f..134b7b9 100644
--- a/m4/spawn_h.m4
+++ b/m4/spawn_h.m4
@@ -1,4 +1,4 @@
-# spawn_h.m4 serial 20
+# spawn_h.m4 serial 21
 dnl Copyright (C) 2008-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -79,6 +79,10 @@ AC_DEFUN([gl_HAVE_POSIX_SPAWN],
   fi
 ])
 
+# gl_SPAWN_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_SPAWN_MODULE_INDICATOR],
 [
   dnl Ensure to expand the default settings once only.
@@ -88,6 +92,9 @@ AC_DEFUN([gl_SPAWN_MODULE_INDICATOR],
   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_SPAWN_H_REQUIRE_DEFAULTS],
 [
   m4_defun(GL_MODULE_INDICATOR_PREFIX[_SPAWN_H_MODULE_INDICATOR_DEFAULTS], [
diff --git a/m4/stddef_h.m4 b/m4/stddef_h.m4
index 53a69dd..1303d2e 100644
--- a/m4/stddef_h.m4
+++ b/m4/stddef_h.m4
@@ -1,4 +1,4 @@
-# stddef_h.m4 serial 10
+# stddef_h.m4 serial 11
 dnl Copyright (C) 2009-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -68,6 +68,10 @@ AC_DEFUN_ONCE([gl_STDDEF_H],
   fi
 ])
 
+# gl_STDDEF_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_STDDEF_MODULE_INDICATOR],
 [
   dnl Ensure to expand the default settings once only.
@@ -75,6 +79,9 @@ AC_DEFUN([gl_STDDEF_MODULE_INDICATOR],
   gl_MODULE_INDICATOR_SET_VARIABLE([$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_STDDEF_H_REQUIRE_DEFAULTS],
 [
   m4_defun(GL_MODULE_INDICATOR_PREFIX[_STDDEF_H_MODULE_INDICATOR_DEFAULTS], [
diff --git a/m4/stdio_h.m4 b/m4/stdio_h.m4
index d9820e4..e704383 100644
--- a/m4/stdio_h.m4
+++ b/m4/stdio_h.m4
@@ -1,4 +1,4 @@
-# stdio_h.m4 serial 55
+# stdio_h.m4 serial 56
 dnl Copyright (C) 2007-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -93,6 +93,10 @@ AC_DEFUN_ONCE([gl_STDIO_H],
   fi
 ])
 
+# gl_STDIO_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_STDIO_MODULE_INDICATOR],
 [
   dnl Ensure to expand the default settings once only.
@@ -102,6 +106,9 @@ AC_DEFUN([gl_STDIO_MODULE_INDICATOR],
   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_STDIO_H_REQUIRE_DEFAULTS],
 [
   m4_defun(GL_MODULE_INDICATOR_PREFIX[_STDIO_H_MODULE_INDICATOR_DEFAULTS], [
diff --git a/m4/stdlib_h.m4 b/m4/stdlib_h.m4
index e938b5a..2de57f7 100644
--- a/m4/stdlib_h.m4
+++ b/m4/stdlib_h.m4
@@ -1,4 +1,4 @@
-# stdlib_h.m4 serial 61
+# stdlib_h.m4 serial 62
 dnl Copyright (C) 2007-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -46,6 +46,10 @@ AC_DEFUN_ONCE([gl_STDLIB_H],
   fi
 ])
 
+# gl_STDLIB_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_STDLIB_MODULE_INDICATOR],
 [
   dnl Ensure to expand the default settings once only.
@@ -55,6 +59,9 @@ AC_DEFUN([gl_STDLIB_MODULE_INDICATOR],
   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_STDLIB_H_REQUIRE_DEFAULTS],
 [
   m4_defun(GL_MODULE_INDICATOR_PREFIX[_STDLIB_H_MODULE_INDICATOR_DEFAULTS], [
diff --git a/m4/string_h.m4 b/m4/string_h.m4
index e44461f..80d1e58 100644
--- a/m4/string_h.m4
+++ b/m4/string_h.m4
@@ -5,7 +5,7 @@
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 31
+# serial 32
 
 # Written by Paul Eggert.
 
@@ -28,6 +28,10 @@ AC_DEFUN_ONCE([gl_STRING_H],
   AC_REQUIRE([AC_C_RESTRICT])
 ])
 
+# gl_STRING_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_STRING_MODULE_INDICATOR],
 [
   dnl Ensure to expand the default settings once only.
@@ -37,6 +41,9 @@ AC_DEFUN([gl_STRING_MODULE_INDICATOR],
   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_STRING_H_REQUIRE_DEFAULTS],
 [
   m4_defun(GL_MODULE_INDICATOR_PREFIX[_STRING_H_MODULE_INDICATOR_DEFAULTS], [
diff --git a/m4/strings_h.m4 b/m4/strings_h.m4
index da19d1b..69de32a 100644
--- a/m4/strings_h.m4
+++ b/m4/strings_h.m4
@@ -1,5 +1,5 @@
 # Configure a replacement for <strings.h>.
-# serial 8
+# serial 9
 
 # Copyright (C) 2007, 2009-2021 Free Software Foundation, Inc.
 # This file is free software; the Free Software Foundation
@@ -30,6 +30,10 @@ AC_DEFUN_ONCE([gl_STRINGS_H],
     ]], [ffs strcasecmp strncasecmp])
 ])
 
+# gl_STRINGS_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_STRINGS_MODULE_INDICATOR],
 [
   dnl Ensure to expand the default settings once only.
@@ -37,6 +41,9 @@ AC_DEFUN([gl_STRINGS_MODULE_INDICATOR],
   gl_MODULE_INDICATOR_SET_VARIABLE([$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_STRINGS_H_REQUIRE_DEFAULTS],
 [
   m4_defun(GL_MODULE_INDICATOR_PREFIX[_STRINGS_H_MODULE_INDICATOR_DEFAULTS], [
diff --git a/m4/sys_file_h.m4 b/m4/sys_file_h.m4
index 4515c73..bcde4d7 100644
--- a/m4/sys_file_h.m4
+++ b/m4/sys_file_h.m4
@@ -1,5 +1,5 @@
 # Configure a replacement for <sys/file.h>.
-# serial 8
+# serial 9
 
 # Copyright (C) 2008-2021 Free Software Foundation, Inc.
 # This file is free software; the Free Software Foundation
@@ -28,12 +28,19 @@ AC_DEFUN_ONCE([gl_SYS_FILE_H],
     ]], [flock])
 ])
 
+# gl_SYS_FILE_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_SYS_FILE_MODULE_INDICATOR],
 [
   gl_SYS_FILE_H_REQUIRE_DEFAULTS
   gl_MODULE_INDICATOR_SET_VARIABLE([$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_SYS_FILE_H_REQUIRE_DEFAULTS],
 [
   m4_defun(GL_MODULE_INDICATOR_PREFIX[_SYS_FILE_H_MODULE_INDICATOR_DEFAULTS], [
diff --git a/m4/sys_ioctl_h.m4 b/m4/sys_ioctl_h.m4
index 9f36509..cd00410 100644
--- a/m4/sys_ioctl_h.m4
+++ b/m4/sys_ioctl_h.m4
@@ -1,4 +1,4 @@
-# sys_ioctl_h.m4 serial 14
+# sys_ioctl_h.m4 serial 15
 dnl Copyright (C) 2008-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -44,6 +44,10 @@ AC_DEFUN_ONCE([gl_SYS_IOCTL_H],
     ]], [ioctl])
 ])
 
+# gl_SYS_IOCTL_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_SYS_IOCTL_MODULE_INDICATOR],
 [
   dnl Ensure to expand the default settings once only.
@@ -53,6 +57,9 @@ AC_DEFUN([gl_SYS_IOCTL_MODULE_INDICATOR],
   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_SYS_IOCTL_H_REQUIRE_DEFAULTS],
 [
   m4_defun(GL_MODULE_INDICATOR_PREFIX[_SYS_IOCTL_H_MODULE_INDICATOR_DEFAULTS], [
diff --git a/m4/sys_random_h.m4 b/m4/sys_random_h.m4
index 621601f..37bc316 100644
--- a/m4/sys_random_h.m4
+++ b/m4/sys_random_h.m4
@@ -1,4 +1,4 @@
-# sys_random_h.m4 serial 7
+# sys_random_h.m4 serial 8
 dnl Copyright (C) 2020-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -35,6 +35,10 @@ AC_DEFUN_ONCE([gl_SYS_RANDOM_H],
     [getrandom])
 ])
 
+# gl_SYS_RANDOM_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_SYS_RANDOM_MODULE_INDICATOR],
 [
   dnl Ensure to expand the default settings once only.
@@ -44,6 +48,9 @@ AC_DEFUN([gl_SYS_RANDOM_MODULE_INDICATOR],
   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_SYS_RANDOM_H_REQUIRE_DEFAULTS],
 [
   m4_defun(GL_MODULE_INDICATOR_PREFIX[_SYS_RANDOM_H_MODULE_INDICATOR_DEFAULTS], [
diff --git a/m4/sys_resource_h.m4 b/m4/sys_resource_h.m4
index 4570a01..0b85e7b 100644
--- a/m4/sys_resource_h.m4
+++ b/m4/sys_resource_h.m4
@@ -1,4 +1,4 @@
-# sys_resource_h.m4 serial 4
+# sys_resource_h.m4 serial 5
 dnl Copyright (C) 2012-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -30,6 +30,10 @@ AC_DEFUN_ONCE([gl_SYS_RESOURCE_H],
     [getrusage])
 ])
 
+# gl_SYS_RESOURCE_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_SYS_RESOURCE_MODULE_INDICATOR],
 [
   dnl Ensure to expand the default settings once only.
@@ -39,6 +43,9 @@ AC_DEFUN([gl_SYS_RESOURCE_MODULE_INDICATOR],
   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_SYS_RESOURCE_H_REQUIRE_DEFAULTS],
 [
   m4_defun(GL_MODULE_INDICATOR_PREFIX[_SYS_RESOURCE_H_MODULE_INDICATOR_DEFAULTS], [
diff --git a/m4/sys_select_h.m4 b/m4/sys_select_h.m4
index 198bb05..2e7d140 100644
--- a/m4/sys_select_h.m4
+++ b/m4/sys_select_h.m4
@@ -1,4 +1,4 @@
-# sys_select_h.m4 serial 22
+# sys_select_h.m4 serial 23
 dnl Copyright (C) 2006-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -75,6 +75,10 @@ AC_DEFUN_ONCE([gl_SYS_SELECT_H],
     ]], [pselect select])
 ])
 
+# gl_SYS_SELECT_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_SYS_SELECT_MODULE_INDICATOR],
 [
   dnl Ensure to expand the default settings once only.
@@ -84,6 +88,9 @@ AC_DEFUN([gl_SYS_SELECT_MODULE_INDICATOR],
   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_SYS_SELECT_H_REQUIRE_DEFAULTS],
 [
   m4_defun(GL_MODULE_INDICATOR_PREFIX[_SYS_SELECT_H_MODULE_INDICATOR_DEFAULTS], [
diff --git a/m4/sys_socket_h.m4 b/m4/sys_socket_h.m4
index 8a8075c..5676a0d 100644
--- a/m4/sys_socket_h.m4
+++ b/m4/sys_socket_h.m4
@@ -1,4 +1,4 @@
-# sys_socket_h.m4 serial 27
+# sys_socket_h.m4 serial 28
 dnl Copyright (C) 2005-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -156,6 +156,10 @@ AC_DEFUN([gl_PREREQ_SYS_H_WS2TCPIP],
   AC_SUBST([HAVE_WS2TCPIP_H])
 ])
 
+# gl_SYS_SOCKET_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_SYS_SOCKET_MODULE_INDICATOR],
 [
   dnl Ensure to expand the default settings once only.
@@ -165,6 +169,9 @@ AC_DEFUN([gl_SYS_SOCKET_MODULE_INDICATOR],
   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_SYS_SOCKET_H_REQUIRE_DEFAULTS],
 [
   m4_defun(GL_MODULE_INDICATOR_PREFIX[_SYS_SOCKET_H_MODULE_INDICATOR_DEFAULTS], [
diff --git a/m4/sys_stat_h.m4 b/m4/sys_stat_h.m4
index 02a621c..ac91d42 100644
--- a/m4/sys_stat_h.m4
+++ b/m4/sys_stat_h.m4
@@ -1,4 +1,4 @@
-# sys_stat_h.m4 serial 40   -*- Autoconf -*-
+# sys_stat_h.m4 serial 41   -*- Autoconf -*-
 dnl Copyright (C) 2006-2021 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,6 +52,10 @@ AC_DEFUN_ONCE([gl_SYS_STAT_H],
   AC_REQUIRE([AC_C_RESTRICT])
 ])
 
+# gl_SYS_STAT_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_SYS_STAT_MODULE_INDICATOR],
 [
   dnl Ensure to expand the default settings once only.
@@ -61,6 +65,9 @@ AC_DEFUN([gl_SYS_STAT_MODULE_INDICATOR],
   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_SYS_STAT_H_REQUIRE_DEFAULTS],
 [
   m4_defun(GL_MODULE_INDICATOR_PREFIX[_SYS_STAT_H_MODULE_INDICATOR_DEFAULTS], [
diff --git a/m4/sys_time_h.m4 b/m4/sys_time_h.m4
index 81b755d..c425a96 100644
--- a/m4/sys_time_h.m4
+++ b/m4/sys_time_h.m4
@@ -1,5 +1,5 @@
 # Configure a replacement for <sys/time.h>.
-# serial 11
+# serial 12
 
 # Copyright (C) 2007, 2009-2021 Free Software Foundation, Inc.
 # This file is free software; the Free Software Foundation
@@ -84,6 +84,10 @@ AC_DEFUN_ONCE([gl_SYS_TIME_H],
     ]], [gettimeofday])
 ])
 
+# gl_SYS_TIME_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_SYS_TIME_MODULE_INDICATOR],
 [
   dnl Ensure to expand the default settings once only.
@@ -93,6 +97,9 @@ AC_DEFUN([gl_SYS_TIME_MODULE_INDICATOR],
   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_SYS_TIME_H_REQUIRE_DEFAULTS],
 [
   m4_defun(GL_MODULE_INDICATOR_PREFIX[_SYS_TIME_H_MODULE_INDICATOR_DEFAULTS], [
diff --git a/m4/sys_times_h.m4 b/m4/sys_times_h.m4
index c83a9d6..577ead6 100644
--- a/m4/sys_times_h.m4
+++ b/m4/sys_times_h.m4
@@ -1,5 +1,5 @@
 # Configure a replacement for <sys/times.h>.
-# serial 10
+# serial 11
 
 # Copyright (C) 2008-2021 Free Software Foundation, Inc.
 # This file is free software; the Free Software Foundation
@@ -36,6 +36,10 @@ AC_DEFUN_ONCE([gl_SYS_TIMES_H],
     ]], [times])
 ])
 
+# gl_SYS_TIMES_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_SYS_TIMES_MODULE_INDICATOR],
 [
   dnl Ensure to expand the default settings once only.
@@ -43,6 +47,9 @@ AC_DEFUN([gl_SYS_TIMES_MODULE_INDICATOR],
   gl_MODULE_INDICATOR_SET_VARIABLE([$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_SYS_TIMES_H_REQUIRE_DEFAULTS],
 [
   m4_defun(GL_MODULE_INDICATOR_PREFIX[_SYS_TIMES_H_MODULE_INDICATOR_DEFAULTS], [
diff --git a/m4/sys_types_h.m4 b/m4/sys_types_h.m4
index 53f2c09..6dd6fee 100644
--- a/m4/sys_types_h.m4
+++ b/m4/sys_types_h.m4
@@ -1,4 +1,4 @@
-# sys_types_h.m4 serial 12
+# sys_types_h.m4 serial 13
 dnl Copyright (C) 2011-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -31,6 +31,9 @@ AC_DEFUN_ONCE([gl_SYS_TYPES_H],
   AC_SUBST([WINDOWS_STAT_INODES])
 ])
 
+# 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_SYS_TYPES_H_REQUIRE_DEFAULTS],
 [
   m4_defun(GL_MODULE_INDICATOR_PREFIX[_SYS_TYPE_H_MODULE_INDICATOR_DEFAULTS], [
diff --git a/m4/sys_uio_h.m4 b/m4/sys_uio_h.m4
index baea88a..fa176e0 100644
--- a/m4/sys_uio_h.m4
+++ b/m4/sys_uio_h.m4
@@ -1,4 +1,4 @@
-# sys_uio_h.m4 serial 2
+# sys_uio_h.m4 serial 3
 dnl Copyright (C) 2011-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -17,6 +17,10 @@ AC_DEFUN_ONCE([gl_SYS_UIO_H],
   AC_SUBST([HAVE_SYS_UIO_H])
 ])
 
+# gl_SYS_UIO_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_SYS_UIO_MODULE_INDICATOR],
 [
   dnl Ensure to expand the default settings once only.
@@ -26,6 +30,9 @@ AC_DEFUN([gl_SYS_UIO_MODULE_INDICATOR],
   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_SYS_UIO_H_REQUIRE_DEFAULTS],
 [
   m4_defun(GL_MODULE_INDICATOR_PREFIX[_SYS_UIO_H_MODULE_INDICATOR_DEFAULTS], [
diff --git a/m4/sys_utsname_h.m4 b/m4/sys_utsname_h.m4
index cc1d849..9a0f0e3 100644
--- a/m4/sys_utsname_h.m4
+++ b/m4/sys_utsname_h.m4
@@ -1,4 +1,4 @@
-# sys_utsname_h.m4 serial 10
+# sys_utsname_h.m4 serial 11
 dnl Copyright (C) 2009-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -38,6 +38,10 @@ AC_DEFUN_ONCE([gl_SYS_UTSNAME_H],
     ]], [uname])
 ])
 
+# gl_SYS_UTSNAME_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_SYS_UTSNAME_MODULE_INDICATOR],
 [
   dnl Ensure to expand the default settings once only.
@@ -45,6 +49,9 @@ AC_DEFUN([gl_SYS_UTSNAME_MODULE_INDICATOR],
   gl_MODULE_INDICATOR_SET_VARIABLE([$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_SYS_UTSNAME_H_REQUIRE_DEFAULTS],
 [
   m4_defun(GL_MODULE_INDICATOR_PREFIX[_SYS_UTSNAME_H_MODULE_INDICATOR_DEFAULTS], [
diff --git a/m4/sys_wait_h.m4 b/m4/sys_wait_h.m4
index 294ab52..d7c412a 100644
--- a/m4/sys_wait_h.m4
+++ b/m4/sys_wait_h.m4
@@ -1,4 +1,4 @@
-# sys_wait_h.m4 serial 8
+# sys_wait_h.m4 serial 9
 dnl Copyright (C) 2008-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -20,6 +20,10 @@ AC_DEFUN_ONCE([gl_SYS_WAIT_H],
     [waitpid])
 ])
 
+# gl_SYS_WAIT_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_SYS_WAIT_MODULE_INDICATOR],
 [
   dnl Ensure to expand the default settings once only.
@@ -29,6 +33,9 @@ AC_DEFUN([gl_SYS_WAIT_MODULE_INDICATOR],
   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_SYS_WAIT_H_REQUIRE_DEFAULTS],
 [
   m4_defun(GL_MODULE_INDICATOR_PREFIX[_SYS_WAIT_H_MODULE_INDICATOR_DEFAULTS], [
diff --git a/m4/termios_h.m4 b/m4/termios_h.m4
index c7d57fc..861b232 100644
--- a/m4/termios_h.m4
+++ b/m4/termios_h.m4
@@ -1,4 +1,4 @@
-# termios_h.m4 serial 6
+# termios_h.m4 serial 7
 dnl Copyright (C) 2010-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -25,6 +25,10 @@ AC_DEFUN_ONCE([gl_TERMIOS_H],
     [tcgetsid])
 ])
 
+# gl_TERMIOS_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_TERMIOS_MODULE_INDICATOR],
 [
   dnl Ensure to expand the default settings once only.
@@ -34,6 +38,9 @@ AC_DEFUN([gl_TERMIOS_MODULE_INDICATOR],
   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_TERMIOS_H_REQUIRE_DEFAULTS],
 [
   m4_defun(GL_MODULE_INDICATOR_PREFIX[_TERMIOS_H_MODULE_INDICATOR_DEFAULTS], [
diff --git a/m4/threads.m4 b/m4/threads.m4
index 2a2bfea..53ec6d5 100644
--- a/m4/threads.m4
+++ b/m4/threads.m4
@@ -1,4 +1,4 @@
-# threads.m4 serial 9
+# threads.m4 serial 10
 dnl Copyright (C) 2019-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -137,6 +137,10 @@ AC_DEFUN([gl_THREAD_LOCAL_DEFINITION],
 #endif
 ]])
 
+# gl_THREADS_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_THREADS_MODULE_INDICATOR],
 [
   dnl Ensure to expand the default settings once only.
@@ -146,6 +150,9 @@ AC_DEFUN([gl_THREADS_MODULE_INDICATOR],
   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_THREADS_H_REQUIRE_DEFAULTS],
 [
   m4_defun(GL_MODULE_INDICATOR_PREFIX[_THREADS_H_MODULE_INDICATOR_DEFAULTS], [
diff --git a/m4/time_h.m4 b/m4/time_h.m4
index 8c8648e..b57474b 100644
--- a/m4/time_h.m4
+++ b/m4/time_h.m4
@@ -2,7 +2,7 @@
 
 # Copyright (C) 2000-2001, 2003-2007, 2009-2021 Free Software Foundation, Inc.
 
-# serial 17
+# serial 18
 
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -106,6 +106,10 @@ AC_DEFUN([gl_CHECK_TYPE_STRUCT_TIMESPEC],
   AC_SUBST([UNISTD_H_DEFINES_STRUCT_TIMESPEC])
 ])
 
+# gl_TIME_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_TIME_MODULE_INDICATOR],
 [
   dnl Ensure to expand the default settings once only.
@@ -115,6 +119,9 @@ AC_DEFUN([gl_TIME_MODULE_INDICATOR],
   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_TIME_H_REQUIRE_DEFAULTS],
 [
   m4_defun(GL_MODULE_INDICATOR_PREFIX[_TIME_H_MODULE_INDICATOR_DEFAULTS], [
diff --git a/m4/uchar.m4 b/m4/uchar.m4
index 6ebe94d..1923f17 100644
--- a/m4/uchar.m4
+++ b/m4/uchar.m4
@@ -1,4 +1,4 @@
-# uchar.m4 serial 19
+# uchar.m4 serial 20
 dnl Copyright (C) 2019-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -120,6 +120,10 @@ AC_DEFUN_ONCE([gl_TYPE_CHAR32_T],
   AC_SUBST([GNULIBHEADERS_OVERRIDE_CHAR32_T])
 ])
 
+# gl_UCHAR_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_UCHAR_MODULE_INDICATOR],
 [
   dnl Ensure to expand the default settings once only.
@@ -129,6 +133,9 @@ AC_DEFUN([gl_UCHAR_MODULE_INDICATOR],
   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_UCHAR_H_REQUIRE_DEFAULTS],
 [
   m4_defun(GL_MODULE_INDICATOR_PREFIX[_UCHAR_H_MODULE_INDICATOR_DEFAULTS], [
diff --git a/m4/unistd_h.m4 b/m4/unistd_h.m4
index ada0101..a40a41b 100644
--- a/m4/unistd_h.m4
+++ b/m4/unistd_h.m4
@@ -1,4 +1,4 @@
-# unistd_h.m4 serial 87
+# unistd_h.m4 serial 88
 dnl Copyright (C) 2006-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -59,6 +59,10 @@ AC_DEFUN_ONCE([gl_UNISTD_H],
   fi
 ])
 
+# gl_UNISTD_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_UNISTD_MODULE_INDICATOR],
 [
   dnl Ensure to expand the default settings once only.
@@ -68,6 +72,9 @@ AC_DEFUN([gl_UNISTD_MODULE_INDICATOR],
   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_UNISTD_H_REQUIRE_DEFAULTS],
 [
   m4_defun(GL_MODULE_INDICATOR_PREFIX[_UNISTD_H_MODULE_INDICATOR_DEFAULTS], [
diff --git a/m4/utime_h.m4 b/m4/utime_h.m4
index 1daed6e..e288bb1 100644
--- a/m4/utime_h.m4
+++ b/m4/utime_h.m4
@@ -1,4 +1,4 @@
-# utime_h.m4 serial 7
+# utime_h.m4 serial 8
 dnl Copyright (C) 2017-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -28,6 +28,10 @@ AC_DEFUN_ONCE([gl_UTIME_H],
     [utime])
 ])
 
+# gl_UTIME_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_UTIME_MODULE_INDICATOR],
 [
   dnl Ensure to expand the default settings once only.
@@ -37,6 +41,9 @@ AC_DEFUN([gl_UTIME_MODULE_INDICATOR],
   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_UTIME_H_REQUIRE_DEFAULTS],
 [
   m4_defun(GL_MODULE_INDICATOR_PREFIX[_UTIME_H_MODULE_INDICATOR_DEFAULTS], [
diff --git a/m4/wchar_h.m4 b/m4/wchar_h.m4
index 9b3e2b0..818b319 100644
--- a/m4/wchar_h.m4
+++ b/m4/wchar_h.m4
@@ -7,7 +7,7 @@ dnl with or without modifications, as long as this notice is preserved.
 
 dnl Written by Eric Blake.
 
-# wchar_h.m4 serial 52
+# wchar_h.m4 serial 53
 
 AC_DEFUN_ONCE([gl_WCHAR_H],
 [
@@ -125,6 +125,10 @@ Configuration aborted.])
   fi
 ])
 
+# gl_WCHAR_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_WCHAR_MODULE_INDICATOR],
 [
   dnl Ensure to expand the default settings once only.
@@ -134,6 +138,9 @@ AC_DEFUN([gl_WCHAR_MODULE_INDICATOR],
   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_WCHAR_H_REQUIRE_DEFAULTS],
 [
   m4_defun(GL_MODULE_INDICATOR_PREFIX[_WCHAR_H_MODULE_INDICATOR_DEFAULTS], [
diff --git a/m4/wctype_h.m4 b/m4/wctype_h.m4
index b32c863..7d74212 100644
--- a/m4/wctype_h.m4
+++ b/m4/wctype_h.m4
@@ -1,4 +1,4 @@
-# wctype_h.m4 serial 29
+# wctype_h.m4 serial 30
 
 dnl A placeholder for ISO C99 <wctype.h>, for platforms that lack it.
 
@@ -157,6 +157,10 @@ AC_DEFUN_ONCE([gl_WCTYPE_H],
     ])
 ])
 
+# gl_WCTYPE_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_WCTYPE_MODULE_INDICATOR],
 [
   dnl Ensure to expand the default settings once only.
@@ -166,6 +170,9 @@ AC_DEFUN([gl_WCTYPE_MODULE_INDICATOR],
   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_WCTYPE_H_REQUIRE_DEFAULTS],
 [
   m4_defun(GL_MODULE_INDICATOR_PREFIX[_WCTYPE_H_MODULE_INDICATOR_DEFAULTS], [



^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: Interference between two installations of gnulib
  2021-04-11 19:32 ` Bruno Haible
  2021-04-12  7:50   ` Reuben Thomas
  2021-04-17 15:17   ` Bruno Haible
@ 2021-06-13 17:41   ` Paul Eggert
  2021-06-13 20:55     ` Bruno Haible
  2021-06-13 21:11     ` general comments about gnulib Bruno Haible
  2 siblings, 2 replies; 8+ messages in thread
From: Paul Eggert @ 2021-06-13 17:41 UTC (permalink / raw)
  To: Bruno Haible; +Cc: Gnulib bugs, Reuben Thomas

[-- Attachment #1: Type: text/plain, Size: 2160 bytes --]

On 4/11/21 12:32 PM, Bruno Haible wrote:

> Having two separate configure scripts is undesirable, because that would
> increase the total configure time of the package (and people have already
> complained about the configure time).
> 
> The same problem is seen also in GNU gettext and in GNU poke. I'm fixing it
> through the attached patch set.

Unfortunately this broke getopt-gnu on Solaris 10, because it relies on 
this line in modules/unistd:

	      -e 
's/@''GNULIB_UNISTD_H_GETOPT''@/0$(GNULIB_${gl_include_guard_prefix}_UNISTD_H_GETOPT)/g' 
\

and substitution went awry in this line, resulting in:

               -e 
's/@''GNULIB_UNISTD_H_GETOPT''@/0$(GL_GNULIB_GL_UNISTD_H_GETOPT)/g' \

This caused 'make check' to fail because test-getopt-gnu.c was testing 
Solaris getopt rather than the Gnulib substitute.

I discovered the problem after updating GNU grep to use the latest 
Gnulib, and after someone else's buildbots failed on Solaris 10 with 
'grep' and I got notified of their failures:

https://buildfarm.opencsw.org/buildbot/builders/ggrep-solaris10-i386/builds/227
https://buildfarm.opencsw.org/buildbot/builders/ggrep-solaris10-sparc/builds/229

I installed the attached patch to work around the problem. The Python 
patch is obviously a hack (and I haven't tested it); suggestions for 
improvements are welcome.

I must say that I am starting to reach my limits in debugging this sort 
of thing. We have quite a pyramid of hacks here, involving more than 
just the usual multilevel combination of make, m4, sh, and sed along 
with Git submodules etc., and now also a duplicate Python implementation 
that I don't offhand know how to test. And 'gnulib-tool', 'configure' 
and 'make check' are so verrryy slow; to find the commit that caused the 
problem, I had to run 'git bisect' overnight because my circa-2005 
Solaris 10 sparc machine is not as fast as modern machines. This is a 
long way from my traditional way of developing where I edited a Makefile 
and typed 'make' (and that was already too slow!).

I don't have a solution to this problem, and to some extent am just venting.

[-- Attachment #2: 0001-getopt-gnu-port-back-to-Solaris-10.patch --]
[-- Type: text/x-patch, Size: 6622 bytes --]

From 3dd3c04d9b5cf70fa454a19c90fa7d9ddd8b0d1c Mon Sep 17 00:00:00 2001
From: Paul Eggert <eggert@cs.ucla.edu>
Date: Sun, 13 Jun 2021 10:31:33 -0700
Subject: [PATCH] getopt-gnu: port back to Solaris 10
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

* gnulib-tool (func_emit_lib_Makefile_am)
(func_emit_tests_Makefile_am): Don’t substitute things like
$(GNULIB_${gl_include_guard_prefix}_UNISTD_H_GETOPT),
as this mishandles unistd and getopt-gnu, which breaks
‘make check’ on Solaris 10 with getopt-gnu.
* pygnulib/GLEmiter.py (lib_Makefile_am, tests_Makefile_am):
Likewise, albeit hackier since I did not test this and
so went with a trivial hack instead.
---
 ChangeLog            | 12 ++++++++++++
 gnulib-tool          |  8 ++++----
 pygnulib/GLEmiter.py | 12 ++++++++++++
 3 files changed, 28 insertions(+), 4 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index b48760c6e..084c43017 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2021-06-13  Paul Eggert  <eggert@cs.ucla.edu>
+
+	getopt-gnu: port back to Solaris 10
+	* gnulib-tool (func_emit_lib_Makefile_am)
+	(func_emit_tests_Makefile_am): Don’t substitute things like
+	$(GNULIB_${gl_include_guard_prefix}_UNISTD_H_GETOPT),
+	as this mishandles unistd and getopt-gnu, which breaks
+	‘make check’ on Solaris 10 with getopt-gnu.
+	* pygnulib/GLEmiter.py (lib_Makefile_am, tests_Makefile_am):
+	Likewise, albeit hackier since I did not test this and
+	so went with a trivial hack instead.
+
 2021-06-13  Bruno Haible  <bruno@clisp.org>
 
 	ialloc: Put appropriate license notice in source files.
diff --git a/gnulib-tool b/gnulib-tool
index 63a875d4a..1ea6580b3 100755
--- a/gnulib-tool
+++ b/gnulib-tool
@@ -3700,7 +3700,7 @@ func_emit_lib_Makefile_am ()
                 -e 's,lib_LTLIBRARIES,lib%_LTLIBRARIES,g' \
                 -e "$sed_eliminate_LDFLAGS" \
                 -e 's,lib_\([A-Z][A-Z]*\),'"${libname}_${libext}"'_\1,g' \
-                -e 's,\$(GNULIB_,$('"${module_indicator_prefix}"'_GNULIB_,' \
+                -e 's,\$(\(GNULIB_[A-Z]\),$('"${module_indicator_prefix}"'_\1,' \
                 -e 's,lib%_LIBRARIES,lib_LIBRARIES,g' \
                 -e 's,lib%_LTLIBRARIES,lib_LTLIBRARIES,g' \
                 -e "$sed_transform_check_PROGRAMS" \
@@ -3714,7 +3714,7 @@ func_emit_lib_Makefile_am ()
           func_get_automake_snippet_unconditional "$module" |
             LC_ALL=C \
             sed -e 's,lib_\([A-Z][A-Z]*\),'"${libname}_${libext}"'_\1,g' \
-                -e 's,\$(GNULIB_,$('"${module_indicator_prefix}"'_GNULIB_,'
+                -e 's,\$(\(GNULIB_[A-Z]\),$('"${module_indicator_prefix}"'_\1,'
         } > "$tmp"/amsnippet2
         # Skip the contents if it's entirely empty.
         if grep '[^	 ]' "$tmp"/amsnippet1 "$tmp"/amsnippet2 > /dev/null ; then
@@ -4058,7 +4058,7 @@ func_emit_tests_Makefile_am ()
                 -e 's,lib_LTLIBRARIES,lib%_LTLIBRARIES,g' \
                 -e "$sed_eliminate_LDFLAGS" \
                 -e 's,lib_\([A-Z][A-Z]*\),libtests_a_\1,g' \
-                -e 's,\$(GNULIB_,$('"${module_indicator_prefix}"'_GNULIB_,' \
+                -e 's,\$(\(GNULIB_[A-Z]\),$('"${module_indicator_prefix}"'_\1,' \
                 -e 's,lib%_LIBRARIES,lib_LIBRARIES,g' \
                 -e 's,lib%_LTLIBRARIES,lib_LTLIBRARIES,g' \
                 -e "$sed_transform_check_PROGRAMS" \
@@ -4072,7 +4072,7 @@ func_emit_tests_Makefile_am ()
           func_get_automake_snippet_unconditional "$module" |
             LC_ALL=C \
             sed -e 's,lib_\([A-Z][A-Z]*\),libtests_a_\1,g' \
-                -e 's,\$(GNULIB_,$('"${module_indicator_prefix}"'_GNULIB_,'
+                -e 's,\$(\(GNULIB_[A-Z]\),$('"${module_indicator_prefix}"'_\1,'
         } > "$tmp"/amsnippet2
         # Skip the contents if it's entirely empty.
         if grep '[^	 ]' "$tmp"/amsnippet1 "$tmp"/amsnippet2 > /dev/null ; then
diff --git a/pygnulib/GLEmiter.py b/pygnulib/GLEmiter.py
index e6b5a2a72..729862bc1 100644
--- a/pygnulib/GLEmiter.py
+++ b/pygnulib/GLEmiter.py
@@ -716,8 +716,12 @@ AC_DEFUN([%V1%_LIBSOURCES], [
                 pattern = compiler('lib_([A-Z][A-Z](?:.*?))', re.S | re.M)
                 amsnippet1 = pattern.sub('%s_%s_\\1' %
                                          (libname, libext), amsnippet1)
+                # FIXME: Use regular expression substitution instead
+                # of this hack.
+                amsnippet1 = amsnippet1.replace('$(GNULIB_$', '$(GNULIB!@#$%')
                 amsnippet1 = amsnippet1.replace(
                     '$(GNULIB_', '$(' + module_indicator_prefix + '_GNULIB_')
+                amsnippet1 = amsnippet1.replace('$(GNULIB!@#$%', '$(GNULIB_$')
                 amsnippet1 = amsnippet1.replace(
                     'lib%_LIBRARIES', 'lib_LIBRARIES')
                 amsnippet1 = amsnippet1.replace(
@@ -741,8 +745,12 @@ AC_DEFUN([%V1%_LIBSOURCES], [
                 pattern = compiler('lib_([A-Z][A-Z](?:.*?))', re.S | re.M)
                 amsnippet2 = pattern.sub('%s_%s_\\1' %
                                          (libname, libext), amsnippet2)
+                # FIXME: Use regular expression substitution instead
+                # of this hack.
+                amsnippet2 = amsnippet2.replace('$(GNULIB_$', '$(GNULIB!@#$%')
                 amsnippet2 = amsnippet2.replace(
                     '$(GNULIB_', '$(' + module_indicator_prefix + '_GNULIB_')
+                amsnippet1 = amsnippet2.replace('$(GNULIB!@#$%', '$(GNULIB_$')
                 if type(amsnippet1) is bytes:
                     amsnippet1 = amsnippet1.decode(ENCS['default'])
                 if type(amsnippet2) is bytes:
@@ -1011,8 +1019,12 @@ AC_DEFUN([%V1%_LIBSOURCES], [
                     snippet = pattern.sub('', snippet)
                 pattern = compiler('lib_([A-Z][A-Z](?:.*?))', re.S | re.M)
                 snippet = pattern.sub('libtests_a_\\1', snippet)
+                # FIXME: Use regular expression substitution instead
+                # of this hack.
+                snippet = snippet.replace('$(GNULIB_$', '$(GNULIB!@#$%')
                 snippet = snippet.replace(
                     '$(GNULIB_', '$(' + module_indicator_prefix + '_GNULIB_')
+                snippet = snippet.replace('$(GNULIB!@#$%', '$(GNULIB_$')
                 snippet = snippet.replace('lib%_LIBRARIES', 'lib_LIBRARIES')
                 snippet = snippet.replace(
                     'lib%_LTLIBRARIES', 'lib_LTLIBRARIES')
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: Interference between two installations of gnulib
  2021-06-13 17:41   ` Paul Eggert
@ 2021-06-13 20:55     ` Bruno Haible
  2021-06-13 21:11     ` general comments about gnulib Bruno Haible
  1 sibling, 0 replies; 8+ messages in thread
From: Bruno Haible @ 2021-06-13 20:55 UTC (permalink / raw)
  To: Paul Eggert; +Cc: bug-gnulib, Reuben Thomas

Paul Eggert wrote:
> > Having two separate configure scripts is undesirable, because that would
> > increase the total configure time of the package (and people have already
> > complained about the configure time).
> > 
> > The same problem is seen also in GNU gettext and in GNU poke. I'm fixing it
> > through the attached patch set.
> 
> Unfortunately this broke getopt-gnu on Solaris 10, because it relies on 
> this line in modules/unistd:
> 
> 	      -e 
> 's/@''GNULIB_UNISTD_H_GETOPT''@/0$(GNULIB_${gl_include_guard_prefix}_UNISTD_H_GETOPT)/g' 
> \
> 
> and substitution went awry in this line, resulting in:
> 
>                -e 
> 's/@''GNULIB_UNISTD_H_GETOPT''@/0$(GL_GNULIB_GL_UNISTD_H_GETOPT)/g' \
> 
> This caused 'make check' to fail because test-getopt-gnu.c was testing 
> Solaris getopt rather than the Gnulib substitute.
> 
> I discovered the problem after updating GNU grep to use the latest 
> Gnulib, and after someone else's buildbots failed on Solaris 10 with 
> 'grep' and I got notified of their failures:
> 
> https://buildfarm.opencsw.org/buildbot/builders/ggrep-solaris10-i386/builds/227
> https://buildfarm.opencsw.org/buildbot/builders/ggrep-solaris10-sparc/builds/229
> 
> I installed the attached patch to work around the problem.

Oh, I see:
My "Support several gnulib-tool invocations under the same configure.ac."
commit from 2021-04-11 interfered with the
"Fix conflict between two instantiations of module 'unistd'." commit
from 2011-11-26. Both attempt to do the same thing, just with a different
naming conventions of the substituted variables. And the later commit is in
fact a generalization of the older one. So, instead of adding a workaround,
it is simpler to just rework the older patch.

More precisely, we have 3 times the same situation, between module 'unistd'
and modules
  getopt-posix
  nonblocking
  sigpipe.

The simpler fix is to treat GNULIB_UNISTD_H_GETOPT like
GNULIB_UNISTD_H_NONBLOCKING and GNULIB_UNISTD_H_SIGPIPE.
Done through the patch below. It uses gl_MODULE_INDICATOR_INIT_VARIABLE
conditionally, like done in modules/windows-stat-override.
Tested with a current GNU grep checkout, on Solaris 10/x86_64.

> The Python 
> patch is obviously a hack (and I haven't tested it); suggestions for 
> improvements are welcome.

Few people are using the Python-based implementation at this point
(the wget2 people, in particular). If I'm not sure how to keep pygnulib/*
in sync with gnulib-tool, I just leave it out, and leave an entry in
gnulib-tool.py.TODO.


2021-06-13  Bruno Haible  <bruno@clisp.org>

	Align 2011-11-26 patch to 2021-04-11 patch (regression from 2021-04-11).
	Reported by Paul Eggert.
	* m4/unistd_h.m4 (gl_UNISTD_H_REQUIRE_DEFAULTS): Also initialize
	GNULIB_UNISTD_H_GETOPT variable.
	* modules/getopt-posix (configure.ac): Set GNULIB_UNISTD_H_GETOPT
	variable.
	* modules/unistd (Makefile.am): Rely on ${gl_include_guard_prefix}
	processing done by gnulib-tool since 2021-04-11.
	* gnulib-tool: Revert last change.
	* pygnulib/GLEmiter.py: Likewise.

diff --git a/m4/unistd_h.m4 b/m4/unistd_h.m4
index a40a41b..0ce4ea4 100644
--- a/m4/unistd_h.m4
+++ b/m4/unistd_h.m4
@@ -1,4 +1,4 @@
-# unistd_h.m4 serial 88
+# unistd_h.m4 serial 89
 dnl Copyright (C) 2006-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -133,6 +133,7 @@ AC_DEFUN([gl_UNISTD_H_REQUIRE_DEFAULTS],
     gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SYMLINKAT])
     gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TRUNCATE])
     gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TTYNAME_R])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNISTD_H_GETOPT])
     gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNISTD_H_NONBLOCKING])
     gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNISTD_H_SIGPIPE])
     gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNLINK])
diff --git a/modules/getopt-posix b/modules/getopt-posix
index cbcfff5..1a665e1 100644
--- a/modules/getopt-posix
+++ b/modules/getopt-posix
@@ -25,10 +25,10 @@ gl_FUNC_GETOPT_POSIX
 if test $REPLACE_GETOPT = 1; then
   AC_LIBOBJ([getopt])
   AC_LIBOBJ([getopt1])
-  dnl Arrange for unistd.h to include getopt.h.
-  GNULIB_${gl_include_guard_prefix}_UNISTD_H_GETOPT=1
+  dnl Define the substituted variable GNULIB_UNISTD_H_GETOPT to 1.
+  gl_UNISTD_H_REQUIRE_DEFAULTS
+  gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNISTD_H_GETOPT], [1])
 fi
-AC_SUBST([GNULIB_${gl_include_guard_prefix}_UNISTD_H_GETOPT])
 gl_UNISTD_MODULE_INDICATOR([getopt-posix])
 
 Makefile.am:
diff --git a/modules/unistd b/modules/unistd
index 281924f..acc9d86 100644
--- a/modules/unistd
+++ b/modules/unistd
@@ -93,7 +93,7 @@ unistd.h: unistd.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H
 	      -e 's/@''GNULIB_SYMLINKAT''@/$(GNULIB_SYMLINKAT)/g' \
 	      -e 's/@''GNULIB_TRUNCATE''@/$(GNULIB_TRUNCATE)/g' \
 	      -e 's/@''GNULIB_TTYNAME_R''@/$(GNULIB_TTYNAME_R)/g' \
-	      -e 's/@''GNULIB_UNISTD_H_GETOPT''@/0$(GNULIB_${gl_include_guard_prefix}_UNISTD_H_GETOPT)/g' \
+	      -e 's/@''GNULIB_UNISTD_H_GETOPT''@/0$(GNULIB_UNISTD_H_GETOPT)/g' \
 	      -e 's/@''GNULIB_UNISTD_H_NONBLOCKING''@/$(GNULIB_UNISTD_H_NONBLOCKING)/g' \
 	      -e 's/@''GNULIB_UNISTD_H_SIGPIPE''@/$(GNULIB_UNISTD_H_SIGPIPE)/g' \
 	      -e 's/@''GNULIB_UNLINK''@/$(GNULIB_UNLINK)/g' \
diff --git a/gnulib-tool b/gnulib-tool
index 1ea6580..63a875d 100755
--- a/gnulib-tool
+++ b/gnulib-tool
@@ -3700,7 +3700,7 @@ func_emit_lib_Makefile_am ()
                 -e 's,lib_LTLIBRARIES,lib%_LTLIBRARIES,g' \
                 -e "$sed_eliminate_LDFLAGS" \
                 -e 's,lib_\([A-Z][A-Z]*\),'"${libname}_${libext}"'_\1,g' \
-                -e 's,\$(\(GNULIB_[A-Z]\),$('"${module_indicator_prefix}"'_\1,' \
+                -e 's,\$(GNULIB_,$('"${module_indicator_prefix}"'_GNULIB_,' \
                 -e 's,lib%_LIBRARIES,lib_LIBRARIES,g' \
                 -e 's,lib%_LTLIBRARIES,lib_LTLIBRARIES,g' \
                 -e "$sed_transform_check_PROGRAMS" \
@@ -3714,7 +3714,7 @@ func_emit_lib_Makefile_am ()
           func_get_automake_snippet_unconditional "$module" |
             LC_ALL=C \
             sed -e 's,lib_\([A-Z][A-Z]*\),'"${libname}_${libext}"'_\1,g' \
-                -e 's,\$(\(GNULIB_[A-Z]\),$('"${module_indicator_prefix}"'_\1,'
+                -e 's,\$(GNULIB_,$('"${module_indicator_prefix}"'_GNULIB_,'
         } > "$tmp"/amsnippet2
         # Skip the contents if it's entirely empty.
         if grep '[^	 ]' "$tmp"/amsnippet1 "$tmp"/amsnippet2 > /dev/null ; then
@@ -4058,7 +4058,7 @@ func_emit_tests_Makefile_am ()
                 -e 's,lib_LTLIBRARIES,lib%_LTLIBRARIES,g' \
                 -e "$sed_eliminate_LDFLAGS" \
                 -e 's,lib_\([A-Z][A-Z]*\),libtests_a_\1,g' \
-                -e 's,\$(\(GNULIB_[A-Z]\),$('"${module_indicator_prefix}"'_\1,' \
+                -e 's,\$(GNULIB_,$('"${module_indicator_prefix}"'_GNULIB_,' \
                 -e 's,lib%_LIBRARIES,lib_LIBRARIES,g' \
                 -e 's,lib%_LTLIBRARIES,lib_LTLIBRARIES,g' \
                 -e "$sed_transform_check_PROGRAMS" \
@@ -4072,7 +4072,7 @@ func_emit_tests_Makefile_am ()
           func_get_automake_snippet_unconditional "$module" |
             LC_ALL=C \
             sed -e 's,lib_\([A-Z][A-Z]*\),libtests_a_\1,g' \
-                -e 's,\$(\(GNULIB_[A-Z]\),$('"${module_indicator_prefix}"'_\1,'
+                -e 's,\$(GNULIB_,$('"${module_indicator_prefix}"'_GNULIB_,'
         } > "$tmp"/amsnippet2
         # Skip the contents if it's entirely empty.
         if grep '[^	 ]' "$tmp"/amsnippet1 "$tmp"/amsnippet2 > /dev/null ; then
diff --git a/pygnulib/GLEmiter.py b/pygnulib/GLEmiter.py
index 729862b..e6b5a2a 100644
--- a/pygnulib/GLEmiter.py
+++ b/pygnulib/GLEmiter.py
@@ -716,12 +716,8 @@ AC_DEFUN([%V1%_LIBSOURCES], [
                 pattern = compiler('lib_([A-Z][A-Z](?:.*?))', re.S | re.M)
                 amsnippet1 = pattern.sub('%s_%s_\\1' %
                                          (libname, libext), amsnippet1)
-                # FIXME: Use regular expression substitution instead
-                # of this hack.
-                amsnippet1 = amsnippet1.replace('$(GNULIB_$', '$(GNULIB!@#$%')
                 amsnippet1 = amsnippet1.replace(
                     '$(GNULIB_', '$(' + module_indicator_prefix + '_GNULIB_')
-                amsnippet1 = amsnippet1.replace('$(GNULIB!@#$%', '$(GNULIB_$')
                 amsnippet1 = amsnippet1.replace(
                     'lib%_LIBRARIES', 'lib_LIBRARIES')
                 amsnippet1 = amsnippet1.replace(
@@ -745,12 +741,8 @@ AC_DEFUN([%V1%_LIBSOURCES], [
                 pattern = compiler('lib_([A-Z][A-Z](?:.*?))', re.S | re.M)
                 amsnippet2 = pattern.sub('%s_%s_\\1' %
                                          (libname, libext), amsnippet2)
-                # FIXME: Use regular expression substitution instead
-                # of this hack.
-                amsnippet2 = amsnippet2.replace('$(GNULIB_$', '$(GNULIB!@#$%')
                 amsnippet2 = amsnippet2.replace(
                     '$(GNULIB_', '$(' + module_indicator_prefix + '_GNULIB_')
-                amsnippet1 = amsnippet2.replace('$(GNULIB!@#$%', '$(GNULIB_$')
                 if type(amsnippet1) is bytes:
                     amsnippet1 = amsnippet1.decode(ENCS['default'])
                 if type(amsnippet2) is bytes:
@@ -1019,12 +1011,8 @@ AC_DEFUN([%V1%_LIBSOURCES], [
                     snippet = pattern.sub('', snippet)
                 pattern = compiler('lib_([A-Z][A-Z](?:.*?))', re.S | re.M)
                 snippet = pattern.sub('libtests_a_\\1', snippet)
-                # FIXME: Use regular expression substitution instead
-                # of this hack.
-                snippet = snippet.replace('$(GNULIB_$', '$(GNULIB!@#$%')
                 snippet = snippet.replace(
                     '$(GNULIB_', '$(' + module_indicator_prefix + '_GNULIB_')
-                snippet = snippet.replace('$(GNULIB!@#$%', '$(GNULIB_$')
                 snippet = snippet.replace('lib%_LIBRARIES', 'lib_LIBRARIES')
                 snippet = snippet.replace(
                     'lib%_LTLIBRARIES', 'lib_LTLIBRARIES')



^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: general comments about gnulib
  2021-06-13 17:41   ` Paul Eggert
  2021-06-13 20:55     ` Bruno Haible
@ 2021-06-13 21:11     ` Bruno Haible
  1 sibling, 0 replies; 8+ messages in thread
From: Bruno Haible @ 2021-06-13 21:11 UTC (permalink / raw)
  To: Paul Eggert; +Cc: bug-gnulib, Reuben Thomas

Paul Eggert wrote:
> I must say that I am starting to reach my limits in debugging this sort 
> of thing. We have quite a pyramid of hacks here, involving more than 
> just the usual multilevel combination of make, m4, sh, and sed along 
> with Git submodules etc.

Yes, these GL_GNULIB_* variables whose name depends on the gnulib-tool
invocation require even more attention and care during problem analysis.
And when developing patches in this area, things are so complex that I
need a written-up plan, because it's impossible to keep the details in
memory.

> And 'gnulib-tool', 'configure' 
> and 'make check' are so verrryy slow; to find the commit that caused the 
> problem, I had to run 'git bisect' overnight because my circa-2005 
> Solaris 10 sparc machine is not as fast as modern machines. This is a 
> long way from my traditional way of developing where I edited a Makefile 
> and typed 'make' (and that was already too slow!).

It's similar on a more modern machine (with GNU grep):

time ./bootstrap          99 sec.
time ./configure          33 sec.
time make                 18 sec.
time make check          114 sec.
------------------       --------
TOTAL                    264 sec.

Yes, a build cycle of 4 minutes requires a different kind of developing.
In these situations, I typically prepare a script that I can run 100 times,
and turn to other things while the script is running.

Speeding up 'gnulib-tool' would not help much in this situation. It might reduce
the build cycle from 4 minutes to 3 minutes (if it were highly optimized),
but that does not change the basic situation.

> I don't have a solution to this problem, and to some extent am just venting.

It's OK. That's what a mailing list is for :)

Bruno



^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2021-06-13 21:11 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-10  7:38 Interference between two installations of gnulib Reuben Thomas
2021-04-11 19:32 ` Bruno Haible
2021-04-12  7:50   ` Reuben Thomas
2021-04-17 15:17   ` Bruno Haible
2021-04-18 11:16     ` Bruno Haible
2021-06-13 17:41   ` Paul Eggert
2021-06-13 20:55     ` Bruno Haible
2021-06-13 21:11     ` general comments about gnulib Bruno Haible

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).