changeset 14683:efab6978105e

Avoid unnecessary compilation units, through conditional dependencies. * modules/accept (Depends-on): Add conditions to the dependencies. * modules/acosl (Depends-on): Likewise. * modules/argz (Depends-on): Likewise. * modules/asinl (Depends-on): Likewise. * modules/atanl (Depends-on): Likewise. * modules/atoll (Depends-on): Likewise. * modules/bind (Depends-on): Likewise. * modules/btowc (Depends-on): Likewise. * modules/canonicalize-lgpl (Depends-on): Likewise. * modules/ceil (Depends-on): Likewise. * modules/ceilf (Depends-on): Likewise. * modules/ceill (Depends-on): Likewise. * modules/chdir-long (Depends-on): Likewise. * modules/chown (Depends-on): Likewise. * modules/close (Depends-on): Likewise. * modules/connect (Depends-on): Likewise. * modules/cosl (Depends-on): Likewise. * modules/dirfd (Depends-on): Likewise. * modules/dprintf (Depends-on): Likewise. * modules/dprintf-posix (Depends-on): Likewise. * modules/error (Depends-on): Likewise. * modules/euidaccess (Depends-on): Likewise. * modules/expl (Depends-on): Likewise. * modules/faccessat (Depends-on): Likewise. * modules/fchdir (Depends-on): Likewise. * modules/fclose (Depends-on): Likewise. * modules/fcntl (Depends-on): Likewise. * modules/fdopendir (Depends-on): Likewise. * modules/fflush (Depends-on): Likewise. * modules/floor (Depends-on): Likewise. * modules/floorf (Depends-on): Likewise. * modules/floorl (Depends-on): Likewise. * modules/fnmatch (Depends-on): Likewise. * modules/fopen (Depends-on): Likewise. * modules/fprintf-posix (Depends-on): Likewise. * modules/frexp (Depends-on): Likewise. * modules/frexp-nolibm (Depends-on): Likewise. * modules/frexpl (Depends-on): Likewise. * modules/frexpl-nolibm (Depends-on): Likewise. * modules/fseek (Depends-on): Likewise. * modules/fsusage (Depends-on): Likewise. * modules/ftell (Depends-on): Likewise. * modules/ftello (Depends-on): Likewise. * modules/futimens (Depends-on): Likewise. * modules/getcwd (Depends-on): Likewise. * modules/getcwd-lgpl (Depends-on): Likewise. * modules/getdelim (Depends-on): Likewise. * modules/getdomainname (Depends-on): Likewise. * modules/getgroups (Depends-on): Likewise. * modules/gethostname (Depends-on): Likewise. * modules/getline (Depends-on): Likewise. * modules/getlogin_r (Depends-on): Likewise. * modules/getopt-posix (Depends-on): Likewise. * modules/getpeername (Depends-on): Likewise. * modules/getsockname (Depends-on): Likewise. * modules/getsockopt (Depends-on): Likewise. * modules/getsubopt (Depends-on): Likewise. * modules/getusershell (Depends-on): Likewise. * modules/glob (Depends-on): Likewise. * modules/grantpt (Depends-on): Likewise. * modules/iconv_open (Depends-on): Likewise. * modules/iconv_open-utf (Depends-on): Likewise. * modules/inet_ntop (Depends-on): Likewise. * modules/inet_pton (Depends-on): Likewise. * modules/ioctl (Depends-on): Likewise. * modules/isapipe (Depends-on): Likewise. * modules/isfinite (Depends-on): Likewise. * modules/isinf (Depends-on): Likewise. * modules/lchown (Depends-on): Likewise. * modules/ldexpl (Depends-on): Likewise. * modules/link (Depends-on): Likewise. * modules/linkat (Depends-on): Likewise. * modules/listen (Depends-on): Likewise. * modules/logl (Depends-on): Likewise. * modules/lstat (Depends-on): Likewise. * modules/mbrlen (Depends-on): Likewise. * modules/mbrtowc (Depends-on): Likewise. * modules/mbsinit (Depends-on): Likewise. * modules/mbsnrtowcs (Depends-on): Likewise. * modules/mbsrtowcs (Depends-on): Likewise. * modules/mbtowc (Depends-on): Likewise. * modules/memcmp (Depends-on): Likewise. * modules/mkdir (Depends-on): Likewise. * modules/mkdtemp (Depends-on): Likewise. * modules/mkfifo (Depends-on): Likewise. * modules/mkfifoat (Depends-on): Likewise. * modules/mknod (Depends-on): Likewise. * modules/mkostemp (Depends-on): Likewise. * modules/mkostemps (Depends-on): Likewise. * modules/mkstemp (Depends-on): Likewise. * modules/mkstemps (Depends-on): Likewise. * modules/mktime (Depends-on): Likewise. * modules/nanosleep (Depends-on): Likewise. * modules/open (Depends-on): Likewise. * modules/openat (Depends-on): Likewise. * modules/perror (Depends-on): Likewise. * modules/poll (Depends-on): Likewise. * modules/popen (Depends-on): Likewise. * modules/posix_spawn (Depends-on): Likewise. * modules/posix_spawn_file_actions_addclose (Depends-on): Likewise. * modules/posix_spawn_file_actions_adddup2 (Depends-on): Likewise. * modules/posix_spawn_file_actions_addopen (Depends-on): Likewise. * modules/posix_spawnp (Depends-on): Likewise. * modules/pread (Depends-on): Likewise. * modules/printf-posix (Depends-on): Likewise. * modules/ptsname (Depends-on): Likewise. * modules/putenv (Depends-on): Likewise. * modules/pwrite (Depends-on): Likewise. * modules/readline (Depends-on): Likewise. * modules/readlink (Depends-on): Likewise. * modules/readlinkat (Depends-on): Likewise. * modules/recv (Depends-on): Likewise. * modules/recvfrom (Depends-on): Likewise. * modules/regex (Depends-on): Likewise. * modules/remove (Depends-on): Likewise. * modules/rename (Depends-on): Likewise. * modules/renameat (Depends-on): Likewise. * modules/rmdir (Depends-on): Likewise. * modules/round (Depends-on): Likewise. * modules/roundf (Depends-on): Likewise. * modules/roundl (Depends-on): Likewise. * modules/rpmatch (Depends-on): Likewise. * modules/select (Depends-on): Likewise. * modules/send (Depends-on): Likewise. * modules/sendto (Depends-on): Likewise. * modules/setenv (Depends-on): Likewise. * modules/setlocale (Depends-on): Likewise. * modules/setsockopt (Depends-on): Likewise. * modules/shutdown (Depends-on): Likewise. * modules/sigaction (Depends-on): Likewise. * modules/signbit (Depends-on): Likewise. * modules/sigprocmask (Depends-on): Likewise. * modules/sinl (Depends-on): Likewise. * modules/sleep (Depends-on): Likewise. * modules/snprintf (Depends-on): Likewise. * modules/snprintf-posix (Depends-on): Likewise. * modules/socket (Depends-on): Likewise. * modules/sprintf-posix (Depends-on): Likewise. * modules/sqrtl (Depends-on): Likewise. * modules/stat (Depends-on): Likewise. * modules/strchrnul (Depends-on): Likewise. * modules/strdup-posix (Depends-on): Likewise. * modules/strerror (Depends-on): Likewise. * modules/strerror_r-posix (Depends-on): Likewise. * modules/strndup (Depends-on): Likewise. * modules/strnlen (Depends-on): Likewise. * modules/strptime (Depends-on): Likewise. * modules/strsep (Depends-on): Likewise. * modules/strsignal (Depends-on): Likewise. * modules/strstr-simple (Depends-on): Likewise. * modules/strtod (Depends-on): Likewise. * modules/strtoimax (Depends-on): Likewise. * modules/strtok_r (Depends-on): Likewise. * modules/strtoumax (Depends-on): Likewise. * modules/symlink (Depends-on): Likewise. * modules/symlinkat (Depends-on): Likewise. * modules/tanl (Depends-on): Likewise. * modules/tcgetsid (Depends-on): Likewise. * modules/tmpfile (Depends-on): Likewise. * modules/trunc (Depends-on): Likewise. * modules/truncf (Depends-on): Likewise. * modules/truncl (Depends-on): Likewise. * modules/uname (Depends-on): Likewise. * modules/unlink (Depends-on): Likewise. * modules/unlockpt (Depends-on): Likewise. * modules/unsetenv (Depends-on): Likewise. * modules/usleep (Depends-on): Likewise. * modules/utimensat (Depends-on): Likewise. * modules/vasprintf (Depends-on): Likewise. * modules/vdprintf (Depends-on): Likewise. * modules/vdprintf-posix (Depends-on): Likewise. * modules/vfprintf-posix (Depends-on): Likewise. * modules/vprintf-posix (Depends-on): Likewise. * modules/vsnprintf (Depends-on): Likewise. * modules/vsnprintf-posix (Depends-on): Likewise. * modules/vsprintf-posix (Depends-on): Likewise. * modules/wcrtomb (Depends-on): Likewise. * modules/wcscasecmp (Depends-on): Likewise. * modules/wcscspn (Depends-on): Likewise. * modules/wcsdup (Depends-on): Likewise. * modules/wcsncasecmp (Depends-on): Likewise. * modules/wcsnrtombs (Depends-on): Likewise. * modules/wcspbrk (Depends-on): Likewise. * modules/wcsrtombs (Depends-on): Likewise. * modules/wcsspn (Depends-on): Likewise. * modules/wcsstr (Depends-on): Likewise. * modules/wcstok (Depends-on): Likewise. * modules/wcswidth (Depends-on): Likewise. * modules/wctob (Depends-on): Likewise. * modules/wctomb (Depends-on): Likewise. * modules/wctype (Depends-on): Likewise. * modules/wcwidth (Depends-on): Likewise. * modules/write (Depends-on): Likewise.
author Bruno Haible <bruno@clisp.org>
date Tue, 03 May 2011 23:36:43 +0200
parents af0bb23f406a
children 8acb3380123d
files ChangeLog modules/accept modules/acosl modules/argz modules/asinl modules/atanl modules/atoll modules/bind modules/btowc modules/canonicalize-lgpl modules/ceil modules/ceilf modules/ceill modules/chdir-long modules/chown modules/close modules/connect modules/cosl modules/dirfd modules/dprintf modules/dprintf-posix modules/error modules/euidaccess modules/expl modules/faccessat modules/fchdir modules/fclose modules/fcntl modules/fdopendir modules/fflush modules/floor modules/floorf modules/floorl modules/fnmatch modules/fopen modules/fprintf-posix modules/frexp modules/frexp-nolibm modules/frexpl modules/frexpl-nolibm modules/fseek modules/fsusage modules/ftell modules/ftello modules/futimens modules/getcwd modules/getcwd-lgpl modules/getdelim modules/getdomainname modules/getgroups modules/gethostname modules/getline modules/getlogin_r modules/getopt-posix modules/getpeername modules/getsockname modules/getsockopt modules/getsubopt modules/getusershell modules/glob modules/grantpt modules/iconv_open modules/iconv_open-utf modules/inet_ntop modules/inet_pton modules/ioctl modules/isapipe modules/isfinite modules/isinf modules/lchown modules/ldexpl modules/link modules/linkat modules/listen modules/logl modules/lstat modules/mbrlen modules/mbrtowc modules/mbsinit modules/mbsnrtowcs modules/mbsrtowcs modules/mbtowc modules/memcmp modules/mkdir modules/mkdtemp modules/mkfifo modules/mkfifoat modules/mknod modules/mkostemp modules/mkostemps modules/mkstemp modules/mkstemps modules/mktime modules/nanosleep modules/open modules/openat modules/perror modules/poll modules/popen modules/posix_spawn modules/posix_spawn_file_actions_addclose modules/posix_spawn_file_actions_adddup2 modules/posix_spawn_file_actions_addopen modules/posix_spawnp modules/pread modules/printf-posix modules/ptsname modules/putenv modules/pwrite modules/readline modules/readlink modules/readlinkat modules/recv modules/recvfrom modules/regex modules/remove modules/rename modules/renameat modules/rmdir modules/round modules/roundf modules/roundl modules/rpmatch modules/select modules/send modules/sendto modules/setenv modules/setlocale modules/setsockopt modules/shutdown modules/sigaction modules/signbit modules/sigprocmask modules/sinl modules/sleep modules/snprintf modules/snprintf-posix modules/socket modules/sprintf-posix modules/sqrtl modules/stat modules/strchrnul modules/strdup-posix modules/strerror modules/strerror_r-posix modules/strndup modules/strnlen modules/strptime modules/strsep modules/strsignal modules/strstr-simple modules/strtod modules/strtoimax modules/strtok_r modules/strtoumax modules/symlink modules/symlinkat modules/tanl modules/tcgetsid modules/tmpfile modules/trunc modules/truncf modules/truncl modules/uname modules/unlink modules/unlockpt modules/unsetenv modules/usleep modules/utimensat modules/vasprintf modules/vdprintf modules/vdprintf-posix modules/vfprintf-posix modules/vprintf-posix modules/vsnprintf modules/vsnprintf-posix modules/vsprintf-posix modules/wcrtomb modules/wcscasecmp modules/wcscspn modules/wcsdup modules/wcsncasecmp modules/wcsnrtombs modules/wcspbrk modules/wcsrtombs modules/wcsspn modules/wcsstr modules/wcstok modules/wcswidth modules/wctob modules/wctomb modules/wctype modules/wcwidth modules/write
diffstat 194 files changed, 751 insertions(+), 553 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,200 @@
+2011-05-03  Bruno Haible  <bruno@clisp.org>
+
+	Avoid unnecessary compilation units, through conditional dependencies.
+	* modules/accept (Depends-on): Add conditions to the dependencies.
+	* modules/acosl (Depends-on): Likewise.
+	* modules/argz (Depends-on): Likewise.
+	* modules/asinl (Depends-on): Likewise.
+	* modules/atanl (Depends-on): Likewise.
+	* modules/atoll (Depends-on): Likewise.
+	* modules/bind (Depends-on): Likewise.
+	* modules/btowc (Depends-on): Likewise.
+	* modules/canonicalize-lgpl (Depends-on): Likewise.
+	* modules/ceil (Depends-on): Likewise.
+	* modules/ceilf (Depends-on): Likewise.
+	* modules/ceill (Depends-on): Likewise.
+	* modules/chdir-long (Depends-on): Likewise.
+	* modules/chown (Depends-on): Likewise.
+	* modules/close (Depends-on): Likewise.
+	* modules/connect (Depends-on): Likewise.
+	* modules/cosl (Depends-on): Likewise.
+	* modules/dirfd (Depends-on): Likewise.
+	* modules/dprintf (Depends-on): Likewise.
+	* modules/dprintf-posix (Depends-on): Likewise.
+	* modules/error (Depends-on): Likewise.
+	* modules/euidaccess (Depends-on): Likewise.
+	* modules/expl (Depends-on): Likewise.
+	* modules/faccessat (Depends-on): Likewise.
+	* modules/fchdir (Depends-on): Likewise.
+	* modules/fclose (Depends-on): Likewise.
+	* modules/fcntl (Depends-on): Likewise.
+	* modules/fdopendir (Depends-on): Likewise.
+	* modules/fflush (Depends-on): Likewise.
+	* modules/floor (Depends-on): Likewise.
+	* modules/floorf (Depends-on): Likewise.
+	* modules/floorl (Depends-on): Likewise.
+	* modules/fnmatch (Depends-on): Likewise.
+	* modules/fopen (Depends-on): Likewise.
+	* modules/fprintf-posix (Depends-on): Likewise.
+	* modules/frexp (Depends-on): Likewise.
+	* modules/frexp-nolibm (Depends-on): Likewise.
+	* modules/frexpl (Depends-on): Likewise.
+	* modules/frexpl-nolibm (Depends-on): Likewise.
+	* modules/fseek (Depends-on): Likewise.
+	* modules/fsusage (Depends-on): Likewise.
+	* modules/ftell (Depends-on): Likewise.
+	* modules/ftello (Depends-on): Likewise.
+	* modules/futimens (Depends-on): Likewise.
+	* modules/getcwd (Depends-on): Likewise.
+	* modules/getcwd-lgpl (Depends-on): Likewise.
+	* modules/getdelim (Depends-on): Likewise.
+	* modules/getdomainname (Depends-on): Likewise.
+	* modules/getgroups (Depends-on): Likewise.
+	* modules/gethostname (Depends-on): Likewise.
+	* modules/getline (Depends-on): Likewise.
+	* modules/getlogin_r (Depends-on): Likewise.
+	* modules/getopt-posix (Depends-on): Likewise.
+	* modules/getpeername (Depends-on): Likewise.
+	* modules/getsockname (Depends-on): Likewise.
+	* modules/getsockopt (Depends-on): Likewise.
+	* modules/getsubopt (Depends-on): Likewise.
+	* modules/getusershell (Depends-on): Likewise.
+	* modules/glob (Depends-on): Likewise.
+	* modules/grantpt (Depends-on): Likewise.
+	* modules/iconv_open (Depends-on): Likewise.
+	* modules/iconv_open-utf (Depends-on): Likewise.
+	* modules/inet_ntop (Depends-on): Likewise.
+	* modules/inet_pton (Depends-on): Likewise.
+	* modules/ioctl (Depends-on): Likewise.
+	* modules/isapipe (Depends-on): Likewise.
+	* modules/isfinite (Depends-on): Likewise.
+	* modules/isinf (Depends-on): Likewise.
+	* modules/lchown (Depends-on): Likewise.
+	* modules/ldexpl (Depends-on): Likewise.
+	* modules/link (Depends-on): Likewise.
+	* modules/linkat (Depends-on): Likewise.
+	* modules/listen (Depends-on): Likewise.
+	* modules/logl (Depends-on): Likewise.
+	* modules/lstat (Depends-on): Likewise.
+	* modules/mbrlen (Depends-on): Likewise.
+	* modules/mbrtowc (Depends-on): Likewise.
+	* modules/mbsinit (Depends-on): Likewise.
+	* modules/mbsnrtowcs (Depends-on): Likewise.
+	* modules/mbsrtowcs (Depends-on): Likewise.
+	* modules/mbtowc (Depends-on): Likewise.
+	* modules/memcmp (Depends-on): Likewise.
+	* modules/mkdir (Depends-on): Likewise.
+	* modules/mkdtemp (Depends-on): Likewise.
+	* modules/mkfifo (Depends-on): Likewise.
+	* modules/mkfifoat (Depends-on): Likewise.
+	* modules/mknod (Depends-on): Likewise.
+	* modules/mkostemp (Depends-on): Likewise.
+	* modules/mkostemps (Depends-on): Likewise.
+	* modules/mkstemp (Depends-on): Likewise.
+	* modules/mkstemps (Depends-on): Likewise.
+	* modules/mktime (Depends-on): Likewise.
+	* modules/nanosleep (Depends-on): Likewise.
+	* modules/open (Depends-on): Likewise.
+	* modules/openat (Depends-on): Likewise.
+	* modules/perror (Depends-on): Likewise.
+	* modules/poll (Depends-on): Likewise.
+	* modules/popen (Depends-on): Likewise.
+	* modules/posix_spawn (Depends-on): Likewise.
+	* modules/posix_spawn_file_actions_addclose (Depends-on): Likewise.
+	* modules/posix_spawn_file_actions_adddup2 (Depends-on): Likewise.
+	* modules/posix_spawn_file_actions_addopen (Depends-on): Likewise.
+	* modules/posix_spawnp (Depends-on): Likewise.
+	* modules/pread (Depends-on): Likewise.
+	* modules/printf-posix (Depends-on): Likewise.
+	* modules/ptsname (Depends-on): Likewise.
+	* modules/putenv (Depends-on): Likewise.
+	* modules/pwrite (Depends-on): Likewise.
+	* modules/readline (Depends-on): Likewise.
+	* modules/readlink (Depends-on): Likewise.
+	* modules/readlinkat (Depends-on): Likewise.
+	* modules/recv (Depends-on): Likewise.
+	* modules/recvfrom (Depends-on): Likewise.
+	* modules/regex (Depends-on): Likewise.
+	* modules/remove (Depends-on): Likewise.
+	* modules/rename (Depends-on): Likewise.
+	* modules/renameat (Depends-on): Likewise.
+	* modules/rmdir (Depends-on): Likewise.
+	* modules/round (Depends-on): Likewise.
+	* modules/roundf (Depends-on): Likewise.
+	* modules/roundl (Depends-on): Likewise.
+	* modules/rpmatch (Depends-on): Likewise.
+	* modules/select (Depends-on): Likewise.
+	* modules/send (Depends-on): Likewise.
+	* modules/sendto (Depends-on): Likewise.
+	* modules/setenv (Depends-on): Likewise.
+	* modules/setlocale (Depends-on): Likewise.
+	* modules/setsockopt (Depends-on): Likewise.
+	* modules/shutdown (Depends-on): Likewise.
+	* modules/sigaction (Depends-on): Likewise.
+	* modules/signbit (Depends-on): Likewise.
+	* modules/sigprocmask (Depends-on): Likewise.
+	* modules/sinl (Depends-on): Likewise.
+	* modules/sleep (Depends-on): Likewise.
+	* modules/snprintf (Depends-on): Likewise.
+	* modules/snprintf-posix (Depends-on): Likewise.
+	* modules/socket (Depends-on): Likewise.
+	* modules/sprintf-posix (Depends-on): Likewise.
+	* modules/sqrtl (Depends-on): Likewise.
+	* modules/stat (Depends-on): Likewise.
+	* modules/strchrnul (Depends-on): Likewise.
+	* modules/strdup-posix (Depends-on): Likewise.
+	* modules/strerror (Depends-on): Likewise.
+	* modules/strerror_r-posix (Depends-on): Likewise.
+	* modules/strndup (Depends-on): Likewise.
+	* modules/strnlen (Depends-on): Likewise.
+	* modules/strptime (Depends-on): Likewise.
+	* modules/strsep (Depends-on): Likewise.
+	* modules/strsignal (Depends-on): Likewise.
+	* modules/strstr-simple (Depends-on): Likewise.
+	* modules/strtod (Depends-on): Likewise.
+	* modules/strtoimax (Depends-on): Likewise.
+	* modules/strtok_r (Depends-on): Likewise.
+	* modules/strtoumax (Depends-on): Likewise.
+	* modules/symlink (Depends-on): Likewise.
+	* modules/symlinkat (Depends-on): Likewise.
+	* modules/tanl (Depends-on): Likewise.
+	* modules/tcgetsid (Depends-on): Likewise.
+	* modules/tmpfile (Depends-on): Likewise.
+	* modules/trunc (Depends-on): Likewise.
+	* modules/truncf (Depends-on): Likewise.
+	* modules/truncl (Depends-on): Likewise.
+	* modules/uname (Depends-on): Likewise.
+	* modules/unlink (Depends-on): Likewise.
+	* modules/unlockpt (Depends-on): Likewise.
+	* modules/unsetenv (Depends-on): Likewise.
+	* modules/usleep (Depends-on): Likewise.
+	* modules/utimensat (Depends-on): Likewise.
+	* modules/vasprintf (Depends-on): Likewise.
+	* modules/vdprintf (Depends-on): Likewise.
+	* modules/vdprintf-posix (Depends-on): Likewise.
+	* modules/vfprintf-posix (Depends-on): Likewise.
+	* modules/vprintf-posix (Depends-on): Likewise.
+	* modules/vsnprintf (Depends-on): Likewise.
+	* modules/vsnprintf-posix (Depends-on): Likewise.
+	* modules/vsprintf-posix (Depends-on): Likewise.
+	* modules/wcrtomb (Depends-on): Likewise.
+	* modules/wcscasecmp (Depends-on): Likewise.
+	* modules/wcscspn (Depends-on): Likewise.
+	* modules/wcsdup (Depends-on): Likewise.
+	* modules/wcsncasecmp (Depends-on): Likewise.
+	* modules/wcsnrtombs (Depends-on): Likewise.
+	* modules/wcspbrk (Depends-on): Likewise.
+	* modules/wcsrtombs (Depends-on): Likewise.
+	* modules/wcsspn (Depends-on): Likewise.
+	* modules/wcsstr (Depends-on): Likewise.
+	* modules/wcstok (Depends-on): Likewise.
+	* modules/wcswidth (Depends-on): Likewise.
+	* modules/wctob (Depends-on): Likewise.
+	* modules/wctomb (Depends-on): Likewise.
+	* modules/wctype (Depends-on): Likewise.
+	* modules/wcwidth (Depends-on): Likewise.
+	* modules/write (Depends-on): Likewise.
+
 2011-05-03  Bruno Haible  <bruno@clisp.org>
 
 	Support for conditional dependencies.
--- a/modules/accept
+++ b/modules/accept
@@ -7,7 +7,7 @@
 
 Depends-on:
 sys_socket
-errno
+errno           [test "$ac_cv_header_winsock2_h" = yes]
 
 configure.ac:
 AC_REQUIRE([gl_HEADER_SYS_SOCKET])
--- a/modules/acosl
+++ b/modules/acosl
@@ -8,8 +8,8 @@
 Depends-on:
 math
 extensions
-asinl
-sqrtl
+asinl           [test $HAVE_ACOSL = 0]
+sqrtl           [test $HAVE_ACOSL = 0]
 
 configure.ac:
 gl_FUNC_ACOSL
--- a/modules/argz
+++ b/modules/argz
@@ -7,12 +7,12 @@
 m4/argz.m4
 
 Depends-on:
-memmove
-mempcpy
-stpcpy
-strndup
-strnlen
-strstr
+memmove         [test -n "$ARGZ_H"]
+mempcpy         [test -n "$ARGZ_H"]
+stpcpy          [test -n "$ARGZ_H"]
+strndup         [test -n "$ARGZ_H"]
+strnlen         [test -n "$ARGZ_H"]
+strstr          [test -n "$ARGZ_H"]
 
 configure.ac:
 gl_FUNC_ARGZ
--- a/modules/asinl
+++ b/modules/asinl
@@ -8,7 +8,7 @@
 Depends-on:
 math
 extensions
-sqrtl
+sqrtl           [test $HAVE_ASINL = 0]
 
 configure.ac:
 gl_FUNC_ASINL
--- a/modules/atanl
+++ b/modules/atanl
@@ -8,7 +8,7 @@
 Depends-on:
 math
 extensions
-isnanl
+isnanl          [test $HAVE_ATANL = 0]
 
 configure.ac:
 gl_FUNC_ATANL
--- a/modules/atoll
+++ b/modules/atoll
@@ -7,7 +7,7 @@
 m4/longlong.m4
 
 Depends-on:
-strtoll
+strtoll         [test $HAVE_ATOLL = 0]
 
 configure.ac:
 gl_FUNC_ATOLL
--- a/modules/bind
+++ b/modules/bind
@@ -7,7 +7,7 @@
 
 Depends-on:
 sys_socket
-errno
+errno           [test "$ac_cv_header_winsock2_h" = yes]
 
 configure.ac:
 AC_REQUIRE([gl_HEADER_SYS_SOCKET])
--- a/modules/btowc
+++ b/modules/btowc
@@ -8,7 +8,7 @@
 
 Depends-on:
 wchar
-mbtowc
+mbtowc          [test $HAVE_BTOWC = 0 || test $REPLACE_BTOWC = 1]
 
 configure.ac:
 gl_FUNC_BTOWC
--- a/modules/canonicalize-lgpl
+++ b/modules/canonicalize-lgpl
@@ -7,16 +7,16 @@
 m4/double-slash-root.m4
 
 Depends-on:
-alloca-opt
-errno
 extensions
-lstat
-malloca
-memmove
-pathmax
-readlink
 stdlib
-sys_stat
+alloca-opt      [test $HAVE_CANONICALIZE_FILE_NAME = 0 || test $REPLACE_CANONICALIZE_FILE_NAME = 1]
+errno           [test $HAVE_CANONICALIZE_FILE_NAME = 0 || test $REPLACE_CANONICALIZE_FILE_NAME = 1]
+lstat           [test $HAVE_CANONICALIZE_FILE_NAME = 0 || test $REPLACE_CANONICALIZE_FILE_NAME = 1]
+malloca         [test $HAVE_CANONICALIZE_FILE_NAME = 0 || test $REPLACE_CANONICALIZE_FILE_NAME = 1]
+memmove         [test $HAVE_CANONICALIZE_FILE_NAME = 0 || test $REPLACE_CANONICALIZE_FILE_NAME = 1]
+pathmax         [test $HAVE_CANONICALIZE_FILE_NAME = 0 || test $REPLACE_CANONICALIZE_FILE_NAME = 1]
+readlink        [test $HAVE_CANONICALIZE_FILE_NAME = 0 || test $REPLACE_CANONICALIZE_FILE_NAME = 1]
+sys_stat        [test $HAVE_CANONICALIZE_FILE_NAME = 0 || test $REPLACE_CANONICALIZE_FILE_NAME = 1]
 
 configure.ac:
 gl_CANONICALIZE_LGPL
--- a/modules/ceil
+++ b/modules/ceil
@@ -7,7 +7,7 @@
 
 Depends-on:
 math
-float
+float           [test $REPLACE_CEIL = 1]
 
 configure.ac:
 gl_FUNC_CEIL
--- a/modules/ceilf
+++ b/modules/ceilf
@@ -9,7 +9,7 @@
 Depends-on:
 math
 extensions
-float
+float           [test $HAVE_DECL_CEILF = 0 || test $REPLACE_CEILF = 1]
 
 configure.ac:
 gl_FUNC_CEILF
--- a/modules/ceill
+++ b/modules/ceill
@@ -9,7 +9,7 @@
 Depends-on:
 math
 extensions
-float
+float           [test $HAVE_DECL_CEILL = 0 || test $REPLACE_CEILL = 1]
 
 configure.ac:
 gl_FUNC_CEILL
--- a/modules/chdir-long
+++ b/modules/chdir-long
@@ -7,15 +7,16 @@
 m4/chdir-long.m4
 
 Depends-on:
-atexit
-fchdir
-fcntl-h
-openat
-memchr
-mempcpy
-memrchr
-stdbool
-stdlib
+unistd
+atexit          [test $gl_cv_have_arbitrary_file_name_length_limit = yes]
+fchdir          [test $gl_cv_have_arbitrary_file_name_length_limit = yes]
+fcntl-h         [test $gl_cv_have_arbitrary_file_name_length_limit = yes]
+openat          [test $gl_cv_have_arbitrary_file_name_length_limit = yes]
+memchr          [test $gl_cv_have_arbitrary_file_name_length_limit = yes]
+mempcpy         [test $gl_cv_have_arbitrary_file_name_length_limit = yes]
+memrchr         [test $gl_cv_have_arbitrary_file_name_length_limit = yes]
+stdbool         [test $gl_cv_have_arbitrary_file_name_length_limit = yes]
+stdlib          [test $gl_cv_have_arbitrary_file_name_length_limit = yes]
 
 configure.ac:
 gl_FUNC_CHDIR_LONG
--- a/modules/chown
+++ b/modules/chown
@@ -7,11 +7,11 @@
 m4/chown.m4
 
 Depends-on:
-open
-stat
-stdbool
-sys_stat
 unistd
+open            [test $HAVE_CHOWN = 0 || test $REPLACE_CHOWN = 1]
+stat            [test $HAVE_CHOWN = 0 || test $REPLACE_CHOWN = 1]
+stdbool         [test $HAVE_CHOWN = 0 || test $REPLACE_CHOWN = 1]
+sys_stat        [test $HAVE_CHOWN = 0 || test $REPLACE_CHOWN = 1]
 
 configure.ac:
 gl_FUNC_CHOWN
--- a/modules/close
+++ b/modules/close
@@ -7,7 +7,7 @@
 
 Depends-on:
 unistd
-fd-hook
+fd-hook         [test $REPLACE_CLOSE = 1]
 fclose
 
 configure.ac:
--- a/modules/connect
+++ b/modules/connect
@@ -7,7 +7,7 @@
 
 Depends-on:
 sys_socket
-errno
+errno           [test "$ac_cv_header_winsock2_h" = yes]
 
 configure.ac:
 AC_REQUIRE([gl_HEADER_SYS_SOCKET])
--- a/modules/cosl
+++ b/modules/cosl
@@ -11,10 +11,10 @@
 Depends-on:
 math
 extensions
-float
-isnanl
-floor
-floorl
+float           [test $HAVE_COSL = 0]
+isnanl          [test $HAVE_COSL = 0]
+floor           [test $HAVE_COSL = 0]
+floorl          [test $HAVE_COSL = 0]
 
 configure.ac:
 gl_FUNC_COSL
--- a/modules/dirfd
+++ b/modules/dirfd
@@ -7,8 +7,8 @@
 
 Depends-on:
 dirent
-errno
 extensions
+errno           [test $ac_cv_have_decl_dirfd = no || test $REPLACE_DIRFD = 1]
 
 configure.ac:
 gl_FUNC_DIRFD
--- a/modules/dprintf
+++ b/modules/dprintf
@@ -7,9 +7,9 @@
 
 Depends-on:
 stdio
-vasnprintf
-full-write
-errno
+vasnprintf      [test $ac_cv_func_dprintf = no || test $REPLACE_DPRINTF = 1]
+full-write      [test $ac_cv_func_dprintf = no || test $REPLACE_DPRINTF = 1]
+errno           [test $ac_cv_func_dprintf = no || test $REPLACE_DPRINTF = 1]
 
 configure.ac:
 gl_FUNC_DPRINTF
--- a/modules/dprintf-posix
+++ b/modules/dprintf-posix
@@ -14,18 +14,18 @@
 
 Depends-on:
 dprintf
-vasnprintf
-isnand-nolibm
-isnanl-nolibm
-frexp-nolibm
-frexpl-nolibm
-printf-frexp
-printf-frexpl
-signbit
-fpucw
 nocrash
 printf-safe
 multiarch
+vasnprintf      [test $ac_cv_func_dprintf = no || test $REPLACE_DPRINTF = 1]
+isnand-nolibm   [test $ac_cv_func_dprintf = no || test $REPLACE_DPRINTF = 1]
+isnanl-nolibm   [test $ac_cv_func_dprintf = no || test $REPLACE_DPRINTF = 1]
+frexp-nolibm    [test $ac_cv_func_dprintf = no || test $REPLACE_DPRINTF = 1]
+frexpl-nolibm   [test $ac_cv_func_dprintf = no || test $REPLACE_DPRINTF = 1]
+printf-frexp    [test $ac_cv_func_dprintf = no || test $REPLACE_DPRINTF = 1]
+printf-frexpl   [test $ac_cv_func_dprintf = no || test $REPLACE_DPRINTF = 1]
+signbit         [test $ac_cv_func_dprintf = no || test $REPLACE_DPRINTF = 1]
+fpucw           [test $ac_cv_func_dprintf = no || test $REPLACE_DPRINTF = 1]
 
 configure.ac:
 gl_FUNC_DPRINTF_POSIX
--- a/modules/error
+++ b/modules/error
@@ -12,8 +12,8 @@
 m4/error.m4
 
 Depends-on:
-strerror
-unistd
+strerror        [test $ac_cv_lib_error_at_line = no]
+unistd          [test $ac_cv_lib_error_at_line = no]
 
 configure.ac:
 gl_ERROR
--- a/modules/euidaccess
+++ b/modules/euidaccess
@@ -8,9 +8,9 @@
 Depends-on:
 unistd
 extensions
-group-member
-stat
-sys_stat
+group-member    [test $HAVE_EUIDACCESS = 0]
+stat            [test $HAVE_EUIDACCESS = 0]
+sys_stat        [test $HAVE_EUIDACCESS = 0]
 
 configure.ac:
 gl_FUNC_EUIDACCESS
--- a/modules/expl
+++ b/modules/expl
@@ -8,8 +8,8 @@
 Depends-on:
 math
 extensions
-float
-floorl
+float           [test $HAVE_EXPL = 0]
+floorl          [test $HAVE_EXPL = 0]
 
 configure.ac:
 gl_FUNC_EXPL
--- a/modules/faccessat
+++ b/modules/faccessat
@@ -6,11 +6,11 @@
 m4/faccessat.m4
 
 Depends-on:
-euidaccess
+unistd
 extensions
 fcntl-h
-openat
-unistd
+euidaccess      [test $HAVE_FACCESSAT = 0]
+openat          [test $HAVE_FACCESSAT = 0]
 
 configure.ac:
 gl_FUNC_FACCESSAT
--- a/modules/fchdir
+++ b/modules/fchdir
@@ -6,23 +6,23 @@
 m4/fchdir.m4
 
 Depends-on:
-close
-dirent
-dirfd
-dosname
-dup2
-fcntl
-fcntl-h
-filenamecat-lgpl
-getcwd-lgpl
-malloc-posix
-open
-realloc-posix
-stat
-stdbool
-strdup-posix
-sys_stat
 unistd
+close            [test $HAVE_FCHDIR = 0]
+dirent           [test $HAVE_FCHDIR = 0]
+dirfd            [test $HAVE_FCHDIR = 0]
+dosname          [test $HAVE_FCHDIR = 0]
+dup2             [test $HAVE_FCHDIR = 0]
+fcntl            [test $HAVE_FCHDIR = 0]
+fcntl-h          [test $HAVE_FCHDIR = 0]
+filenamecat-lgpl [test $HAVE_FCHDIR = 0]
+getcwd-lgpl      [test $HAVE_FCHDIR = 0]
+malloc-posix     [test $HAVE_FCHDIR = 0]
+open             [test $HAVE_FCHDIR = 0]
+realloc-posix    [test $HAVE_FCHDIR = 0]
+stat             [test $HAVE_FCHDIR = 0]
+stdbool          [test $HAVE_FCHDIR = 0]
+strdup-posix     [test $HAVE_FCHDIR = 0]
+sys_stat         [test $HAVE_FCHDIR = 0]
 
 configure.ac:
 gl_FUNC_FCHDIR
--- a/modules/fclose
+++ b/modules/fclose
@@ -7,9 +7,9 @@
 
 Depends-on:
 stdio
-close
-freading
-lseek
+close           [test $REPLACE_FCLOSE = 1]
+freading        [test $REPLACE_FCLOSE = 1]
+lseek           [test $REPLACE_FCLOSE = 1]
 
 configure.ac:
 gl_FUNC_FCLOSE
--- a/modules/fcntl
+++ b/modules/fcntl
@@ -6,10 +6,10 @@
 lib/fcntl.c
 
 Depends-on:
-dup2
 fcntl-h
-getdtablesize
 extensions
+dup2            [test $HAVE_FCNTL = 0 || test $REPLACE_FCNTL = 1]
+getdtablesize   [test $HAVE_FCNTL = 0 || test $REPLACE_FCNTL = 1]
 
 configure.ac:
 gl_FUNC_FCNTL
--- a/modules/fdopendir
+++ b/modules/fdopendir
@@ -9,11 +9,11 @@
 
 Depends-on:
 dirent
-errno
 extensions
-fchdir
-openat-die
-save-cwd
+errno           [test $HAVE_FDOPENDIR = 0 || test $REPLACE_FDOPENDIR = 1]
+fchdir          [test $HAVE_FDOPENDIR = 0 || test $REPLACE_FDOPENDIR = 1]
+openat-die      [test $HAVE_FDOPENDIR = 0 || test $REPLACE_FDOPENDIR = 1]
+save-cwd        [test $HAVE_FDOPENDIR = 0 || test $REPLACE_FDOPENDIR = 1]
 
 configure.ac:
 gl_FUNC_FDOPENDIR
--- a/modules/fflush
+++ b/modules/fflush
@@ -7,14 +7,14 @@
 m4/fflush.m4
 
 Depends-on:
+stdio
 fclose
-fpurge
-ftello
-freading
-lseek
-stdio
-unistd
-fseeko
+fpurge          [test $REPLACE_FFLUSH = 1]
+ftello          [test $REPLACE_FFLUSH = 1]
+freading        [test $REPLACE_FFLUSH = 1]
+lseek           [test $REPLACE_FFLUSH = 1]
+unistd          [test $REPLACE_FFLUSH = 1]
+fseeko          [test $REPLACE_FFLUSH = 1]
 
 configure.ac-early:
 AC_REQUIRE([AC_FUNC_FSEEKO])
--- a/modules/floor
+++ b/modules/floor
@@ -7,7 +7,7 @@
 
 Depends-on:
 math
-float
+float           [test $REPLACE_FLOOR = 1]
 
 configure.ac:
 gl_FUNC_FLOOR
--- a/modules/floorf
+++ b/modules/floorf
@@ -9,7 +9,7 @@
 Depends-on:
 math
 extensions
-float
+float           [test $HAVE_DECL_FLOORF = 0 || test $REPLACE_FLOORF = 1]
 
 configure.ac:
 gl_FUNC_FLOORF
--- a/modules/floorl
+++ b/modules/floorl
@@ -9,7 +9,7 @@
 Depends-on:
 math
 extensions
-float
+float           [test $HAVE_DECL_FLOORL = 0 || test $REPLACE_FLOORL = 1]
 
 configure.ac:
 gl_FUNC_FLOORL
--- a/modules/fnmatch
+++ b/modules/fnmatch
@@ -11,14 +11,14 @@
 Depends-on:
 arg-nonnull
 extensions
-alloca
-stdbool
-wchar
-wctype-h
-memchr
-memcmp
-mbsrtowcs
-mbsinit
+alloca          [test -n "$FNMATCH_H"]
+stdbool         [test -n "$FNMATCH_H"]
+wchar           [test -n "$FNMATCH_H"]
+wctype-h        [test -n "$FNMATCH_H"]
+memchr          [test -n "$FNMATCH_H"]
+memcmp          [test -n "$FNMATCH_H"]
+mbsrtowcs       [test -n "$FNMATCH_H"]
+mbsinit         [test -n "$FNMATCH_H"]
 
 configure.ac:
 gl_FUNC_FNMATCH_POSIX
--- a/modules/fopen
+++ b/modules/fopen
@@ -7,7 +7,7 @@
 
 Depends-on:
 stdio
-unistd
+unistd          [test $REPLACE_FOPEN = 1]
 
 configure.ac:
 gl_FUNC_FOPEN
--- a/modules/fprintf-posix
+++ b/modules/fprintf-posix
@@ -14,20 +14,20 @@
 
 Depends-on:
 stdio
-fseterr
-vasnprintf
-isnand-nolibm
-isnanl-nolibm
-frexp-nolibm
-frexpl-nolibm
-printf-frexp
-printf-frexpl
-signbit
-fpucw
 nocrash
 printf-safe
 errno
 multiarch
+fseterr         [test $REPLACE_FPRINTF = 1]
+vasnprintf      [test $REPLACE_FPRINTF = 1]
+isnand-nolibm   [test $REPLACE_FPRINTF = 1]
+isnanl-nolibm   [test $REPLACE_FPRINTF = 1]
+frexp-nolibm    [test $REPLACE_FPRINTF = 1]
+frexpl-nolibm   [test $REPLACE_FPRINTF = 1]
+printf-frexp    [test $REPLACE_FPRINTF = 1]
+printf-frexpl   [test $REPLACE_FPRINTF = 1]
+signbit         [test $REPLACE_FPRINTF = 1]
+fpucw           [test $REPLACE_FPRINTF = 1]
 
 configure.ac:
 gl_FUNC_FPRINTF_POSIX
--- a/modules/frexp
+++ b/modules/frexp
@@ -7,7 +7,7 @@
 
 Depends-on:
 math
-isnand-nolibm
+isnand-nolibm   [test $gl_func_frexp != yes]
 
 configure.ac:
 gl_FUNC_FREXP
--- a/modules/frexp-nolibm
+++ b/modules/frexp-nolibm
@@ -7,7 +7,7 @@
 
 Depends-on:
 math
-isnand-nolibm
+isnand-nolibm   [test $gl_func_frexp_no_libm != yes]
 
 configure.ac:
 gl_FUNC_FREXP_NO_LIBM
--- a/modules/frexpl
+++ b/modules/frexpl
@@ -8,8 +8,8 @@
 
 Depends-on:
 math
-isnanl-nolibm
-fpucw
+isnanl-nolibm   [test $HAVE_DECL_FREXPL = 0 || test $gl_func_frexpl = no]
+fpucw           [test $HAVE_DECL_FREXPL = 0 || test $gl_func_frexpl = no]
 
 configure.ac:
 gl_FUNC_FREXPL
--- a/modules/frexpl-nolibm
+++ b/modules/frexpl-nolibm
@@ -9,8 +9,8 @@
 
 Depends-on:
 math
-isnanl-nolibm
-fpucw
+isnanl-nolibm   [test $HAVE_DECL_FREXPL = 0 || test $gl_func_frexpl_no_libm = no]
+fpucw           [test $HAVE_DECL_FREXPL = 0 || test $gl_func_frexpl_no_libm = no]
 
 configure.ac:
 gl_FUNC_FREXPL_NO_LIBM
--- a/modules/fseek
+++ b/modules/fseek
@@ -6,8 +6,8 @@
 m4/fseek.m4
 
 Depends-on:
-fseeko
 stdio
+fseeko          [test $REPLACE_FSEEK = 1]
 
 configure.ac:
 gl_FUNC_FSEEK
--- a/modules/fsusage
+++ b/modules/fsusage
@@ -7,9 +7,9 @@
 m4/fsusage.m4
 
 Depends-on:
-full-read
 stdbool
 stdint
+full-read       [test $gl_cv_fs_space = yes]
 
 configure.ac:
 gl_FSUSAGE
--- a/modules/ftell
+++ b/modules/ftell
@@ -6,9 +6,9 @@
 m4/ftell.m4
 
 Depends-on:
-ftello
 stdio
 errno
+ftello          [test $REPLACE_FTELL = 1]
 
 configure.ac:
 gl_FUNC_FTELL
--- a/modules/ftello
+++ b/modules/ftello
@@ -8,9 +8,9 @@
 m4/ftello.m4
 
 Depends-on:
+stdio
 extensions
-lseek
-stdio
+lseek           [test $HAVE_FTELLO = 0 || test $REPLACE_FTELLO = 1]
 
 configure.ac-early:
 AC_REQUIRE([AC_FUNC_FSEEKO])
--- a/modules/futimens
+++ b/modules/futimens
@@ -7,8 +7,8 @@
 
 Depends-on:
 sys_stat
-utimens
 extensions
+utimens         [test $HAVE_FUTIMENS = 0 || test $REPLACE_FUTIMENS = 1]
 
 configure.ac:
 gl_FUNC_FUTIMENS
--- a/modules/getcwd
+++ b/modules/getcwd
@@ -8,15 +8,15 @@
 m4/getcwd.m4
 
 Depends-on:
-mempcpy
-d-ino
+unistd
 extensions
-memmove
-openat
-stdbool
-unistd
-malloc-posix
-strdup-posix
+mempcpy         [test $REPLACE_GETCWD = 1]
+d-ino           [test $REPLACE_GETCWD = 1]
+memmove         [test $REPLACE_GETCWD = 1]
+openat          [test $REPLACE_GETCWD = 1]
+stdbool         [test $REPLACE_GETCWD = 1]
+malloc-posix    [test $REPLACE_GETCWD = 1]
+strdup-posix    [test $REPLACE_GETCWD = 1]
 
 configure.ac:
 gl_FUNC_GETCWD
--- a/modules/getcwd-lgpl
+++ b/modules/getcwd-lgpl
@@ -6,8 +6,8 @@
 m4/getcwd.m4
 
 Depends-on:
-strdup
 unistd
+strdup          [test $REPLACE_GETCWD = 1]
 
 configure.ac:
 gl_FUNC_GETCWD_LGPL
--- a/modules/getdelim
+++ b/modules/getdelim
@@ -6,11 +6,11 @@
 m4/getdelim.m4
 
 Depends-on:
+stdio
 extensions
-stdio
-stdint
-realloc-posix
-errno
+stdint          [test $HAVE_DECL_GETDELIM = 0 || test $REPLACE_GETDELIM = 1]
+realloc-posix   [test $HAVE_DECL_GETDELIM = 0 || test $REPLACE_GETDELIM = 1]
+errno           [test $HAVE_DECL_GETDELIM = 0 || test $REPLACE_GETDELIM = 1]
 
 configure.ac:
 gl_FUNC_GETDELIM
--- a/modules/getdomainname
+++ b/modules/getdomainname
@@ -8,8 +8,8 @@
 Depends-on:
 unistd
 extensions
-netdb
-sys_socket
+netdb           [test $HAVE_DECL_GETDOMAINNAME = 0 || test $REPLACE_GETDOMAINNAME = 1]
+sys_socket      [test $HAVE_DECL_GETDOMAINNAME = 0 || test $REPLACE_GETDOMAINNAME = 1]
 
 configure.ac:
 gl_FUNC_GETDOMAINNAME
--- a/modules/getgroups
+++ b/modules/getgroups
@@ -6,9 +6,9 @@
 m4/getgroups.m4
 
 Depends-on:
-malloc-posix
-stdint
 unistd
+malloc-posix    [test $HAVE_GETGROUPS = 0 || test $REPLACE_GETGROUPS = 1]
+stdint          [test $HAVE_GETGROUPS = 0 || test $REPLACE_GETGROUPS = 1]
 
 configure.ac:
 gl_FUNC_GETGROUPS
--- a/modules/gethostname
+++ b/modules/gethostname
@@ -8,9 +8,9 @@
 
 Depends-on:
 unistd
-sys_socket
-errno
-sockets
+sys_socket      [test $HAVE_GETHOSTNAME = 0]
+errno           [test $HAVE_GETHOSTNAME = 0]
+sockets         [test $HAVE_GETHOSTNAME = 0]
 
 configure.ac:
 gl_FUNC_GETHOSTNAME
--- a/modules/getline
+++ b/modules/getline
@@ -6,9 +6,9 @@
 m4/getline.m4
 
 Depends-on:
+stdio
 extensions
-getdelim
-stdio
+getdelim        [test $REPLACE_GETLINE = 1]
 
 configure.ac:
 gl_FUNC_GETLINE
--- a/modules/getlogin_r
+++ b/modules/getlogin_r
@@ -6,9 +6,9 @@
 m4/getlogin_r.m4
 
 Depends-on:
+unistd
 extensions
-unistd
-memchr
+memchr          [test $HAVE_GETLOGIN_R = 0 || test $REPLACE_GETLOGIN_R = 1]
 
 configure.ac:
 gl_FUNC_GETLOGIN_R
--- a/modules/getopt-posix
+++ b/modules/getopt-posix
@@ -9,11 +9,11 @@
 m4/getopt.m4
 
 Depends-on:
-gettext-h
 unistd
 extensions
 include_next
 arg-nonnull
+gettext-h       [test $GNULIB_UNISTD_H_GETOPT = 1]
 
 configure.ac:
 gl_FUNC_GETOPT_POSIX
--- a/modules/getpeername
+++ b/modules/getpeername
@@ -8,7 +8,7 @@
 
 Depends-on:
 sys_socket
-errno
+errno           [test "$ac_cv_header_winsock2_h" = yes]
 
 configure.ac:
 AC_REQUIRE([gl_HEADER_SYS_SOCKET])
--- a/modules/getsockname
+++ b/modules/getsockname
@@ -8,7 +8,7 @@
 
 Depends-on:
 sys_socket
-errno
+errno           [test "$ac_cv_header_winsock2_h" = yes]
 
 configure.ac:
 AC_REQUIRE([gl_HEADER_SYS_SOCKET])
--- a/modules/getsockopt
+++ b/modules/getsockopt
@@ -7,8 +7,8 @@
 
 Depends-on:
 sys_socket
-sys_time
-errno
+sys_time        [test "$ac_cv_header_winsock2_h" = yes]
+errno           [test "$ac_cv_header_winsock2_h" = yes]
 
 configure.ac:
 AC_REQUIRE([gl_HEADER_SYS_SOCKET])
--- a/modules/getsubopt
+++ b/modules/getsubopt
@@ -6,10 +6,10 @@
 m4/getsubopt.m4
 
 Depends-on:
+stdlib
 extensions
-strchrnul
-stdlib
-memchr
+strchrnul       [test $HAVE_GETSUBOPT = 0]
+memchr          [test $HAVE_GETSUBOPT = 0]
 
 configure.ac:
 gl_FUNC_GETSUBOPT
--- a/modules/getusershell
+++ b/modules/getusershell
@@ -8,8 +8,8 @@
 Depends-on:
 unistd
 extensions
-fopen-safer
-xalloc
+fopen-safer     [test $ac_cv_func_getusershell = no]
+xalloc          [test $ac_cv_func_getusershell = no]
 
 configure.ac:
 gl_FUNC_GETUSERSHELL
--- a/modules/glob
+++ b/modules/glob
@@ -9,22 +9,22 @@
 m4/glob.m4
 
 Depends-on:
-alloca
 arg-nonnull
 c++defs
-d-type
-dirfd
 extensions
-fnmatch
-getlogin_r
-memchr
-mempcpy
-stdbool
-strdup
-sys_stat
-unistd
 warn-on-use
-malloc-posix
+alloca          [test -n "$GLOB_H"]
+d-type          [test -n "$GLOB_H"]
+dirfd           [test -n "$GLOB_H"]
+fnmatch         [test -n "$GLOB_H"]
+getlogin_r      [test -n "$GLOB_H"]
+memchr          [test -n "$GLOB_H"]
+mempcpy         [test -n "$GLOB_H"]
+stdbool         [test -n "$GLOB_H"]
+strdup          [test -n "$GLOB_H"]
+sys_stat        [test -n "$GLOB_H"]
+unistd          [test -n "$GLOB_H"]
+malloc-posix    [test -n "$GLOB_H"]
 
 configure.ac:
 gl_GLOB
--- a/modules/grantpt
+++ b/modules/grantpt
@@ -8,9 +8,9 @@
 Depends-on:
 stdlib
 extensions
-pt_chown
-waitpid
-configmake
+pt_chown        [test $HAVE_GRANTPT = 0]
+waitpid         [test $HAVE_GRANTPT = 0]
+configmake      [test $HAVE_GRANTPT = 0]
 
 configure.ac:
 gl_FUNC_GRANTPT
--- a/modules/iconv_open
+++ b/modules/iconv_open
@@ -14,8 +14,8 @@
 gperf
 iconv-h
 iconv
-c-ctype
-c-strcase
+c-ctype         [test $REPLACE_ICONV_OPEN = 1]
+c-strcase       [test $REPLACE_ICONV_OPEN = 1]
 
 configure.ac:
 gl_FUNC_ICONV_OPEN
--- a/modules/iconv_open-utf
+++ b/modules/iconv_open-utf
@@ -8,9 +8,9 @@
 
 Depends-on:
 iconv_open
-stdint
-unistr/u8-mbtoucr
-unistr/u8-uctomb
+stdint            [test $REPLACE_ICONV_UTF = 1]
+unistr/u8-mbtoucr [test $REPLACE_ICONV_UTF = 1]
+unistr/u8-uctomb  [test $REPLACE_ICONV_UTF = 1]
 
 configure.ac:
 gl_FUNC_ICONV_OPEN_UTF
--- a/modules/inet_ntop
+++ b/modules/inet_ntop
@@ -6,11 +6,11 @@
 m4/inet_ntop.m4
 
 Depends-on:
-sys_socket
 arpa_inet
-errno
-netinet_in
 extensions
+sys_socket      [test "$ac_cv_search_inet_ntop" = no && test $ac_cv_func_inet_ntop = no]
+errno           [test "$ac_cv_search_inet_ntop" = no && test $ac_cv_func_inet_ntop = no]
+netinet_in      [test "$ac_cv_search_inet_ntop" = no && test $ac_cv_func_inet_ntop = no]
 
 configure.ac:
 gl_FUNC_INET_NTOP
--- a/modules/inet_pton
+++ b/modules/inet_pton
@@ -6,12 +6,12 @@
 m4/inet_pton.m4
 
 Depends-on:
-c-ctype
-sys_socket
 arpa_inet
-errno
-netinet_in
 extensions
+c-ctype         [test "$ac_cv_search_inet_pton" = no && test $ac_cv_func_inet_pton = no]
+sys_socket      [test "$ac_cv_search_inet_pton" = no && test $ac_cv_func_inet_pton = no]
+errno           [test "$ac_cv_search_inet_pton" = no && test $ac_cv_func_inet_pton = no]
+netinet_in      [test "$ac_cv_search_inet_pton" = no && test $ac_cv_func_inet_pton = no]
 
 configure.ac:
 gl_FUNC_INET_PTON
--- a/modules/ioctl
+++ b/modules/ioctl
@@ -8,9 +8,9 @@
 
 Depends-on:
 sys_ioctl
-sys_socket
-errno
-fd-hook
+sys_socket      [test "$ac_cv_header_winsock2_h" = yes || test $REPLACE_IOCTL = 1]
+errno           [test "$ac_cv_header_winsock2_h" = yes || test $REPLACE_IOCTL = 1]
+fd-hook         [test "$ac_cv_header_winsock2_h" = yes || test $REPLACE_IOCTL = 1]
 
 configure.ac:
 gl_FUNC_IOCTL
--- a/modules/isapipe
+++ b/modules/isapipe
@@ -7,9 +7,9 @@
 m4/isapipe.m4
 
 Depends-on:
-stdbool
-sys_stat
-unistd
+stdbool         [test $ac_cv_func_isapipe = no]
+sys_stat        [test $ac_cv_func_isapipe = no]
+unistd          [test $ac_cv_func_isapipe = no]
 
 configure.ac:
 gl_ISAPIPE
--- a/modules/isfinite
+++ b/modules/isfinite
@@ -7,11 +7,11 @@
 m4/check-math-lib.m4
 
 Depends-on:
-isnanf-nolibm
-isnand-nolibm
-isnanl-nolibm
 math
 extensions
+isnanf-nolibm   [test $REPLACE_ISFINITE = 1]
+isnand-nolibm   [test $REPLACE_ISFINITE = 1]
+isnanl-nolibm   [test $REPLACE_ISFINITE = 1]
 
 configure.ac:
 gl_ISFINITE
--- a/modules/isinf
+++ b/modules/isinf
@@ -7,9 +7,9 @@
 m4/check-math-lib.m4
 
 Depends-on:
-float
 math
 extensions
+float           [test $REPLACE_ISINF = 1]
 
 configure.ac:
 gl_ISINF
--- a/modules/lchown
+++ b/modules/lchown
@@ -6,12 +6,12 @@
 m4/lchown.m4
 
 Depends-on:
-chown
-errno
-lstat
-stdbool
-sys_stat
 unistd
+chown           [test $HAVE_LCHOWN = 0 || test $REPLACE_LCHOWN = 1]
+errno           [test $HAVE_LCHOWN = 0 || test $REPLACE_LCHOWN = 1]
+lstat           [test $HAVE_LCHOWN = 0 || test $REPLACE_LCHOWN = 1]
+stdbool         [test $HAVE_LCHOWN = 0 || test $REPLACE_LCHOWN = 1]
+sys_stat        [test $HAVE_LCHOWN = 0 || test $REPLACE_LCHOWN = 1]
 
 configure.ac:
 gl_FUNC_LCHOWN
--- a/modules/ldexpl
+++ b/modules/ldexpl
@@ -7,8 +7,8 @@
 
 Depends-on:
 math
-isnanl
-fpucw
+isnanl          [test $HAVE_DECL_LDEXPL = 0 || test $gl_func_ldexpl = no]
+fpucw           [test $HAVE_DECL_LDEXPL = 0 || test $gl_func_ldexpl = no]
 
 configure.ac:
 gl_FUNC_LDEXPL
--- a/modules/link
+++ b/modules/link
@@ -6,10 +6,10 @@
 m4/link.m4
 
 Depends-on:
-stat
-strdup-posix
-sys_stat
 unistd
+stat            [test $HAVE_LINK = 0 || test $REPLACE_LINK = 1]
+strdup-posix    [test $HAVE_LINK = 0 || test $REPLACE_LINK = 1]
+sys_stat        [test $HAVE_LINK = 0 || test $REPLACE_LINK = 1]
 
 configure.ac:
 gl_FUNC_LINK
--- a/modules/linkat
+++ b/modules/linkat
@@ -7,24 +7,24 @@
 m4/linkat.m4
 
 Depends-on:
-areadlink
-areadlinkat
-dirname-lgpl
-errno
+unistd
 extensions
-fcntl-h
-filenamecat-lgpl
-getcwd-lgpl
-openat
-link
-link-follow
-lstat
-readlink
-same-inode
-stpcpy
-symlink
-symlinkat
-unistd
+areadlink        [test $HAVE_LINKAT = 0 || test $REPLACE_LINKAT = 1]
+areadlinkat      [test $HAVE_LINKAT = 0 || test $REPLACE_LINKAT = 1]
+dirname-lgpl     [test $HAVE_LINKAT = 0 || test $REPLACE_LINKAT = 1]
+errno            [test $HAVE_LINKAT = 0 || test $REPLACE_LINKAT = 1]
+fcntl-h          [test $HAVE_LINKAT = 0 || test $REPLACE_LINKAT = 1]
+filenamecat-lgpl [test $HAVE_LINKAT = 0 || test $REPLACE_LINKAT = 1]
+getcwd-lgpl      [test $HAVE_LINKAT = 0 || test $REPLACE_LINKAT = 1]
+openat           [test $HAVE_LINKAT = 0 || test $REPLACE_LINKAT = 1]
+link             [test $HAVE_LINKAT = 0 || test $REPLACE_LINKAT = 1]
+link-follow      [test $HAVE_LINKAT = 0 || test $REPLACE_LINKAT = 1]
+lstat            [test $HAVE_LINKAT = 0 || test $REPLACE_LINKAT = 1]
+readlink         [test $HAVE_LINKAT = 0 || test $REPLACE_LINKAT = 1]
+same-inode       [test $HAVE_LINKAT = 0 || test $REPLACE_LINKAT = 1]
+stpcpy           [test $HAVE_LINKAT = 0 || test $REPLACE_LINKAT = 1]
+symlink          [test $HAVE_LINKAT = 0 || test $REPLACE_LINKAT = 1]
+symlinkat        [test $HAVE_LINKAT = 0 || test $REPLACE_LINKAT = 1]
 
 configure.ac:
 gl_FUNC_LINKAT
--- a/modules/listen
+++ b/modules/listen
@@ -7,7 +7,7 @@
 
 Depends-on:
 sys_socket
-errno
+errno           [test "$ac_cv_header_winsock2_h" = yes]
 
 configure.ac:
 AC_REQUIRE([gl_HEADER_SYS_SOCKET])
--- a/modules/logl
+++ b/modules/logl
@@ -8,9 +8,9 @@
 Depends-on:
 math
 extensions
-frexpl
-isnanl
-floorl
+frexpl          [test $HAVE_LOGL = 0]
+isnanl          [test $HAVE_LOGL = 0]
+floorl          [test $HAVE_LOGL = 0]
 
 configure.ac:
 gl_FUNC_LOGL
--- a/modules/lstat
+++ b/modules/lstat
@@ -6,9 +6,9 @@
 m4/lstat.m4
 
 Depends-on:
-dosname
-stat
 sys_stat
+dosname         [test $REPLACE_LSTAT = 1]
+stat            [test $REPLACE_LSTAT = 1]
 
 configure.ac:
 gl_FUNC_LSTAT
--- a/modules/mbrlen
+++ b/modules/mbrlen
@@ -8,8 +8,8 @@
 
 Depends-on:
 wchar
-mbrtowc
 extensions
+mbrtowc         [test $HAVE_MBRLEN = 0 || test $REPLACE_MBRLEN = 1]
 
 configure.ac:
 gl_FUNC_MBRLEN
--- a/modules/mbrtowc
+++ b/modules/mbrtowc
@@ -12,11 +12,11 @@
 
 Depends-on:
 wchar
-mbsinit
-localcharset
-streq
-verify
 extensions
+mbsinit         [test $HAVE_MBRTOWC = 0 || test $REPLACE_MBRTOWC = 1]
+localcharset    [test $HAVE_MBRTOWC = 0 || test $REPLACE_MBRTOWC = 1]
+streq           [test $HAVE_MBRTOWC = 0 || test $REPLACE_MBRTOWC = 1]
+verify          [test $HAVE_MBRTOWC = 0 || test $REPLACE_MBRTOWC = 1]
 
 configure.ac:
 gl_FUNC_MBRTOWC
--- a/modules/mbsinit
+++ b/modules/mbsinit
@@ -8,9 +8,9 @@
 
 Depends-on:
 wchar
-mbrtowc
-verify
 extensions
+mbrtowc         [test $HAVE_MBSINIT = 0 || test $REPLACE_MBSINIT = 1]
+verify          [test $HAVE_MBSINIT = 0 || test $REPLACE_MBSINIT = 1]
 
 configure.ac:
 gl_FUNC_MBSINIT
--- a/modules/mbsnrtowcs
+++ b/modules/mbsnrtowcs
@@ -9,11 +9,11 @@
 m4/mbstate_t.m4
 
 Depends-on:
+wchar
 extensions
-wchar
-mbrtowc
-minmax
-strnlen1
+mbrtowc         [test $HAVE_MBSNRTOWCS = 0 || test $REPLACE_MBSNRTOWCS = 1]
+minmax          [test $HAVE_MBSNRTOWCS = 0 || test $REPLACE_MBSNRTOWCS = 1]
+strnlen1        [test $HAVE_MBSNRTOWCS = 0 || test $REPLACE_MBSNRTOWCS = 1]
 
 configure.ac:
 gl_FUNC_MBSNRTOWCS
--- a/modules/mbsrtowcs
+++ b/modules/mbsrtowcs
@@ -14,9 +14,9 @@
 
 Depends-on:
 wchar
-mbrtowc
-strnlen1
 extensions
+mbrtowc         [test $HAVE_MBSRTOWCS = 0 || test $REPLACE_MBSRTOWCS = 1]
+strnlen1        [test $HAVE_MBSRTOWCS = 0 || test $REPLACE_MBSRTOWCS = 1]
 
 configure.ac:
 gl_FUNC_MBSRTOWCS
--- a/modules/mbtowc
+++ b/modules/mbtowc
@@ -8,8 +8,8 @@
 
 Depends-on:
 stdlib
-mbrtowc
-wchar
+mbrtowc         [test $REPLACE_MBTOWC = 1]
+wchar           [test $REPLACE_MBTOWC = 1]
 
 configure.ac:
 gl_FUNC_MBTOWC
--- a/modules/memcmp
+++ b/modules/memcmp
@@ -12,7 +12,7 @@
 m4/memcmp.m4
 
 Depends-on:
-stdint
+stdint          [test $ac_cv_func_memcmp_working = no]
 
 configure.ac:
 gl_FUNC_MEMCMP
--- a/modules/mkdir
+++ b/modules/mkdir
@@ -6,8 +6,8 @@
 m4/mkdir.m4
 
 Depends-on:
-dirname-lgpl
 sys_stat
+dirname-lgpl    [test $REPLACE_MKDIR = 1]
 
 configure.ac:
 gl_FUNC_MKDIR
--- a/modules/mkdtemp
+++ b/modules/mkdtemp
@@ -6,9 +6,9 @@
 m4/mkdtemp.m4
 
 Depends-on:
-stdint
 stdlib
-tempname
+stdint          [test $HAVE_MKDTEMP = 0]
+tempname        [test $HAVE_MKDTEMP = 0]
 
 configure.ac:
 gt_FUNC_MKDTEMP
--- a/modules/mkfifo
+++ b/modules/mkfifo
@@ -6,8 +6,8 @@
 m4/mkfifo.m4
 
 Depends-on:
-stat
 sys_stat
+stat            [test $HAVE_MKFIFO = 0 || test $REPLACE_MKFIFO = 1]
 
 configure.ac:
 gl_FUNC_MKFIFO
--- a/modules/mkfifoat
+++ b/modules/mkfifoat
@@ -7,12 +7,12 @@
 m4/mkfifoat.m4
 
 Depends-on:
+sys_stat
 extensions
 fcntl-h
-mkfifo
-mknod
-openat
-sys_stat
+mkfifo          [test $HAVE_MKFIFOAT = 0]
+mknod           [test $HAVE_MKNODAT = 0]
+openat          [test $HAVE_MKFIFOAT = 0 || test $HAVE_MKNODAT = 0]
 
 configure.ac:
 gl_FUNC_MKFIFOAT
--- a/modules/mknod
+++ b/modules/mknod
@@ -6,10 +6,10 @@
 m4/mknod.m4
 
 Depends-on:
-mkfifo
-stat
 sys_stat
 extensions
+mkfifo          [test $HAVE_MKNOD = 0 || test $REPLACE_MKNOD = 1]
+stat            [test $HAVE_MKNOD = 0 || test $REPLACE_MKNOD = 1]
 
 configure.ac:
 gl_FUNC_MKNOD
--- a/modules/mkostemp
+++ b/modules/mkostemp
@@ -7,9 +7,9 @@
 m4/mkostemp.m4
 
 Depends-on:
+stdlib
 extensions
-stdlib
-tempname
+tempname        [test $HAVE_MKOSTEMP = 0]
 
 configure.ac:
 gl_FUNC_MKOSTEMP
--- a/modules/mkostemps
+++ b/modules/mkostemps
@@ -7,9 +7,9 @@
 m4/mkostemps.m4
 
 Depends-on:
+stdlib
 extensions
-stdlib
-tempname
+tempname        [test $HAVE_MKOSTEMPS = 0]
 
 configure.ac:
 gl_FUNC_MKOSTEMPS
--- a/modules/mkstemp
+++ b/modules/mkstemp
@@ -6,9 +6,9 @@
 m4/mkstemp.m4
 
 Depends-on:
+stdlib
 extensions
-stdlib
-tempname
+tempname        [test $HAVE_MKSTEMP = 0 || test $REPLACE_MKSTEMP = 1]
 
 configure.ac:
 gl_FUNC_MKSTEMP
--- a/modules/mkstemps
+++ b/modules/mkstemps
@@ -6,9 +6,9 @@
 m4/mkstemps.m4
 
 Depends-on:
+stdlib
 extensions
-stdlib
-tempname
+tempname        [test $HAVE_MKSTEMPS = 0]
 
 configure.ac:
 gl_FUNC_MKSTEMPS
--- a/modules/mktime
+++ b/modules/mktime
@@ -8,7 +8,7 @@
 
 Depends-on:
 multiarch
-time_r
+time_r          [test $REPLACE_MKTIME = 1]
 
 configure.ac:
 gl_FUNC_MKTIME
--- a/modules/nanosleep
+++ b/modules/nanosleep
@@ -6,16 +6,16 @@
 m4/nanosleep.m4
 
 Depends-on:
+time
 extensions
-intprops
 multiarch
-select
-sigaction
-stdbool
-sys_select
-sys_time
-time
-verify
+intprops        [test $HAVE_NANOSLEEP = 0 || test $REPLACE_NANOSLEEP = 1]
+select          [test $HAVE_NANOSLEEP = 0 || test $REPLACE_NANOSLEEP = 1]
+sigaction       [test $HAVE_NANOSLEEP = 0 || test $REPLACE_NANOSLEEP = 1]
+stdbool         [test $HAVE_NANOSLEEP = 0 || test $REPLACE_NANOSLEEP = 1]
+sys_select      [test $HAVE_NANOSLEEP = 0 || test $REPLACE_NANOSLEEP = 1]
+sys_time        [test $HAVE_NANOSLEEP = 0 || test $REPLACE_NANOSLEEP = 1]
+verify          [test $HAVE_NANOSLEEP = 0 || test $REPLACE_NANOSLEEP = 1]
 
 configure.ac:
 gl_FUNC_NANOSLEEP
--- a/modules/open
+++ b/modules/open
@@ -8,7 +8,7 @@
 
 Depends-on:
 fcntl-h
-stat
+stat            [test $REPLACE_OPEN = 1]
 
 configure.ac:
 gl_FUNC_OPEN
--- a/modules/openat
+++ b/modules/openat
@@ -24,18 +24,18 @@
 fdopendir
 gettext-h
 intprops
-lchown
+lchown          [test $HAVE_FCHOWNAT = 0 || test $REPLACE_FCHOWNAT = 1]
 lstat
-mkdir
+mkdir           [test $HAVE_MKDIRAT = 0]
 open
 openat-die
-rmdir
+rmdir           [test $REPLACE_UNLINKAT = 1]
 same-inode
 save-cwd
 stdbool
 sys_stat
 unistd
-unlink
+unlink          [test $REPLACE_UNLINKAT = 1]
 
 configure.ac:
 gl_FUNC_OPENAT
--- a/modules/perror
+++ b/modules/perror
@@ -7,8 +7,8 @@
 
 Depends-on:
 stdio
-errno
-strerror
+errno           [test $REPLACE_PERROR = 1]
+strerror        [test $REPLACE_PERROR = 1]
 
 configure.ac:
 gl_FUNC_PERROR
--- a/modules/poll
+++ b/modules/poll
@@ -7,11 +7,11 @@
 
 Depends-on:
 poll-h
-alloca
-select
-sys_select
-sys_time
-errno
+alloca          [test $HAVE_POLL = 0 || test $REPLACE_POLL = 1]
+select          [test $HAVE_POLL = 0 || test $REPLACE_POLL = 1]
+sys_select      [test $HAVE_POLL = 0 || test $REPLACE_POLL = 1]
+sys_time        [test $HAVE_POLL = 0 || test $REPLACE_POLL = 1]
+errno           [test $HAVE_POLL = 0 || test $REPLACE_POLL = 1]
 
 configure.ac:
 gl_FUNC_POLL
--- a/modules/popen
+++ b/modules/popen
@@ -6,8 +6,8 @@
 m4/popen.m4
 
 Depends-on:
-open
 stdio
+open            [test $REPLACE_POPEN = 1]
 
 configure.ac:
 gl_FUNC_POPEN
--- a/modules/posix_spawn
+++ b/modules/posix_spawn
@@ -7,7 +7,7 @@
 
 Depends-on:
 spawn
-posix_spawn-internal
+posix_spawn-internal [test $HAVE_POSIX_SPAWN = 0 || test $REPLACE_POSIX_SPAWN = 1]
 
 configure.ac:
 gl_POSIX_SPAWN
--- a/modules/posix_spawn_file_actions_addclose
+++ b/modules/posix_spawn_file_actions_addclose
@@ -9,7 +9,7 @@
 
 Depends-on:
 spawn
-getdtablesize
+getdtablesize   [test $HAVE_POSIX_SPAWN = 0 || test $REPLACE_POSIX_SPAWN = 1]
 
 configure.ac:
 gl_POSIX_SPAWN
--- a/modules/posix_spawn_file_actions_adddup2
+++ b/modules/posix_spawn_file_actions_adddup2
@@ -9,7 +9,7 @@
 
 Depends-on:
 spawn
-getdtablesize
+getdtablesize   [test $HAVE_POSIX_SPAWN = 0 || test $REPLACE_POSIX_SPAWN = 1]
 
 configure.ac:
 gl_POSIX_SPAWN
--- a/modules/posix_spawn_file_actions_addopen
+++ b/modules/posix_spawn_file_actions_addopen
@@ -9,7 +9,7 @@
 
 Depends-on:
 spawn
-getdtablesize
+getdtablesize   [test $HAVE_POSIX_SPAWN = 0 || test $REPLACE_POSIX_SPAWN = 1]
 
 configure.ac:
 gl_POSIX_SPAWN
--- a/modules/posix_spawnp
+++ b/modules/posix_spawnp
@@ -7,7 +7,7 @@
 
 Depends-on:
 spawn
-posix_spawn-internal
+posix_spawn-internal [test $HAVE_POSIX_SPAWN = 0 || test $REPLACE_POSIX_SPAWN = 1]
 
 configure.ac:
 gl_POSIX_SPAWN
--- a/modules/pread
+++ b/modules/pread
@@ -6,10 +6,10 @@
 m4/pread.m4
 
 Depends-on:
+unistd
 extensions
-lseek
-read
-unistd
+lseek           [test $HAVE_PREAD = 0 || test $REPLACE_PREAD = 1]
+read            [test $HAVE_PREAD = 0 || test $REPLACE_PREAD = 1]
 
 configure.ac:
 gl_FUNC_PREAD
--- a/modules/printf-posix
+++ b/modules/printf-posix
@@ -15,8 +15,8 @@
 
 Depends-on:
 stdio
-vfprintf-posix
 printf-safe
+vfprintf-posix  [test $REPLACE_PRINTF = 1]
 
 configure.ac:
 gl_FUNC_PRINTF_POSIX
--- a/modules/ptsname
+++ b/modules/ptsname
@@ -8,7 +8,7 @@
 Depends-on:
 stdlib
 extensions
-ttyname_r
+ttyname_r       [test $HAVE_PTSNAME = 0]
 
 configure.ac:
 gl_FUNC_PTSNAME
--- a/modules/putenv
+++ b/modules/putenv
@@ -7,7 +7,7 @@
 
 Depends-on:
 stdlib
-malloc-posix
+malloc-posix    [test $REPLACE_PUTENV = 1]
 
 configure.ac:
 gl_FUNC_PUTENV
--- a/modules/pwrite
+++ b/modules/pwrite
@@ -6,10 +6,10 @@
 m4/pwrite.m4
 
 Depends-on:
+unistd
 extensions
-lseek
-unistd
-write
+lseek           [test $HAVE_PWRITE = 0 || test $REPLACE_PWRITE = 1]
+write           [test $HAVE_PWRITE = 0 || test $REPLACE_PWRITE = 1]
 
 configure.ac:
 gl_FUNC_PWRITE
--- a/modules/readline
+++ b/modules/readline
@@ -7,8 +7,8 @@
 m4/readline.m4
 
 Depends-on:
-getline
 havelib
+getline         [test "$gl_cv_lib_readline" = no]
 
 configure.ac:
 gl_FUNC_READLINE
--- a/modules/readlink
+++ b/modules/readlink
@@ -6,8 +6,8 @@
 m4/readlink.m4
 
 Depends-on:
-stat
 unistd
+stat            [test $HAVE_READLINK = 0 || test $REPLACE_READLINK = 1]
 
 configure.ac:
 gl_FUNC_READLINK
--- a/modules/readlinkat
+++ b/modules/readlinkat
@@ -6,11 +6,11 @@
 m4/readlinkat.m4
 
 Depends-on:
+unistd
 extensions
 fcntl-h
-openat
-readlink
-unistd
+openat          [test $HAVE_READLINKAT = 0]
+readlink        [test $HAVE_READLINKAT = 0]
 
 configure.ac:
 gl_FUNC_READLINKAT
--- a/modules/recv
+++ b/modules/recv
@@ -7,7 +7,7 @@
 
 Depends-on:
 sys_socket
-errno
+errno           [test "$ac_cv_header_winsock2_h" = yes]
 
 configure.ac:
 AC_REQUIRE([gl_HEADER_SYS_SOCKET])
--- a/modules/recvfrom
+++ b/modules/recvfrom
@@ -7,8 +7,8 @@
 
 Depends-on:
 sys_socket
-errno
-getpeername
+errno           [test "$ac_cv_header_winsock2_h" = yes]
+getpeername     [test "$ac_cv_header_winsock2_h" = yes]
 
 configure.ac:
 AC_REQUIRE([gl_HEADER_SYS_SOCKET])
--- a/modules/regex
+++ b/modules/regex
@@ -12,23 +12,23 @@
 m4/mbstate_t.m4
 
 Depends-on:
-alloca-opt
-btowc
 extensions
-gettext-h
-localcharset
-malloc-gnu
-memcmp
-memmove
-mbrtowc
-mbsinit
-nl_langinfo
-stdbool
-stdint
 ssize_t
-wchar
-wcrtomb
-wctype-h
+alloca-opt      [test $ac_use_included_regex = yes]
+btowc           [test $ac_use_included_regex = yes]
+gettext-h       [test $ac_use_included_regex = yes]
+localcharset    [test $ac_use_included_regex = yes]
+malloc-gnu      [test $ac_use_included_regex = yes]
+memcmp          [test $ac_use_included_regex = yes]
+memmove         [test $ac_use_included_regex = yes]
+mbrtowc         [test $ac_use_included_regex = yes]
+mbsinit         [test $ac_use_included_regex = yes]
+nl_langinfo     [test $ac_use_included_regex = yes]
+stdbool         [test $ac_use_included_regex = yes]
+stdint          [test $ac_use_included_regex = yes]
+wchar           [test $ac_use_included_regex = yes]
+wcrtomb         [test $ac_use_included_regex = yes]
+wctype-h        [test $ac_use_included_regex = yes]
 
 configure.ac:
 gl_REGEX
--- a/modules/remove
+++ b/modules/remove
@@ -6,9 +6,9 @@
 m4/remove.m4
 
 Depends-on:
-rmdir
 stdio
-unlink
+rmdir           [test $REPLACE_REMOVE = 1]
+unlink          [test $REPLACE_REMOVE = 1]
 
 configure.ac:
 gl_FUNC_REMOVE
--- a/modules/rename
+++ b/modules/rename
@@ -6,14 +6,14 @@
 m4/rename.m4
 
 Depends-on:
-canonicalize-lgpl
-dirname-lgpl
-lstat
-rmdir
-same-inode
-stdbool
 stdio
-strdup
+canonicalize-lgpl [test $REPLACE_RENAME = 1]
+dirname-lgpl      [test $REPLACE_RENAME = 1]
+lstat             [test $REPLACE_RENAME = 1]
+rmdir             [test $REPLACE_RENAME = 1]
+same-inode        [test $REPLACE_RENAME = 1]
+stdbool           [test $REPLACE_RENAME = 1]
+strdup            [test $REPLACE_RENAME = 1]
 
 configure.ac:
 gl_FUNC_RENAME
--- a/modules/renameat
+++ b/modules/renameat
@@ -7,15 +7,15 @@
 m4/renameat.m4
 
 Depends-on:
+stdio
 extensions
 fcntl-h
-filenamecat-lgpl
-getcwd-lgpl
-openat
-rename
-same-inode
-stdio
-stpcpy
+filenamecat-lgpl [test $HAVE_RENAMEAT = 0 || test $REPLACE_RENAMEAT = 1]
+getcwd-lgpl      [test $HAVE_RENAMEAT = 0 || test $REPLACE_RENAMEAT = 1]
+openat           [test $HAVE_RENAMEAT = 0 || test $REPLACE_RENAMEAT = 1]
+rename           [test $HAVE_RENAMEAT = 0 || test $REPLACE_RENAMEAT = 1]
+same-inode       [test $HAVE_RENAMEAT = 0 || test $REPLACE_RENAMEAT = 1]
+stpcpy           [test $HAVE_RENAMEAT = 0 || test $REPLACE_RENAMEAT = 1]
 
 configure.ac:
 gl_FUNC_RENAMEAT
--- a/modules/rmdir
+++ b/modules/rmdir
@@ -6,9 +6,9 @@
 m4/rmdir.m4
 
 Depends-on:
-dosname
-sys_stat
 unistd
+dosname         [test $REPLACE_RMDIR = 1]
+sys_stat        [test $REPLACE_RMDIR = 1]
 
 configure.ac:
 gl_FUNC_RMDIR
--- a/modules/round
+++ b/modules/round
@@ -9,10 +9,10 @@
 m4/ceil.m4
 
 Depends-on:
-float
-floor
 math
 extensions
+float           [test $HAVE_DECL_ROUND = 0 || test $REPLACE_ROUND = 1]
+floor           [test $HAVE_DECL_ROUND = 0 || test $REPLACE_ROUND = 1]
 
 configure.ac:
 gl_FUNC_ROUND
--- a/modules/roundf
+++ b/modules/roundf
@@ -10,9 +10,9 @@
 m4/ceilf.m4
 
 Depends-on:
-float
 math
 extensions
+float           [test $HAVE_DECL_ROUNDF = 0 || test $REPLACE_ROUNDF = 1]
 
 configure.ac:
 gl_FUNC_ROUNDF
--- a/modules/roundl
+++ b/modules/roundl
@@ -10,9 +10,9 @@
 m4/ceill.m4
 
 Depends-on:
-float
 math
 extensions
+float           [test $HAVE_DECL_ROUNDL = 0 || test $REPLACE_ROUNDL = 1]
 
 configure.ac:
 gl_FUNC_ROUNDL
--- a/modules/rpmatch
+++ b/modules/rpmatch
@@ -8,10 +8,10 @@
 Depends-on:
 stdlib
 extensions
-stdbool
-gettext-h
-regex
-strdup
+stdbool         [test $HAVE_RPMATCH = 0]
+gettext-h       [test $HAVE_RPMATCH = 0]
+regex           [test $HAVE_RPMATCH = 0]
+strdup          [test $HAVE_RPMATCH = 0]
 
 configure.ac:
 gl_FUNC_RPMATCH
--- a/modules/select
+++ b/modules/select
@@ -6,9 +6,9 @@
 m4/select.m4
 
 Depends-on:
-alloca
-sockets
 sys_select
+alloca          [test "$ac_cv_header_winsock2_h" = yes || test $REPLACE_SELECT = 1]
+sockets         [test "$ac_cv_header_winsock2_h" = yes || test $REPLACE_SELECT = 1]
 
 configure.ac:
 gl_FUNC_SELECT
--- a/modules/send
+++ b/modules/send
@@ -7,7 +7,7 @@
 
 Depends-on:
 sys_socket
-errno
+errno           [test "$ac_cv_header_winsock2_h" = yes]
 
 configure.ac:
 AC_REQUIRE([gl_HEADER_SYS_SOCKET])
--- a/modules/sendto
+++ b/modules/sendto
@@ -7,7 +7,7 @@
 
 Depends-on:
 sys_socket
-errno
+errno           [test "$ac_cv_header_winsock2_h" = yes]
 
 configure.ac:
 AC_REQUIRE([gl_HEADER_SYS_SOCKET])
--- a/modules/setenv
+++ b/modules/setenv
@@ -7,10 +7,10 @@
 
 Depends-on:
 stdlib
-malloca
-alloca-opt
-unistd
-environ
+malloca         [test $HAVE_SETENV = 0 || test $REPLACE_SETENV = 1]
+alloca-opt      [test $HAVE_SETENV = 0 || test $REPLACE_SETENV = 1]
+unistd          [test $HAVE_SETENV = 0 || test $REPLACE_SETENV = 1]
+environ         [test $HAVE_SETENV = 0 || test $REPLACE_SETENV = 1]
 
 configure.ac:
 gl_FUNC_SETENV
--- a/modules/setlocale
+++ b/modules/setlocale
@@ -7,7 +7,7 @@
 
 Depends-on:
 locale
-localename
+localename      [test $REPLACE_SETLOCALE = 1]
 
 configure.ac:
 gl_FUNC_SETLOCALE
--- a/modules/setsockopt
+++ b/modules/setsockopt
@@ -7,8 +7,8 @@
 
 Depends-on:
 sys_socket
-sys_time
-errno
+sys_time        [test "$ac_cv_header_winsock2_h" = yes]
+errno           [test "$ac_cv_header_winsock2_h" = yes]
 
 configure.ac:
 AC_REQUIRE([gl_HEADER_SYS_SOCKET])
--- a/modules/shutdown
+++ b/modules/shutdown
@@ -7,7 +7,7 @@
 
 Depends-on:
 sys_socket
-errno
+errno           [test "$ac_cv_header_winsock2_h" = yes]
 
 configure.ac:
 AC_REQUIRE([gl_HEADER_SYS_SOCKET])
--- a/modules/sigaction
+++ b/modules/sigaction
@@ -8,7 +8,7 @@
 
 Depends-on:
 signal
-sigprocmask
+sigprocmask     [test $HAVE_SIGACTION = 0]
 
 configure.ac:
 gl_SIGACTION
--- a/modules/signbit
+++ b/modules/signbit
@@ -9,13 +9,13 @@
 m4/signbit.m4
 
 Depends-on:
-float
 math
-isnanf-nolibm
-isnand-nolibm
-isnanl-nolibm
-fpieee
-memcmp
+float           [test $REPLACE_SIGNBIT = 1]
+isnanf-nolibm   [test $REPLACE_SIGNBIT = 1]
+isnand-nolibm   [test $REPLACE_SIGNBIT = 1]
+isnanl-nolibm   [test $REPLACE_SIGNBIT = 1]
+fpieee          [test $REPLACE_SIGNBIT = 1]
+memcmp          [test $REPLACE_SIGNBIT = 1]
 
 configure.ac:
 gl_SIGNBIT
--- a/modules/sigprocmask
+++ b/modules/sigprocmask
@@ -7,8 +7,8 @@
 
 Depends-on:
 signal
-stdint
-raise
+stdint          [test $HAVE_POSIX_SIGNALBLOCKING = 0]
+raise           [test $HAVE_POSIX_SIGNALBLOCKING = 0]
 
 configure.ac:
 gl_SIGNALBLOCKING
--- a/modules/sinl
+++ b/modules/sinl
@@ -11,10 +11,10 @@
 Depends-on:
 math
 extensions
-float
-isnanl
-floor
-floorl
+float           [test $HAVE_SINL = 0]
+isnanl          [test $HAVE_SINL = 0]
+floor           [test $HAVE_SINL = 0]
+floorl          [test $HAVE_SINL = 0]
 
 configure.ac:
 gl_FUNC_SINL
--- a/modules/sleep
+++ b/modules/sleep
@@ -6,9 +6,9 @@
 m4/sleep.m4
 
 Depends-on:
-stdint
 unistd
-verify
+stdint          [test $HAVE_SLEEP = 0 || test $REPLACE_SLEEP = 1]
+verify          [test $HAVE_SLEEP = 0 || test $REPLACE_SLEEP = 1]
 
 configure.ac:
 gl_FUNC_SLEEP
--- a/modules/snprintf
+++ b/modules/snprintf
@@ -8,8 +8,8 @@
 
 Depends-on:
 stdio
-vasnprintf
-errno
+vasnprintf      [test $ac_cv_func_snprintf = no || test $REPLACE_SNPRINTF = 1]
+errno           [test $ac_cv_func_snprintf = no || test $REPLACE_SNPRINTF = 1]
 
 configure.ac:
 gl_FUNC_SNPRINTF
--- a/modules/snprintf-posix
+++ b/modules/snprintf-posix
@@ -14,18 +14,18 @@
 
 Depends-on:
 snprintf
-vasnprintf
-isnand-nolibm
-isnanl-nolibm
-frexp-nolibm
-frexpl-nolibm
-printf-frexp
-printf-frexpl
-signbit
-fpucw
 nocrash
 printf-safe
 multiarch
+vasnprintf      [test $ac_cv_func_snprintf = no || test $REPLACE_SNPRINTF = 1]
+isnand-nolibm   [test $ac_cv_func_snprintf = no || test $REPLACE_SNPRINTF = 1]
+isnanl-nolibm   [test $ac_cv_func_snprintf = no || test $REPLACE_SNPRINTF = 1]
+frexp-nolibm    [test $ac_cv_func_snprintf = no || test $REPLACE_SNPRINTF = 1]
+frexpl-nolibm   [test $ac_cv_func_snprintf = no || test $REPLACE_SNPRINTF = 1]
+printf-frexp    [test $ac_cv_func_snprintf = no || test $REPLACE_SNPRINTF = 1]
+printf-frexpl   [test $ac_cv_func_snprintf = no || test $REPLACE_SNPRINTF = 1]
+signbit         [test $ac_cv_func_snprintf = no || test $REPLACE_SNPRINTF = 1]
+fpucw           [test $ac_cv_func_snprintf = no || test $REPLACE_SNPRINTF = 1]
 
 configure.ac:
 gl_FUNC_SNPRINTF_POSIX
--- a/modules/socket
+++ b/modules/socket
@@ -7,8 +7,8 @@
 
 Depends-on:
 sys_socket
-errno
-sockets
+errno           [test "$ac_cv_header_winsock2_h" = yes]
+sockets         [test "$ac_cv_header_winsock2_h" = yes]
 
 configure.ac:
 AC_REQUIRE([gl_HEADER_SYS_SOCKET])
--- a/modules/sprintf-posix
+++ b/modules/sprintf-posix
@@ -14,20 +14,20 @@
 
 Depends-on:
 stdio
-vasnprintf
-isnand-nolibm
-isnanl-nolibm
-frexp-nolibm
-frexpl-nolibm
-printf-frexp
-printf-frexpl
-signbit
-fpucw
 nocrash
 printf-safe
-stdint
-errno
 multiarch
+vasnprintf      [test $REPLACE_SPRINTF = 1]
+isnand-nolibm   [test $REPLACE_SPRINTF = 1]
+isnanl-nolibm   [test $REPLACE_SPRINTF = 1]
+frexp-nolibm    [test $REPLACE_SPRINTF = 1]
+frexpl-nolibm   [test $REPLACE_SPRINTF = 1]
+printf-frexp    [test $REPLACE_SPRINTF = 1]
+printf-frexpl   [test $REPLACE_SPRINTF = 1]
+signbit         [test $REPLACE_SPRINTF = 1]
+fpucw           [test $REPLACE_SPRINTF = 1]
+stdint          [test $REPLACE_SPRINTF = 1]
+errno           [test $REPLACE_SPRINTF = 1]
 
 configure.ac:
 gl_FUNC_SPRINTF_POSIX
--- a/modules/sqrtl
+++ b/modules/sqrtl
@@ -8,11 +8,11 @@
 Depends-on:
 math
 extensions
-float
-isnanl
-frexpl
-ldexpl
-sqrt
+float           [test $HAVE_SQRTL = 0]
+isnanl          [test $HAVE_SQRTL = 0]
+frexpl          [test $HAVE_SQRTL = 0]
+ldexpl          [test $HAVE_SQRTL = 0]
+sqrt            [test $HAVE_SQRTL = 0]
 
 configure.ac:
 gl_FUNC_SQRTL
--- a/modules/stat
+++ b/modules/stat
@@ -6,9 +6,9 @@
 m4/stat.m4
 
 Depends-on:
-dosname
-stdbool
 sys_stat
+dosname         [test $REPLACE_STAT = 1]
+stdbool         [test $REPLACE_STAT = 1]
 
 configure.ac:
 gl_FUNC_STAT
--- a/modules/strchrnul
+++ b/modules/strchrnul
@@ -8,9 +8,9 @@
 m4/strchrnul.m4
 
 Depends-on:
+string
 extensions
-string
-rawmemchr
+rawmemchr       [test $HAVE_STRCHRNUL = 0 || test $REPLACE_STRCHRNUL = 1]
 
 configure.ac:
 gl_FUNC_STRCHRNUL
--- a/modules/strdup-posix
+++ b/modules/strdup-posix
@@ -7,7 +7,7 @@
 
 Depends-on:
 string
-malloc-posix
+malloc-posix    [test $ac_cv_func_strdup = no || test $REPLACE_STRDUP = 1]
 
 configure.ac:
 gl_FUNC_STRDUP_POSIX
--- a/modules/strerror
+++ b/modules/strerror
@@ -6,9 +6,9 @@
 m4/strerror.m4
 
 Depends-on:
-errno
-intprops
 string
+errno           [test $REPLACE_STRERROR = 1]
+intprops        [test $REPLACE_STRERROR = 1]
 
 configure.ac:
 gl_FUNC_STRERROR
--- a/modules/strerror_r-posix
+++ b/modules/strerror_r-posix
@@ -7,10 +7,10 @@
 
 Depends-on:
 string
-errno
 extensions
-lock
-strerror
+errno           [test $HAVE_DECL_STRERROR_R = 0 || test $REPLACE_STRERROR_R = 1]
+lock            [test $HAVE_DECL_STRERROR_R = 0 || test $REPLACE_STRERROR_R = 1]
+strerror        [test $HAVE_DECL_STRERROR_R = 0 || test $REPLACE_STRERROR_R = 1]
 
 configure.ac:
 gl_FUNC_STRERROR_R
--- a/modules/strndup
+++ b/modules/strndup
@@ -6,9 +6,9 @@
 m4/strndup.m4
 
 Depends-on:
+string
 extensions
-string
-strnlen
+strnlen         [test $ac_cv_func_strndup = no || test $REPLACE_STRNDUP = 1]
 
 configure.ac:
 gl_FUNC_STRNDUP
--- a/modules/strnlen
+++ b/modules/strnlen
@@ -6,9 +6,9 @@
 m4/strnlen.m4
 
 Depends-on:
+string
 extensions
-string
-memchr-obsolete
+memchr-obsolete [test $HAVE_DECL_STRNLEN = 0 || test $REPLACE_STRNLEN = 1]
 
 configure.ac:
 gl_FUNC_STRNLEN
--- a/modules/strptime
+++ b/modules/strptime
@@ -7,13 +7,13 @@
 m4/tm_gmtoff.m4
 
 Depends-on:
+time
 extensions
-sys_time
-string
-strcase
-stdbool
-time
-time_r
+sys_time        [test $HAVE_STRPTIME = 0]
+string          [test $HAVE_STRPTIME = 0]
+strcase         [test $HAVE_STRPTIME = 0]
+stdbool         [test $HAVE_STRPTIME = 0]
+time_r          [test $HAVE_STRPTIME = 0]
 
 configure.ac:
 gl_FUNC_STRPTIME
--- a/modules/strsep
+++ b/modules/strsep
@@ -6,9 +6,9 @@
 m4/strsep.m4
 
 Depends-on:
+string
 extensions
-string
-strpbrk
+strpbrk         [test $HAVE_STRSEP = 0]
 
 configure.ac:
 gl_FUNC_STRSEP
--- a/modules/strsignal
+++ b/modules/strsignal
@@ -8,12 +8,12 @@
 
 Depends-on:
 string
-gettext-h
-lock
-tls
-snprintf
-memset
 extensions
+gettext-h       [test $ac_cv_func_strsignal = no || test $REPLACE_STRSIGNAL = 1]
+lock            [test $ac_cv_func_strsignal = no || test $REPLACE_STRSIGNAL = 1]
+tls             [test $ac_cv_func_strsignal = no || test $REPLACE_STRSIGNAL = 1]
+snprintf        [test $ac_cv_func_strsignal = no || test $REPLACE_STRSIGNAL = 1]
+memset          [test $ac_cv_func_strsignal = no || test $REPLACE_STRSIGNAL = 1]
 
 configure.ac:
 gl_FUNC_STRSIGNAL
--- a/modules/strstr-simple
+++ b/modules/strstr-simple
@@ -8,9 +8,9 @@
 
 Depends-on:
 string
-stdbool
-memchr
-memcmp
+stdbool         [test $REPLACE_STRSTR = 1]
+memchr          [test $REPLACE_STRSTR = 1]
+memcmp          [test $REPLACE_STRSTR = 1]
 
 configure.ac:
 gl_FUNC_STRSTR_SIMPLE
--- a/modules/strtod
+++ b/modules/strtod
@@ -7,10 +7,10 @@
 m4/ldexp.m4
 
 Depends-on:
-c-ctype
-stdbool
 stdlib
 strtod-obsolete
+c-ctype         [test $HAVE_STRTOD = 0 || test $REPLACE_STRTOD = 1]
+stdbool         [test $HAVE_STRTOD = 0 || test $REPLACE_STRTOD = 1]
 
 configure.ac:
 gl_FUNC_STRTOD
--- a/modules/strtoimax
+++ b/modules/strtoimax
@@ -7,10 +7,10 @@
 m4/strtoimax.m4
 
 Depends-on:
-strtoll
-verify
 inttypes-incomplete
-stdint
+verify          [test "$ac_cv_have_decl_strtoimax" != yes && test $ac_cv_func_strtoimax = no]
+stdint          [test "$ac_cv_have_decl_strtoimax" != yes && test $ac_cv_func_strtoimax = no]
+strtoll         [test "$ac_cv_have_decl_strtoimax" != yes && test $ac_cv_func_strtoimax = no && test $ac_cv_type_long_long_int = yes]
 
 configure.ac:
 gl_FUNC_STRTOIMAX
--- a/modules/strtok_r
+++ b/modules/strtok_r
@@ -7,7 +7,7 @@
 
 Depends-on:
 string
-strpbrk
+strpbrk         [test $ac_cv_func_strtok_r = no]
 
 configure.ac:
 gl_FUNC_STRTOK_R
--- a/modules/strtoumax
+++ b/modules/strtoumax
@@ -8,10 +8,10 @@
 m4/strtoumax.m4
 
 Depends-on:
-strtoull
-verify
 inttypes-incomplete
-stdint
+verify          [test "$ac_cv_have_decl_strtoumax" != yes && test $ac_cv_func_strtoumax = no]
+stdint          [test "$ac_cv_have_decl_strtoumax" != yes && test $ac_cv_func_strtoumax = no]
+strtoull        [test "$ac_cv_have_decl_strtoumax" != yes && test $ac_cv_func_strtoumax = no && test $ac_cv_type_unsigned_long_long_int = yes]
 
 configure.ac:
 gl_FUNC_STRTOUMAX
--- a/modules/symlink
+++ b/modules/symlink
@@ -6,8 +6,8 @@
 m4/symlink.m4
 
 Depends-on:
-lstat
 unistd
+lstat           [test $HAVE_SYMLINK = 0 || test $REPLACE_SYMLINK = 1]
 
 configure.ac:
 gl_FUNC_SYMLINK
--- a/modules/symlinkat
+++ b/modules/symlinkat
@@ -6,11 +6,11 @@
 m4/symlinkat.m4
 
 Depends-on:
+unistd
 extensions
 fcntl-h
-openat
-symlink
-unistd
+openat          [test $HAVE_SYMLINKAT = 0]
+symlink         [test $HAVE_SYMLINKAT = 0]
 
 configure.ac:
 gl_FUNC_SYMLINKAT
--- a/modules/tanl
+++ b/modules/tanl
@@ -10,10 +10,10 @@
 Depends-on:
 math
 extensions
-float
-isnanl
-floor
-floorl
+float           [test $HAVE_TANL = 0]
+isnanl          [test $HAVE_TANL = 0]
+floor           [test $HAVE_TANL = 0]
+floorl          [test $HAVE_TANL = 0]
 
 configure.ac:
 gl_FUNC_TANL
--- a/modules/tcgetsid
+++ b/modules/tcgetsid
@@ -9,7 +9,7 @@
 Depends-on:
 termios
 extensions
-sys_ioctl
+sys_ioctl       [test $ac_cv_func_tcgetsid = no]
 
 configure.ac:
 gl_FUNC_TCGETSID
--- a/modules/tmpfile
+++ b/modules/tmpfile
@@ -7,9 +7,9 @@
 
 Depends-on:
 stdio
-pathmax
-tempname
-tmpdir
+pathmax         [test $REPLACE_TMPFILE = 1]
+tempname        [test $REPLACE_TMPFILE = 1]
+tmpdir          [test $REPLACE_TMPFILE = 1]
 
 configure.ac:
 gl_FUNC_TMPFILE
--- a/modules/trunc
+++ b/modules/trunc
@@ -8,7 +8,7 @@
 Depends-on:
 math
 extensions
-float
+float           [test $HAVE_DECL_TRUNC = 0 || test $REPLACE_TRUNC = 1]
 
 configure.ac:
 gl_FUNC_TRUNC
--- a/modules/truncf
+++ b/modules/truncf
@@ -9,7 +9,7 @@
 Depends-on:
 math
 extensions
-float
+float           [test $HAVE_DECL_TRUNCF = 0 || test $REPLACE_TRUNCF = 1]
 
 configure.ac:
 gl_FUNC_TRUNCF
--- a/modules/truncl
+++ b/modules/truncl
@@ -9,7 +9,7 @@
 Depends-on:
 math
 extensions
-float
+float           [test $HAVE_DECL_TRUNCL = 0 || test $REPLACE_TRUNCL = 1]
 
 configure.ac:
 gl_FUNC_TRUNCL
--- a/modules/uname
+++ b/modules/uname
@@ -7,7 +7,7 @@
 
 Depends-on:
 sys_utsname
-gethostname
+gethostname     [test $HAVE_UNAME = 0]
 
 configure.ac:
 gl_FUNC_UNAME
--- a/modules/unlink
+++ b/modules/unlink
@@ -6,9 +6,9 @@
 m4/unlink.m4
 
 Depends-on:
-dosname
-lstat
 unistd
+dosname         [test $REPLACE_UNLINK = 1]
+lstat           [test $REPLACE_UNLINK = 1]
 
 configure.ac:
 gl_FUNC_UNLINK
--- a/modules/unlockpt
+++ b/modules/unlockpt
@@ -9,7 +9,7 @@
 Depends-on:
 stdlib
 extensions
-ptsname
+ptsname         [test $HAVE_UNLOCKPT = 0]
 
 configure.ac:
 gl_FUNC_UNLOCKPT
--- a/modules/unsetenv
+++ b/modules/unsetenv
@@ -7,8 +7,8 @@
 
 Depends-on:
 stdlib
-unistd
-environ
+unistd          [test $ac_cv_func_unsetenv = no || test $REPLACE_UNSETENV = 1]
+environ         [test $ac_cv_func_unsetenv = no || test $REPLACE_UNSETENV = 1]
 
 configure.ac:
 gl_FUNC_UNSETENV
--- a/modules/usleep
+++ b/modules/usleep
@@ -6,9 +6,9 @@
 m4/usleep.m4
 
 Depends-on:
+unistd
 extensions
-sleep
-unistd
+sleep           [test $HAVE_USLEEP = 0 || test $REPLACE_USLEEP = 1]
 
 configure.ac:
 gl_FUNC_USLEEP
--- a/modules/utimensat
+++ b/modules/utimensat
@@ -6,10 +6,10 @@
 m4/utimensat.m4
 
 Depends-on:
-openat
 sys_stat
-utimens
 extensions
+openat          [test $HAVE_UTIMENSAT = 0 || test $REPLACE_UTIMENSAT = 1]
+utimens         [test $HAVE_UTIMENSAT = 0 || test $REPLACE_UTIMENSAT = 1]
 
 configure.ac:
 gl_FUNC_UTIMENSAT
--- a/modules/vasprintf
+++ b/modules/vasprintf
@@ -12,10 +12,10 @@
 m4/vasprintf.m4
 
 Depends-on:
+stdio
 extensions
-vasnprintf
-stdio
-errno
+vasnprintf      [test $HAVE_VASPRINTF = 0 || test $REPLACE_VASPRINTF = 1]
+errno           [test $HAVE_VASPRINTF = 0 || test $REPLACE_VASPRINTF = 1]
 
 configure.ac:
 gl_FUNC_VASPRINTF
--- a/modules/vdprintf
+++ b/modules/vdprintf
@@ -7,9 +7,9 @@
 
 Depends-on:
 stdio
-vasnprintf
-full-write
-errno
+vasnprintf      [test $ac_cv_func_vdprintf = no || test $REPLACE_VDPRINTF = 1]
+full-write      [test $ac_cv_func_vdprintf = no || test $REPLACE_VDPRINTF = 1]
+errno           [test $ac_cv_func_vdprintf = no || test $REPLACE_VDPRINTF = 1]
 
 configure.ac:
 gl_FUNC_VDPRINTF
--- a/modules/vdprintf-posix
+++ b/modules/vdprintf-posix
@@ -14,18 +14,18 @@
 
 Depends-on:
 vdprintf
-vasnprintf
-isnand-nolibm
-isnanl-nolibm
-frexp-nolibm
-frexpl-nolibm
-printf-frexp
-printf-frexpl
-signbit
-fpucw
 nocrash
 printf-safe
 multiarch
+vasnprintf      [test $ac_cv_func_vdprintf = no || test $REPLACE_VDPRINTF = 1]
+isnand-nolibm   [test $ac_cv_func_vdprintf = no || test $REPLACE_VDPRINTF = 1]
+isnanl-nolibm   [test $ac_cv_func_vdprintf = no || test $REPLACE_VDPRINTF = 1]
+frexp-nolibm    [test $ac_cv_func_vdprintf = no || test $REPLACE_VDPRINTF = 1]
+frexpl-nolibm   [test $ac_cv_func_vdprintf = no || test $REPLACE_VDPRINTF = 1]
+printf-frexp    [test $ac_cv_func_vdprintf = no || test $REPLACE_VDPRINTF = 1]
+printf-frexpl   [test $ac_cv_func_vdprintf = no || test $REPLACE_VDPRINTF = 1]
+signbit         [test $ac_cv_func_vdprintf = no || test $REPLACE_VDPRINTF = 1]
+fpucw           [test $ac_cv_func_vdprintf = no || test $REPLACE_VDPRINTF = 1]
 
 configure.ac:
 gl_FUNC_VDPRINTF_POSIX
--- a/modules/vfprintf-posix
+++ b/modules/vfprintf-posix
@@ -14,20 +14,20 @@
 
 Depends-on:
 stdio
-fseterr
-vasnprintf
-isnand-nolibm
-isnanl-nolibm
-frexp-nolibm
-frexpl-nolibm
-printf-frexp
-printf-frexpl
-signbit
-fpucw
 nocrash
 printf-safe
-errno
 multiarch
+fseterr         [test $REPLACE_VFPRINTF = 1]
+vasnprintf      [test $REPLACE_VFPRINTF = 1]
+isnand-nolibm   [test $REPLACE_VFPRINTF = 1]
+isnanl-nolibm   [test $REPLACE_VFPRINTF = 1]
+frexp-nolibm    [test $REPLACE_VFPRINTF = 1]
+frexpl-nolibm   [test $REPLACE_VFPRINTF = 1]
+printf-frexp    [test $REPLACE_VFPRINTF = 1]
+printf-frexpl   [test $REPLACE_VFPRINTF = 1]
+signbit         [test $REPLACE_VFPRINTF = 1]
+fpucw           [test $REPLACE_VFPRINTF = 1]
+errno           [test $REPLACE_VFPRINTF = 1]
 
 configure.ac:
 gl_FUNC_VFPRINTF_POSIX
--- a/modules/vprintf-posix
+++ b/modules/vprintf-posix
@@ -14,8 +14,8 @@
 
 Depends-on:
 stdio
-vfprintf-posix
 printf-safe
+vfprintf-posix  [test $REPLACE_VPRINTF = 1]
 
 configure.ac:
 gl_FUNC_VPRINTF_POSIX
--- a/modules/vsnprintf
+++ b/modules/vsnprintf
@@ -9,8 +9,8 @@
 
 Depends-on:
 stdio
-vasnprintf
-errno
+vasnprintf      [test $ac_cv_func_vsnprintf = no || test $REPLACE_VSNPRINTF = 1]
+errno           [test $ac_cv_func_vsnprintf = no || test $REPLACE_VSNPRINTF = 1]
 
 configure.ac:
 gl_FUNC_VSNPRINTF
--- a/modules/vsnprintf-posix
+++ b/modules/vsnprintf-posix
@@ -14,18 +14,18 @@
 
 Depends-on:
 vsnprintf
-vasnprintf
-isnand-nolibm
-isnanl-nolibm
-frexp-nolibm
-frexpl-nolibm
-printf-frexp
-printf-frexpl
-signbit
-fpucw
 nocrash
 printf-safe
 multiarch
+vasnprintf      [test $ac_cv_func_vsnprintf = no || test $REPLACE_VSNPRINTF = 1]
+isnand-nolibm   [test $ac_cv_func_vsnprintf = no || test $REPLACE_VSNPRINTF = 1]
+isnanl-nolibm   [test $ac_cv_func_vsnprintf = no || test $REPLACE_VSNPRINTF = 1]
+frexp-nolibm    [test $ac_cv_func_vsnprintf = no || test $REPLACE_VSNPRINTF = 1]
+frexpl-nolibm   [test $ac_cv_func_vsnprintf = no || test $REPLACE_VSNPRINTF = 1]
+printf-frexp    [test $ac_cv_func_vsnprintf = no || test $REPLACE_VSNPRINTF = 1]
+printf-frexpl   [test $ac_cv_func_vsnprintf = no || test $REPLACE_VSNPRINTF = 1]
+signbit         [test $ac_cv_func_vsnprintf = no || test $REPLACE_VSNPRINTF = 1]
+fpucw           [test $ac_cv_func_vsnprintf = no || test $REPLACE_VSNPRINTF = 1]
 
 configure.ac:
 gl_FUNC_VSNPRINTF_POSIX
--- a/modules/vsprintf-posix
+++ b/modules/vsprintf-posix
@@ -14,20 +14,20 @@
 
 Depends-on:
 stdio
-vasnprintf
-isnand-nolibm
-isnanl-nolibm
-frexp-nolibm
-frexpl-nolibm
-printf-frexp
-printf-frexpl
-signbit
-fpucw
 nocrash
 printf-safe
-stdint
-errno
 multiarch
+vasnprintf      [test $REPLACE_VSPRINTF = 1]
+isnand-nolibm   [test $REPLACE_VSPRINTF = 1]
+isnanl-nolibm   [test $REPLACE_VSPRINTF = 1]
+frexp-nolibm    [test $REPLACE_VSPRINTF = 1]
+frexpl-nolibm   [test $REPLACE_VSPRINTF = 1]
+printf-frexp    [test $REPLACE_VSPRINTF = 1]
+printf-frexpl   [test $REPLACE_VSPRINTF = 1]
+signbit         [test $REPLACE_VSPRINTF = 1]
+fpucw           [test $REPLACE_VSPRINTF = 1]
+stdint          [test $REPLACE_VSPRINTF = 1]
+errno           [test $REPLACE_VSPRINTF = 1]
 
 configure.ac:
 gl_FUNC_VSPRINTF_POSIX
--- a/modules/wcrtomb
+++ b/modules/wcrtomb
@@ -12,9 +12,9 @@
 m4/codeset.m4
 
 Depends-on:
+wchar
 extensions
-wchar
-mbsinit
+mbsinit         [test $HAVE_WCRTOMB = 0 || test $REPLACE_WCRTOMB = 1]
 
 configure.ac:
 gl_FUNC_WCRTOMB
--- a/modules/wcscasecmp
+++ b/modules/wcscasecmp
@@ -8,7 +8,7 @@
 
 Depends-on:
 wchar
-wctype-h
+wctype-h        [test $HAVE_WCSCASECMP = 0]
 
 configure.ac:
 gl_FUNC_WCSCASECMP
--- a/modules/wcscspn
+++ b/modules/wcscspn
@@ -14,8 +14,8 @@
 
 Depends-on:
 wchar
-wcslen
-wcschr
+wcslen          [test $HAVE_WCSCSPN = 0]
+wcschr          [test $HAVE_WCSCSPN = 0]
 
 configure.ac:
 gl_FUNC_WCSCSPN
--- a/modules/wcsdup
+++ b/modules/wcsdup
@@ -8,8 +8,8 @@
 
 Depends-on:
 wchar
-wcslen
-wmemcpy
+wcslen          [test $HAVE_WCSDUP = 0]
+wmemcpy         [test $HAVE_WCSDUP = 0]
 
 configure.ac:
 gl_FUNC_WCSDUP
--- a/modules/wcsncasecmp
+++ b/modules/wcsncasecmp
@@ -8,7 +8,7 @@
 
 Depends-on:
 wchar
-wctype-h
+wctype-h        [test $HAVE_WCSNCASECMP = 0]
 
 configure.ac:
 gl_FUNC_WCSNCASECMP
--- a/modules/wcsnrtombs
+++ b/modules/wcsnrtombs
@@ -13,9 +13,9 @@
 m4/codeset.m4
 
 Depends-on:
+wchar
 extensions
-wchar
-wcrtomb
+wcrtomb         [test $HAVE_WCSNRTOMBS = 0 || test $REPLACE_WCSNRTOMBS = 1]
 
 configure.ac:
 gl_FUNC_WCSNRTOMBS
--- a/modules/wcspbrk
+++ b/modules/wcspbrk
@@ -14,7 +14,7 @@
 
 Depends-on:
 wchar
-wcschr
+wcschr          [test $HAVE_WCSPBRK = 0]
 
 configure.ac:
 gl_FUNC_WCSPBRK
--- a/modules/wcsrtombs
+++ b/modules/wcsrtombs
@@ -14,9 +14,9 @@
 m4/codeset.m4
 
 Depends-on:
+wchar
 extensions
-wchar
-wcrtomb
+wcrtomb         [test $HAVE_WCSRTOMBS = 0 || test $REPLACE_WCSRTOMBS = 1]
 
 configure.ac:
 gl_FUNC_WCSRTOMBS
--- a/modules/wcsspn
+++ b/modules/wcsspn
@@ -14,7 +14,7 @@
 
 Depends-on:
 wchar
-wcschr
+wcschr          [test $HAVE_WCSSPN = 0]
 
 configure.ac:
 gl_FUNC_WCSSPN
--- a/modules/wcsstr
+++ b/modules/wcsstr
@@ -8,7 +8,7 @@
 
 Depends-on:
 wchar
-wcschr
+wcschr          [test $HAVE_WCSSTR = 0]
 
 configure.ac:
 gl_FUNC_WCSSTR
--- a/modules/wcstok
+++ b/modules/wcstok
@@ -8,8 +8,8 @@
 
 Depends-on:
 wchar
-wcsspn
-wcspbrk
+wcsspn          [test $HAVE_WCSTOK = 0]
+wcspbrk         [test $HAVE_WCSTOK = 0]
 
 configure.ac:
 gl_FUNC_WCSTOK
--- a/modules/wcswidth
+++ b/modules/wcswidth
@@ -9,7 +9,7 @@
 
 Depends-on:
 wchar
-wcwidth
+wcwidth         [test $HAVE_WCSWIDTH = 0 || test $REPLACE_WCSWIDTH = 1]
 
 configure.ac:
 gl_FUNC_WCSWIDTH
--- a/modules/wctob
+++ b/modules/wctob
@@ -9,7 +9,7 @@
 
 Depends-on:
 wchar
-wctomb
+wctomb          [test $ac_cv_func_wctob = no || test $REPLACE_WCTOB = 1]
 
 configure.ac:
 gl_FUNC_WCTOB
--- a/modules/wctomb
+++ b/modules/wctomb
@@ -8,8 +8,8 @@
 
 Depends-on:
 stdlib
-wcrtomb
-wchar
+wcrtomb         [test $REPLACE_WCTOMB = 1]
+wchar           [test $REPLACE_WCTOMB = 1]
 
 configure.ac:
 gl_FUNC_WCTOMB
--- a/modules/wctype
+++ b/modules/wctype
@@ -14,7 +14,7 @@
 
 Depends-on:
 wctype-h
-iswblank
+iswblank        [test $HAVE_WCTYPE_T = 0]
 
 configure.ac:
 gl_FUNC_WCTYPE
--- a/modules/wcwidth
+++ b/modules/wcwidth
@@ -8,12 +8,12 @@
 m4/wint_t.m4
 
 Depends-on:
+wchar
 extensions
-wchar
-wctype-h
-localcharset
-streq
-uniwidth/width
+wctype-h        [test $ac_cv_func_wcwidth != yes || test $REPLACE_WCWIDTH = 1]
+localcharset    [test $ac_cv_func_wcwidth != yes || test $REPLACE_WCWIDTH = 1]
+streq           [test $ac_cv_func_wcwidth != yes || test $REPLACE_WCWIDTH = 1]
+uniwidth/width  [test $ac_cv_func_wcwidth != yes || test $REPLACE_WCWIDTH = 1]
 
 configure.ac:
 gl_FUNC_WCWIDTH
--- a/modules/write
+++ b/modules/write
@@ -7,7 +7,7 @@
 
 Depends-on:
 unistd
-raise
+raise           [test $REPLACE_WRITE = 1]
 
 configure.ac:
 gl_FUNC_WRITE