# HG changeset patch # User Bruce Korb # Date 1304694959 25200 # Node ID 6758fa38915e76d5ed673670eccf06fc3c7ed534 # Parent 04ce36b456ccee9ea456434c6c55b43765b00db6# Parent 6b83b217fcdd054d582e7b1e3d1c79f68960df44 manual merge diff -r 04ce36b456cc -r 6758fa38915e ChangeLog --- a/ChangeLog Fri Apr 01 16:04:45 2011 -0700 +++ b/ChangeLog Fri May 06 08:15:59 2011 -0700 @@ -1,3 +1,1649 @@ +2011-05-06 Jim Meyering + + maint.mk: use info-gnu@ as the default only for a stable release + * top/maint.mk: Don't default to info-gnu for alpha or beta releases. + For those, just use $(PACKAGE_BUGREPORT), in which case we don't have + to set the Mail-Followup-To header. Prompted by Reuben Thomas in + http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/26488 + +2011-05-05 Paul Eggert + + assert-h: new module, which supports C1X-style static_assert + * lib/assert.in.h, m4/assert_h.m4, modules/assert-h: New files. + * lib/verify.h: Revamp so that this can be copied into assert.h, + while retaining the ability to use it standalone as before. + Rename private identifiers so as not to encroach on the + standard C namespace, since this is now used by assert.h. + (_GL_VERIFY_TYPE): New macro, factoring out differing parts of + the old verify_true. + (_GL_VERIFY_TRUE): New macro, with much of the contents of + the old verify_true. Use _GL_VERIFY_TYPE. + (_GL_VERIFY): New macro, with much of the contents of the old verify. + (static_assert): New macro, if _GL_STATIC_ASSERT_H + is defined and static_assert is not; _GL_STATIC_ASSERT_H is + defined when this file is copied into the replacement assert.h. + (_Static_assert): New macro, if _GL_STATIC_ASSERT_H is defined + and _Static_assert is not built in. + (verify_true, verify): Define only if _GL_STATIC_ASSERT_H is not + defined, and use the new macros mentioned above. + * doc/posix-headers/assert.texi: Document this. + +2011-05-05 Bruno Haible + + fclose, fflush: Respect rules for use of AC_LIBOBJ. + * m4/fflush.m4 (gl_FUNC_FFLUSH): Don't invoke gl_REPLACE_FCLOSE. + * m4/fclose.m4 (gl_FUNC_FCLOSE): Invoke gl_FUNC_FFLUSH_STDIN and + gl_REPLACE_FCLOSE here. + * modules/fflush (Depends-on): Remove fclose. + * doc/posix-functions/fclose.texi: Mention module 'fflush' only in + combination with module 'fclose'. + +2011-05-05 Bruno Haible + + fflush, fseeko: Respect rules for use of AC_LIBOBJ. + * m4/fflush.m4 (gl_FUNC_FFLUSH_STDIN): New macro, extracted from + gl_FUNC_FFLUSH. + (gl_FUNC_FFLUSH): Use it. + (gl_REPLACE_FFLUSH): Don't invoke gl_REPLACE_FSEEKO. + * m4/fseeko.m4 (gl_FUNC_FSEEKO): Invoke gl_FUNC_FFLUSH_STDIN and + gl_REPLACE_FSEEKO here. + +2011-05-05 Bruno Haible + + tzset: Relicense under LGPL. + * modules/tzset (License): Change to LGPL. + No agreement needed; it's a no-op. + + strtoimax, strtoumax: Relicense under LGPL. + * modules/strtoimax (License): Change to LGPL. + * modules/strtoumax (License): Likewise. + With permission from Jim Meyering, Paul Eggert: + + + + getgroups: Relicense under LGPL. + * modules/getgroups (License): Change to LGPL. + With permission from Jim Meyering, Paul Eggert, Eric Blake: + + + + + nanosleep: Relicense under LGPL. + * modules/nanosleep (License): Change to LGPL. + With permission from Jim Meyering, Paul Eggert, Eric Blake, Bruno + Haible: + + + + + + futimens: Relicense under LGPL. + * modules/futimens (License): Change to LGPL. + With permission from Eric Blake: + + + fflush: Relicense under LGPL. + * modules/fflush (License): Change to LGPL. + With permission from Eric Blake, Bruno Haible, Jim Meyering: + + + + + tmpfile: Relicense under LGPL. + * modules/tmpfile (License): Change to LGPL. + With permission from Ben Pfaff: + + + isfinite: Relicense under LGPL. + * modules/isfinite (License): Change to LGPL. + With permission from Ben Pfaff, Bruno Haible: + + + + acosl..tanl: Relicense under LGPL. + * modules/acosl (License): Change to LGPL. + * modules/asinl (License): Likewise. + * modules/atanl (License): Likewise. + * modules/cosl (License): Likewise. + * modules/expl (License): Likewise. + * modules/logl (License): Likewise. + * modules/sinl (License): Likewise. + * modules/sqrtl (License): Likewise. + * modules/tanl (License): Likewise. + Source code originally from glibc and Paolo Bonzini. Agreements: + + + +2011-05-05 Bruno Haible + + signal: Define sighandler_t. + * lib/signal.in.h (sighandler_t): New type. + * m4/signal_h.m4 (gl_SIGNAL_H): Require AC_USE_SYSTEM_EXTENSIONS. Test + whether sighandler_t is defined. + (gl_SIGNAL_H_DEFAULTS): Initialize HAVE_SIGHANDLER_T. + * modules/signal (Depends-on): Add extensions. + (Makefile.am): Substitute HAVE_SIGHANDLER_T. + * doc/posix-headers/signal.texi: Mention the problem with sighandler_t. + Suggested by Markus Steinborn . + +2011-05-05 Eric Blake + + maint: remove useless REPLACE_*_H macros + * m4/arpa_inet_h.m4 (gl_REPLACE_ARPA_INET_H): Delete. + * m4/dirent_h.m4 (gl_REPLACE_DIRENT_H): Likewise. + * m4/locale_h.m4 (gl_REPLACE_LOCALE_H): Likewise. + * m4/poll_h.m4 (gl_REPLACE_POLL_H): Likewise. + * m4/spawn_h.m4 (gl_REPLACE_SPAWN_H): Likewise. + * m4/sys_ioctl_h.m4 (gl_REPLACE_SYS_IOCTL_H): Likewise. + * m4/wchar_h.m4 (gl_REPLACE_WCHAR_H): Likewise. + * m4/btowc.m4: Update callers. + * m4/dirfd.m4: Likewise. + * m4/duplocale.m4: Likewise. + * m4/fchdir.m4: Likewise. + * m4/fdopendir.m4: Likewise. + * m4/inet_ntop.m4: Likewise. + * m4/inet_pton.m4: Likewise. + * m4/ioctl.m4: Likewise. + * m4/mbrlen.m4: Likewise. + * m4/mbrtowc.m4: Likewise. + * m4/mbsinit.m4: Likewise. + * m4/mbsnrtowcs.m4: Likewise. + * m4/mbsrtowcs.m4: Likewise. + * m4/poll.m4: Likewise. + * m4/setlocale.m4: Likewise. + * m4/wcrtomb.m4: Likewise. + * m4/wcsnrtombs.m4: Likewise. + * m4/wcsrtombs.m4: Likewise. + * m4/wctob.m4: Likewise. + * m4/wcwidth.m4: Likewise. + * modules/posix_spawn: Likewise. + * modules/posix_spawn_file_actions_addclose: Likewise. + * modules/posix_spawn_file_actions_adddup2: Likewise. + * modules/posix_spawn_file_actions_addopen: Likewise. + * modules/posix_spawn_file_actions_destroy: Likewise. + * modules/posix_spawn_file_actions_init: Likewise. + * modules/posix_spawnattr_destroy: Likewise. + * modules/posix_spawnattr_getflags: Likewise. + * modules/posix_spawnattr_getpgroup: Likewise. + * modules/posix_spawnattr_getschedparam: Likewise. + * modules/posix_spawnattr_getschedpolicy: Likewise. + * modules/posix_spawnattr_getsigdefault: Likewise. + * modules/posix_spawnattr_getsigmask: Likewise. + * modules/posix_spawnattr_init: Likewise. + * modules/posix_spawnattr_setflags: Likewise. + * modules/posix_spawnattr_setpgroup: Likewise. + * modules/posix_spawnattr_setschedparam: Likewise. + * modules/posix_spawnattr_setschedpolicy: Likewise. + * modules/posix_spawnattr_setsigdefault: Likewise. + * modules/posix_spawnattr_setsigmask: Likewise. + * modules/posix_spawnp: Likewise. + +2011-05-04 Reuben Thomas + + Add option to do-release-commit-and-tag to specify branch. + * build-aux/do-release-commit-and-tag: Add --branch. + +2011-05-03 Bruno Haible + + 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 + + Support for conditional dependencies. + * doc/gnulib.texi (Module description): Document the syntax of + conditional dependencies. + * gnulib-tool: New option --conditional-dependencies. + (func_usage): Document it. + (cond_dependencies): New variable. + (func_get_automake_snippet_conditional, + func_get_automake_snippet_unconditional): New functions, extracted from + func_get_automake_snippet. + (func_get_automake_snippet): Use them. + (sed_first_32_chars): New variable. + (func_module_shellfunc_name): New function. + (func_module_shellvar_name): New function. + (func_module_conditional_name): New function. + (func_uncond_add_module, func_conddep_add_module, func_cond_module_p, + func_cond_module_condition): New functions. + (func_modules_transitive_closure): Add support for conditional + dependencies. + (func_emit_lib_Makefile_am): For a conditional module, enclose the + conditional automake snippet in an automake conditional. + (func_emit_autoconf_snippets): Emit shell functions that contain the + code for conditional modules. + (func_import, func_create_testdir): Update specification. + +2011-05-03 Eric Blake + + test-getaddrinfo: report error information + * tests/test-getaddrinfo.c (simple): Use err outside of dbprintf. + +2011-05-03 Jim Meyering + + bootstrap: avoid build failure when $GZIP is set + * build-aux/bootstrap (check_versions): Do not treat $GZIP as a + program name. If defined at all, it is supposed to list gzip options. + Reported by Alan Curry in http://debbugs.gnu.org/8609 + +2011-05-03 Reuben Thomas + + readme-release: new module with release instructions + * modules/readme-release: New module. + * top/README-release: New file, from coreutils, grep, diffutils. + * MODULES.html.sh (Support for maintaining and releasing): Add it. + +2011-05-02 Eric Blake + + fflush: also replace fclose when fixing fflush + * modules/fflush (Depends-on): Add fclose. + * m4/fflush.m4 (gl_FUNC_FFLUSH): Also replace fclose. + * lib/fclose.c (rpl_fclose): Don't cause spurious failures on + memstreams with no backing fd. + * doc/posix-functions/fclose.texi (fclose): Document the use of + fflush module to fix the bug. + * tests/test-fclose.c (main): Relax test when fclose is used in + isolation. + + fclose: add some tests + * modules/fclose-tests: New test module. + * tests/test-fclose.c: New file. + * doc/posix-functions/fclose.texi (fclose): Document the bug. + + fclose: reduced dependencies + * modules/fclose (Depends-on): Switch from fflush/fseeko to + simpler lseek. + * lib/fclose.c (rpl_fclose): Likewise. + Reported by Simon Josefsson. + + exit: drop remaining clients + * modules/argmatch (Depends-on): Replace exit with stdlib. + * modules/copy-file (Depends-on): Likewise. + * modules/execute (Depends-on): Likewise. + * modules/exitfail (Depends-on): Likewise. + * modules/obstack (Depends-on): Likewise. + * modules/pagealign_alloc (Depends-on): Likewise. + * modules/pipe-filter-gi (Depends-on): Likewise. + * modules/pipe-filter-ii (Depends-on): Likewise. + * modules/savewd (Depends-on): Likewise. + * modules/spawn-pipe (Depends-on): Likewise. + * modules/wait-process (Depends-on): Likewise. + * modules/xsetenv (Depends-on): Likewise. + * modules/chdir-long (Depends-on): Add stdlib, for EXIT_FAILURE. + * modules/git-merge-changelog (Depends-on): Likewise. + * modules/long-options (Depends-on): Likewise. + * modules/pt_chown (Depends-on): Likewise. + * modules/sysexits (Depends-on): Likewise. + + freading: relax license from LGPLv3+ to LGPLv2+ + * modules/freading (License): Relax LGPL version. + +2011-05-02 Bruno Haible + + fchdir: Remove unused dependencies. + * modules/fchdir (Depends-on): Remove include_next. + +2011-05-02 Bruno Haible + + gnulib-tool: Refactor. + * gnulib-tool (func_emit_autoconf_snippet): New function, extracted + from func_emit_autoconf_snippets. + (func_emit_autoconf_snippets): Use it. + +2011-05-02 Simon Josefsson + + * NEWS: Document removal of 'exit'. + * modules/exit: Remove file. + +2011-05-01 Bruno Haible + + Update DEPENDENCIES. + * DEPENDENCIES (gettext): Recommend the newest release. + Reported by Simon Josefsson. + +2011-05-01 Bruno Haible + + gnulib-tool: Reduce code duplication. + * gnulib-tool (func_emit_autoconf_snippets): New function. + (func_import, func_create_testdir): Use it. + +2011-04-30 Eric Blake + + fclose: don't fail on non-seekable input stream + * modules/fclose (Depends-on): Add freading, fflush, fseeko. + * lib/fclose.c (rpl_fclose): Skip fflush for non-seekable input, + since fflush is allowed to fail in that case. + +2011-04-30 Bruno Haible + + dup3: cleanup + * lib/dup3.c: Remove old code, leftover from 2009-12-16. + +2011-04-30 Bruno Haible + + netdb: Make it work in C++ mode. + * lib/netdb.in.h (struct addrinfo): In C++, define as a C struct. + (getaddrinfo, freeaddrinfo, getnameinfo): Use macros from c++defs + module. + * m4/netdb_h.m4 (gl_NETDB_MODULE_INDICATOR): Invoke + gl_MODULE_INDICATOR_FOR_TESTS. + * modules/netdb-tests (Depends-on): Add netdb-c++-tests. + * modules/netdb-c++-tests: New file. + * tests/test-netdb-c++.cc: New file. + +2011-04-30 Bruno Haible + + New modules 'vfscanf', 'vscanf'. + * modules/vfscanf: New file. + * modules/vscanf: New file. + * m4/stdio_h.m4 (gl_STDIO_H): Don't set GNULIB_VFSCANF, GNULIB_VSCANF + here. + * doc/posix-functions/vfscanf.texi: Mention module 'vfscanf'. + * doc/posix-functions/vscanf.texi: Mention module 'vscanf'. + +2011-04-30 Bruno Haible + + passfd: Add comments. + * lib/passfd.c: Add comments about platforms. + +2011-04-30 Bruno Haible + + sys_uio: Make self-contained. + * lib/sys_uio.in.h: Include before . + * doc/posix-headers/sys_uio.texi: Mention the OpenBSD problem. + +2011-04-30 Bruno Haible + + sys_socket: Ensure 'struct iovec' definition. + * lib/sys_socket.in.h: Include also on platforms that have + . + * doc/posix-headers/sys_socket.texi: Mention the OpenBSD problem. + +2011-04-30 Bruno Haible + + sys_uio: Protect definition of 'struct iovec'. + * lib/sys_uio.in.h (struct iovec): Avoid redefinition. In C++, define + it as a C struct. + +2011-04-30 Bruno Haible + + manywarnings: fix indentation + * m4/manywarnings.m4: Indent by 2 spaces consistently. + +2011-04-30 Pádraig Brady + + manywarnings: add -Wno-missing-field-initializers if needed. + * m4/manywarnings.m4 (gl_MANYWARN_ALL_GCC): Add the above + option if it's needed to allow initialization with { 0, } + +2011-04-29 Reuben Thomas + + announce-gen: cosmetic improvement + * build-aux/announce-gen: Strip any leading ./ from the NEWS file name. + +2011-04-29 Jim Meyering + + vc-list-files: indent with spaces, not TABs + * build-aux/vc-list-files: Convert leading TABs to spaces, + to match the style of most other files in gnulib. + + announce-gen: indent with spaces, not TABs + * build-aux/announce-gen: Convert all TABs to spaces, to match + the style of most other files in gnulib. + +2011-04-29 Eric Blake + + quotearg: avoid uninitialized variable use + * lib/quotearg.c (quoting_options_from_style): Initialize + remaining fields, and ensure that custom styles are only used via + quoting_options rather than quoting_style. + +2011-04-29 Jim Meyering + + maint.mk: remove unused VC-tag variable + * top/maint.mk (VC-tag): Remove unused variable. + +2011-04-29 Bruno Haible + + netdb: fix gai_strerror replacements + * lib/netdb.in.h: Add _GL_FUNCDECL_RPL definitions. + * modules/netdb: Substitute it. + +2011-04-29 Jim Meyering + + test-getcwd.c: avoid new set-but-not-used warning + * tests/test-getcwd.c (test_abort_bug): Exit nonzero for any problem, + not just the glibc/abort one that getcwd-abort-bug.m4 detects. + * m4/getcwd-abort-bug.m4: Update this now-duplicated code to match, + and adjust the code that sets gl_cv_func_getcwd_abort_bug accordingly. + + test-hash.c: avoid a new shadowing warning + * tests/test-hash.c (main): Don't shadow "dup". + +2011-04-28 Eric Blake + + getaddrinfo: fix gai_strerror signature + * m4/getaddrinfo.m4 (gl_GETADDRINFO): Detect broken signatures, + and work around mingw with UNICODE defined. + (gl_PREREQ_GETADDRINFO): Drop redundant decl check. + * m4/netdb_h.m4 (gl_NETDB_H_DEFAULTS): Add witness. + * modules/netdb (Makefile.am): Substitute it. + * lib/netdb.in.h (gai_strerror): Declare replacement. + * lib/gai_strerror.c (rpl_gai_strerror): Fix signature. + * doc/posix-functions/gai_strerror.texi (gai_strerror): Document + the fix. + + getsockopt: avoid compiler warning + * lib/getsockopt.c (rpl_getsockopt): Add a cast for mingw. + Reported by Matthias Bolte. + + tests: drop unused link dependency + * modules/areadlinkat-tests (Makefile.am): Drop stale LDADD. + * modules/dirent-safer-tests (Makefile.am): Likewise. + * modules/fdopendir-tests (Makefile.am): Likewise. + * modules/mkfifoat-tests (Makefile.am): Likewise. + * modules/openat-safer-tests (Makefile.am): Likewise. + * modules/openat-tests (Makefile.am): Likewise. + * modules/readlinkat-tests (Makefile.am): Likewise. + * modules/symlinkat-tests (Makefile.am): Likewise. + * modules/linkat-tests (Makefile.am): Likewise. + (Depends-on): Switch to filenamecat-lgpl. + * modules/fdutimensat-tests (test_fdutimensat_LDADD): Drop unused + LIBINTL. + * modules/utimensat-tests (test_utimensat_LDADD): Likewise. + * tests/test-linkat.c (main): Don't require xalloc. + + hash, mgetgroups: drop xalloc dependency + * lib/hash.c (includes): Adjust includes. + * lib/mgetgroups.c (includes): Likewise. + (xgetgroups): Move... + * lib/xgetgroups.c: ...to new file. + * lib/mgetgroups.h (xgetgroups): Make declaration conditional. + * modules/xgetgroups: New file, split from... + * modules/mgetgroups: ...here. + (Depends-on): Add xalloc-oversized. + * modules/hash (Depends-on): Likewise. + * modules/hash-tests (Depends-on): Drop xalloc. + (test_hash_LDADD): Drop unused library. + * tests/test-hash.c (main): Break xalloc dependency. + (includes): Drop unused include. + + xalloc-oversized: new module + * modules/xalloc-oversized: New module. + * modules/xalloc (Depends-on): Add it. + * lib/xalloc.h (xalloc_oversized): Move... + * lib/xalloc-oversized.h: ...into new file. + + utimecmp: drop dependency on xmalloc + * lib/utimecmp.c (utimecmp): Work even if hash table cache fails + due to memory pressure. + * modules/utimecmp (Depends-on): Drop xalloc. + +2011-04-27 Eric Blake + + getcwd: fix mingw bugs + * m4/getcwd.m4 (gl_FUNC_GETCWD_NULL): Detect one mingw bug. + * doc/posix-functions/getcwd.texi (getcwd): Document the problems. + * lib/getcwd-lgpl.c (rpl_getcwd): Fix return type. + +2011-04-27 Bruno Haible + + mkstemps: Ensure declaration on MacOS X 10.5. + * lib/stdlib.in.h: Include when mkstemps is requested. + * doc/glibc-functions/mkstemps.texi: Document header file problem on + MacOS X. + +2011-04-27 Bruno Haible + + mkstemp: More documentation. + * doc/posix-functions/mkstemp.texi: Document header file problem on + MacOS X. + +2011-04-27 Bruno Haible + + mkstemp: Tweak configure message when cross-compiling. + * m4/mkstemp.m4 (gl_FUNC_MKSTEMP): When cross-compiling, qualify the + result as a guess. + +2011-04-27 Bruno Haible + + clean-temp: Clarify what it does. + * lib/clean-temp.h: Add more comments. + * doc/posix-functions/mkstemp.texi: Tweak reference to 'clean-temp' + module. + * doc/glibc-functions/mkostemp.texi: Mention 'clean-temp' here too. + * doc/glibc-functions/mkstemps.texi: Likewise. + * doc/glibc-functions/mkostemps.texi: Likewise. + +2011-04-27 Eric Blake + + fchdir: avoid extra chdir and fix test + * modules/fchdir (Depends-on): Add dosname, filenamecat-lgpl, + getcwd-lgpl. + * lib/fchdir.c (get_name): Any absolute name will do; it does not + have to be canonical. + (canonicalize_file_name): Drop unused macro. + * m4/dup2.m4 (gl_REPLACE_DUP2): Ensure dup2 is replaced. + + filenamecat-lgpl: fix licence + * modules/filenamecat-lgpl (License): Mark as LGPLv2+, as intended + when it was first created. + + linkat, renameat: add missing dependency + * modules/linkat (Depends-on): Require getcwd-lgpl. + * modules/renameat (Depends-on): Likewise. + + tests: reduce dependencies + * tests/test-linkat.c (main): Use lighter-weight getcwd. + * tests/test-renameat.c (main): Likewise. + * modules/linkat-tests (Depends-on): Relax dependency. + * modules/renameat-tests (Depends-on): Likewise. + * modules/fchdir-tests (Depends-on): Likewise. Also make cloexec + dependency explicit. + + save-cwd: reduce default dependency + * modules/save-cwd (Depends-on): Use getcwd-lgpl. + * lib/save-cwd.c: Update comments. + * NEWS: Document the semantic change. + + getcwd: enhance tests + * tests/test-getcwd-lgpl.c: New file, taken from... + * tests/test-getcwd.c: ...old contents. Rewrite this file to + repeat long path stress tests from m4 probe. + * modules/getcwd-lgpl-tests: New module. + * modules/getcwd-tests (Depends-on): Depend on lgpl tests. + * m4/getcwd-abort-bug.m4: Update comment. + * m4/getcwd-path-max.m4: Likewise. + + getcwd-lgpl: new module + * modules/getcwd-lgpl: New module. + * lib/getcwd-lgpl.c: New file. + * doc/posix-functions/getcwd.texi (getcwd): Document it. + * MODULES.html.sh (lacking POSIX:2008): Likewise. + * modules/getcwd (configure.ac): Set C witness. + * m4/getcwd.m4 (gl_FUNC_GETCWD_LGPL): New macro. + + getcwd: tweak comments + * m4/getcwd-abort-bug.m4: Fix comments. + * m4/getcwd-path-max.m4: Likewise. + * m4/getcwd.m4: Likewise. + +2011-04-27 Reuben Thomas + and Eric Blake + + mkstemp: replace if system version uses wrong permissions + * m4/mkstemp.m4 (gl_FUNC_MKSTEMP): Add test for non-owner + read/write mode bits set in file created by mkstemp. + * doc/posix-functions/mkstemp.texi (mkstemp): Document the fix. + +2011-04-27 Eric Blake + + passfd: avoid compiler warning + * lib/passfd.c (sendfd, recvfd): Avoid shadowing names. + Reported by Laine Stump. + +2011-04-27 J.T. Conklin (tiny change) + + * gnulib-tool: change "join -a 2" to "join -a2", the latter is + required by the NetBSD (and perhaps other 4.4BSD derived) join. + +2011-04-27 Reuben Thomas + and Eric Blake + + mkstemp: mention clean-temp module + * lib/mkstemp.c: Add comment. + * doc/posix-functions/mkstemp.texi (mkstemp): Likewise. + +2011-04-26 Paul Eggert + + inttypes: also provide default values for 32-bit tests + * m4/inttypes.m4 (gl_INTTYPES_H_DEFAULTS): Also provide default values + for INT32_MAX_LT_INTMAX_MAX and for UINT32_MAX_LT_UINTMAX_MAX. + +2011-04-25 Paul Eggert + + strtoumax: remove dependency on strtoimax + This is like the strtoull change of yesterday. + * modules/strtoumax (Files): Add lib/strtoimax.c. + (Depends-on): Remove strtoimax and add verify. + + inttypes-incomplete: new module + * m4/inttypes.m4 (gl_INTTYPES_INCOMPLETE): New macro, containing + all but the PRI* and SCN* parts of gl_INTTYPES_H. + (gl_INTTYPES_PRI_SCN): New macro, containing the PRI* and SCN* parts + of gl_INTTYPES_H. + (gl_INTTYPES_H): Rewrite in terms of these new macros. + (gl_INTTYPES_H_DEFAULTS): Provide defaults for the PRI* and SCN* + parts, in case gl_INTTYPE_PRI_SCN is not invoked. + * modules/imaxabs, modules/imaxdiv, modules/strtoimax (Depends-on): + * modules/strtoumax, modules/xstrtol (Depends-on): + Depend on inttypes-incomplete, not inttypes. + * modules/inttypes-incomplete: New module, containing the contents + of the old modules/inttypes module, except that the Files: section + omits m4/inttypes-pri.m4, and the configure.ac section invokes + gl_INTTYPES_INCOMPLETE rather than gl_INTTYPES_H. + * modules/inttypes (Files): Remove lib/inttypes.in.h, m4/inttypes.m4. + (Depends-on): Depend only on inttypes-incomplete. + (Makefile.am): Remove everything; this is now in inttypes-incomplete. + + inttypes: omit now-redundant strtoimax and strtoumax work + * m4/inttypes.m4 (gl_INTTYPES_H): Do not check for strtoimax and + strtoumax decls; gl_FUNC_STRTOIMAX and gl_FUNC_STRTOUMAX now do this. + + strtoimax, strtoumax: simplify, port to HP-UX 11.00 64-bit + This supports apps that need pointers to strtoimax and strtoumax, + and ports to HP-UX 11.00 64.bit, which has macros that expand to + nonexistent functions. See + + et seq. + * lib/inttypes.in.h (strtoimax, strtoumax): #undef before declaring. + * m4/strtoimax.m4 (gl_FUNC_STRTOIMAX): Don't check whether it's + a macro. + * m4/strtoumax.m4 (gl_FUNC_STRTOUMAX): Likewise. + +2011-04-25 Simon Josefsson + + * modules/gnumakefile (configure.ac): Replace TAB with SPCs. + +2011-04-25 Bruno Haible + + strtol, strtoul: Mark modules as obsolete. + * modules/strtol (Status, Notice): New sections. + * modules/strtoul (Status, Notice): New sections. + +2011-04-25 Bruno Haible + + strtod: Remove check for strtod, unless supporting old platforms. + * modules/strtod-obsolete: New file. + * m4/strtod-obsolete.m4: New file. + * m4/strtod.m4 (gl_FUNC_STRTOD): Don't check whether strtod is declared + if gl_FUNC_STRTOD_OBSOLETE is not also defined. + * modules/strtod (Depends-on): Add strtod-obsolete. + * doc/posix-functions/strtod.texi: Mention module strtod-obsolete. + +2011-04-25 Bruno Haible + + strcase: Make module obsolete. + * modules/strcase (Status, Notice): New sections. + +2011-04-25 Bruno Haible + + dup2: Remove check for dup2, unless supporting old obsolete platforms. + * modules/dup2-obsolete: New file. + * m4/dup2-obsolete.m4: New file. + * m4/dup2.m4 (gl_FUNC_DUP2): Don't check whether dup2 exists if + gl_FUNC_DUP2_OBSOLETE is not also defined. + * modules/dup2 (Depends-on): Add dup2-obsolete. + * doc/posix-functions/dup2.texi: Mention module dup2-obsolete. + +2011-04-25 Bruno Haible + + strnlen: Avoid memchr related link error on old obsolete platforms. + * modules/memchr-obsolete: New file. + * m4/memchr-obsolete.m4: New file. + * m4/memchr.m4 (gl_FUNC_MEMCHR): Don't check whether memchr exists if + gl_FUNC_MEMCHR_OBSOLETE is not also defined. + * modules/memchr (Depends-on): Add memchr-obsolete. + * modules/strnlen (Depends-on): Likewise. + * doc/posix-functions/memchr.texi: Mention module memchr-obsolete. + +2011-04-25 Jim Meyering + + maint.mk: makefile_at_at_check extend and clean up + * top/maint.mk (sc_makefile_at_at_check): Check *.mk files + in addition to */Makefile.am. + Exempt legitimate uses of @VAR@ notation, e.g., + MAKEINFO = env LANG= LC_MESSAGES= LC_ALL= LANGUAGE= @MAKEINFO@ + Remove obsolete coreutils-specific comment. + Prompted by discussion here: + http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/26074 + +2011-04-24 Paul Eggert + + strtoul: remove dependency on strtol + This is so that 'configure' need not check for strtol merely because + the application needs strtoul. + * modules/strtoul (Files): Add lib/strtol.c. + (Depends-on): Remove strtol. + + strtoull: remove dependency on strtoul + This is like the strtoll change. + * modules/strtoull (Files): Add lib/strtol.c, lib/strtoul.c. + (Depends-on): Remove strtoul. + + strtoll: remove dependency on strtol + This is so that 'configure' need not check for strtol merely because + the application needs strtoll. + * modules/strtoll (Files): Add lib/strtol.c. + (Depends-on): Remove strtol. + +2011-04-22 Paul Eggert + + inttypes: Move some configure check to module 'imaxdiv'. + * m4/imaxdiv.m4 (gl_FUNC_IMAXDIV): Require gl_INTTYPES_H_DEFAULTS + instead of gl_INTTYPES_H. Check for imaxdiv decl here. + * m4/inttypes.m4 (gl_INTTYPES_H): Don't check for imaxdiv decl here. + +2011-04-22 Paul Eggert + + inttypes: Move some configure check to module 'imaxabs'. + * m4/imaxabs.m4 (gl_FUNC_IMAXABS): Require gl_INTTYPES_H_DEFAULTS + instead of gl_INTTYPES_H. Check for imaxabs decl here. + * m4/inttypes.m4 (gl_INTTYPES_H): Don't check for imaxabs decl here. + +2011-04-22 Paul Eggert + + inttypes: Remove configure tests that are not needed since 2009-12-31. + * m4/inttypes.m4 (gl_INTTYPES_H): Remove determination of + gl_cv_header_working_inttypes_h. + +2011-04-22 Paul Eggert + + * modules/strnlen (Depends-on): Remove memchr. + The strnlen implementation doesn't need the memchr module's fixes; see + . + + strtol: remove dependency on wchar + * lib/strtol.c: Include only if USE_WIDE_CHAR is defined. + * modules/strtol (Depends-on): Remove wchar. + +2011-04-21 Eric Blake + + passfd: fix test regression on Linux + * modules/passfd-tests (configure.ac): Correct socketpair check. + + passfd: speed up configure and drop unused code + * m4/afunix.m4 (gl_SOCKET_AFUNIX): Rename... + * m4/passfd.m4 (gl_PASSFD): ...to something more fitting of + its use. Drop test for setting unused HAVE_UNIXSOCKET_SCM_RIGHTS. + Instead of probing at configure for unix_scm_rights_bsd44_way, + instead probe for CMSG_FIRSTHDR at compile time. Simplify BSD 4.3 + check to a struct member probe. + * lib/passfd.c (includes): Nothing here requires . + (sendfd, recvfd): Update preprocessor checks. + * modules/passfd (Files): Reflect rename, and drop unused file. + (Depends-on): Drop unused dependency. + + passfd: allow compilation on mingw + * modules/sys_socket (Depends-on): Add sys_uio. + * lib/sys_socket.in.h [!@HAVE_SYS_SOCKET_H@]: Use it for struct + iovec and a minimal struct msghdr. + * m4/afunix.m4 (gl_SOCKET_AFUNIX): Detect recvmsg/sendmsg. + * tests/test-sys_socket.c (main): Enhance test. + * lib/passfd.c (include): Drop ; is + guaranteed to provide what we need. + (sendmsg, recvmsg): Declare fallbacks if we lack sendmsg. + * modules/passfd-tests (Depends-on): Add sys_wait. + * tests/test-passfd.c (main): Skip test on mingw, for now. + * doc/posix-headers/sys_socket.texi (sys/socket.h): Document the + partial 'struct msghdr' implementation. + + sys_uio: new module + * modules/sys_uio: New module. + * modules/sys_uio-tests: Likewise. + * lib/sys_uio.in.h: New file. + * m4/sys_uio_h.m4: Likewise. + * tests/test-sys_uio.c: Likewise. + * doc/posix-headers/sys_uio.texi (sys/uio.h): Document it. + * MODULES.html.sh (systems lacking POSIX:2008): Likewise. + +2011-04-20 Jim Meyering + + useless-if-before-free: avoid false-positive + * build-aux/useless-if-before-free: Adjust regexp for the non-brace + disjunct so that it too requires a terminating ";". Without that, + this script would identify as useless one statement from gcc that + was not: + if (aligned_ptr) + free (((void **) aligned_ptr) [-1]); + +2011-04-20 Giuseppe Scrivano + + doc: update users.txt. + * users.txt: Add barcode. + +2011-04-19 Bruno Haible + + ioctl: Remove link dependency on native Windows. + * lib/fd-hook.h: Renamed from lib/close-hook.h. + (gl_close_fn, gl_ioctl_fn): New types. + (struct fd_hook): Renamed from struct close_hook. Change type of + private_close_fn field. Add private_ioctl_fn field. + (close_hook_fn): Add parameter for primary close method. + (execute_close_hooks, execute_all_close_hooks): Likewise. + (ioctl_hook_fn): New type. + (execute_ioctl_hooks, execute_all_ioctl_hooks): New declarations. + (register_fd_hook): Renamed from register_close_hook. Add ioctl_hook + argument. + (unregister_fd_hook): Renamed from unregister_close_hook. + * lib/fd-hook.c: Renamed from lib/close-hook.c. + Don't include . + (close): Remove undef. + (anchor): Update. + (execute_close_hooks): Add argument for primary close method. + (execute_all_close_hooks): Likewise. + (execute_ioctl_hooks, execute_all_ioctl_hooks): New functions. + (register_fd_hook): Renamed from register_close_hook. Add ioctl_hook + argument. Allow each argument to be NULL. + (unregister_fd_hook): Renamed from unregister_close_hook. + * lib/close.c (rpl_close): Pass 'close' function pointer to + execute_all_close_hooks. + * lib/ioctl.c: Include , fd-hook.h. + (primary_ioctl): New function. + (ioctl): Don't call ioctlsocket here. Instead, call + execute_all_ioctl_hooks. + * lib/sockets.c (close_fd_maybe_socket): Add argument for primary + close method. + (ioctl_fd_maybe_socket): New function, with code from lib/ioctl.c. + (fd_sockets_hook): Renamed from close_sockets_hook. + (gl_sockets_startup, gl_sockets_cleanup): Update. + * modules/fd-hook: Renamed from modules/close-hook. Update. + * modules/close (Depends-on): Add fd-hook, remove close-hook. + * modules/sockets (Depends-on): Likewise. + * modules/ioctl (Depends-on): Add fd-hook. + * tests/test-nonblocking.c (main): Use GNULIB_TEST_SOCKET, not + GNULIB_SOCKET. + +2011-04-19 Bruno Haible + + Move the support of O_NONBLOCK in open() to the 'open' module. + * modules/nonblocking (Depends-on): Remove 'open'. + * m4/nonblocking.m4 (gl_NONBLOCKING_IO_BODY): Set + gl_cv_have_open_O_NONBLOCK. + * m4/open.m4 (gl_FUNC_OPEN): Replace open() also when required for + O_NONBLOCK support. + * doc/posix-functions/open.texi: Document support for O_NONBLOCK. + +2011-04-17 Bruno Haible + + pipe2: Simplify code. + * lib/pipe2.c (pipe2): Reduce code duplication. + +2011-04-17 Bruno Haible + + nonblocking: Add comment. + * lib/fcntl.in.h (O_NONBLOCK): Add comment. + +2011-04-17 Bruno Haible + + nonblocking: Add tests for sockets. + * tests/test-nonblocking-socket.sh: New file. + * tests/test-nonblocking-socket-main.c: New file. + * tests/test-nonblocking-socket-child.c: New file. + * tests/test-nonblocking-socket.h: New file. + * tests/socket-server.h: New file. + * tests/socket-client.h: New file. + * modules/nonblocking-socket-tests: New file. + * modules/nonblocking-tests (Depends-on): Add nonblocking-socket-tests. + +2011-04-17 Bruno Haible + + nonblocking: Add tests for pipes. + * tests/test-nonblocking-pipe.sh: New file. + * tests/test-nonblocking-pipe-main.c: New file. + * tests/test-nonblocking-pipe-child.c: New file. + * tests/test-nonblocking-pipe.h: New file. + * tests/test-nonblocking-writer.h: New file. + * tests/test-nonblocking-reader.h: New file. + * tests/test-nonblocking-misc.h: New file. + * modules/nonblocking-pipe-tests: New file. + * modules/nonblocking-tests (Depends-on): Add nonblocking-pipe-tests. + +2011-04-16 Bruno Haible + + gettext: Clarify the needed programmer actions. + * modules/gettext (Notice): New field. + Suggested by Ben Pfaff . + +2011-04-16 Bruno Haible + + strchrnul: Tweak last commit. + * doc/glibc-functions/strchrnul.texi: Add more details about Cygwin + bug. + * lib/string.in.h (strchrnul): Use same arguments in _GL_FUNCDECL_RPL + as in _GL_FUNCDECL_SYS. + * m4/strchrnul.m4 (gl_FUNC_STRCHRNUL): Invoke gl_PREREQ_STRCHRNUL after + AC_LIBOBJ. When cross-compiling, say "guessing yes" not "yes". + +2011-04-15 Eric Blake + + strchrnul: work around cygwin bug + * doc/glibc-functions/strchrnul.texi (strchrnul): Document bug. + * m4/strchrnul.m4 (gl_FUNC_STRCHRNUL): Detect it. + * m4/string_h.m4 (gl_HEADER_STRING_H_DEFAULTS): New witness. + * modules/string (Makefile.am): Substitute it. + * lib/string.in.h (strchrnul): Use it. + +2011-04-15 Bruno Haible + + Don't require lib/stdio-write.c when only module 'stdio' is used. + * m4/stdio_h.m4 (gl_STDIO_H): Move the AC_LIBOBJ back into the m4_ifdef + invocation. + Reported by Rob Vermaas . + +2011-04-14 Bruno Haible + + Support non-blocking pipe I/O in read() on native Windows. + * lib/unistd.in.h: Include also for 'read'. + (read): New declaration. + * lib/read.c: New file. + * lib/stdio.in.h (_GL_ATTRIBUTE_FORMAT_SCANF, + _GL_ATTRIBUTE_FORMAT_SCANF_SYSTEM): New macros. + (fgetc, fgets, fread, fscanf, getc, getchar, gets, scanf, vfscanf, + vscanf): New declarations. + * lib/stdio-read.c: New file. + * m4/read.m4: New file. + * m4/unistd_h.m4 (gl_UNISTD_H_DEFAULTS): Initialize GNULIB_READ, + REPLACE_READ. + * m4/stdio_h.m4 (gl_STDIO_H): Set GNULIB_FGETC, GNULIB_FGETS, + GNULIB_FREAD, GNULIB_FSCANF, GNULIB_GETC, GNULIB_GETCHAR, GNULIB_GETS, + GNULIB_SCANF, GNULIB_VFSCANF, GNULIB_VSCANF. In non-blocking I/O is + desired and needs workarounds, set REPLACE_STDIO_READ_FUNCS. + (gl_STDIO_H_DEFAULTS): Initialize GNULIB_FGETC, GNULIB_FGETS, + GNULIB_FREAD, GNULIB_FSCANF, GNULIB_GETC, GNULIB_GETCHAR, GNULIB_GETS, + GNULIB_SCANF, GNULIB_VFSCANF, GNULIB_VSCANF, REPLACE_STDIO_READ_FUNCS. + * modules/read: New file. + * modules/nonblocking (Files): Add lib/stdio-read.c. + * modules/unistd (Makefile.am): Substitute GNULIB_READ, REPLACE_READ. + * modules/stdio (Makefile.am): Substitute GNULIB_FGETC, GNULIB_FGETS, + GNULIB_FREAD, GNULIB_FSCANF, GNULIB_GETC, GNULIB_GETCHAR, GNULIB_GETS, + GNULIB_SCANF, GNULIB_VFSCANF, GNULIB_VSCANF, REPLACE_STDIO_READ_FUNCS. + * modules/pread (Depends-on): Add read. + * modules/safe-read (Depends-on): Likewise. + * tests/test-stdio-c++.cc (fgetc, fgets, fread, fscanf, getc, getchar, + gets, scanf, vfscanf, vscanf): Verify signatures. + * doc/posix-functions/read.texi: Mention 'nonblocking' module and + problem with non-blocking pipes. + * doc/posix-functions/fgetc.texi: Likewise. + * doc/posix-functions/fgets.texi: Likewise. + * doc/posix-functions/fread.texi: Likewise. + * doc/posix-functions/fscanf.texi: Likewise. + * doc/posix-functions/getc.texi: Likewise. + * doc/posix-functions/getchar.texi: Likewise. + * doc/posix-functions/gets.texi: Likewise. + * doc/posix-functions/scanf.texi: Likewise. + * doc/posix-functions/vfscanf.texi: Likewise. + * doc/posix-functions/vscanf.texi: Likewise. + +2011-04-14 Bruno Haible + + Support non-blocking pipe I/O in write() on native Windows. + * lib/write.c (rpl_write): Split a write request that failed merely + because the byte count was larger than the pipe buffer's size. + * doc/posix-functions/write.texi: Mention the problem with large byte + counts. + +2011-04-14 Bruno Haible + + wchar: Ensure that wchar_t gets defined on uClibc. + * lib/wchar.in.h: On uClibc, include . + Reported by Giuseppe Scrivano . + +2011-04-13 Bruno Haible + + safe-write, full-read: Avoid unnecessary compilation units. + * modules/safe-write (Files): Add lib/safe-read.c, m4/safe-read.m4. + (Depends-on): Remove safe-read. Add ssize_t. + * modules/full-read (Files): Add lib/full-write.c. + (Depends-on): Add full-write. + +2011-04-13 Bruno Haible + + Support non-blocking pipe I/O and SIGPIPE in pwrite(). + * modules/pwrite (Depends-on): Add 'write'. + +2011-04-13 Bruno Haible + + Support non-blocking pipe I/O in write() on native Windows. + * lib/unistd.in.h (write): Enable replacement also if + GNULIB_UNISTD_H_NONBLOCKING is 1. + * lib/write.c: Enable replacement also if GNULIB_NONBLOCKING. + (rpl_write): When failing to write on a non-blocking pipe, change + errno from ENOSPC to EAGAIN. + * lib/stdio.in.h (fprintf, fputc, fputs, fwrite, printf, putc, + putchar, puts, vfprintf, vprintf): Enable replacement also if + GNULIB_STDIO_H_NONBLOCKING is 1. + * lib/stdio-write.c: Enable replacements also if GNULIB_NONBLOCKING. + (CLEAR_ERRNO, HANDLE_ENOSPC): New macros. + (CLEAR_LastError, HANDLE_ERROR_NO_DATA): New macros, extracted from + CALL_WITH_SIGPIPE_EMULATION. + (CALL_WITH_SIGPIPE_EMULATION): Use them. + * m4/nonblocking.m4: New file. + * m4/write.m4 (gl_FUNC_WRITE): Enable REPLACE_WRITE also if required + for non-blocking I/O support. + * m4/unistd_h.m4 (gl_UNISTD_H_DEFAULTS): Initialize + GNULIB_UNISTD_H_NONBLOCKING. + * m4/stdio_h.m4 (gl_STDIO_H): Enable REPLACE_STDIO_WRITE_FUNCS also if + required for non-blocking I/O support. + (gl_STDIO_H_DEFAULTS): Initialize GNULIB_STDIO_H_NONBLOCKING. + * modules/nonblocking (Files): Add m4/nonblocking.m4, + lib/stdio-write.c, m4/asm-underscore.m4. + (Depends-on): Add stdio, unistd. + (configure.ac): Invoke gl_NONBLOCKING_IO. Define GNULIB_NONBLOCKING. + Set GNULIB_STDIO_H_NONBLOCKING, GNULIB_UNISTD_H_NONBLOCKING. + * modules/unistd (Makefile.am): Substitute GNULIB_UNISTD_H_NONBLOCKING. + * modules/stdio (Makefile.am): Substitute GNULIB_STDIO_H_NONBLOCKING. + * doc/posix-functions/fprintf.texi: Mention 'nonblocking' module and + problem with non-blocking pipes. + * doc/posix-functions/fputc.texi: Likewise. + * doc/posix-functions/fputs.texi: Likewise. + * doc/posix-functions/fwrite.texi: Likewise. + * doc/posix-functions/printf.texi: Likewise. + * doc/posix-functions/putc.texi: Likewise. + * doc/posix-functions/putchar.texi: Likewise. + * doc/posix-functions/puts.texi: Likewise. + * doc/posix-functions/vfprintf.texi: Likewise. + * doc/posix-functions/vprintf.texi: Likewise. + * doc/posix-functions/write.texi: Likewise. + +2011-04-10 Jim Meyering + + maint.mk: prohibit doubled words + Detect them also when they're separated by a newline. + There are 3 ways to customize it: + - disable the test on a per file basis, as usual with rules using + $(VC_LIST_EXCEPT) + - replace the default doubled-word-selecting regexp (affects all files) + - ignore a particular file-vs-doubled-word match + I nearly used that last one to ignore the "is is" match in + coreutils' NEWS file, since the text was "ls -is is ..." + To do that, I would have added this line to cfg.mk: + ignore_doubled_word_match_RE_ = ^NEWS:[0-9]+:is[ ]is$ + but it would have ignored any "is is" match in NEWS. + Low probability, but still... + Instead, I changed the text, slightly: + - ls -is is now consistent with ls -lis in ignoring values returned + + "ls -is" is now consistent with ls -lis in ignoring values returned + * top/maint.mk (prohibit_double_word_RE_): Provide default. + (prohibit_doubled_word_): Define. + (sc_prohibit_doubled_word): New rule. + (sc_prohibit_the_the): Remove. Subsumed by the above. + +2011-04-10 Jim Meyering + + maint: fix doubled-word typo in comment + * m4/gethostname.m4: s/is is/it is/ + * m4/getdomainname.m4: Likewise. + +2011-04-10 Jim Meyering + + maint: remove doubled word: s/it it/it/ + * lib/stat-time.h (get_stat_birthtime): s/it it/it/ + +2011-04-10 Jim Meyering + + maint.mk: remove useless semicolon and backslash + * top/maint.mk (sc_prohibit_empty_lines_at_EOF): Remove stray + semicolon and backslash. + +2011-04-10 Bruno Haible + + stdint test: Fix compilation failure on OSF/1 with DTK compiler. + * modules/stdint-tests (Depends-on): Add wchar. + +2011-04-10 Jim Meyering + + maint: remove doubled words in comments, e.g., s/a a/a/ + * lib/strptime.c (day_of_the_week): s/the the/the/ + * tests/test-chown.h (test_chown): s/a a/a/ + + test-chown.h: correct a cast + * tests/test-chown.h (test_chown): Cast -1 to gid_t (not uid_t) + when the destination is a stat.st_gid. + +2011-04-09 Mats Erik Andersson (tiny change) + + getaddrinfo: Fix test for sa_len member. + * m4/getaddrinfo.m4 (gl_PREREQ_GETADDRINFO): When testing for sa_len, + include before . + +2011-04-09 Paul Eggert + + maint: change "can not" to "cannot" + * doc/posix-functions/iconv.texi (iconv): This one crossed line + boundaries. + +2011-04-09 Jim Meyering + + maint: change "a a" to "a" + * tests/test-lchown.h (test_lchown): s/a a/a/ + + maint.mk: prohibit \ + * top/maint.mk (sc_prohibit_the_the): New rule. + + maint: fix "the the" in comment + * lib/count-one-bits.h: s/the the/the/ + + maint: change "can not" to "cannot" + But do not change the occurrences in maintain.texi or in + build-aux/po/Makefile.in.in, which I presume comes from gettext. + * doc/gnulib-tool.texi: s/can not/cannot/ + * doc/posix-functions/accept.texi (accept): Likewise. + * doc/posix-functions/socket.texi (socket): Likewise. + * lib/mbrtowc.c: Likewise. + + maint.mk: prohibit use of "can not" + * top/maint.mk (sc_prohibit_can_not): New rule. + Writing "can not" (rather than "cannot") is too common. Prohibit it. + +2011-04-09 Bruno Haible + + careadlinkat: Guard against misuse of careadlinkatcwd. + * lib/careadlinkat.c: Include . + (careadlinkatcwd): Check that the fd argument is as expected. + +2011-04-09 Bruno Haible + + careadlinkat: Use common coding style. + * lib/careadlinkat.c: Move gnulib includes after system includes. + +2011-04-09 Bruno Haible + + careadlinkat: Clarify specification. + * lib/careadlinkat.h (careadlinkat): Clarify preadlinkat argument. + (careadlinkatcwd): Add comment. + * lib/careadlinkat.c (careadlinkat): Clarify preadlinkat argument. + +2011-04-09 Bruno Haible + + areadlinkat: Avoid link error on many platforms. + * modules/areadlinkat (Depends-on): Add areadlink. + +2011-04-09 Bruno Haible + + allocator, careadlinkat: Fix double-inclusion guard. + * lib/allocator.h: Fix double-inclusion guard. + * lib/careadlinkat.h: Likewise. + +2011-04-09 Bruno Haible + + relocatable-prog-wrapper: Update after module 'areadlink' changed. + * lib/relocwrapper.c: Update dependencies hierarchy. + * build-aux/install-reloc: Update list of files to be compiled. + * modules/relocatable-prog-wrapper (Files): Add lib/careadlinkat.[hc], + lib/allocator.[hc]. + +2011-04-08 Eric Blake + + strftime: silence gnulib-tool warning + * modules/strftime-tests (Depends-on): Drop automatic dependency. + +2011-04-08 Bruno Haible + + verify: Fix syntax error with GCC 4.6 in C++ mode. + * lib/verify.h (HAVE__STATIC_ASSERT): Don't define in C++ mode. + (HAVE_STATIC_ASSERT): New macro. + (verify_true, verify): Use 'static_assert' if it is supported and + '_Static_assert' is not supported. + +2011-04-08 Paul Eggert + + allocator: New module. + * modules/allocator, lib/allocator.c: New files. + * lib/allocator.h (stdlib_allocator): New decl. + * lib/careadlinkat.c (_GL_USE_STDLIB_ALLOC, standard_allocator): + Remove. Do not include . + (careadlinkat): Use stdlib_allocator instead of rolling our own. + * modules/careadlinkat (Files): Remove lib/allocator.h. + (Depends-on): Add allocator. + + stdlib: let modules use system malloc, realloc + * lib/stdlib.in.h (malloc, realloc): Don't #define or add warnings + if !_GL_USE_STDLIB_ALLOC. + (malloc, realloc): Limit this change to a smaller scope. + + * lib/careadlinkat.c (_GL_USE_STDLIB_ALLOC): Define. + (malloc, realloc): Don't #undef; no longer needed. + * lib/malloca.c (_GL_USE_STDLIB_ALLOC, malloc): Likewise. + * lib/progreloc.c (_GL_USE_STDLIB_ALLOC, malloc): Likewise. + * lib/setenv.c (_GL_USE_STDLIB_ALLOC, malloc, realloc): Likewise. + * lib/canonicalize-lgpl.c (_GL_USE_STDLIB_ALLOC, malloc): Likewise. + * lib/relocatable.c (_GL_USE_STDLIB_ALLOC, malloc): Likewise. + * lib/relocwrapper.c (_GL_USE_STDLIB_ALLOC, malloc): Likewise. + * lib/malloc.c (_GL_USE_STDLIB_ALLOC, malloc): Likewise. + * lib/realloc.c (_GL_USE_STDLIB_ALLOC, malloc, realloc): Likewise. + + careadlinkat: rename members to avoid problem + * lib/allocator.h (struct allocator): Rename members from + malloc/realloc to allocate/reallocate, to avoid problems if malloc + and realloc are #define'd. Reported by Eric Blake in + . + * lib/careadlinkat.c (careadlinkat): Adjust to renaming. + +2011-04-08 Eric Blake + + nonblocking: reduce dependency + * tests/test-nonblocking.c: Only test sockets when in use. + * modules/nonblocking-tests (Depends-on): Drop socket. + (Makefile.am): Link even if sockets are not present. + * modules/pipe2-tests (Makefile.am): Likewise. + * lib/ioctl.c (ioctl) [WIN32]: Fail if sockets are not also in use. + + pipe2: fix O_NONBLOCK support on mingw + * modules/pipe2 (Depends-on): Add nonblocking. + * lib/pipe2.c (pipe2) [WIN32]: Add O_NONBLOCK support. + * tests/test-pipe2.c (is_nonblocking): Adjust test accordingly. + * tests/test-nonblocking.c (main): Likewise. + * modules/pipe2-tests (Makefile.am): Avoid link failure. + + fcntl-h: fix O_ACCMODE on cygwin + * doc/posix-headers/fcntl.texi (fcntl.h): Document the bug. + * lib/fcntl.in.h (O_ACCMODE): Fix it. + + pipe-filter: drop O_NONBLOCK workarounds + * modules/pipe-filter-gi (Depends-on): Add fcntl-h. + * modules/pipe-filter-ii (Depends-on): Likewise. + * lib/pipe-filter-aux.h (O_NONBLOCK): Delete workaround. + + nonblocking: provide O_NONBLOCK for mingw + * modules/nonblocking (Depends-on): Add open. + (configure.ac): Set new witness macro. + * m4/fcntl_h.m4 (gl_FCNTL_H_DEFAULTS): Provide default for it. + * modules/fcntl-h (Makefile.am): Substitute it. + * lib/fcntl.in.h (O_NONBLOCK): Guarantee non-zero definition when + nonblocking module is in use. + * lib/nonblocking.c: Adjust portability test. + * lib/open.c (open): Don't let native open see gnulib flag. + * tests/test-fcntl-h.c (main): Enhance test. + * tests/test-open.h (test_open): Likewise. + * doc/posix-headers/fcntl.texi (fcntl.h): Document the replacement. + + careadlinkat: fix compilation error on mingw + * lib/careadlinkat.c (standard_allocator): Avoid renaming fields + within struct allocator. + +2011-04-06 Eric Blake + + binary-io: relicense under LGPLv2+ + * modules/binary-io (License): Relax to LGPLv2+. + Requested for libvirt, and required by pipe2. + +2011-04-06 Paul Eggert + + verify: use _Static_assert if available + * lib/verify.h (HAVE__STATIC_ASSERT): New macro. + (verify_true, verify): Use it if available. This generates better + diagnostics with GCC 4.6.0 and later. + +2011-04-05 Bruno Haible + + Remove leftover generated .h files after config.status changed. + + * m4/alloca.m4 (gl_FUNC_ALLOCA): New automake conditional + GL_GENERATE_ALLOCA_H. + * modules/alloca-opt (Makefile.am): Remove alloca.h if + GL_GENERATE_ALLOCA_H evaluates to false. + + * m4/argz.m4 (gl_FUNC_ARGZ): New automake conditional + GL_GENERATE_ARGZ_H. + * modules/argz (Makefile.am): Remove argz.h if GL_GENERATE_ARGZ_H + evaluates to false. + + * m4/byteswap.m4 (gl_BYTESWAP): New automake conditional + GL_GENERATE_BYTESWAP_H. + * modules/byteswap (Makefile.am): Remove byteswap.h if + GL_GENERATE_BYTESWAP_H evaluates to false. + + * m4/errno_h.m4 (gl_HEADER_ERRNO_H): New automake conditional + GL_GENERATE_ERRNO_H. + * modules/errno (Makefile.am): Remove errno.h if GL_GENERATE_ERRNO_H + evaluates to false. + + * m4/float_h.m4 (gl_FLOAT_H): New automake conditional + GL_GENERATE_FLOAT_H. + * modules/float (Makefile.am): Remove float.h if GL_GENERATE_FLOAT_H + evaluates to false. + + * m4/fnmatch.m4 (gl_FUNC_FNMATCH_POSIX): New automake conditional + GL_GENERATE_FNMATCH_H. + * modules/fnmatch (Makefile.am): Remove fnmatch.h if + GL_GENERATE_FNMATCH_H evaluates to false. + + * m4/glob.m4 (gl_GLOB_SUBSTITUTE, gl_GLOB): New automake conditional + GL_GENERATE_GLOB_H. + * modules/glob (Makefile.am): Remove glob.h if GL_GENERATE_GLOB_H + evaluates to false. + + * m4/iconv_h.m4 (gl_REPLACE_ICONV_H, gl_ICONV_H_DEFAULTS): New + automake conditional GL_GENERATE_ICONV_H. + * modules/iconv-h (Makefile.am): Remove iconv.h if GL_GENERATE_ICONV_H + evaluates to false. + + * m4/netinet_in_h.m4 (gl_HEADER_NETINET_IN): New automake conditional + GL_GENERATE_NETINET_IN_H. + * modules/netinet_in (Makefile.am): Remove netinet/in.h if + GL_GENERATE_NETINET_IN_H evaluates to false. + + * m4/pthread.m4 (gl_PTHREAD_CHECK): Set PTHREAD_H here. New automake + conditional GL_GENERATE_PTHREAD_H. + (gl_PTHREAD_DEFAULTS): Don't set PTHREAD_H here. + * modules/pthread (Makefile.am): Remove pthread.h if + GL_GENERATE_PTHREAD_H evaluates to false. + + * m4/sched_h.m4 (gl_SCHED_H): New automake conditional + GL_GENERATE_SCHED_H. + * modules/sched (Makefile.am): Remove sched.h if GL_GENERATE_SCHED_H + evaluates to false. + + * m4/selinux-context-h.m4 (gl_HEADERS_SELINUX_CONTEXT_H): New automake + conditional GL_GENERATE_SELINUX_CONTEXT_H. + * modules/selinux-h (Makefile.am): Remove selinux/context.h if + GL_GENERATE_SELINUX_CONTEXT_H evaluates to false. + + * m4/stdarg.m4 (gl_STDARG_H): New automake conditional + GL_GENERATE_STDARG_H. + * modules/stdarg (Makefile.am): Remove stdarg.h if + GL_GENERATE_STDARG_H evaluates to false. + + * m4/stdbool.m4 (AM_STDBOOL_H): New automake conditional + GL_GENERATE_STDBOOL_H. + * modules/stdbool (Makefile.am): Remove stdbool.h if + GL_GENERATE_STDBOOL_H evaluates to false. + + * m4/stddef_h.m4 (gl_STDDEF_H): Set STDDEF_H here. New automake + conditional GL_GENERATE_STDDEF_H. + (gl_STDDEF_H_DEFAULTS): Don't set STDDEF_H here. + * modules/stddef (Makefile.am): Remove stddef.h if + GL_GENERATE_STDDEF_H evaluates to false. + + * m4/stdint.m4 (gl_STDINT_H): New automake conditional + GL_GENERATE_STDINT_H. + * modules/stdint (Makefile.am): Remove stdint.h if + GL_GENERATE_STDINT_H evaluates to false. + + * m4/sysexits.m4 (gl_SYSEXITS): New automake conditional + GL_GENERATE_SYSEXITS_H. + * modules/sysexits (Makefile.am): Remove sysexits.h if + GL_GENERATE_SYSEXITS_H evaluates to false. + + Reported by Karl Berry and Ralf Wildenhues. + +2011-04-05 Bruno Haible + + Ensure to rebuild generated .h files when config.status has changed. + * modules/arpa_inet (Makefile.am): Add dependency from .h file to + config.status. + * modules/ctype (Makefile.am): Likewise. + * modules/dirent (Makefile.am): Likewise. + * modules/errno (Makefile.am): Likewise. + * modules/fcntl-h (Makefile.am): Likewise. + * modules/float (Makefile.am): Likewise. + * modules/getopt-posix (Makefile.am): Likewise. + * modules/glob (Makefile.am): Likewise. + * modules/iconv-h (Makefile.am): Likewise. + * modules/inttypes (Makefile.am): Likewise. + * modules/langinfo (Makefile.am): Likewise. + * modules/locale (Makefile.am): Likewise. + * modules/math (Makefile.am): Likewise. + * modules/netdb (Makefile.am): Likewise. + * modules/netinet_in (Makefile.am): Likewise. + * modules/poll-h (Makefile.am): Likewise. + * modules/pthread (Makefile.am): Likewise. + * modules/pty (Makefile.am): Likewise. + * modules/sched (Makefile.am): Likewise. + * modules/search (Makefile.am): Likewise. + * modules/selinux-h (Makefile.am): Likewise. + * modules/signal (Makefile.am): Likewise. + * modules/spawn (Makefile.am): Likewise. + * modules/stdarg (Makefile.am): Likewise. + * modules/stdbool (Makefile.am): Likewise. + * modules/stddef (Makefile.am): Likewise. + * modules/stdint (Makefile.am): Likewise. + * modules/stdio (Makefile.am): Likewise. + * modules/stdlib (Makefile.am): Likewise. + * modules/string (Makefile.am): Likewise. + * modules/strings (Makefile.am): Likewise. + * modules/sys_file (Makefile.am): Likewise. + * modules/sys_ioctl (Makefile.am): Likewise. + * modules/sys_select (Makefile.am): Likewise. + * modules/sys_socket (Makefile.am): Likewise. + * modules/sys_stat (Makefile.am): Likewise. + * modules/sys_time (Makefile.am): Likewise. + * modules/sys_times (Makefile.am): Likewise. + * modules/sys_utsname (Makefile.am): Likewise. + * modules/sys_wait (Makefile.am): Likewise. + * modules/sysexits (Makefile.am): Likewise. + * modules/termios (Makefile.am): Likewise. + * modules/time (Makefile.am): Likewise. + * modules/unistd (Makefile.am): Likewise. + * modules/wchar (Makefile.am): Likewise. + * modules/wctype-h (Makefile.am): Likewise. + Reported by Karl Berry, Eric Blake, and Ralf Wildenhues. + +2011-04-05 Bruno Haible + + pipe2: Relicense under LGPLv2+. + * modules/pipe2 (License): Change to LGPLv2+. + Requested by Eric Blake, for libvirt. + +2011-04-05 Bruce Korb + + bootstrap: compute gnulib_extra_files after updating build_aux + * build-aux/bootstrap (gnulib_extra_files): bootstrap.conf may + change build_aux or also supply gnulib_extra_files. Handle correctly. + +2011-04-05 Eric Blake + + bootstrap: preserve git whitelist item sorting + * build-aux/bootstrap (sort_patterns): New function. + (insert_sorted_if_absent): Use it to sink ! lines to the bottom. + +2011-04-05 Simon Josefsson + + * top/maint.mk (sc_prohibit_empty_lines_at_EOF): Don't trigger + sc_space_tab check. + +2011-04-05 Paul Eggert + + areadlink, areadlinkat: rewrite in terms of careadlinkat + * lib/areadlink.c, lib/areadlinkat.c: Include careadlinkat.h + instead of errno.h, limits.h, stdint.h, stdlib.h, string.h, unistd.h. + (SSIZE_MAX, INITIAL_BUF_SIZE): Remove. + (malloc, realloc): Remove #undefs. + (areadlink, areadlinkat): Rewrite in terms of careadlinkat. + * modules/areadlink (Depends-on): Add careadlinkat. Remove + readlink, ssize_t, stdint, unistd. + * modules/areadlinkat (Depends-on): Add careadlinkat. Remove + areadlink, stdint. + + careadlinkat: new module + * lib/allocator.h, lib/careadlinkat.h, lib/careadlinkat.c: + * modules/careadlinkat: New files, written by me with + a review and feedback from Ben Pfaff in + . + 2011-04-01 Bruno Haible wmemchr, wcschr, wcsrchr, wcspbrk, wcsstr: Avoid errors in C++ mode. @@ -606,7 +2252,7 @@ Reported by Tom G. Christensen . 2011-03-20 Paul Eggert - Bruno Haible + Bruno Haible socklen: do not depend on sys_socket While trying to modify Emacs to use gnulib's socklen module, @@ -643,7 +2289,7 @@ * m4/socklen.m4: Update comment about platforms. 2011-03-19 Paul Eggert - Bruno Haible + Bruno Haible inet_ntop, inet_pton: Simplify. * modules/inet_ntop (Depends-on): Remove socklen, since sys_socket is @@ -652,7 +2298,7 @@ * lib/arpa_inet.in.h: Adjust comment. 2011-03-19 Paul Eggert - Bruno Haible + Bruno Haible netdb: Simplify. * modules/netdb (Depends-on): Remove socklen, since sys_socket is @@ -741,7 +2387,7 @@ (check): Depend on the new variable, not the hard-coded list. 2011-03-13 Bastien Roucariès - Bruno Haible + Bruno Haible passfd module, part 3. * lib/passfd.h (recvfd): Add a flags argument. @@ -917,8 +2563,8 @@ Suggested by Simon Josefsson . 2011-02-28 Corinna Vinschen (tiny change) - Charles Wilson (tiny change) - Bruno Haible (tiny change) + Charles Wilson (tiny change) + Bruno Haible (tiny change) On Cygwin, use /proc file system instead of win32 API. * lib/relocatable.c: On Cygwin, use file names from /proc, rather than @@ -2765,7 +4411,7 @@ * lib/strerror_r.c (strerror_r): Fix return type. 2011-01-21 Pádraig Brady - Bruno Haible + Bruno Haible uN_strstr: New unit tests. * modules/unistr/u8-strstr-tests: New file. @@ -2777,7 +4423,7 @@ * tests/unistr/test-u32-strstr.c: New file. 2011-01-21 Pádraig Brady - Bruno Haible + Bruno Haible Make uN_strstr functions O(n) worst-case. * lib/unistr/u-strstr.h (FUNC): In the 8-bit case, use strstr. In the @@ -2801,7 +4447,7 @@ (configure.ac): Update required libunistring version. 2011-01-21 Pádraig Brady - Bruno Haible + Bruno Haible Prepare for faster uN_strstr functions. * lib/str-kmp.h: Support definable UNITs. @@ -4344,7 +5990,7 @@ http://sourceware.org/bugzilla/show_bug.cgi?id=12348 2010-12-28 Bruno Haible - Paul Eggert + Paul Eggert linkat: Make implementation robust against system behaviour variations. * m4/link-follow.m4 (gl_FUNC_LINK_FOLLOWS_SYMLINK): Define @@ -5377,7 +7023,7 @@ relate to each other. 2010-12-15 Pádraig Brady - Bruno Haible + Bruno Haible Improve cross-compilation guesses for uClibc. * m4/memmem.m4 (gl_FUNC_MEMMEM_SIMPLE): When cross-compiling, assume @@ -5613,7 +7259,7 @@ * m4/strerror_r.m4 (gl_FUNC_STRERROR_R): Fix typo. 2010-11-28 Bruno Haible - Paul Eggert + Paul Eggert Tests for module 'getdomainname'. * modules/getdomainname-tests: New file. @@ -5621,7 +7267,7 @@ tests/test-gethostname.c. 2010-11-28 Bruno Haible - Paul Eggert + Paul Eggert getdomainname: Use the system function when possible. * lib/unistd.in.h: Include , for getdomainname's declaration. @@ -7169,7 +8815,7 @@ styles, and some unnecessary blank lines. 2010-10-03 Bruno Haible - Joachim Schmitz (tiny change) + Joachim Schmitz (tiny change) acl: Add support for ACLs on NonStop Kernel. * m4/acl.m4 (gl_FUNC_ACL): For Solaris, test for facl(), not for acl(). @@ -7441,7 +9087,7 @@ Reported by Paul Eggert. 2010-09-22 Pádraig Brady - Bruno Haible + Bruno Haible Fix endless loop in mbmemcasecoll. * lib/mbmemcasecoll.c (apply_towlower): When mbrtowc returns 0, copy 1 @@ -8217,7 +9863,7 @@ Reported by Johan Hattne . 2010-08-29 Ralf Wildenhues - Bruno Haible + Bruno Haible Make the module 'realloc-gnu' work again on AIX and OSF/1. * m4/realloc.m4 (gl_FUNC_REALLOC_GNU): Define HAVE_REALLOC_GNU instead @@ -8228,7 +9874,7 @@ * modules/realloc-gnu (configure.ac): Use gl_MODULE_INDICATOR. 2010-08-29 Ralf Wildenhues - Bruno Haible + Bruno Haible Make the module 'calloc-gnu' work again on AIX and OSF/1. * m4/calloc.m4 (gl_FUNC_CALLOC_GNU): Define HAVE_CALLOC_GNU instead of @@ -8239,7 +9885,7 @@ * modules/calloc-gnu (configure.ac): Invoke gl_MODULE_INDICATOR. 2010-08-29 Ralf Wildenhues - Bruno Haible + Bruno Haible Make the module 'malloc-gnu' work again on AIX and OSF/1. * m4/malloc.m4 (gl_FUNC_MALLOC_GNU): Define HAVE_MALLOC_GNU instead of @@ -8315,8 +9961,8 @@ * lib/read-file.c (fread_file): Shrink the buffer at the end. 2010-08-28 Giuseppe Scrivano - Eric Blake - Bruno Haible + Eric Blake + Bruno Haible read-file: Avoid memory reallocations with regular files. * lib/read-file.c: Include , , . @@ -8654,7 +10300,7 @@ (Match-end-of-line Operator): Mention 'not_eol'. 2010-08-14 Brian Gough - Bruno Haible + Bruno Haible git-merge-changelog: add doc relating to use with bzr and hg. * lib/git-merge-changelog.c: Add comments regarding bzr, hg, diff3. @@ -9345,7 +10991,7 @@ * modules/strtod-tests (Makefile.am): Likewise. 2010-07-11 Pádraig Brady - Bruno Haible + Bruno Haible unistr/u8-strchr: Optimize ASCII argument case. * lib/unistr/u8-strchr.c (u8_strchr): For ASCII arguments, use strchr. @@ -9703,7 +11349,7 @@ * tests/test-inttostr.c: New file. Test these functions. 2010-06-09 Ben Pfaff - Bruno Haible + Bruno Haible Add "Extending Gnulib" chapter to manual. * doc/gnulib.texi (Writing Modules): Add cross-reference to new @@ -9743,7 +11389,7 @@ Suggested by Eric Blake. 2010-06-04 Martin Lambers - Bruno Haible + Bruno Haible havelib: Allow library names with '+' characters. * m4/lib-link.m4 (AC_LIB_LINKFLAGS, AC_LIB_HAVE_LINKFLAGS, @@ -9999,7 +11645,7 @@ * modules/libunistring-optional (Files): Likewise. 2010-05-18 Paolo Bonzini - Bruno Haible + Bruno Haible New module 'libunistring-optional'. * modules/libunistring-optional: New file. @@ -11551,7 +13197,7 @@ (func_import): Set the excl_*_tests variables to empty. 2010-04-25 Simon Josefsson - Bruno Haible + Bruno Haible Work around a MacOS X 10.4 bug with openpty. * doc/glibc-functions/openpty.texi: Mention the MacOS X 10.4 bug. @@ -11620,7 +13266,7 @@ EPIPE. 2010-04-20 Simon Josefsson - Bruno Haible + Bruno Haible visibility: Don't use -fvisibility if it leads to a warning. * m4/visibility.m4 (gl_VISIBILITY): Check whether -Werror is usable. If @@ -11656,7 +13302,7 @@ Reported by Ian Beckwith . 2010-04-18 Andreas Gruenbacher - Bruno Haible + Bruno Haible diffseq: Accommodate use-case with abstract arrays. * lib/diffseq.h (struct context): Remove xvec, yvec fields if ELEMENT @@ -11807,7 +13453,7 @@ declared. 2010-04-11 Paolo Bonzini - Bruno Haible + Bruno Haible libunistring: Improve configure output. * m4/libunistring.m4 (gl_LIBUNISTRING): Check for libiconv first. @@ -12230,14 +13876,14 @@ Reported by Hauke Fath . 2010-04-04 Hauke Fath (tiny change) - Bruno Haible + Bruno Haible wchar: Port to NetBSD 1.5. * lib/wchar.in.h (WEOF): Provide fallback also when wint_t exists. * lib/wctype.in.h (WEOF): Likewise. 2010-04-04 Hauke Fath (tiny change) - Bruno Haible + Bruno Haible Port extended stdio to NetBSD 1.5. * lib/stdio-impl.h [NetBSD]: Include . @@ -13018,7 +14664,7 @@ $(LIBSOCKET). 2010-03-28 Bruno Haible - Ralf Wildenhues + Ralf Wildenhues lib-ignore: Determine different options for different compilers. * m4/lib-ignore.m4 (gl_IGNORE_UNUSED_LIBRARIES): Set a variable which diff -r 04ce36b456cc -r 6758fa38915e DEPENDENCIES --- a/DEPENDENCIES Fri Apr 01 16:04:45 2011 -0700 +++ b/DEPENDENCIES Fri May 06 08:15:59 2011 -0700 @@ -90,7 +90,9 @@ http://ftp.gnu.org/gnu/grep/ ftp://ftp.gnu.org/gnu/grep/ -* GNU gettext 0.16.1. +* GNU gettext. + + Always use the newest available gettext release, see + . + Recommended. Needed if you use modules that use internationalization (many do). + Homepage: diff -r 04ce36b456cc -r 6758fa38915e MODULES.html.sh --- a/MODULES.html.sh Fri Apr 01 16:04:45 2011 -0700 +++ b/MODULES.html.sh Fri May 06 08:15:59 2011 -0700 @@ -2353,6 +2353,7 @@ func_module futimens func_module getaddrinfo func_module getcwd + func_module getcwd-lgpl func_module getgroups func_module gethostname func_module getlogin @@ -2464,6 +2465,7 @@ func_module sys_stat func_module sys_time func_module sys_times + func_module sys_uio func_module sys_utsname func_module sys_wait func_module tsearch @@ -3474,6 +3476,7 @@ func_module gnupload func_module maintainer-makefile func_module mktempd + func_module readme-release func_module update-copyright func_module useless-if-before-free func_module vc-list-files diff -r 04ce36b456cc -r 6758fa38915e NEWS --- a/NEWS Fri Apr 01 16:04:45 2011 -0700 +++ b/NEWS Fri May 06 08:15:59 2011 -0700 @@ -12,6 +12,20 @@ Date Modules Changes +2011-05-02 exit The module is removed. It was deprecated + on 2010-03-05. Use 'stdlib' directly instead. + +2011-04-27 mgetgroups The 'xgetgroups' function has been split into + a new 'xgetgroups' module. + +2011-04-27 save-cwd This module pulls in fewer dependencies by + default; to retain robust handling of directories + with an absolute name longer than PATH_MAX, you + must now explicitly include the 'getcwd' module. + +2011-04-19 close-hook This module has been renamed to 'fd-hook' and + generalized. + 2011-03-08 regex-quote The last argument is no longer an 'int cflags' but instead a pointer to a previously constructed 'struct regex_quote_spec'. diff -r 04ce36b456cc -r 6758fa38915e build-aux/announce-gen --- a/build-aux/announce-gen Fri Apr 01 16:04:45 2011 -0700 +++ b/build-aux/announce-gen Fri May 06 08:15:59 2011 -0700 @@ -3,7 +3,7 @@ if 0; # Generate a release announcement message. -my $VERSION = '2010-05-03 20:17'; # UTC +my $VERSION = '2011-04-29 21:01'; # UTC # The definition above must lie within the first 8 lines in order # for the Emacs time-stamp write hook (at end) to update it. # If you change this file with Emacs, please let the write hook @@ -106,7 +106,7 @@ my $t = `$cmd`; # FIXME-someday: give a better diagnostic, a la $PROCESS_STATUS $@ - and (warn "$ME: command failed: `$cmd'\n"), $fail = 1; + and (warn "$ME: command failed: `$cmd'\n"), $fail = 1; chomp $t; $t =~ s/^([\d.]+[MkK]).*/${1}B/; $res{$f} = $t; @@ -128,12 +128,12 @@ foreach my $url (@{$url}) { for my $file (@file) - { - print " $url/$file"; - print " (", $$size{$file}, ")" - if exists $$size{$file}; - print "\n"; - } + { + print " $url/$file"; + print " (", $$size{$file}, ")" + if exists $$size{$file}; + print "\n"; + } } print "\n"; } @@ -154,17 +154,17 @@ foreach my $meth (qw (md5 sha1)) { foreach my $f (@file) - { - open IN, '<', $f - or die "$ME: $f: cannot open for reading: $!\n"; - binmode IN; - my $dig = - ($meth eq 'md5' - ? Digest::MD5->new->addfile(*IN)->hexdigest - : Digest::SHA1->new->addfile(*IN)->hexdigest); - close IN; - print "$dig $f\n"; - } + { + open IN, '<', $f + or die "$ME: $f: cannot open for reading: $!\n"; + binmode IN; + my $dig = + ($meth eq 'md5' + ? Digest::MD5->new->addfile(*IN)->hexdigest + : Digest::SHA1->new->addfile(*IN)->hexdigest); + close IN; + print "$dig $f\n"; + } } print "\n"; } @@ -180,7 +180,10 @@ { my ($news_file, $prev_version, $curr_version) = @_; - print "\n$news_file\n\n"; + my $news_name = $news_file; + $news_name =~ s|^\./||; + + print "\n$news_name\n\n"; # Print all lines from $news_file, starting with the first one # that mentions $curr_version up to but not including @@ -194,24 +197,24 @@ while (defined (my $line = )) { if ( ! $in_items) - { - # Match lines like these: - # * Major changes in release 5.0.1: - # * Noteworthy changes in release 6.6 (2006-11-22) [stable] - $line =~ /^$re_prefix.*(?:[^\d.]|$)\Q$curr_version\E(?:[^\d.]|$)/o - or next; - $in_items = 1; - print $line; - } + { + # Match lines like these: + # * Major changes in release 5.0.1: + # * Noteworthy changes in release 6.6 (2006-11-22) [stable] + $line =~ /^$re_prefix.*(?:[^\d.]|$)\Q$curr_version\E(?:[^\d.]|$)/o + or next; + $in_items = 1; + print $line; + } else - { - # This regexp must not match version numbers in NEWS items. - # For example, they might well say `introduced in 4.5.5', - # and we don't want that to match. - $line =~ /^$re_prefix.*(?:[^\d.]|$)\Q$prev_version\E(?:[^\d.]|$)/o - and last; - print $line; - } + { + # This regexp must not match version numbers in NEWS items. + # For example, they might well say `introduced in 4.5.5', + # and we don't want that to match. + $line =~ /^$re_prefix.*(?:[^\d.]|$)\Q$prev_version\E(?:[^\d.]|$)/o + and last; + print $line; + } } close NEWS; @@ -229,8 +232,8 @@ use File::Find; my @changelog; find ({wanted => sub {$_ eq 'ChangeLog' && -d 'CVS' - and push @changelog, $File::Find::name}}, - '.'); + and push @changelog, $File::Find::name}}, + '.'); # If there are no ChangeLog files, we're done. @changelog @@ -255,7 +258,7 @@ my $dot_slash = $d eq '.' ? $d : "./$d"; my $target = "$dot_slash/ChangeLog"; delete $changelog{$target} - and push @reordered, $target; + and push @reordered, $target; } # Append any remaining ChangeLog files. @@ -282,20 +285,20 @@ while (defined (my $line = )) { if ($line =~ /^\+\+\+ /) - { - my $separator = "*"x70 ."\n"; - $line =~ s///; - $line =~ s/\s.*//; - $prev_printed_line_empty - or print "\n"; - print $separator, $line, $separator; - } + { + my $separator = "*"x70 ."\n"; + $line =~ s///; + $line =~ s/\s.*//; + $prev_printed_line_empty + or print "\n"; + print $separator, $line, $separator; + } elsif ($line =~ /^\+/) - { - $line =~ s///; - print $line; - $prev_printed_line_empty = ($line =~ /^$/); - } + { + $line =~ s///; + print $line; + $prev_printed_line_empty = ($line =~ /^$/); + } } close DIFF; @@ -316,25 +319,25 @@ foreach my $t (@$tool_list) { if ($t eq 'gnulib') - { - push @tool_version_pair, ucfirst $t . ' ' . $gnulib_version; - next; - } + { + push @tool_version_pair, ucfirst $t . ' ' . $gnulib_version; + next; + } # Assume that the last "word" on the first line of # `tool --version` output is the version string. my ($first_line, undef) = split ("\n", `$t --version`); if ($first_line =~ /.* (\d[\w.-]+)$/) - { - $t = ucfirst $t; - push @tool_version_pair, "$t $1"; - } + { + $t = ucfirst $t; + push @tool_version_pair, "$t $1"; + } else - { - defined $first_line - and $first_line = ''; - warn "$ME: $t: unexpected --version output\n:$first_line"; - $fail = 1; - } + { + defined $first_line + and $first_line = ''; + warn "$ME: $t: unexpected --version output\n:$first_line"; + $fail = 1; + } } $fail @@ -398,8 +401,8 @@ grep (/^gnulib$/, @tool_list) ^ defined $gnulib_version and (warn "$ME: when specifying gnulib as a tool, you must also specify\n" - . "--gnulib-version=V, where V is the result of running git describe\n" - . "in the gnulib source directory.\n"), $fail = 1; + . "--gnulib-version=V, where V is the result of running git describe\n" + . "in the gnulib source directory.\n"), $fail = 1; exists $valid_release_types{$release_type} or (warn "$ME: `$release_type': invalid release type\n"), $fail = 1; @@ -448,11 +451,11 @@ print_locations ("compressed sources", @url_dir_list, %size, @tarballs); -f $xd and print_locations ("xdelta diffs (useful? if so, " - . "please tell bug-gnulib\@gnu.org)", - @url_dir_list, %size, $xd); + . "please tell bug-gnulib\@gnu.org)", + @url_dir_list, %size, $xd); my @sig_files = map { "$_.sig" } @tarballs; print_locations ("GPG detached signatures[*]", @url_dir_list, %size, - @sig_files); + @sig_files); if ($url_dir_list[0] =~ "gnu\.org") { print "To reduce load on the main server, use a mirror listed at:\n"; diff -r 04ce36b456cc -r 6758fa38915e build-aux/bootstrap --- a/build-aux/bootstrap Fri Apr 01 16:04:45 2011 -0700 +++ b/build-aux/bootstrap Fri May 06 08:15:59 2011 -0700 @@ -1,6 +1,6 @@ #! /bin/sh # Print a version string. -scriptversion=2011-03-03.12; # UTC +scriptversion=2011-05-03.08; # UTC # Bootstrap this package from checked-out sources. @@ -130,18 +130,7 @@ m4_base=m4 doc_base=doc tests_base=tests - -# Extra files from gnulib, which override files from other sources. -gnulib_extra_files=" - $build_aux/install-sh - $build_aux/missing - $build_aux/mdate-sh - $build_aux/texinfo.tex - $build_aux/depcomp - $build_aux/config.guess - $build_aux/config.sub - doc/INSTALL -" +gnulib_extra_files='' # Additional gnulib-tool options to use. Use "\newline" to break lines. gnulib_tool_option_extras= @@ -229,6 +218,18 @@ *) test -r "$0.conf" && . ./"$0.conf" ;; esac +# Extra files from gnulib, which override files from other sources. +test -z "${gnulib_extra_files}" && \ + gnulib_extra_files=" + $build_aux/install-sh + $build_aux/missing + $build_aux/mdate-sh + $build_aux/texinfo.tex + $build_aux/depcomp + $build_aux/config.guess + $build_aux/config.sub + doc/INSTALL +" if test "$vc_ignore" = auto; then vc_ignore= @@ -278,14 +279,29 @@ exit 1 fi +# Ensure that lines starting with ! sort last, per gitignore conventions +# for whitelisting exceptions after a more generic blacklist pattern. +sort_patterns() { + sort -u "$@" | sed '/^!/ { + H + d + } + $ { + P + x + s/^\n// + }' +} + # If $STR is not already on a line by itself in $FILE, insert it, # sorting the new contents of the file and replacing $FILE with the result. insert_sorted_if_absent() { file=$1 str=$2 test -f $file || touch $file - echo "$str" | sort -u - $file | cmp - $file > /dev/null \ - || echo "$str" | sort -u - $file -o $file \ + echo "$str" | sort_patterns - $file | cmp - $file > /dev/null \ + || { echo "$str" | sort_patterns - $file > $file.bak \ + && mv $file.bak $file; } \ || exit 1 } @@ -405,7 +421,10 @@ # Honor $APP variables ($TAR, $AUTOCONF, etc.) appvar=`echo $app | tr '[a-z]-' '[A-Z]_'` test "$appvar" = TAR && appvar=AMTAR - eval "app=\${$appvar-$app}" + case $appvar in + GZIP) ;; # Do not use $GZIP: it contains gzip options. + *) eval "app=\${$appvar-$app}" ;; + esac inst_ver=$(get_version $app) if [ ! "$inst_ver" ]; then echo "$me: Error: '$app' not found" >&2 diff -r 04ce36b456cc -r 6758fa38915e build-aux/config.sub --- a/build-aux/config.sub Fri Apr 01 16:04:45 2011 -0700 +++ b/build-aux/config.sub Fri May 06 08:15:59 2011 -0700 @@ -286,6 +286,7 @@ | nds32 | nds32le | nds32be \ | nios | nios2 \ | ns16k | ns32k \ + | open8 \ | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle \ @@ -394,6 +395,7 @@ | nds32-* | nds32le-* | nds32be-* \ | nios-* | nios2-* \ | none-* | np1-* | ns16k-* | ns32k-* \ + | open8-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ diff -r 04ce36b456cc -r 6758fa38915e build-aux/depcomp --- a/build-aux/depcomp Fri Apr 01 16:04:45 2011 -0700 +++ b/build-aux/depcomp Fri May 06 08:15:59 2011 -0700 @@ -1,10 +1,10 @@ #! /bin/sh # depcomp - compile a program generating dependencies as side-effects -scriptversion=2010-10-07.20; # UTC +scriptversion=2011-04-16.09; # UTC -# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009, 2010 -# Free Software Foundation, Inc. +# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009, 2010, +# 2011 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -166,10 +166,12 @@ ' < "$tmpdepfile" | ## Some versions of gcc put a space before the `:'. On the theory ## that the space means something, we add a space to the output as -## well. +## well. hp depmode also adds that space, but also prefixes the VPATH +## to the object. Take care to not repeat it in the output. ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. - sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" + sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \ + | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; @@ -557,7 +559,9 @@ touch "$tmpdepfile" ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" rm -f "$depfile" - cat < "$tmpdepfile" > "$depfile" + # makedepend may prepend the VPATH from the source file name to the object. + # No need to regex-escape $object, excess matching of '.' is harmless. + sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile" sed '1,2d' "$tmpdepfile" | tr ' ' ' ' | \ ## Some versions of the HPUX 10.20 sed can't process this invocation diff -r 04ce36b456cc -r 6758fa38915e build-aux/do-release-commit-and-tag --- a/build-aux/do-release-commit-and-tag Fri Apr 01 16:04:45 2011 -0700 +++ b/build-aux/do-release-commit-and-tag Fri May 06 08:15:59 2011 -0700 @@ -3,7 +3,7 @@ # controlled .prev-version file, automate the procedure by which we record # the date, release-type and version string in the NEWS file. That commit # will serve to identify the release, so apply a signed tag to it as well. -VERSION=2010-06-07.07 # UTC +VERSION=2011-05-04.11 # UTC # Note: this is a bash script (could be zsh or dash) @@ -32,7 +32,7 @@ { case $1 in --help) cat <} instead of @code{} +on some platforms: +MacOS X 10.5. @end itemize Portability problems not fixed by Gnulib: @itemize @end itemize + +The gnulib module @code{clean-temp} can create temporary files that will not +be left behind after signals such as SIGINT. diff -r 04ce36b456cc -r 6758fa38915e doc/glibc-functions/strchrnul.texi --- a/doc/glibc-functions/strchrnul.texi Fri Apr 01 16:04:45 2011 -0700 +++ b/doc/glibc-functions/strchrnul.texi Fri May 06 08:15:59 2011 -0700 @@ -7,8 +7,13 @@ Portability problems fixed by Gnulib: @itemize @item -This function is missing on all non-glibc platforms: -MacOS X 10.5, FreeBSD 6.0, NetBSD 5.0, OpenBSD 3.8, AIX 5.1, HP-UX 11, IRIX 6.5, OSF/1 5.1, Solaris 10, Cygwin, mingw, Interix 3.5, BeOS. +This function is missing on many non-glibc platforms: +MacOS X 10.5, FreeBSD 6.0, NetBSD 5.0, OpenBSD 3.8, AIX 5.1, HP-UX 11, +IRIX 6.5, OSF/1 5.1, Solaris 10, Cygwin 1.7.8, mingw, Interix 3.5, +BeOS. +@item +This function crashes when no occurrence is found on some platforms: +Cygwin 1.7.9. @end itemize Portability problems not fixed by Gnulib: diff -r 04ce36b456cc -r 6758fa38915e doc/gnulib-tool.texi --- a/doc/gnulib-tool.texi Fri Apr 01 16:04:45 2011 -0700 +++ b/doc/gnulib-tool.texi Fri May 06 08:15:59 2011 -0700 @@ -287,7 +287,7 @@ @samp{_GNU_SOURCE} may be ineffective, or may have only a limited effect, if defined after the first system header file is included. -Finally, note that you can not use @code{AC_LIBOBJ} or +Finally, note that you cannot use @code{AC_LIBOBJ} or @code{AC_REPLACE_FUNCS} in your @file{configure.ac} and expect the resulting object files to be automatically added to @file{lib/libgnu.a}. This is because your @code{AC_LIBOBJ} and @code{AC_REPLACE_FUNCS} invocations diff -r 04ce36b456cc -r 6758fa38915e doc/gnulib.texi --- a/doc/gnulib.texi Fri Apr 01 16:04:45 2011 -0700 +++ b/doc/gnulib.texi Fri May 06 08:15:59 2011 -0700 @@ -396,6 +396,15 @@ depend on tests modules. (Recall that tests modules are built in a separate directory.) +Each listed required module may be declared a conditional dependency. This +is indicated by placing the condition for the dependency on the same line, +enclosed in brackets, after the name of the required module. The condition +is a shell expression that is run after the module's @code{configure.ac} +statements. For example: +@smallexample +strtoull [test $ac_cv_func_strtoumax = no] +@end smallexample + @item configure.ac-early This field contains @file{configure.ac} stuff (Autoconf macro invocations and shell statements) that are logically placed early in the @file{configure.ac} diff -r 04ce36b456cc -r 6758fa38915e doc/posix-functions/accept.texi --- a/doc/posix-functions/accept.texi Fri Apr 01 16:04:45 2011 -0700 +++ b/doc/posix-functions/accept.texi Fri May 06 08:15:59 2011 -0700 @@ -10,7 +10,7 @@ @itemize @item On Windows platforms (excluding Cygwin), the descriptors returned by -the @code{accept} function can not be used in calls to @code{read}, +the @code{accept} function cannot be used in calls to @code{read}, @code{write}, and @code{close}; you have to use @code{recv}, @code{send}, @code{closesocket} in these cases instead. @item @@ -22,7 +22,7 @@ Portability problems not fixed by Gnulib: @itemize @item -On BeOS, the descriptors returned by the @code{accept} function can not be used +On BeOS, the descriptors returned by the @code{accept} function cannot be used in calls to @code{read}, @code{write}, and @code{close}; you have to use @code{recv}, @code{send}, @code{closesocket} in these cases instead. @item diff -r 04ce36b456cc -r 6758fa38915e doc/posix-functions/dup2.texi --- a/doc/posix-functions/dup2.texi Fri Apr 01 16:04:45 2011 -0700 +++ b/doc/posix-functions/dup2.texi Fri May 06 08:15:59 2011 -0700 @@ -4,9 +4,9 @@ POSIX specification:@* @url{http://www.opengroup.org/onlinepubs/9699919799/functions/dup2.html} -Gnulib module: dup2 +Gnulib module: dup2 or dup2-obsolete -Portability problems fixed by Gnulib: +Portability problems fixed by either Gnulib module @code{dup2} or @code{dup2-obsolete}: @itemize @item This function always returns 0 for success on some platforms: @@ -34,7 +34,10 @@ extremely large targets, which interferes with using @code{dup2(fd,fd)==fd)} as the minimal @code{EBADF} filter: FreeBSD 6.1, Cygwin 1.5. +@end itemize +Portability problems fixed by Gnulib module @code{dup2-obsolete}: +@itemize @item This function is missing on some older platforms. @end itemize diff -r 04ce36b456cc -r 6758fa38915e doc/posix-functions/fclose.texi --- a/doc/posix-functions/fclose.texi Fri Apr 01 16:04:45 2011 -0700 +++ b/doc/posix-functions/fclose.texi Fri May 06 08:15:59 2011 -0700 @@ -4,9 +4,17 @@ POSIX specification:@* @url{http://www.opengroup.org/onlinepubs/9699919799/functions/fclose.html} -Gnulib module: fclose +Gnulib module: fclose, fflush -Portability problems fixed by Gnulib: +Portability problems fixed by Gnulib module @code{fclose} together with module @code{fflush}: +@itemize +@item +On some platforms, this function fails to set the file position of a +seekable input stream to the byte after the last one actually read: +glibc 2.13, FreeBSD. +@end itemize + +Portability problems fixed by Gnulib module @code{fclose}: @itemize @item On Windows platforms (excluding Cygwin), @code{socket} and @code{accept} diff -r 04ce36b456cc -r 6758fa38915e doc/posix-functions/fgetc.texi --- a/doc/posix-functions/fgetc.texi Fri Apr 01 16:04:45 2011 -0700 +++ b/doc/posix-functions/fgetc.texi Fri May 06 08:15:59 2011 -0700 @@ -4,10 +4,15 @@ POSIX specification:@* @url{http://www.opengroup.org/onlinepubs/9699919799/functions/fgetc.html} -Gnulib module: --- +Gnulib module: stdio, nonblocking -Portability problems fixed by Gnulib: +Portability problems fixed by Gnulib module @code{stdio}, together with module @code{nonblocking}: @itemize +@item +When reading from a non-blocking pipe whose buffer is empty, this function +fails with @code{errno} being set to @code{EINVAL} instead of @code{EAGAIN} on +some platforms: +mingw. @end itemize Portability problems not fixed by Gnulib: diff -r 04ce36b456cc -r 6758fa38915e doc/posix-functions/fgets.texi --- a/doc/posix-functions/fgets.texi Fri Apr 01 16:04:45 2011 -0700 +++ b/doc/posix-functions/fgets.texi Fri May 06 08:15:59 2011 -0700 @@ -4,10 +4,15 @@ POSIX specification:@* @url{http://www.opengroup.org/onlinepubs/9699919799/functions/fgets.html} -Gnulib module: --- +Gnulib module: stdio, nonblocking -Portability problems fixed by Gnulib: +Portability problems fixed by Gnulib module @code{stdio}, together with module @code{nonblocking}: @itemize +@item +When reading from a non-blocking pipe whose buffer is empty, this function +fails with @code{errno} being set to @code{EINVAL} instead of @code{EAGAIN} on +some platforms: +mingw. @end itemize Portability problems not fixed by Gnulib: diff -r 04ce36b456cc -r 6758fa38915e doc/posix-functions/fprintf.texi --- a/doc/posix-functions/fprintf.texi Fri Apr 01 16:04:45 2011 -0700 +++ b/doc/posix-functions/fprintf.texi Fri May 06 08:15:59 2011 -0700 @@ -4,7 +4,7 @@ POSIX specification:@* @url{http://www.opengroup.org/onlinepubs/9699919799/functions/fprintf.html} -Gnulib module: fprintf-posix or stdio, sigpipe +Gnulib module: fprintf-posix or stdio, nonblocking, sigpipe Portability problems fixed by Gnulib module @code{fprintf-posix}: @itemize @@ -64,6 +64,15 @@ MacOS X 10.3, FreeBSD 6.0, NetBSD 5.0. @end itemize +Portability problems fixed by Gnulib module @code{stdio} or @code{fprintf-posix}, together with module @code{nonblocking}: +@itemize +@item +When writing to a non-blocking pipe whose buffer is full, this function fails +with @code{errno} being set to @code{ENOSPC} instead of @code{EAGAIN} on some +platforms: +mingw. +@end itemize + Portability problems fixed by Gnulib module @code{stdio} or @code{fprintf-posix}, together with module @code{sigpipe}: @itemize @item diff -r 04ce36b456cc -r 6758fa38915e doc/posix-functions/fputc.texi --- a/doc/posix-functions/fputc.texi Fri Apr 01 16:04:45 2011 -0700 +++ b/doc/posix-functions/fputc.texi Fri May 06 08:15:59 2011 -0700 @@ -4,9 +4,18 @@ POSIX specification:@* @url{http://www.opengroup.org/onlinepubs/9699919799/functions/fputc.html} -Gnulib module: stdio, sigpipe +Gnulib module: stdio, nonblocking, sigpipe -Portability problems fixed by Gnulib: +Portability problems fixed by Gnulib module @code{stdio}, together with module @code{nonblocking}: +@itemize +@item +When writing to a non-blocking pipe whose buffer is full, this function fails +with @code{errno} being set to @code{ENOSPC} instead of @code{EAGAIN} on some +platforms: +mingw. +@end itemize + +Portability problems fixed by Gnulib module @code{stdio}, together with module @code{sigpipe}: @itemize @item When writing to a pipe with no readers, this function fails, instead of diff -r 04ce36b456cc -r 6758fa38915e doc/posix-functions/fputs.texi --- a/doc/posix-functions/fputs.texi Fri Apr 01 16:04:45 2011 -0700 +++ b/doc/posix-functions/fputs.texi Fri May 06 08:15:59 2011 -0700 @@ -4,9 +4,18 @@ POSIX specification:@* @url{http://www.opengroup.org/onlinepubs/9699919799/functions/fputs.html} -Gnulib module: stdio, sigpipe +Gnulib module: stdio, nonblocking, sigpipe -Portability problems fixed by Gnulib: +Portability problems fixed by Gnulib module @code{stdio}, together with module @code{nonblocking}: +@itemize +@item +When writing to a non-blocking pipe whose buffer is full, this function fails +with @code{errno} being set to @code{ENOSPC} instead of @code{EAGAIN} on some +platforms: +mingw. +@end itemize + +Portability problems fixed by Gnulib module @code{stdio}, together with module @code{sigpipe}: @itemize @item When writing to a pipe with no readers, this function fails, instead of diff -r 04ce36b456cc -r 6758fa38915e doc/posix-functions/fread.texi --- a/doc/posix-functions/fread.texi Fri Apr 01 16:04:45 2011 -0700 +++ b/doc/posix-functions/fread.texi Fri May 06 08:15:59 2011 -0700 @@ -4,10 +4,15 @@ POSIX specification:@* @url{http://www.opengroup.org/onlinepubs/9699919799/functions/fread.html} -Gnulib module: --- +Gnulib module: stdio, nonblocking -Portability problems fixed by Gnulib: +Portability problems fixed by Gnulib module @code{stdio}, together with module @code{nonblocking}: @itemize +@item +When reading from a non-blocking pipe whose buffer is empty, this function +fails with @code{errno} being set to @code{EINVAL} instead of @code{EAGAIN} on +some platforms: +mingw. @end itemize Portability problems not fixed by Gnulib: diff -r 04ce36b456cc -r 6758fa38915e doc/posix-functions/fscanf.texi --- a/doc/posix-functions/fscanf.texi Fri Apr 01 16:04:45 2011 -0700 +++ b/doc/posix-functions/fscanf.texi Fri May 06 08:15:59 2011 -0700 @@ -4,10 +4,15 @@ POSIX specification:@* @url{http://www.opengroup.org/onlinepubs/9699919799/functions/fscanf.html} -Gnulib module: --- +Gnulib module: stdio, nonblocking -Portability problems fixed by Gnulib: +Portability problems fixed by Gnulib module @code{stdio}, together with module @code{nonblocking}: @itemize +@item +When reading from a non-blocking pipe whose buffer is empty, this function +fails with @code{errno} being set to @code{EINVAL} instead of @code{EAGAIN} on +some platforms: +mingw. @end itemize Portability problems not fixed by Gnulib: diff -r 04ce36b456cc -r 6758fa38915e doc/posix-functions/fwrite.texi --- a/doc/posix-functions/fwrite.texi Fri Apr 01 16:04:45 2011 -0700 +++ b/doc/posix-functions/fwrite.texi Fri May 06 08:15:59 2011 -0700 @@ -4,9 +4,18 @@ POSIX specification:@* @url{http://www.opengroup.org/onlinepubs/9699919799/functions/fwrite.html} -Gnulib module: stdio, sigpipe +Gnulib module: stdio, nonblocking, sigpipe -Portability problems fixed by Gnulib: +Portability problems fixed by Gnulib module @code{stdio}, together with module @code{nonblocking}: +@itemize +@item +When writing to a non-blocking pipe whose buffer is full, this function fails +with @code{errno} being set to @code{ENOSPC} instead of @code{EAGAIN} on some +platforms: +mingw. +@end itemize + +Portability problems fixed by Gnulib module @code{stdio}, together with module @code{sigpipe}: @itemize @item When writing to a pipe with no readers, this function fails, instead of diff -r 04ce36b456cc -r 6758fa38915e doc/posix-functions/gai_strerror.texi --- a/doc/posix-functions/gai_strerror.texi Fri Apr 01 16:04:45 2011 -0700 +++ b/doc/posix-functions/gai_strerror.texi Fri May 06 08:15:59 2011 -0700 @@ -10,13 +10,18 @@ @itemize @item This function is missing on some platforms: -HP-UX 11.11, IRIX 6.5, OSF/1 4.0, Solaris 7, Cygwin 1.5.x, mingw, Interix 3.5, BeOS. +HP-UX 11.11, IRIX 6.5, OSF/1 4.0, Solaris 7, Cygwin 1.5.x, Interix +3.5, BeOS. +@item +This function is only available in @code{} on some +platforms: +mingw. +@item +This function's return type is @code{char *} instead of @code{const char *} +on some platforms: +AIX 7.1, HP-UX 11, OSF/1 5.1, Solaris 9, mingw. @end itemize Portability problems not fixed by Gnulib: @itemize -@item -This function's return type is @code{char *} instead of @code{const char *} -on some platforms: -AIX 7.1, HP-UX 11, OSF/1 5.1, Solaris 9. @end itemize diff -r 04ce36b456cc -r 6758fa38915e doc/posix-functions/getc.texi --- a/doc/posix-functions/getc.texi Fri Apr 01 16:04:45 2011 -0700 +++ b/doc/posix-functions/getc.texi Fri May 06 08:15:59 2011 -0700 @@ -4,10 +4,15 @@ POSIX specification:@* @url{http://www.opengroup.org/onlinepubs/9699919799/functions/getc.html} -Gnulib module: --- +Gnulib module: stdio, nonblocking -Portability problems fixed by Gnulib: +Portability problems fixed by Gnulib module @code{stdio}, together with module @code{nonblocking}: @itemize +@item +When reading from a non-blocking pipe whose buffer is empty, this function +fails with @code{errno} being set to @code{EINVAL} instead of @code{EAGAIN} on +some platforms: +mingw. @end itemize Portability problems not fixed by Gnulib: diff -r 04ce36b456cc -r 6758fa38915e doc/posix-functions/getchar.texi --- a/doc/posix-functions/getchar.texi Fri Apr 01 16:04:45 2011 -0700 +++ b/doc/posix-functions/getchar.texi Fri May 06 08:15:59 2011 -0700 @@ -4,10 +4,15 @@ POSIX specification:@* @url{http://www.opengroup.org/onlinepubs/9699919799/functions/getchar.html} -Gnulib module: --- +Gnulib module: stdio, nonblocking -Portability problems fixed by Gnulib: +Portability problems fixed by Gnulib module @code{stdio}, together with module @code{nonblocking}: @itemize +@item +When reading from a non-blocking pipe whose buffer is empty, this function +fails with @code{errno} being set to @code{EINVAL} instead of @code{EAGAIN} on +some platforms: +mingw. @end itemize Portability problems not fixed by Gnulib: diff -r 04ce36b456cc -r 6758fa38915e doc/posix-functions/getcwd.texi --- a/doc/posix-functions/getcwd.texi Fri Apr 01 16:04:45 2011 -0700 +++ b/doc/posix-functions/getcwd.texi Fri May 06 08:15:59 2011 -0700 @@ -4,16 +4,26 @@ POSIX specification:@* @url{http://www.opengroup.org/onlinepubs/9699919799/functions/getcwd.html} -Gnulib module: getcwd +Gnulib module: getcwd or getcwd-lgpl -Portability problems fixed by Gnulib: +Portability problems fixed by either Gnulib module @code{getcwd} or +@code{getcwd-lgpl}: +@itemize +@item +On glibc platforms, @code{getcwd (NULL, n)} allocates memory for the result. +On some other platforms, this call is not allowed. Conversely, mingw fails +to honor non-zero @code{n}. +@item +On some platforms, the prototype for @code{getcwd} uses @code{int} +instead of @code{size_t} for the size argument: +mingw. +@end itemize + +Portability problems fixed by Gnulib module @code{getcwd}: @itemize @item This function is missing on some older platforms. @item -On glibc platforms, @code{getcwd (NULL, n)} allocates memory for the result. -On other platforms, this call is not allowed. -@item This function does not handle long file names (greater than @code{PATH_MAX}) correctly on some platforms. @end itemize diff -r 04ce36b456cc -r 6758fa38915e doc/posix-functions/gets.texi --- a/doc/posix-functions/gets.texi Fri Apr 01 16:04:45 2011 -0700 +++ b/doc/posix-functions/gets.texi Fri May 06 08:15:59 2011 -0700 @@ -4,10 +4,15 @@ POSIX specification:@* @url{http://www.opengroup.org/onlinepubs/9699919799/functions/gets.html} -Gnulib module: --- +Gnulib module: stdio, nonblocking -Portability problems fixed by Gnulib: +Portability problems fixed by Gnulib module @code{stdio}, together with module @code{nonblocking}: @itemize +@item +When reading from a non-blocking pipe whose buffer is empty, this function +fails with @code{errno} being set to @code{EINVAL} instead of @code{EAGAIN} on +some platforms: +mingw. @end itemize Portability problems not fixed by Gnulib: diff -r 04ce36b456cc -r 6758fa38915e doc/posix-functions/iconv.texi --- a/doc/posix-functions/iconv.texi Fri Apr 01 16:04:45 2011 -0700 +++ b/doc/posix-functions/iconv.texi Fri May 06 08:15:59 2011 -0700 @@ -27,8 +27,8 @@ @item This function was not correctly implemented in glibc versions before 2.2. @item -When @code{iconv} encounters an input character that is valid but that can -not be converted to the output character set, glibc's and GNU libiconv's +When @code{iconv} encounters an input character that is valid but that +cannot be converted to the output character set, glibc's and GNU libiconv's @code{iconv} stop the conversion. Some other implementations put an implementation-defined character into the output buffer. --- Gnulib provides higher-level facilities @code{striconv} and @code{striconveh} diff -r 04ce36b456cc -r 6758fa38915e doc/posix-functions/memchr.texi --- a/doc/posix-functions/memchr.texi Fri Apr 01 16:04:45 2011 -0700 +++ b/doc/posix-functions/memchr.texi Fri May 06 08:15:59 2011 -0700 @@ -4,18 +4,21 @@ POSIX specification:@* @url{http://www.opengroup.org/onlinepubs/9699919799/functions/memchr.html} -Gnulib module: memchr +Gnulib module: memchr or memchr-obsolete -Portability problems fixed by Gnulib: +Portability problems fixed by either Gnulib module @code{memchr} or @code{memchr-obsolete}: @itemize @item -This function is missing on some older platforms. - -@item This function dereferences too much memory on some platforms: glibc 2.10 on x86_64, IA-64; glibc 2.11 on Alpha. @end itemize +Portability problems fixed by Gnulib module @code{memchr-obsolete}: +@itemize +@item +This function is missing on some older platforms. +@end itemize + Portability problems not fixed by Gnulib: @itemize @end itemize diff -r 04ce36b456cc -r 6758fa38915e doc/posix-functions/mkstemp.texi --- a/doc/posix-functions/mkstemp.texi Fri Apr 01 16:04:45 2011 -0700 +++ b/doc/posix-functions/mkstemp.texi Fri May 06 08:15:59 2011 -0700 @@ -12,15 +12,22 @@ This function is missing on some platforms: mingw. @item +This function is declared in @code{} instead of @code{} +on some platforms: +MacOS X 10.3. +@item On some platforms (HP-UX 10.20, SunOS 4.1.4, Solaris 2.5.1), mkstemp has a silly limit that it can create no more than 26 files from a given template. On OSF/1 4.0f, it can create only 32 files per process. +@item +On some older platforms, @code{mkstemp} can create a world or group +writable or readable file, if you haven't set the process umask to +077. This is a security risk. @end itemize Portability problems not fixed by Gnulib: @itemize -@item -On platforms other than glibc 2.0.7 or newer, @code{mkstemp} can create a -world or group writable or readable file, if you haven't set the process -umask to 077. This is a security risk. @end itemize + +The gnulib module @code{clean-temp} can create temporary files that will not +be left behind after signals such as SIGINT. diff -r 04ce36b456cc -r 6758fa38915e doc/posix-functions/open.texi --- a/doc/posix-functions/open.texi Fri Apr 01 16:04:45 2011 -0700 +++ b/doc/posix-functions/open.texi Fri May 06 08:15:59 2011 -0700 @@ -14,6 +14,10 @@ directory, on some platforms: FreeBSD 7.2, AIX 7.1, HP-UX 11.00, Solaris 9, Irix 5.3. @item +This function does not support the @code{O_NONBLOCK} flag when it is defined +by the gnulib module @code{nonblock} on some platforms: +mingw. +@item On Windows platforms (excluding Cygwin), this function does usually not recognize the @file{/dev/null} filename. @end itemize diff -r 04ce36b456cc -r 6758fa38915e doc/posix-functions/printf.texi --- a/doc/posix-functions/printf.texi Fri Apr 01 16:04:45 2011 -0700 +++ b/doc/posix-functions/printf.texi Fri May 06 08:15:59 2011 -0700 @@ -4,7 +4,7 @@ POSIX specification:@* @url{http://www.opengroup.org/onlinepubs/9699919799/functions/printf.html} -Gnulib module: printf-posix or stdio, sigpipe +Gnulib module: printf-posix or stdio, nonblocking, sigpipe Portability problems fixed by Gnulib module @code{printf-posix}: @itemize @@ -64,6 +64,15 @@ MacOS X 10.3, FreeBSD 6.0, NetBSD 5.0. @end itemize +Portability problems fixed by Gnulib module @code{stdio} or @code{printf-posix}, together with module @code{nonblocking}: +@itemize +@item +When writing to a non-blocking pipe whose buffer is full, this function fails +with @code{errno} being set to @code{ENOSPC} instead of @code{EAGAIN} on some +platforms: +mingw. +@end itemize + Portability problems fixed by Gnulib module @code{stdio} or @code{printf-posix}, together with module @code{sigpipe}: @itemize @item diff -r 04ce36b456cc -r 6758fa38915e doc/posix-functions/putc.texi --- a/doc/posix-functions/putc.texi Fri Apr 01 16:04:45 2011 -0700 +++ b/doc/posix-functions/putc.texi Fri May 06 08:15:59 2011 -0700 @@ -4,9 +4,18 @@ POSIX specification:@* @url{http://www.opengroup.org/onlinepubs/9699919799/functions/putc.html} -Gnulib module: stdio, sigpipe +Gnulib module: stdio, nonblocking, sigpipe -Portability problems fixed by Gnulib: +Portability problems fixed by Gnulib module @code{stdio}, together with module @code{nonblocking}: +@itemize +@item +When writing to a non-blocking pipe whose buffer is full, this function fails +with @code{errno} being set to @code{ENOSPC} instead of @code{EAGAIN} on some +platforms: +mingw. +@end itemize + +Portability problems fixed by Gnulib module @code{stdio}, together with module @code{sigpipe}: @itemize @item When writing to a pipe with no readers, this function fails, instead of diff -r 04ce36b456cc -r 6758fa38915e doc/posix-functions/putchar.texi --- a/doc/posix-functions/putchar.texi Fri Apr 01 16:04:45 2011 -0700 +++ b/doc/posix-functions/putchar.texi Fri May 06 08:15:59 2011 -0700 @@ -4,9 +4,18 @@ POSIX specification:@* @url{http://www.opengroup.org/onlinepubs/9699919799/functions/putchar.html} -Gnulib module: stdio, sigpipe +Gnulib module: stdio, nonblocking, sigpipe -Portability problems fixed by Gnulib: +Portability problems fixed by Gnulib module @code{stdio}, together with module @code{nonblocking}: +@itemize +@item +When writing to a non-blocking pipe whose buffer is full, this function fails +with @code{errno} being set to @code{ENOSPC} instead of @code{EAGAIN} on some +platforms: +mingw. +@end itemize + +Portability problems fixed by Gnulib module @code{stdio}, together with module @code{sigpipe}: @itemize @item When writing to a pipe with no readers, this function fails, instead of diff -r 04ce36b456cc -r 6758fa38915e doc/posix-functions/puts.texi --- a/doc/posix-functions/puts.texi Fri Apr 01 16:04:45 2011 -0700 +++ b/doc/posix-functions/puts.texi Fri May 06 08:15:59 2011 -0700 @@ -4,9 +4,18 @@ POSIX specification:@* @url{http://www.opengroup.org/onlinepubs/9699919799/functions/puts.html} -Gnulib module: stdio, sigpipe +Gnulib module: stdio, nonblocking, sigpipe -Portability problems fixed by Gnulib: +Portability problems fixed by Gnulib module @code{stdio}, together with module @code{nonblocking}: +@itemize +@item +When writing to a non-blocking pipe whose buffer is full, this function fails +with @code{errno} being set to @code{ENOSPC} instead of @code{EAGAIN} on some +platforms: +mingw. +@end itemize + +Portability problems fixed by Gnulib module @code{stdio}, together with module @code{sigpipe}: @itemize @item When writing to a pipe with no readers, this function fails, instead of diff -r 04ce36b456cc -r 6758fa38915e doc/posix-functions/read.texi --- a/doc/posix-functions/read.texi Fri Apr 01 16:04:45 2011 -0700 +++ b/doc/posix-functions/read.texi Fri May 06 08:15:59 2011 -0700 @@ -4,10 +4,15 @@ POSIX specification:@* @url{http://www.opengroup.org/onlinepubs/9699919799/functions/read.html} -Gnulib module: --- +Gnulib module: stdio, nonblocking -Portability problems fixed by Gnulib: +Portability problems fixed by Gnulib module @code{stdio}, together with module @code{nonblocking}: @itemize +@item +When reading from a non-blocking pipe whose buffer is empty, this function +fails with @code{errno} being set to @code{EINVAL} instead of @code{EAGAIN} on +some platforms: +mingw. @end itemize Portability problems not fixed by Gnulib: diff -r 04ce36b456cc -r 6758fa38915e doc/posix-functions/scanf.texi --- a/doc/posix-functions/scanf.texi Fri Apr 01 16:04:45 2011 -0700 +++ b/doc/posix-functions/scanf.texi Fri May 06 08:15:59 2011 -0700 @@ -4,10 +4,15 @@ POSIX specification:@* @url{http://www.opengroup.org/onlinepubs/9699919799/functions/scanf.html} -Gnulib module: --- +Gnulib module: stdio, nonblocking -Portability problems fixed by Gnulib: +Portability problems fixed by Gnulib module @code{stdio}, together with module @code{nonblocking}: @itemize +@item +When reading from a non-blocking pipe whose buffer is empty, this function +fails with @code{errno} being set to @code{EINVAL} instead of @code{EAGAIN} on +some platforms: +mingw. @end itemize Portability problems not fixed by Gnulib: diff -r 04ce36b456cc -r 6758fa38915e doc/posix-functions/socket.texi --- a/doc/posix-functions/socket.texi Fri Apr 01 16:04:45 2011 -0700 +++ b/doc/posix-functions/socket.texi Fri May 06 08:15:59 2011 -0700 @@ -10,7 +10,7 @@ @itemize @item On Windows platforms (excluding Cygwin), the descriptors returned by -the @code{socket} function can not be used in calls to @code{read}, +the @code{socket} function cannot be used in calls to @code{read}, @code{write}, and @code{close}; you have to use @code{recv}, @code{send}, @code{closesocket} in these cases instead. @item @@ -22,7 +22,7 @@ Portability problems not fixed by Gnulib: @itemize @item -On BeOS, the descriptors returned by the @code{socket} function can not be used +On BeOS, the descriptors returned by the @code{socket} function cannot be used in calls to @code{read}, @code{write}, and @code{close}; you have to use @code{recv}, @code{send}, @code{closesocket} in these cases instead. @end itemize diff -r 04ce36b456cc -r 6758fa38915e doc/posix-functions/strtod.texi --- a/doc/posix-functions/strtod.texi Fri Apr 01 16:04:45 2011 -0700 +++ b/doc/posix-functions/strtod.texi Fri May 06 08:15:59 2011 -0700 @@ -4,14 +4,11 @@ POSIX specification:@* @url{http://www.opengroup.org/onlinepubs/9699919799/functions/strtod.html} -Gnulib module: strtod +Gnulib module: strtod or strtod-obsolete -Portability problems fixed by Gnulib: +Portability problems fixed by either Gnulib module @code{strtod} or @code{strtod-obsolete}: @itemize @item -This function is missing on some old platforms. - -@item This function mis-parses strings with leading @samp{+} on some old platforms: Old versions of Linux. @@ -67,6 +64,12 @@ AIX 7.1. @end itemize +Portability problems fixed by Gnulib module @code{strtod-obsolete}: +@itemize +@item +This function is missing on some old platforms. +@end itemize + Portability problems not fixed by Gnulib: @itemize @item diff -r 04ce36b456cc -r 6758fa38915e doc/posix-functions/vfprintf.texi --- a/doc/posix-functions/vfprintf.texi Fri Apr 01 16:04:45 2011 -0700 +++ b/doc/posix-functions/vfprintf.texi Fri May 06 08:15:59 2011 -0700 @@ -4,7 +4,7 @@ POSIX specification:@* @url{http://www.opengroup.org/onlinepubs/9699919799/functions/vfprintf.html} -Gnulib module: vfprintf-posix or stdio, sigpipe +Gnulib module: vfprintf-posix or stdio, nonblocking, sigpipe Portability problems fixed by Gnulib module @code{vfprintf-posix}: @itemize @@ -64,6 +64,15 @@ MacOS X 10.3, FreeBSD 6.0, NetBSD 5.0. @end itemize +Portability problems fixed by Gnulib module @code{stdio} or @code{vfprintf-posix}, together with module @code{nonblocking}: +@itemize +@item +When writing to a non-blocking pipe whose buffer is full, this function fails +with @code{errno} being set to @code{ENOSPC} instead of @code{EAGAIN} on some +platforms: +mingw. +@end itemize + Portability problems fixed by Gnulib module @code{stdio} or @code{vfprintf-posix}, together with module @code{sigpipe}: @itemize @item diff -r 04ce36b456cc -r 6758fa38915e doc/posix-functions/vfscanf.texi --- a/doc/posix-functions/vfscanf.texi Fri Apr 01 16:04:45 2011 -0700 +++ b/doc/posix-functions/vfscanf.texi Fri May 06 08:15:59 2011 -0700 @@ -4,10 +4,15 @@ POSIX specification:@* @url{http://www.opengroup.org/onlinepubs/9699919799/functions/vfscanf.html} -Gnulib module: --- +Gnulib module: vfscanf, nonblocking -Portability problems fixed by Gnulib: +Portability problems fixed by Gnulib module @code{vfscanf}, together with module @code{nonblocking}: @itemize +@item +When reading from a non-blocking pipe whose buffer is empty, this function +fails with @code{errno} being set to @code{EINVAL} instead of @code{EAGAIN} on +some platforms: +mingw. @end itemize Portability problems not fixed by Gnulib: diff -r 04ce36b456cc -r 6758fa38915e doc/posix-functions/vprintf.texi --- a/doc/posix-functions/vprintf.texi Fri Apr 01 16:04:45 2011 -0700 +++ b/doc/posix-functions/vprintf.texi Fri May 06 08:15:59 2011 -0700 @@ -4,7 +4,7 @@ POSIX specification:@* @url{http://www.opengroup.org/onlinepubs/9699919799/functions/vprintf.html} -Gnulib module: vprintf-posix or stdio, sigpipe +Gnulib module: vprintf-posix or stdio, nonblocking, sigpipe Portability problems fixed by Gnulib module @code{vprintf-posix}: @itemize @@ -64,6 +64,15 @@ MacOS X 10.3, FreeBSD 6.0, NetBSD 5.0. @end itemize +Portability problems fixed by Gnulib module @code{stdio} or @code{vprintf-posix}, together with module @code{nonblocking}: +@itemize +@item +When writing to a non-blocking pipe whose buffer is full, this function fails +with @code{errno} being set to @code{ENOSPC} instead of @code{EAGAIN} on some +platforms: +mingw. +@end itemize + Portability problems fixed by Gnulib module @code{stdio} or @code{vprintf-posix}, together with module @code{sigpipe}: @itemize @item diff -r 04ce36b456cc -r 6758fa38915e doc/posix-functions/vscanf.texi --- a/doc/posix-functions/vscanf.texi Fri Apr 01 16:04:45 2011 -0700 +++ b/doc/posix-functions/vscanf.texi Fri May 06 08:15:59 2011 -0700 @@ -4,10 +4,15 @@ POSIX specification:@* @url{http://www.opengroup.org/onlinepubs/9699919799/functions/vscanf.html} -Gnulib module: --- +Gnulib module: vscanf, nonblocking -Portability problems fixed by Gnulib: +Portability problems fixed by Gnulib module @code{vscanf}, together with module @code{nonblocking}: @itemize +@item +When reading from a non-blocking pipe whose buffer is empty, this function +fails with @code{errno} being set to @code{EINVAL} instead of @code{EAGAIN} on +some platforms: +mingw. @end itemize Portability problems not fixed by Gnulib: diff -r 04ce36b456cc -r 6758fa38915e doc/posix-functions/write.texi --- a/doc/posix-functions/write.texi Fri Apr 01 16:04:45 2011 -0700 +++ b/doc/posix-functions/write.texi Fri May 06 08:15:59 2011 -0700 @@ -4,9 +4,24 @@ POSIX specification:@* @url{http://www.opengroup.org/onlinepubs/9699919799/functions/write.html} -Gnulib module: write, sigpipe +Gnulib module: write, nonblocking, sigpipe -Portability problems fixed by Gnulib: +Portability problems fixed by Gnulib module @code{stdio}, together with module @code{nonblocking}: +@itemize +@item +When writing to a non-blocking pipe whose buffer is full, this function fails +with @code{errno} being set to @code{ENOSPC} instead of @code{EAGAIN} on some +platforms: +mingw. +@item +When writing to a non-blocking pipe on which no reader is currently waiting +an amount of bytes that exceeds the pipe buffer's size, then -- even if the +pipe's buffer is empty -- this function fails, instead of performing a partial +write into the pipe buffer, on some platforms: +mingw. +@end itemize + +Portability problems fixed by Gnulib module @code{stdio}, together with module @code{sigpipe}: @itemize @item When writing to a pipe with no readers, this function fails with error diff -r 04ce36b456cc -r 6758fa38915e doc/posix-headers/assert.texi --- a/doc/posix-headers/assert.texi Fri Apr 01 16:04:45 2011 -0700 +++ b/doc/posix-headers/assert.texi Fri May 06 08:15:59 2011 -0700 @@ -3,12 +3,31 @@ POSIX specification:@* @url{http://www.opengroup.org/onlinepubs/9699919799/basedefs/assert.h.html} -Gnulib module: --- +Gnulib module: assert-h + +See also the Gnulib module @code{assert}. Portability problems fixed by Gnulib: @itemize +@item +The draft C1X and C++0X @code{static_assert}, and the draft C1X +@code{_Static_assert}, are not supported by many platforms. +For example, GCC versions before 4.6.0 do not support @code{_Static_assert}, +and G++ versions through at least 4.6.0 do not support @code{static_assert}. @end itemize Portability problems not fixed by Gnulib: @itemize +@item +Draft C1X @code{_Static_assert} and draft C++0X @code{static_assert} +are keywords that can be used without including @code{}. +The Gnulib substitutes are macros that require including @code{}. +@item +The draft C1X @code{static_assert} and @code{_Static_assert} can also +be used within a @code{struct} or @code{union} specifier, in place of +an ordinary declaration of a member of the struct or union. The +Gnulib substitute can be used only as an ordinary declaration. +@item +In C99, @code{assert} can be applied to any scalar expression. +In C89, the argument to @code{assert} is of type @code{int}. @end itemize diff -r 04ce36b456cc -r 6758fa38915e doc/posix-headers/fcntl.texi --- a/doc/posix-headers/fcntl.texi Fri Apr 01 16:04:45 2011 -0700 +++ b/doc/posix-headers/fcntl.texi Fri May 06 08:15:59 2011 -0700 @@ -9,15 +9,25 @@ @itemize @item @samp{O_CLOEXEC}, @samp{O_DIRECTORY}, @samp{O_DSYNC}, @samp{O_NOCTTY}, -@samp{O_NOFOLLOW}, @samp{O_NONBLOCK}, @samp{O_RSYNC}, @samp{O_SYNC}, +@samp{O_NOFOLLOW}, @samp{O_RSYNC}, @samp{O_SYNC}, and @samp{O_TTY_INIT} are not defined on some platforms. Gnulib defines -these macros to 0. +these macros to 0, which is generally safe. + +@item +@samp{O_NONBLOCK} is not defined on some platforms. If the +@samp{nonblocking} module is in use, gnulib guarantees a working +non-zero value; otherwise, the gnulib replacement is 0. @item @samp{O_EXEC} and @samp{O_SEARCH} are not defined on some platforms. Gnulib defines these macros to @samp{O_RDONLY}, which is typically 0. @item +The @samp{O_ACCMODE} mask mistakenly omits @samp{O_SEARCH} and +@samp{O_EXEC} on some platforms: +Cygwin. + +@item @samp{O_BINARY}, @samp{O_TEXT} (not specified by POSIX, but essential for portability to Woe32 platforms) are defined on some platforms but not on others. diff -r 04ce36b456cc -r 6758fa38915e doc/posix-headers/signal.texi --- a/doc/posix-headers/signal.texi Fri Apr 01 16:04:45 2011 -0700 +++ b/doc/posix-headers/signal.texi Fri May 06 08:15:59 2011 -0700 @@ -28,6 +28,11 @@ @item The macro @code{SA_NODEFER} is not defined on some platforms: Interix 3.5. +@item +The type @code{sighandler_t} (a GNU extension) is not defined on most non-glibc +platforms: +MacOS X 10.5, FreeBSD 6.0, NetBSD 5.0, OpenBSD 3.8, AIX 5.1, HP-UX 11, +IRIX 6.5, OSF/1 5.1, Solaris 11 2010-11, Cygwin, mingw, Interix 3.5, BeOS. @end itemize Portability problems not fixed by Gnulib: diff -r 04ce36b456cc -r 6758fa38915e doc/posix-headers/sys_socket.texi --- a/doc/posix-headers/sys_socket.texi Fri Apr 01 16:04:45 2011 -0700 +++ b/doc/posix-headers/sys_socket.texi Fri May 06 08:15:59 2011 -0700 @@ -17,6 +17,9 @@ This header file does not define the type @code{socklen_t} on some platforms: HP-UX 10.20, IRIX 6.5, OSF/1 4.0, Interix 3.5, BeOS. @item +This header file does not define the type @code{struct iovec} on some platforms: +OpenBSD 4.4. +@item This header file is lacking the @code{SHUT_RD}, @code{SHUT_WR}, @code{SHUT_RDWR} macros on some platforms, despite having the @code{shutdown} functions: @@ -29,4 +32,10 @@ Portability problems not fixed by Gnulib: @itemize +@item +This header file does not declare the @code{msg_control} and +@code{msg_controllen} members of @code{struct msghdr} on some +platforms. This can be detected by the absence of the +@code{CMSG_FIRSTHDR} macro: +gnulib replacement header, old BSD @end itemize diff -r 04ce36b456cc -r 6758fa38915e doc/posix-headers/sys_uio.texi --- a/doc/posix-headers/sys_uio.texi Fri Apr 01 16:04:45 2011 -0700 +++ b/doc/posix-headers/sys_uio.texi Fri May 06 08:15:59 2011 -0700 @@ -3,15 +3,19 @@ POSIX specification:@* @url{http://www.opengroup.org/onlinepubs/9699919799/basedefs/sys_uio.h.html} -Gnulib module: --- +Gnulib module: sys_uio Portability problems fixed by Gnulib: @itemize +@item +This header file is missing on some platforms: +mingw. +@item +This header file is not self-contained (it requires @code{} to be +included first) on some platforms: +OpenBSD 4.4. @end itemize Portability problems not fixed by Gnulib: @itemize -@item -This header file is missing on some platforms: -mingw. @end itemize diff -r 04ce36b456cc -r 6758fa38915e gnulib-tool --- a/gnulib-tool Fri Apr 01 16:04:45 2011 -0700 +++ b/gnulib-tool Fri May 06 08:15:59 2011 -0700 @@ -223,6 +223,10 @@ --avoid=MODULE Avoid including the given MODULE. Useful if you have code that provides equivalent functionality. This option can be repeated. + --conditional-dependencies + Support conditional dependencies (experimental, + may save configure time and object code, not + compatible with --with-tests). --libtool Use libtool rules. --no-libtool Don't use libtool rules. @@ -912,6 +916,8 @@ # - excl_unportable_tests true if --without-unportable-tests was given, blank # otherwise # - avoidlist list of modules to avoid, from --avoid +# - cond_dependencies true if --conditional-dependencies was given, blank +# otherwise # - lgpl yes or a number if --lgpl was given, blank otherwise # - makefile_name from --makefile-name # - libtool true if --libtool was given, false if --no-libtool was @@ -953,6 +959,7 @@ excl_privileged_tests= excl_unportable_tests= avoidlist= + cond_dependencies= lgpl= makefile_name= libtool= @@ -1002,7 +1009,7 @@ --extract-* ) mode=`echo "X$1" | sed -e 's/^X--//'` shift ;; - --copy-file | --copy-fil | --copy-fi | --copy-f | --copy- | --copy | --cop | --co ) + --copy-file | --copy-fil | --copy-fi | --copy-f | --copy- | --copy | --cop ) mode=copy-file shift ;; --dir ) @@ -1153,6 +1160,9 @@ arg=`echo "X$1" | sed -e 's/^X--avoid=//'` func_append avoidlist " $arg" shift ;; + --conditional-dependencies | --conditional-dependencie | --conditional-dependenci | --conditional-dependenc | --conditional-dependen | --conditional-depende | --conditional-depend | --conditional-depen | --conditional-depe | --conditional-dep | --conditional-de | --conditional-d | --conditional- | --conditional | --conditiona | --condition | --conditio | --conditi | --condit | --condi | --cond | --con) + cond_dependencies=true + shift ;; --lgpl ) lgpl=yes shift ;; @@ -1298,6 +1308,10 @@ if test -z "$pobase" && test -n "$po_domain"; then func_warning "--po-domain has no effect without a --po-base option" fi + if test -n "$cond_dependencies" && test -n "$inctests"; then + echo "gnulib-tool: option --conditional-dependencies is not supported with --with-tests" 1>&2 + func_exit 1 + fi # Determine the minimum supported autoconf version from the project's # configure.ac. @@ -2128,11 +2142,13 @@ fi } -# func_get_automake_snippet module +# func_get_automake_snippet_conditional module +# returns the part of the Makefile.am snippet that can be put inside Automake +# conditionals. # Input: # - local_gnulib_dir from --local-dir # - modcache true or false, from --cache-modules/--no-cache-modules -func_get_automake_snippet () +func_get_automake_snippet_conditional () { if ! $modcache; then func_lookup_file "modules/$1" @@ -2152,6 +2168,16 @@ fi fi fi +} + +# func_get_automake_snippet_unconditional module +# returns the part of the Makefile.am snippet that must stay outside of +# Automake conditionals. +# Input: +# - local_gnulib_dir from --local-dir +# - modcache true or false, from --cache-modules/--no-cache-modules +func_get_automake_snippet_unconditional () +{ case "$1" in *-tests) # *-tests module live in tests/, not lib/. @@ -2176,8 +2202,10 @@ sed_extract_mentioned_files='s/^lib_SOURCES[ ]*+=[ ]*//p' already_mentioned_files=` \ { if ! $modcache; then + func_lookup_file "modules/$1" sed -n -e "/^Makefile\.am$sed_extract_prog" < "$lookedup_file" else + func_cache_lookup_module "$1" if $have_associative; then if eval 'test -n "${modcache_makefile[$1]+set}"'; then eval 'echo "${modcache_makefile[$1]}"' @@ -2243,6 +2271,16 @@ esac } +# func_get_automake_snippet module +# Input: +# - local_gnulib_dir from --local-dir +# - modcache true or false, from --cache-modules/--no-cache-modules +func_get_automake_snippet () +{ + func_get_automake_snippet_conditional "$1" + func_get_automake_snippet_unconditional "$1" +} + # func_get_include_directive module # Input: # - local_gnulib_dir from --local-dir @@ -2380,6 +2418,143 @@ return 0 } +# sed expression to keep the first 32 characters of each line. +sed_first_32_chars='s/^\(................................\).*/\1/' + +# func_module_shellfunc_name module +# computes the shell function name that will contain the m4 macros for the module. +# Input: +# - macro_prefix prefix to use +# Output: +# - shellfunc shell function name +func_module_shellfunc_name () +{ + case $1 in + *[!a-zA-Z0-9_]*) + shellfunc=func_${macro_prefix}_gnulib_m4code_`echo "$1" | md5sum | LC_ALL=C sed -e "$sed_first_32_chars"` ;; + *) + shellfunc=func_${macro_prefix}_gnulib_m4code_$1 ;; + esac +} + +# func_module_shellvar_name module +# computes the shell variable name the will be set to true once the m4 macros +# for the module have been executed. +# Output: +# - shellvar shell variable name +func_module_shellvar_name () +{ + case $1 in + *[!a-zA-Z0-9_]*) + shellvar=${macro_prefix}_gnulib_enabled_`echo "$1" | md5sum | LC_ALL=C sed -e "$sed_first_32_chars"` ;; + *) + shellvar=${macro_prefix}_gnulib_enabled_$1 ;; + esac +} + +# func_module_conditional_name module +# computes the automake conditional name for the module. +# Output: +# - conditional name of automake conditional +func_module_conditional_name () +{ + case $1 in + *[!a-zA-Z0-9_]*) + conditional=${macro_prefix}_GNULIB_ENABLED_`echo "$1" | md5sum | LC_ALL=C sed -e "$sed_first_32_chars"` ;; + *) + conditional=${macro_prefix}_GNULIB_ENABLED_$1 ;; + esac +} + +# func_uncond_add_module B +# notes the presence of B as an unconditional module. +# +# func_conddep_add_module A B cond +# notes the presence of a conditional dependency from module A to module B, +# subject to the condition that A is enabled and cond is true. +# +# func_cond_module_p B +# tests whether module B is conditional. +# +# func_cond_module_condition A B +# returns the condition when B should be enabled as a dependency of A, once the +# m4 code for A has been executed. +# Output: - condition +# +if $have_associative; then + declare -A conddep_isuncond + declare -A conddep_dependers + declare -A conddep_condition + func_uncond_add_module () + { + eval 'conddep_isuncond[$1]=true' + eval 'unset conddep_dependers[$1]' + } + func_conddep_add_module () + { + eval 'isuncond="${conddep_isuncond[$2]}"' + if test -z "$isuncond"; then + # No unconditional dependency to B known at this point. + eval 'conddep_dependers[$2]="${conddep_dependers[$2]} $1"' + eval 'conddep_condition[$1---$2]="$3"' + fi + } + func_cond_module_p () + { + eval 'previous_dependers="${conddep_dependers[$1]}"' + test -n "$previous_dependers" + } + func_cond_module_condition () + { + eval 'condition="${conddep_condition[$1---$2]}"' + } +else + func_uncond_add_module () + { + case $1 in + *[!a-zA-Z0-9_]*) + suffix=`echo "$1" | md5sum | LC_ALL=C sed -e "$sed_first_32_chars"` ;; + *) + suffix=$1 ;; + esac + eval 'conddep_isuncond_'"$suffix"'=true' + eval 'unset conddep_dependers_'"$suffix" + } + func_conddep_add_module () + { + case $2 in + *[!a-zA-Z0-9_]*) + suffix=`echo "$2" | md5sum | LC_ALL=C sed -e "$sed_first_32_chars"` ;; + *) + suffix=$2 ;; + esac + eval 'isuncond="${conddep_isuncond_'"$suffix"'}"' + if test -z "$isuncond"; then + eval 'conddep_dependers_'"$suffix"'="${conddep_dependers_'"$suffix"'} $1"' + suffix=`echo "$1---$2" | md5sum | LC_ALL=C sed -e "$sed_first_32_chars"` + eval 'conddep_condition_'"$suffix"'="$3"' + fi + } + func_cond_module_p () + { + case $1 in + *[!a-zA-Z0-9_]*) + suffix=`echo "$1" | md5sum | LC_ALL=C sed -e "$sed_first_32_chars"` ;; + *) + suffix=$1 ;; + esac + eval 'previous_dependers="${conddep_dependers_'"$suffix"'}"' + test -n "$previous_dependers" + } + func_cond_module_condition () + { + suffix=`echo "$1---$2" | md5sum | LC_ALL=C sed -e "$sed_first_32_chars"` + eval 'condition="${conddep_condition_'"$suffix"'}"' + } +fi + +sed_dependencies_without_conditions='s/ *\[.*//' + # func_modules_transitive_closure # Input: # - local_gnulib_dir from --local-dir @@ -2411,11 +2586,16 @@ # - excl_unportable_tests true if tests that fail on some platforms should be # excluded, blank otherwise # - avoidlist list of modules to avoid +# - cond_dependencies true if conditional dependencies shall be supported, +# blank otherwise # - tmp pathname of a temporary directory # Output: # - modules list of modules, including dependencies +# - conddep_dependers, conddep_condition information about conditionally +# enabled modules func_modules_transitive_closure () { + sed_escape_dependency='s|\([/.]\)|\\\1|g' # In order to process every module only once (for speed), process an "input # list" of modules, producing an "output list" of modules. During each round, # more modules can be queued in the input list. Once a module on the input @@ -2425,6 +2605,16 @@ inmodules="$modules" outmodules= fmtc_inc_all_tests="$inc_all_direct_tests" + if test -n "$cond_dependencies"; then + for module in $inmodules; do + func_verify_module + if test -n "$module"; then + if func_acceptable $module; then + func_uncond_add_module $module + fi + fi + done + fi while test -n "$inmodules"; do inmodules_this_round="$inmodules" inmodules= # Accumulator, queue for next round @@ -2433,7 +2623,23 @@ if test -n "$module"; then if func_acceptable $module; then func_append outmodules " $module" - deps=`func_get_dependencies $module` + if test -n "$cond_dependencies"; then + if func_get_automake_snippet_conditional $module | grep '^if ' > /dev/null; then + # A module whose Makefile.am snippet contains a reference to an + # automake conditional. If we were to use it conditionally, we + # would get an error + # configure: error: conditional "..." was never defined. + # because automake 1.11.1 does not handle nested conditionals + # correctly. As a workaround, make the module unconditional. + func_uncond_add_module $module + fi + if func_cond_module_p $module; then + conditional=true + else + conditional=false + fi + fi + deps=`func_get_dependencies $module | sed -e "$sed_dependencies_without_conditions"` # Duplicate dependencies are harmless, but Jim wants a warning. duplicated_deps=`echo "$deps" | LC_ALL=C sort | LC_ALL=C uniq -d` if test -n "$duplicated_deps"; then @@ -2486,6 +2692,24 @@ done if $inc; then func_append inmodules " $dep" + if test -n "$cond_dependencies"; then + escaped_dep=`echo "$dep" | sed -e "$sed_escape_dependency"` + sed_extract_condition1='/^ *'"$escaped_dep"' *$/{s/^.*$/true/p}' + sed_extract_condition2='/^ *'"$escaped_dep"' *\[.*\] *$/{s/^ *'"$escaped_dep"' *\[\(.*\)\] *$/\1/p}' + condition=`func_get_dependencies $module | sed -n -e "$sed_extract_condition1" -e "$sed_extract_condition2"` + if test "$condition" = true; then + condition= + fi + if test -n "$condition"; then + func_conddep_add_module "$module" "$dep" "$condition" + else + if $conditional; then + func_conddep_add_module "$module" "$dep" true + else + func_uncond_add_module "$dep" + fi + fi + fi fi done fi @@ -2522,7 +2746,7 @@ echo "Module list with included dependencies (indented):" echo "$specified_modules" | sed -e '/^$/d' -e 's/$/| /' > "$tmp"/specified-modules echo "$modules" | sed -e '/^$/d' \ - | LC_ALL=C join -t '|' -a 2 "$tmp"/specified-modules - \ + | LC_ALL=C join -t '|' -a2 "$tmp"/specified-modules - \ | sed -e 's/^\(.*\)|.*/|\1/' -e 's/^/ /' -e 's/^ |\(.*\)$/ '"${bold_on}"'\1'"${bold_off}"'/' } @@ -2812,7 +3036,7 @@ func_verify_nontests_module if test -n "$module"; then { - func_get_automake_snippet "$module" | + func_get_automake_snippet_conditional "$module" | LC_ALL=C \ sed -e 's,lib_LIBRARIES,lib%_LIBRARIES,g' \ -e 's,lib_LTLIBRARIES,lib%_LTLIBRARIES,g' \ @@ -2826,16 +3050,32 @@ echo "${libname}_${libext}_LIBADD += @${perhapsLT}ALLOCA@" echo "${libname}_${libext}_DEPENDENCIES += @${perhapsLT}ALLOCA@" fi - } > "$tmp"/amsnippet + } > "$tmp"/amsnippet1 + { + func_get_automake_snippet_unconditional "$module" | + LC_ALL=C sed -e 's,lib_\([A-Z][A-Z]*\),'"${libname}_${libext}"'_\1,g' + } > "$tmp"/amsnippet2 # Skip the contents if it's entirely empty. - if grep '[^ ]' "$tmp"/amsnippet > /dev/null ; then + if grep '[^ ]' "$tmp"/amsnippet1 "$tmp"/amsnippet2 > /dev/null ; then echo "## begin gnulib module $module" echo - cat "$tmp"/amsnippet + if test -n "$cond_dependencies"; then + if func_cond_module_p "$module"; then + func_module_conditional_name "$module" + echo "if $conditional" + fi + fi + cat "$tmp"/amsnippet1 + if test -n "$cond_dependencies"; then + if func_cond_module_p "$module"; then + echo "endif" + fi + fi + cat "$tmp"/amsnippet2 echo "## end gnulib module $module" echo fi - rm -f "$tmp"/amsnippet + rm -f "$tmp"/amsnippet1 "$tmp"/amsnippet2 # Test whether there are some source files in subdirectories. for f in `func_get_filelist "$module"`; do case $f in @@ -3380,6 +3620,190 @@ echo "])" } +# func_emit_autoconf_snippet indentation +# emits the autoconf snippet of a module. +# Input: +# - local_gnulib_dir from --local-dir +# - modcache true or false, from --cache-modules/--no-cache-modules +# - sed_replace_build_aux sed expression that replaces reference to build-aux +# - module the module name +# - toplevel true or false. 'false' means a subordinate use of +# gnulib-tool. +# - disable_libtool true or false. It tells whether to disable libtool +# handling even if it has been specified through the +# command line options. +# - disable_gettext true or false. It tells whether to disable AM_GNU_GETTEXT +# invocations. +# - indentation spaces to prepend on each line +func_emit_autoconf_snippet () +{ + if { case $module in + gnumakefile | maintainer-makefile) + # These modules are meant to be used only in the top-level directory. + $toplevel ;; + *) + true ;; + esac + }; then + func_get_autoconf_snippet "$module" \ + | sed -e '/^$/d;' -e "s/^/$indentation/" \ + -e "$sed_replace_build_aux" \ + | { if $disable_libtool; then + sed -e 's/\$gl_cond_libtool/false/g' \ + -e 's/gl_libdeps/gltests_libdeps/g' \ + -e 's/gl_ltlibdeps/gltests_ltlibdeps/g' + else + cat + fi + } \ + | { if $disable_gettext; then + sed -e 's/AM_GNU_GETTEXT(\[external\])/dnl you must add AM_GNU_GETTEXT([external]) or similar to configure.ac./' + else + cat + fi + } + if test "$module" = 'alloca' && test "$libtool" = true && ! $disable_libtool; then + echo 'changequote(,)dnl' + echo 'LTALLOCA=`echo "$ALLOCA" | sed -e '"'"'s/\.[^.]* /.lo /g;s/\.[^.]*$/.lo/'"'"'`' + echo 'changequote([, ])dnl' + echo 'AC_SUBST([LTALLOCA])' + fi + fi +} + +# func_emit_autoconf_snippets modules verifier toplevel disable_libtool disable_gettext +# collects and emit the autoconf snippets of a set of modules. +# Input: +# - local_gnulib_dir from --local-dir +# - modcache true or false, from --cache-modules/--no-cache-modules +# - sed_replace_build_aux sed expression that replaces reference to build-aux +# - modules the list of modules. +# - verifier one of func_verify_module, func_verify_nontests_module, +# func_verify_tests_module. It selects the subset of +# $modules to consider. +# - toplevel true or false. 'false' means a subordinate use of +# gnulib-tool. +# - disable_libtool true or false. It tells whether to disable libtool +# handling even if it has been specified through the +# command line options. +# - disable_gettext true or false. It tells whether to disable AM_GNU_GETTEXT +# invocations. +func_emit_autoconf_snippets () +{ + verifier="$2" + toplevel="$3" + disable_libtool="$4" + disable_gettext="$5" + if test -n "$cond_dependencies"; then + # Emit the autoconf code for the unconditional modules. + for module in $1; do + eval $verifier + if test -n "$module"; then + if func_cond_module_p "$module"; then + : + else + func_emit_autoconf_snippet " " + fi + fi + done + # Initialize the shell variables indicating that the modules are enabled. + for module in $1; do + eval $verifier + if test -n "$module"; then + if func_cond_module_p "$module"; then + func_module_shellvar_name "$module" + echo " $shellvar=false" + fi + fi + done + # Emit the autoconf code for the conditional modules, each in a separate + # function. This makes it possible to support cycles among conditional + # modules. + for module in $1; do + eval $verifier + if test -n "$module"; then + if func_cond_module_p "$module"; then + func_module_shellfunc_name "$module" + func_module_shellvar_name "$module" + echo " $shellfunc ()" + echo ' {' + echo " if ! \$$shellvar; then" + func_emit_autoconf_snippet " " + echo " $shellvar=true" + deps=`func_get_dependencies $module | sed -e "$sed_dependencies_without_conditions"` + for dep in $deps; do + if func_cond_module_p "$dep"; then + func_module_shellfunc_name "$dep" + func_cond_module_condition "$module" "$dep" + if test "$condition" != true; then + echo ' if $condition; then' + echo " $shellfunc" + echo ' fi' + else + echo " $shellfunc" + fi + else + # The autoconf code for $dep has already been emitted above and + # therefore is already executed when this function is run. + : + fi + done + echo ' fi' + echo ' }' + fi + fi + done + # Emit the dependencies from the unconditional to the conditional modules. + for module in $1; do + eval $verifier + if test -n "$module"; then + if func_cond_module_p "$module"; then + : + else + deps=`func_get_dependencies $module | sed -e "$sed_dependencies_without_conditions"` + for dep in $deps; do + if func_cond_module_p "$dep"; then + func_module_shellfunc_name "$dep" + func_cond_module_condition "$module" "$dep" + if test "$condition" != true; then + echo " if $condition; then" + echo " $shellfunc" + echo ' fi' + else + echo " $shellfunc" + fi + else + # The autoconf code for $dep has already been emitted above and + # therefore is already executed when this code is run. + : + fi + done + fi + fi + done + # Define the Automake conditionals. + echo " m4_pattern_allow([^${macro_prefix}_GNULIB_ENABLED_])" + for module in $1; do + eval $verifier + if test -n "$module"; then + if func_cond_module_p "$module"; then + func_module_conditional_name "$module" + func_module_shellvar_name "$module" + echo " AM_CONDITIONAL([$conditional], [\$$shellvar])" + fi + fi + done + else + # Ignore the conditions, and enable all modules unconditionally. + for module in $1; do + eval $verifier + if test -n "$module"; then + func_emit_autoconf_snippet " " + fi + done + fi +} + # func_import modules # Uses also the variables # - mode import or add-import or remove-import or update @@ -3406,6 +3830,8 @@ # otherwise # - inc_all_tests true if --with-all-tests was given, blank otherwise # - avoidlist list of modules to avoid, from --avoid +# - cond_dependencies true if conditional dependencies shall be supported, +# blank otherwise # - lgpl yes or a number if library's license shall be LGPL, # blank otherwise # - makefile_name from --makefile-name @@ -4568,22 +4994,7 @@ echo " gl_m4_base='$m4base'" func_emit_initmacro_start $macro_prefix echo " gl_source_base='$sourcebase'" - for module in $main_modules; do - func_verify_module - if test -n "$module"; then - echo " # Code from module $module:" - func_get_autoconf_snippet "$module" \ - | sed -e '/^$/d;' -e 's/^/ /' \ - -e 's/AM_GNU_GETTEXT(\[external\])/dnl you must add AM_GNU_GETTEXT([external]) or similar to configure.ac./' \ - -e "$sed_replace_build_aux" - if test "$module" = 'alloca' && test "$libtool" = true; then - echo 'changequote(,)dnl' - echo 'LTALLOCA=`echo "$ALLOCA" | sed -e '"'"'s/\.[^.]* /.lo /g;s/\.[^.]*$/.lo/'"'"'`' - echo 'changequote([, ])dnl' - echo 'AC_SUBST([LTALLOCA])' - fi - fi - done + func_emit_autoconf_snippets "$main_modules" func_verify_module true false true echo " # End of code from modules" func_emit_initmacro_end $macro_prefix echo " gltests_libdeps=" @@ -4599,18 +5010,7 @@ echo " AC_SUBST([${macro_prefix}tests_WITNESS])" echo " gl_module_indicator_condition=\$${macro_prefix}tests_WITNESS" echo " m4_pushdef([gl_MODULE_INDICATOR_CONDITION], [\$gl_module_indicator_condition])" - for module in $testsrelated_modules; do - func_verify_module - if test -n "$module"; then - func_get_autoconf_snippet "$module" \ - | sed -e '/^$/d;' -e 's/^/ /' \ - -e 's/AM_GNU_GETTEXT(\[external\])/dnl you must add AM_GNU_GETTEXT([external]) or similar to configure.ac./' \ - -e "$sed_replace_build_aux" \ - -e 's/\$gl_cond_libtool/false/g' \ - -e 's/gl_libdeps/gltests_libdeps/g' \ - -e 's/gl_ltlibdeps/gltests_ltlibdeps/g' - fi - done + func_emit_autoconf_snippets "$testsrelated_modules" func_verify_module true true true echo " m4_popdef([gl_MODULE_INDICATOR_CONDITION])" func_emit_initmacro_end ${macro_prefix}tests # _LIBDEPS and _LTLIBDEPS variables are not needed if this library is @@ -4891,6 +5291,8 @@ # - excl_unportable_tests true if tests that fail on some platforms should be # excluded, blank otherwise # - avoidlist list of modules to avoid +# - cond_dependencies true if conditional dependencies shall be supported, +# blank otherwise # - libtool true if --libtool was given, false if --no-libtool was # given, blank otherwise # - symbolic true if files should be symlinked, copied otherwise @@ -5163,34 +5565,9 @@ # autoconf snippets. It's cleanest to put those of the library before # those of the tests. echo "gl_source_base='../$sourcebase'" - for module in $modules; do - func_verify_nontests_module - if test -n "$module"; then - case $module in - gnumakefile | maintainer-makefile) - # These modules are meant to be used only in the top-level directory. - ;; - *) - func_get_autoconf_snippet "$module" \ - | sed -e "$sed_replace_build_aux" - if test "$module" = 'alloca' && test "$libtool" = true; then - echo 'changequote(,)dnl' - echo 'LTALLOCA=`echo "$ALLOCA" | sed -e '"'"'s/\.[^.]* /.lo /g;s/\.[^.]*$/.lo/'"'"'`' - echo 'changequote([, ])dnl' - echo 'AC_SUBST([LTALLOCA])' - fi - ;; - esac - fi - done + func_emit_autoconf_snippets "$modules" func_verify_nontests_module false false false echo "gl_source_base='.'" - for module in $modules; do - func_verify_tests_module - if test -n "$module"; then - func_get_autoconf_snippet "$module" \ - | sed -e "$sed_replace_build_aux" - fi - done + func_emit_autoconf_snippets "$modules" func_verify_tests_module false false false func_emit_initmacro_end $macro_prefix # _LIBDEPS and _LTLIBDEPS variables are not needed if this library is # created using libtool, because libtool already handles the dependencies. @@ -5296,19 +5673,7 @@ echo "gl_m4_base='$m4base'" func_emit_initmacro_start $macro_prefix echo "gl_source_base='$sourcebase'" - for module in $modules; do - func_verify_nontests_module - if test -n "$module"; then - func_get_autoconf_snippet "$module" \ - | sed -e "$sed_replace_build_aux" - if test "$module" = 'alloca' && test "$libtool" = true; then - echo 'changequote(,)dnl' - echo 'LTALLOCA=`echo "$ALLOCA" | sed -e '"'"'s/\.[^.]* /.lo /g;s/\.[^.]*$/.lo/'"'"'`' - echo 'changequote([, ])dnl' - echo 'AC_SUBST([LTALLOCA])' - fi - fi - done + func_emit_autoconf_snippets "$modules" func_verify_nontests_module true false false func_emit_initmacro_end $macro_prefix # _LIBDEPS and _LTLIBDEPS variables are not needed if this library is # created using libtool, because libtool already handles the dependencies. diff -r 04ce36b456cc -r 6758fa38915e lib/allocator.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/allocator.c Fri May 06 08:15:59 2011 -0700 @@ -0,0 +1,5 @@ +#define _GL_USE_STDLIB_ALLOC 1 +#include +#include "allocator.h" +#include +struct allocator const stdlib_allocator = { malloc, realloc, free, NULL }; diff -r 04ce36b456cc -r 6758fa38915e lib/allocator.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/allocator.h Fri May 06 08:15:59 2011 -0700 @@ -0,0 +1,57 @@ +/* Memory allocators such as malloc+free. + + Copyright (C) 2011 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +/* Written by Paul Eggert. */ + +#ifndef _GL_ALLOCATOR_H +#define _GL_ALLOCATOR_H + +#include + +/* An object describing a memory allocator family. */ + +struct allocator +{ + /* Do not use GCC attributes such as __attribute__ ((malloc)) with + the function types pointed at by these members, because these + attributes do not work with pointers to functions. See + . */ + + /* Call ALLOCATE to allocate memory, like 'malloc'. On failure ALLOCATE + should return NULL, though not necessarily set errno. When given + a zero size it may return NULL even if successful. */ + void *(*allocate) (size_t); + + /* If nonnull, call REALLOCATE to reallocate memory, like 'realloc'. + On failure REALLOCATE should return NULL, though not necessarily set + errno. When given a zero size it may return NULL even if + successful. */ + void *(*reallocate) (void *, size_t); + + /* Call FREE to free memory, like 'free'. */ + void (*free) (void *); + + /* If nonnull, call DIE if MALLOC or REALLOC fails. DIE should not + return. DIE can be used by code that detects memory overflow + while calculating sizes to be passed to MALLOC or REALLOC. */ + void (*die) (void); +}; + +/* An allocator using the stdlib functions and a null DIE function. */ +extern struct allocator const stdlib_allocator; + +#endif /* _GL_ALLOCATOR_H */ diff -r 04ce36b456cc -r 6758fa38915e lib/areadlink.c --- a/lib/areadlink.c Fri Apr 01 16:04:45 2011 -0700 +++ b/lib/areadlink.c Fri May 06 08:15:59 2011 -0700 @@ -24,108 +24,16 @@ /* Specification. */ #include "areadlink.h" -#include -#include -#include -#include -#include -#include - -#ifndef SSIZE_MAX -# define SSIZE_MAX ((ssize_t) (SIZE_MAX / 2)) -#endif - -/* Use the system functions, not the gnulib overrides in this file. */ -#undef malloc -#undef realloc - -/* The initial buffer size for the link value. A power of 2 - detects arithmetic overflow earlier, but is not required. */ -enum { - INITIAL_BUF_SIZE = 1024 -}; +#include "careadlinkat.h" /* Call readlink to get the symbolic link value of FILENAME. Return a pointer to that NUL-terminated string in malloc'd storage. If readlink fails, return NULL and set errno. - If realloc fails, or if the link value is longer than SIZE_MAX :-), + If allocation fails, or if the link value is longer than SIZE_MAX :-), return NULL and set errno to ENOMEM. */ char * areadlink (char const *filename) { - /* Allocate the initial buffer on the stack. This way, in the common - case of a symlink of small size, we get away with a single small malloc() - instead of a big malloc() followed by a shrinking realloc(). */ - char initial_buf[INITIAL_BUF_SIZE]; - - char *buffer = initial_buf; - size_t buf_size = sizeof initial_buf; - - while (1) - { - /* Attempt to read the link into the current buffer. */ - ssize_t link_length = readlink (filename, buffer, buf_size); - - /* On AIX 5L v5.3 and HP-UX 11i v2 04/09, readlink returns -1 - with errno == ERANGE if the buffer is too small. */ - if (link_length < 0 && errno != ERANGE) - { - if (buffer != initial_buf) - { - int saved_errno = errno; - free (buffer); - errno = saved_errno; - } - return NULL; - } - - if ((size_t) link_length < buf_size) - { - buffer[link_length++] = '\0'; - - /* Return it in a chunk of memory as small as possible. */ - if (buffer == initial_buf) - { - buffer = (char *) malloc (link_length); - if (buffer == NULL) - { - /* It's easier to set errno to ENOMEM than to rely on the - 'malloc-posix' gnulib module. */ - errno = ENOMEM; - return NULL; - } - memcpy (buffer, initial_buf, link_length); - } - else - { - /* Shrink buffer before returning it. */ - if ((size_t) link_length < buf_size) - { - char *smaller_buffer = (char *) realloc (buffer, link_length); - - if (smaller_buffer != NULL) - buffer = smaller_buffer; - } - } - return buffer; - } - - if (buffer != initial_buf) - free (buffer); - buf_size *= 2; - if (SSIZE_MAX < buf_size || (SIZE_MAX / 2 < SSIZE_MAX && buf_size == 0)) - { - errno = ENOMEM; - return NULL; - } - buffer = (char *) malloc (buf_size); - if (buffer == NULL) - { - /* It's easier to set errno to ENOMEM than to rely on the - 'malloc-posix' gnulib module. */ - errno = ENOMEM; - return NULL; - } - } + return careadlinkat (AT_FDCWD, filename, NULL, 0, NULL, careadlinkatcwd); } diff -r 04ce36b456cc -r 6758fa38915e lib/areadlinkat.c --- a/lib/areadlinkat.c Fri Apr 01 16:04:45 2011 -0700 +++ b/lib/areadlinkat.c Fri May 06 08:15:59 2011 -0700 @@ -25,101 +25,21 @@ /* Specification. */ #include "areadlink.h" -#include -#include -#include -#include -#include -#include - -#ifndef SSIZE_MAX -# define SSIZE_MAX ((ssize_t) (SIZE_MAX / 2)) -#endif +#include "careadlinkat.h" #if HAVE_READLINKAT -/* The initial buffer size for the link value. A power of 2 - detects arithmetic overflow earlier, but is not required. */ -enum { - INITIAL_BUF_SIZE = 1024 -}; - /* Call readlinkat to get the symbolic link value of FILENAME relative to FD. Return a pointer to that NUL-terminated string in malloc'd storage. If readlinkat fails, return NULL and set errno (although failure to change directory will issue a diagnostic and exit). - If realloc fails, or if the link value is longer than SIZE_MAX :-), + If allocation fails, or if the link value is longer than SIZE_MAX :-), return NULL and set errno to ENOMEM. */ char * areadlinkat (int fd, char const *filename) { - /* Allocate the initial buffer on the stack. This way, in the common - case of a symlink of small size, we get away with a single small malloc() - instead of a big malloc() followed by a shrinking realloc(). */ - char initial_buf[INITIAL_BUF_SIZE]; - - char *buffer = initial_buf; - size_t buf_size = sizeof initial_buf; - - while (1) - { - /* Attempt to read the link into the current buffer. */ - ssize_t link_length = readlinkat (fd, filename, buffer, buf_size); - - /* On AIX 5L v5.3 and HP-UX 11i v2 04/09, readlink returns -1 - with errno == ERANGE if the buffer is too small. */ - if (link_length < 0 && errno != ERANGE) - { - if (buffer != initial_buf) - { - int saved_errno = errno; - free (buffer); - errno = saved_errno; - } - return NULL; - } - - if ((size_t) link_length < buf_size) - { - buffer[link_length++] = '\0'; - - /* Return it in a chunk of memory as small as possible. */ - if (buffer == initial_buf) - { - buffer = (char *) malloc (link_length); - if (buffer == NULL) - /* errno is ENOMEM. */ - return NULL; - memcpy (buffer, initial_buf, link_length); - } - else - { - /* Shrink buffer before returning it. */ - if ((size_t) link_length < buf_size) - { - char *smaller_buffer = (char *) realloc (buffer, link_length); - - if (smaller_buffer != NULL) - buffer = smaller_buffer; - } - } - return buffer; - } - - if (buffer != initial_buf) - free (buffer); - buf_size *= 2; - if (SSIZE_MAX < buf_size || (SIZE_MAX / 2 < SSIZE_MAX && buf_size == 0)) - { - errno = ENOMEM; - return NULL; - } - buffer = (char *) malloc (buf_size); - if (buffer == NULL) - /* errno is ENOMEM. */ - return NULL; - } + return careadlinkat (fd, filename, NULL, 0, NULL, readlinkat); } #else /* !HAVE_READLINKAT */ diff -r 04ce36b456cc -r 6758fa38915e lib/argmatch.c diff -r 04ce36b456cc -r 6758fa38915e lib/argv-iter.c diff -r 04ce36b456cc -r 6758fa38915e lib/assert.in.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/assert.in.h Fri May 06 08:15:59 2011 -0700 @@ -0,0 +1,28 @@ +/* Substitute for and wrapper around + Copyright (C) 2011 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software Foundation, + Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + +/* Do not guard the include, since is supposed to define + the assert macro each time it is included. */ + +#if __GNUC__ >= 3 +@PRAGMA_SYSTEM_HEADER@ +#endif +@PRAGMA_COLUMNS@ + +#@INCLUDE_NEXT@ @NEXT_ASSERT_H@ + +/* The definition of static_assert is copied here. */ diff -r 04ce36b456cc -r 6758fa38915e lib/base64.c diff -r 04ce36b456cc -r 6758fa38915e lib/basename-lgpl.c diff -r 04ce36b456cc -r 6758fa38915e lib/c-ctype.c diff -r 04ce36b456cc -r 6758fa38915e lib/c-strncasecmp.c diff -r 04ce36b456cc -r 6758fa38915e lib/canonicalize-lgpl.c --- a/lib/canonicalize-lgpl.c Fri Apr 01 16:04:45 2011 -0700 +++ b/lib/canonicalize-lgpl.c Fri May 06 08:15:59 2011 -0700 @@ -16,6 +16,7 @@ along with this program. If not, see . */ #ifndef _LIBC +# define _GL_USE_STDLIB_ALLOC 1 # include #endif @@ -68,8 +69,6 @@ # endif # define __readlink readlink # define __set_errno(e) errno = (e) -/* Use the system functions, not the gnulib overrides in this file. */ -# undef malloc # ifndef MAXSYMLINKS # ifdef SYMLOOP_MAX # define MAXSYMLINKS SYMLOOP_MAX diff -r 04ce36b456cc -r 6758fa38915e lib/careadlinkat.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/careadlinkat.c Fri May 06 08:15:59 2011 -0700 @@ -0,0 +1,171 @@ +/* Read symbolic links into a buffer without size limitation, relative to fd. + + Copyright (C) 2001, 2003-2004, 2007, 2009-2011 Free Software Foundation, + Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +/* Written by Paul Eggert, Bruno Haible, and Jim Meyering. */ + +#include + +#include "careadlinkat.h" + +#include +#include +#include +#include +#include + +/* Define this independently so that stdint.h is not a prerequisite. */ +#ifndef SIZE_MAX +# define SIZE_MAX ((size_t) -1) +#endif + +#ifndef SSIZE_MAX +# define SSIZE_MAX ((ssize_t) (SIZE_MAX / 2)) +#endif + +#include "allocator.h" + +#if ! HAVE_READLINKAT +/* Get the symbolic link value of FILENAME and put it into BUFFER, with + size BUFFER_SIZE. This function acts like readlink but has + readlinkat's signature. */ +ssize_t +careadlinkatcwd (int fd, char const *filename, char *buffer, + size_t buffer_size) +{ + /* FD must be AT_FDCWD here, otherwise the caller is using this + function in contexts for which it was not meant for. */ + if (fd != AT_FDCWD) + abort (); + return readlink (filename, buffer, buffer_size); +} +#endif + +/* Assuming the current directory is FD, get the symbolic link value + of FILENAME as a null-terminated string and put it into a buffer. + If FD is AT_FDCWD, FILENAME is interpreted relative to the current + working directory, as in openat. + + If the link is small enough to fit into BUFFER put it there. + BUFFER's size is BUFFER_SIZE, and BUFFER can be null + if BUFFER_SIZE is zero. + + If the link is not small, put it into a dynamically allocated + buffer managed by ALLOC. It is the caller's responsibility to free + the returned value if it is nonnull and is not BUFFER. A null + ALLOC stands for the standard allocator. + + The PREADLINKAT function specifies how to read links. It operates + like POSIX readlinkat() + + but can assume that its first argument is the same as FD. + + If successful, return the buffer address; otherwise return NULL and + set errno. */ + +char * +careadlinkat (int fd, char const *filename, + char *buffer, size_t buffer_size, + struct allocator const *alloc, + ssize_t (*preadlinkat) (int, char const *, char *, size_t)) +{ + char *buf; + size_t buf_size; + size_t buf_size_max = + SSIZE_MAX < SIZE_MAX ? (size_t) SSIZE_MAX + 1 : SIZE_MAX; + char stack_buf[1024]; + + if (! alloc) + alloc = &stdlib_allocator; + + if (! buffer_size) + { + /* Allocate the initial buffer on the stack. This way, in the + common case of a symlink of small size, we get away with a + single small malloc() instead of a big malloc() followed by a + shrinking realloc(). */ + buffer = stack_buf; + buffer_size = sizeof stack_buf; + } + + buf = buffer; + buf_size = buffer_size; + + do + { + /* Attempt to read the link into the current buffer. */ + ssize_t link_length = preadlinkat (fd, filename, buf, buf_size); + size_t link_size; + if (link_length < 0) + { + /* On AIX 5L v5.3 and HP-UX 11i v2 04/09, readlink returns -1 + with errno == ERANGE if the buffer is too small. */ + int readlinkat_errno = errno; + if (readlinkat_errno != ERANGE) + { + if (buf != buffer) + { + alloc->free (buf); + errno = readlinkat_errno; + } + return NULL; + } + } + + link_size = link_length; + + if (link_size < buf_size) + { + buf[link_size++] = '\0'; + + if (buf == stack_buf) + { + char *b = (char *) alloc->allocate (link_size); + if (! b) + break; + memcpy (b, buf, link_size); + buf = b; + } + else if (link_size < buf_size && buf != buffer && alloc->reallocate) + { + /* Shrink BUF before returning it. */ + char *b = (char *) alloc->reallocate (buf, link_size); + if (b) + buf = b; + } + + return buf; + } + + if (buf != buffer) + alloc->free (buf); + + if (buf_size <= buf_size_max / 2) + buf_size *= 2; + else if (buf_size < buf_size_max) + buf_size = buf_size_max; + else + break; + buf = (char *) alloc->allocate (buf_size); + } + while (buf); + + if (alloc->die) + alloc->die (); + errno = ENOMEM; + return NULL; +} diff -r 04ce36b456cc -r 6758fa38915e lib/careadlinkat.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/careadlinkat.h Fri May 06 08:15:59 2011 -0700 @@ -0,0 +1,73 @@ +/* Read symbolic links into a buffer without size limitation, relative to fd. + + Copyright (C) 2011 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +/* Written by Paul Eggert, Bruno Haible, and Jim Meyering. */ + +#ifndef _GL_CAREADLINKAT_H +#define _GL_CAREADLINKAT_H + +#include +#include + +struct allocator; + +/* Assuming the current directory is FD, get the symbolic link value + of FILENAME as a null-terminated string and put it into a buffer. + If FD is AT_FDCWD, FILENAME is interpreted relative to the current + working directory, as in openat. + + If the link is small enough to fit into BUFFER put it there. + BUFFER's size is BUFFER_SIZE, and BUFFER can be null + if BUFFER_SIZE is zero. + + If the link is not small, put it into a dynamically allocated + buffer managed by ALLOC. It is the caller's responsibility to free + the returned value if it is nonnull and is not BUFFER. + + The PREADLINKAT function specifies how to read links. It operates + like POSIX readlinkat() + + but can assume that its first argument is the same as FD. + + If successful, return the buffer address; otherwise return NULL and + set errno. */ + +char *careadlinkat (int fd, char const *filename, + char *buffer, size_t buffer_size, + struct allocator const *alloc, + ssize_t (*preadlinkat) (int, char const *, + char *, size_t)); + +/* Suitable values for careadlinkat's FD and PREADLINKAT arguments, + when doing a plain readlink: + Pass FD = AT_FDCWD and PREADLINKAT = careadlinkatcwd. */ +#if HAVE_READLINKAT +/* AT_FDCWD is declared in , readlinkat in . */ +# define careadlinkatcwd readlinkat +#else +/* Define AT_FDCWD independently, so that the careadlinkat module does + not depend on the fcntl-h module. The value does not matter, since + careadlinkatcwd ignores it, but we might as well use the same value + as fcntl-h. */ +# ifndef AT_FDCWD +# define AT_FDCWD (-3041965) +# endif +ssize_t careadlinkatcwd (int fd, char const *filename, + char *buffer, size_t buffer_size); +#endif + +#endif /* _GL_CAREADLINKAT_H */ diff -r 04ce36b456cc -r 6758fa38915e lib/chdir-long.c diff -r 04ce36b456cc -r 6758fa38915e lib/clean-temp.h --- a/lib/clean-temp.h Fri Apr 01 16:04:45 2011 -0700 +++ b/lib/clean-temp.h Fri May 06 08:15:59 2011 -0700 @@ -1,5 +1,5 @@ /* Temporary directories and temporary files with automatic cleanup. - Copyright (C) 2006, 2009-2011 Free Software Foundation, Inc. + Copyright (C) 2006, 2011 Free Software Foundation, Inc. Written by Bruno Haible , 2006. This program is free software: you can redistribute it and/or modify @@ -39,7 +39,11 @@ This module provides support for temporary directories and temporary files inside these temporary directories. Temporary files without temporary - directories are not supported here. */ + directories are not supported here. The temporary directories and files + are automatically cleaned up (at the latest) when the program exits or + dies from a fatal signal such as SIGINT, SIGTERM, SIGHUP, but not if it + dies from a fatal signal such as SIGQUIT, SIGKILL, or SIGABRT, SIGSEGV, + SIGBUS, SIGILL, SIGFPE. */ struct temp_dir { diff -r 04ce36b456cc -r 6758fa38915e lib/close-hook.c --- a/lib/close-hook.c Fri Apr 01 16:04:45 2011 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,91 +0,0 @@ -/* Hook for making the close() function extensible. - Copyright (C) 2009-2011 Free Software Foundation, Inc. - Written by Bruno Haible , 2009. - - This program is free software: you can redistribute it and/or modify it - under the terms of the GNU Lesser General Public License as published - by the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with this program. If not, see . */ - -#include - -/* Specification. */ -#include "close-hook.h" - -#include -#include - -#undef close - - -/* Currently, this entire code is only needed for the handling of sockets - on native Windows platforms. */ -#if WINDOWS_SOCKETS - -/* The first and last link in the doubly linked list. - Initially the list is empty. */ -static struct close_hook anchor = { &anchor, &anchor, NULL }; - -int -execute_close_hooks (int fd, const struct close_hook *remaining_list) -{ - if (remaining_list == &anchor) - /* End of list reached. */ - return close (fd); - else - return remaining_list->private_fn (fd, remaining_list->private_next); -} - -int -execute_all_close_hooks (int fd) -{ - return execute_close_hooks (fd, anchor.private_next); -} - -void -register_close_hook (close_hook_fn hook, struct close_hook *link) -{ - if (link->private_next == NULL && link->private_prev == NULL) - { - /* Add the link to the doubly linked list. */ - link->private_next = anchor.private_next; - link->private_prev = &anchor; - link->private_fn = hook; - anchor.private_next->private_prev = link; - anchor.private_next = link; - } - else - { - /* The link is already in use. */ - if (link->private_fn != hook) - abort (); - } -} - -void -unregister_close_hook (struct close_hook *link) -{ - struct close_hook *next = link->private_next; - struct close_hook *prev = link->private_prev; - - if (next != NULL && prev != NULL) - { - /* The link is in use. Remove it from the doubly linked list. */ - prev->private_next = next; - next->private_prev = prev; - /* Clear the link, to mark it unused. */ - link->private_next = NULL; - link->private_prev = NULL; - link->private_fn = NULL; - } -} - -#endif diff -r 04ce36b456cc -r 6758fa38915e lib/close-hook.h --- a/lib/close-hook.h Fri Apr 01 16:04:45 2011 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,72 +0,0 @@ -/* Hook for making the close() function extensible. - Copyright (C) 2009-2011 Free Software Foundation, Inc. - - This program is free software: you can redistribute it and/or modify it - under the terms of the GNU Lesser General Public License as published - by the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with this program. If not, see . */ - - -#ifndef CLOSE_HOOK_H -#define CLOSE_HOOK_H - -#ifdef __cplusplus -extern "C" { -#endif - - -/* Currently, this entire code is only needed for the handling of sockets - on native Windows platforms. */ -#if WINDOWS_SOCKETS - - -/* An element of the list of close hooks. - The fields of this structure are considered private. */ -struct close_hook -{ - /* Doubly linked list. */ - struct close_hook *private_next; - struct close_hook *private_prev; - /* Function that treats the types of FD that it knows about and calls - execute_close_hooks (FD, REMAINING_LIST) as a fallback. */ - int (*private_fn) (int fd, const struct close_hook *remaining_list); -}; - -/* This type of function closes FD, applying special knowledge for the FD - types it knows about, and calls execute_close_hooks (FD, REMAINING_LIST) - for the other FD types. */ -typedef int (*close_hook_fn) (int fd, const struct close_hook *remaining_list); - -/* Execute the close hooks in REMAINING_LIST. - Return 0 or -1, like close() would do. */ -extern int execute_close_hooks (int fd, const struct close_hook *remaining_list); - -/* Execute all close hooks. - Return 0 or -1, like close() would do. */ -extern int execute_all_close_hooks (int fd); - -/* Add a function to the list of close hooks. - The LINK variable points to a piece of memory which is guaranteed to be - accessible until the corresponding call to unregister_close_hook. */ -extern void register_close_hook (close_hook_fn hook, struct close_hook *link); - -/* Removes a function from the list of close hooks. */ -extern void unregister_close_hook (struct close_hook *link); - - -#endif - - -#ifdef __cplusplus -} -#endif - -#endif /* CLOSE_HOOK_H */ diff -r 04ce36b456cc -r 6758fa38915e lib/close.c --- a/lib/close.c Fri Apr 01 16:04:45 2011 -0700 +++ b/lib/close.c Fri May 06 08:15:59 2011 -0700 @@ -19,7 +19,7 @@ /* Specification. */ #include -#include "close-hook.h" +#include "fd-hook.h" /* Override close() to call into other gnulib modules. */ @@ -28,7 +28,7 @@ #undef close { #if WINDOWS_SOCKETS - int retval = execute_all_close_hooks (fd); + int retval = execute_all_close_hooks (close, fd); #else int retval = close (fd); #endif diff -r 04ce36b456cc -r 6758fa38915e lib/count-one-bits.h --- a/lib/count-one-bits.h Fri Apr 01 16:04:45 2011 -0700 +++ b/lib/count-one-bits.h Fri May 06 08:15:59 2011 -0700 @@ -38,7 +38,7 @@ count += count_one_bits_32 (x >> 31 >> 1); \ return count; -/* Compute and return the the number of 1-bits set in the least +/* Compute and return the number of 1-bits set in the least significant 32 bits of X. */ static inline int count_one_bits_32 (unsigned int x) diff -r 04ce36b456cc -r 6758fa38915e lib/dup3.c --- a/lib/dup3.c Fri Apr 01 16:04:45 2011 -0700 +++ b/lib/dup3.c Fri May 06 08:15:59 2011 -0700 @@ -26,20 +26,6 @@ #include "binary-io.h" -#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ -/* Native Woe32 API. */ - -# include - -/* Get declarations of the Win32 API functions. */ -# define WIN32_LEAN_AND_MEAN -# include - -/* Upper bound on getdtablesize(). See lib/getdtablesize.c. */ -# define OPEN_MAX_MAX 0x10000 - -#endif - int dup3 (int oldfd, int newfd, int flags) { diff -r 04ce36b456cc -r 6758fa38915e lib/exclude.c diff -r 04ce36b456cc -r 6758fa38915e lib/fchdir.c --- a/lib/fchdir.c Fri Apr 01 16:04:45 2011 -0700 +++ b/lib/fchdir.c Fri May 06 08:15:59 2011 -0700 @@ -29,19 +29,13 @@ #include #include +#include "dosname.h" +#include "filenamecat.h" + #ifndef REPLACE_OPEN_DIRECTORY # define REPLACE_OPEN_DIRECTORY 0 #endif -#ifndef HAVE_CANONICALIZE_FILE_NAME -# if GNULIB_CANONICALIZE || GNULIB_CANONICALIZE_LGPL -# define HAVE_CANONICALIZE_FILE_NAME 1 -# else -# define HAVE_CANONICALIZE_FILE_NAME 0 -# define canonicalize_file_name(name) NULL -# endif -#endif - /* This replacement assumes that a directory is not renamed while opened through a file descriptor. @@ -90,36 +84,26 @@ return true; } -/* Return the canonical name of DIR in malloc'd storage. */ +/* Return an absolute name of DIR in malloc'd storage. */ static char * get_name (char const *dir) { + char *cwd; char *result; - if (REPLACE_OPEN_DIRECTORY || !HAVE_CANONICALIZE_FILE_NAME) - { - /* The function canonicalize_file_name has not yet been ported - to mingw, with all its drive letter and backslash quirks. - Fortunately, getcwd is reliable in this case, but we ensure - we can get back to where we started before using it. Treat - "." as a special case, as it is frequently encountered. */ - char *cwd = getcwd (NULL, 0); - int saved_errno; - if (dir[0] == '.' && dir[1] == '\0') - return cwd; - if (chdir (cwd)) - return NULL; - result = chdir (dir) ? NULL : getcwd (NULL, 0); - saved_errno = errno; - if (chdir (cwd)) - abort (); - free (cwd); - errno = saved_errno; - } - else - { - /* Avoid changing the directory. */ - result = canonicalize_file_name (dir); - } + int saved_errno; + + if (IS_ABSOLUTE_FILE_NAME (dir)) + return strdup (dir); + + /* We often encounter "."; treat it as a special case. */ + cwd = getcwd (NULL, 0); + if (!cwd || (dir[0] == '.' && dir[1] == '\0')) + return cwd; + + result = mfile_name_concat (cwd, dir, NULL); + saved_errno = errno; + free (cwd); + errno = saved_errno; return result; } diff -r 04ce36b456cc -r 6758fa38915e lib/fclose.c --- a/lib/fclose.c Fri Apr 01 16:04:45 2011 -0700 +++ b/lib/fclose.c Fri May 06 08:15:59 2011 -0700 @@ -22,18 +22,30 @@ #include #include -/* Override fclose() to call the overridden close(). */ +#include "freading.h" + +/* Override fclose() to call the overridden fflush() or close(). */ int rpl_fclose (FILE *fp) #undef fclose { int saved_errno = 0; + int fd; - if (fflush (fp)) + /* Don't change behavior on memstreams. */ + fd = fileno (fp); + if (fd < 0) + return fclose (fp); + + /* We only need to flush the file if it is not reading or if it is + seekable. This only guarantees the file position of input files + if the fflush module is also in use. */ + if ((!freading (fp) || lseek (fileno (fp), 0, SEEK_CUR) != -1) + && fflush (fp)) saved_errno = errno; - if (close (fileno (fp)) < 0 && saved_errno == 0) + if (close (fd) < 0 && saved_errno == 0) saved_errno = errno; fclose (fp); /* will fail with errno = EBADF */ diff -r 04ce36b456cc -r 6758fa38915e lib/fcntl.in.h --- a/lib/fcntl.in.h Fri Apr 01 16:04:45 2011 -0700 +++ b/lib/fcntl.in.h Fri May 06 08:15:59 2011 -0700 @@ -182,8 +182,7 @@ #endif #if !defined O_CLOEXEC && defined O_NOINHERIT -/* Mingw spells it `O_NOINHERIT'. Intentionally leave it - undefined if not available. */ +/* Mingw spells it `O_NOINHERIT'. */ # define O_CLOEXEC O_NOINHERIT #endif @@ -219,6 +218,19 @@ # define O_NONBLOCK O_NDELAY #endif +/* If the gnulib module 'nonblocking' is in use, guarantee a working non-zero + value of O_NONBLOCK. Otherwise, O_NONBLOCK is defined (above) to O_NDELAY + or to 0 as fallback. */ +#if @GNULIB_NONBLOCKING@ +# if O_NONBLOCK +# define GNULIB_defined_O_NONBLOCK 0 +# else +# define GNULIB_defined_O_NONBLOCK 1 +# undef O_NONBLOCK +# define O_NONBLOCK 0x40000000 +# endif +#endif + #ifndef O_NOCTTY # define O_NOCTTY 0 #endif @@ -247,6 +259,11 @@ # define O_TTY_INIT 0 #endif +#if O_ACCMODE != (O_RDONLY | O_WRONLY | O_RDWR | O_EXEC | O_SEARCH) +# undef O_ACCMODE +# define O_ACCMODE (O_RDONLY | O_WRONLY | O_RDWR | O_EXEC | O_SEARCH) +#endif + /* For systems that distinguish between text and binary I/O. O_BINARY is usually declared in fcntl.h */ #if !defined O_BINARY && defined _O_BINARY diff -r 04ce36b456cc -r 6758fa38915e lib/fd-hook.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/fd-hook.c Fri May 06 08:15:59 2011 -0700 @@ -0,0 +1,116 @@ +/* Hook for making making file descriptor functions close(), ioctl() extensible. + Copyright (C) 2009-2011 Free Software Foundation, Inc. + Written by Bruno Haible , 2009. + + This program is free software: you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License as published + by the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with this program. If not, see . */ + +#include + +/* Specification. */ +#include "fd-hook.h" + +#include + +/* Currently, this entire code is only needed for the handling of sockets + on native Windows platforms. */ +#if WINDOWS_SOCKETS + +/* The first and last link in the doubly linked list. + Initially the list is empty. */ +static struct fd_hook anchor = { &anchor, &anchor, NULL, NULL }; + +int +execute_close_hooks (const struct fd_hook *remaining_list, gl_close_fn primary, + int fd) +{ + if (remaining_list == &anchor) + /* End of list reached. */ + return primary (fd); + else + return remaining_list->private_close_fn (remaining_list->private_next, + primary, fd); +} + +int +execute_all_close_hooks (gl_close_fn primary, int fd) +{ + return execute_close_hooks (anchor.private_next, primary, fd); +} + +int +execute_ioctl_hooks (const struct fd_hook *remaining_list, gl_ioctl_fn primary, + int fd, int request, void *arg) +{ + if (remaining_list == &anchor) + /* End of list reached. */ + return primary (fd, request, arg); + else + return remaining_list->private_ioctl_fn (remaining_list->private_next, + primary, fd, request, arg); +} + +int +execute_all_ioctl_hooks (gl_ioctl_fn primary, + int fd, int request, void *arg) +{ + return execute_ioctl_hooks (anchor.private_next, primary, fd, request, arg); +} + +void +register_fd_hook (close_hook_fn close_hook, ioctl_hook_fn ioctl_hook, struct fd_hook *link) +{ + if (close_hook == NULL) + close_hook = execute_close_hooks; + if (ioctl_hook == NULL) + ioctl_hook = execute_ioctl_hooks; + + if (link->private_next == NULL && link->private_prev == NULL) + { + /* Add the link to the doubly linked list. */ + link->private_next = anchor.private_next; + link->private_prev = &anchor; + link->private_close_fn = close_hook; + link->private_ioctl_fn = ioctl_hook; + anchor.private_next->private_prev = link; + anchor.private_next = link; + } + else + { + /* The link is already in use. */ + if (link->private_close_fn != close_hook + || link->private_ioctl_fn != ioctl_hook) + abort (); + } +} + +void +unregister_fd_hook (struct fd_hook *link) +{ + struct fd_hook *next = link->private_next; + struct fd_hook *prev = link->private_prev; + + if (next != NULL && prev != NULL) + { + /* The link is in use. Remove it from the doubly linked list. */ + prev->private_next = next; + next->private_prev = prev; + /* Clear the link, to mark it unused. */ + link->private_next = NULL; + link->private_prev = NULL; + link->private_close_fn = NULL; + link->private_ioctl_fn = NULL; + } +} + +#endif diff -r 04ce36b456cc -r 6758fa38915e lib/fd-hook.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/fd-hook.h Fri May 06 08:15:59 2011 -0700 @@ -0,0 +1,119 @@ +/* Hook for making making file descriptor functions close(), ioctl() extensible. + Copyright (C) 2009-2011 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License as published + by the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with this program. If not, see . */ + + +#ifndef FD_HOOK_H +#define FD_HOOK_H + +#ifdef __cplusplus +extern "C" { +#endif + + +/* Currently, this entire code is only needed for the handling of sockets + on native Windows platforms. */ +#if WINDOWS_SOCKETS + + +/* Type of function that closes FD. */ +typedef int (*gl_close_fn) (int fd); + +/* Type of function that applies a control request to FD. */ +typedef int (*gl_ioctl_fn) (int fd, int request, void *arg); + +/* An element of the list of file descriptor hooks. + In CLOS (Common Lisp Object System) speak, it consists of an "around" + method for the close() function and an "around" method for the ioctl() + function. + The fields of this structure are considered private. */ +struct fd_hook +{ + /* Doubly linked list. */ + struct fd_hook *private_next; + struct fd_hook *private_prev; + /* Function that treats the types of FD that it knows about and calls + execute_close_hooks (REMAINING_LIST, PRIMARY, FD) as a fallback. */ + int (*private_close_fn) (const struct fd_hook *remaining_list, + gl_close_fn primary, + int fd); + /* Function that treats the types of FD that it knows about and calls + execute_ioctl_hooks (REMAINING_LIST, PRIMARY, FD, REQUEST, ARG) as a + fallback. */ + int (*private_ioctl_fn) (const struct fd_hook *remaining_list, + gl_ioctl_fn primary, + int fd, int request, void *arg); +}; + +/* This type of function closes FD, applying special knowledge for the FD + types it knows about, and calls + execute_close_hooks (REMAINING_LIST, PRIMARY, FD) + for the other FD types. + In CLOS speak, REMAINING_LIST is the remaining list of "around" methods, + and PRIMARY is the "primary" method for close(). */ +typedef int (*close_hook_fn) (const struct fd_hook *remaining_list, + gl_close_fn primary, + int fd); + +/* Execute the close hooks in REMAINING_LIST, with PRIMARY as "primary" method. + Return 0 or -1, like close() would do. */ +extern int execute_close_hooks (const struct fd_hook *remaining_list, + gl_close_fn primary, + int fd); + +/* Execute all close hooks, with PRIMARY as "primary" method. + Return 0 or -1, like close() would do. */ +extern int execute_all_close_hooks (gl_close_fn primary, int fd); + +/* This type of function applies a control request to FD, applying special + knowledge for the FD types it knows about, and calls + execute_ioctl_hooks (REMAINING_LIST, PRIMARY, FD, REQUEST, ARG) + for the other FD types. + In CLOS speak, REMAINING_LIST is the remaining list of "around" methods, + and PRIMARY is the "primary" method for ioctl(). */ +typedef int (*ioctl_hook_fn) (const struct fd_hook *remaining_list, + gl_ioctl_fn primary, + int fd, int request, void *arg); + +/* Execute the ioctl hooks in REMAINING_LIST, with PRIMARY as "primary" method. + Return 0 or -1, like ioctl() would do. */ +extern int execute_ioctl_hooks (const struct fd_hook *remaining_list, + gl_ioctl_fn primary, + int fd, int request, void *arg); + +/* Execute all ioctl hooks, with PRIMARY as "primary" method. + Return 0 or -1, like ioctl() would do. */ +extern int execute_all_ioctl_hooks (gl_ioctl_fn primary, + int fd, int request, void *arg); + +/* Add a function pair to the list of file descriptor hooks. + CLOSE_HOOK and IOCTL_HOOK may be NULL, indicating no change. + The LINK variable points to a piece of memory which is guaranteed to be + accessible until the corresponding call to unregister_fd_hook. */ +extern void register_fd_hook (close_hook_fn close_hook, ioctl_hook_fn ioctl_hook, + struct fd_hook *link); + +/* Removes a hook from the list of file descriptor hooks. */ +extern void unregister_fd_hook (struct fd_hook *link); + + +#endif + + +#ifdef __cplusplus +} +#endif + +#endif /* FD_HOOK_H */ diff -r 04ce36b456cc -r 6758fa38915e lib/file-type.c diff -r 04ce36b456cc -r 6758fa38915e lib/filenamecat-lgpl.c diff -r 04ce36b456cc -r 6758fa38915e lib/filevercmp.c diff -r 04ce36b456cc -r 6758fa38915e lib/freadahead.c diff -r 04ce36b456cc -r 6758fa38915e lib/fts.c diff -r 04ce36b456cc -r 6758fa38915e lib/gai_strerror.c --- a/lib/gai_strerror.c Fri Apr 01 16:04:45 2011 -0700 +++ b/lib/gai_strerror.c Fri May 06 08:15:59 2011 -0700 @@ -32,6 +32,22 @@ # define N_(String) String #endif +#if HAVE_DECL_GAI_STRERROR + +# include +# undef gai_strerror +# if HAVE_DECL_GAI_STRERRORA +# define gai_strerror gai_strerrorA +# endif + +const char * +rpl_gai_strerror (int code) +{ + return gai_strerror (code); +} + +#else /* !HAVE_DECL_GAI_STRERROR */ + static struct { int code; @@ -71,6 +87,7 @@ return _("Unknown error"); } -#ifdef _LIBC +# ifdef _LIBC libc_hidden_def (gai_strerror) -#endif +# endif +#endif /* !HAVE_DECL_GAI_STRERROR */ diff -r 04ce36b456cc -r 6758fa38915e lib/getcwd-lgpl.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/getcwd-lgpl.c Fri May 06 08:15:59 2011 -0700 @@ -0,0 +1,118 @@ +/* Copyright (C) 2011 Free Software Foundation, Inc. + This file is part of gnulib. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +#include + +/* Specification */ +#include + +#include +#include + +#if GNULIB_GETCWD +/* Favor GPL getcwd.c if both getcwd and getcwd-lgpl modules are in use. */ +typedef int dummy; +#else + +/* Get the name of the current working directory, and put it in SIZE + bytes of BUF. Returns NULL if the directory couldn't be determined + (perhaps because the absolute name was longer than PATH_MAX, or + because of missing read/search permissions on parent directories) + or SIZE was too small. If successful, returns BUF. If BUF is + NULL, an array is allocated with `malloc'; the array is SIZE bytes + long, unless SIZE == 0, in which case it is as big as + necessary. */ + +# undef getcwd +char * +rpl_getcwd (char *buf, size_t size) +{ + char *ptr; + char *result; + + /* Handle single size operations. */ + if (buf) + return getcwd (buf, size); + + if (size) + { + buf = malloc (size); + if (!buf) + { + errno = ENOMEM; + return NULL; + } + result = getcwd (buf, size); + if (!result) + { + int saved_errno = errno; + free (buf); + errno = saved_errno; + } + return result; + } + + /* Flexible sizing requested. Avoid over-allocation for the common + case of a name that fits within a 4k page, minus some space for + local variables, to be sure we don't skip over a guard page. */ + { + char tmp[4032]; + size = sizeof tmp; + ptr = getcwd (tmp, size); + if (ptr) + { + result = strdup (ptr); + if (!result) + errno = ENOMEM; + return result; + } + if (errno != ERANGE) + return NULL; + } + + /* My what a large directory name we have. */ + do + { + size <<= 1; + ptr = realloc (buf, size); + if (ptr == NULL) + { + free (buf); + errno = ENOMEM; + return NULL; + } + buf = ptr; + result = getcwd (buf, size); + } + while (!result && errno == ERANGE); + + if (!result) + { + int saved_errno = errno; + free (buf); + errno = saved_errno; + } + else + { + /* Trim to fit, if possible. */ + result = realloc (buf, strlen (buf) + 1); + if (!result) + result = buf; + } + return result; +} + +#endif diff -r 04ce36b456cc -r 6758fa38915e lib/getsockopt.c --- a/lib/getsockopt.c Fri Apr 01 16:04:45 2011 -0700 +++ b/lib/getsockopt.c Fri May 06 08:15:59 2011 -0700 @@ -46,7 +46,8 @@ int milliseconds_len = sizeof (int); struct timeval tv; size_t n; - r = getsockopt (sock, level, optname, &milliseconds, &milliseconds_len); + r = getsockopt (sock, level, optname, (char *) &milliseconds, + &milliseconds_len); tv.tv_sec = milliseconds / 1000; tv.tv_usec = (milliseconds - 1000 * tv.tv_sec) * 1000; n = sizeof (struct timeval); diff -r 04ce36b456cc -r 6758fa38915e lib/hash-pjw.c diff -r 04ce36b456cc -r 6758fa38915e lib/hash-triple.c diff -r 04ce36b456cc -r 6758fa38915e lib/hash.c --- a/lib/hash.c Fri Apr 01 16:04:45 2011 -0700 +++ b/lib/hash.c Fri May 06 08:15:59 2011 -0700 @@ -27,7 +27,7 @@ #include "hash.h" #include "bitrotate.h" -#include "xalloc.h" +#include "xalloc-oversized.h" #include #include diff -r 04ce36b456cc -r 6758fa38915e lib/i-ring.c diff -r 04ce36b456cc -r 6758fa38915e lib/inttypes.in.h --- a/lib/inttypes.in.h Fri Apr 01 16:04:45 2011 -0700 +++ b/lib/inttypes.in.h Fri May 06 08:15:59 2011 -0700 @@ -1076,6 +1076,7 @@ #if @GNULIB_STRTOIMAX@ # if !@HAVE_DECL_STRTOIMAX@ +# undef strtoimax extern intmax_t strtoimax (const char *, char **, int) _GL_ARG_NONNULL ((1)); # endif #elif defined GNULIB_POSIXCHECK @@ -1088,6 +1089,7 @@ #if @GNULIB_STRTOUMAX@ # if !@HAVE_DECL_STRTOUMAX@ +# undef strtoumax extern uintmax_t strtoumax (const char *, char **, int) _GL_ARG_NONNULL ((1)); # endif #elif defined GNULIB_POSIXCHECK diff -r 04ce36b456cc -r 6758fa38915e lib/ioctl.c --- a/lib/ioctl.c Fri Apr 01 16:04:45 2011 -0700 +++ b/lib/ioctl.c Fri May 06 08:15:59 2011 -0700 @@ -44,35 +44,36 @@ #else /* mingw */ -# define WIN32_LEAN_AND_MEAN -/* Get winsock2.h. */ -# include +# include -/* Get set_winsock_errno, FD_TO_SOCKET etc. */ -# include "w32sock.h" +# include "fd-hook.h" -int -ioctl (int fd, int req, ...) +static int +primary_ioctl (int fd, int request, void *arg) { - void *buf; - va_list args; - SOCKET sock; - int r; - - va_start (args, req); - buf = va_arg (args, void *); - va_end (args); - /* We don't support FIONBIO on pipes here. If you want to make pipe fds non-blocking, use the gnulib 'nonblocking' module, until gnulib implements fcntl F_GETFL / F_SETFL with O_NONBLOCK. */ - sock = FD_TO_SOCKET (fd); - r = ioctlsocket (sock, req, buf); - if (r < 0) - set_winsock_errno (); + errno = ENOSYS; + return -1; +} + +int +ioctl (int fd, int request, ... /* {void *,char *} arg */) +{ + void *arg; + va_list args; - return r; + va_start (args, request); + arg = va_arg (args, void *); + va_end (args); + +# if WINDOWS_SOCKETS + return execute_all_ioctl_hooks (primary_ioctl, fd, request, arg); +# else + return primary_ioctl (fd, request, arg); +# endif } #endif diff -r 04ce36b456cc -r 6758fa38915e lib/isnan.c diff -r 04ce36b456cc -r 6758fa38915e lib/malloc.c --- a/lib/malloc.c Fri Apr 01 16:04:45 2011 -0700 +++ b/lib/malloc.c Fri May 06 08:15:59 2011 -0700 @@ -18,6 +18,7 @@ /* written by Jim Meyering and Bruno Haible */ +#define _GL_USE_STDLIB_ALLOC 1 #include /* Only the AC_FUNC_MALLOC macro defines 'malloc' already in config.h. */ #ifdef malloc @@ -28,14 +29,10 @@ # define NEED_MALLOC_GNU 1 #endif -/* Specification. */ #include #include -/* Call the system's malloc below. */ -#undef malloc - /* Allocate an N-byte block of memory from the heap. If N is zero, allocate a 1-byte block. */ diff -r 04ce36b456cc -r 6758fa38915e lib/malloca.c --- a/lib/malloca.c Fri Apr 01 16:04:45 2011 -0700 +++ b/lib/malloca.c Fri May 06 08:15:59 2011 -0700 @@ -16,6 +16,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +#define _GL_USE_STDLIB_ALLOC 1 #include /* Specification. */ @@ -23,9 +24,6 @@ #include "verify.h" -/* Use the system functions, not the gnulib overrides in this file. */ -#undef malloc - /* The speed critical point in this file is freea() applied to an alloca() result: it must be fast, to match the speed of alloca(). The speed of mmalloca() and freea() in the other case are not critical, because they diff -r 04ce36b456cc -r 6758fa38915e lib/mbrtowc.c --- a/lib/mbrtowc.c Fri Apr 01 16:04:45 2011 -0700 +++ b/lib/mbrtowc.c Fri May 06 08:15:59 2011 -0700 @@ -335,7 +335,7 @@ { static mbstate_t internal_state; - /* Override mbrtowc's internal state. We can not call mbsinit() on the + /* Override mbrtowc's internal state. We cannot call mbsinit() on the hidden internal state, but we can call it on our variable. */ if (ps == NULL) ps = &internal_state; diff -r 04ce36b456cc -r 6758fa38915e lib/memcasecmp.c diff -r 04ce36b456cc -r 6758fa38915e lib/memchr2.c diff -r 04ce36b456cc -r 6758fa38915e lib/memcmp2.c diff -r 04ce36b456cc -r 6758fa38915e lib/mgetgroups.c --- a/lib/mgetgroups.c Fri Apr 01 16:04:45 2011 -0700 +++ b/lib/mgetgroups.c Fri May 06 08:15:59 2011 -0700 @@ -31,7 +31,7 @@ #endif #include "getugroups.h" -#include "xalloc.h" +#include "xalloc-oversized.h" static gid_t * realloc_groupbuf (gid_t *g, size_t num) @@ -193,14 +193,3 @@ return ng; } - -/* Like mgetgroups, but call xalloc_die on allocation failure. */ - -int -xgetgroups (char const *username, gid_t gid, gid_t **groups) -{ - int result = mgetgroups (username, gid, groups); - if (result == -1 && errno == ENOMEM) - xalloc_die (); - return result; -} diff -r 04ce36b456cc -r 6758fa38915e lib/mgetgroups.h --- a/lib/mgetgroups.h Fri Apr 01 16:04:45 2011 -0700 +++ b/lib/mgetgroups.h Fri May 06 08:15:59 2011 -0700 @@ -17,4 +17,6 @@ #include int mgetgroups (const char *username, gid_t gid, gid_t **groups); +#if GNULIB_XGETGROUPS int xgetgroups (const char *username, gid_t gid, gid_t **groups); +#endif diff -r 04ce36b456cc -r 6758fa38915e lib/mkstemp.c --- a/lib/mkstemp.c Fri Apr 01 16:04:45 2011 -0700 +++ b/lib/mkstemp.c Fri May 06 08:15:59 2011 -0700 @@ -38,7 +38,11 @@ /* Generate a unique temporary file name from XTEMPLATE. The last six characters of XTEMPLATE must be "XXXXXX"; they are replaced with a string that makes the file name unique. - Then open the file and return a fd. */ + Then open the file and return a fd. + + If you are creating temporary files which will later be removed, + consider using the clean-temp module, which avoids several pitfalls + of using mkstemp directly. */ int mkstemp (char *xtemplate) { diff -r 04ce36b456cc -r 6758fa38915e lib/netdb.in.h --- a/lib/netdb.in.h Fri Apr 01 16:04:45 2011 -0700 +++ b/lib/netdb.in.h Fri May 06 08:15:59 2011 -0700 @@ -41,6 +41,8 @@ 'struct hostent' on MinGW. */ #include +/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */ + /* The definition of _GL_ARG_NONNULL is copied here. */ /* The definition of _GL_WARN_ON_USE is copied here. */ @@ -52,6 +54,10 @@ # if !@HAVE_STRUCT_ADDRINFO@ +# ifdef __cplusplus +extern "C" { +# endif + # if !GNULIB_defined_struct_addrinfo /* Structure to contain information about address of a service provider. */ struct addrinfo @@ -67,6 +73,11 @@ }; # define GNULIB_defined_struct_addrinfo 1 # endif + +# ifdef __cplusplus +} +# endif + # endif /* Possible values for `ai_flags' field in `addrinfo' structure. */ @@ -153,37 +164,67 @@ socket addresses. For more details, see the POSIX:2001 specification . */ -extern int getaddrinfo (const char *restrict nodename, - const char *restrict servname, - const struct addrinfo *restrict hints, - struct addrinfo **restrict res) - _GL_ARG_NONNULL ((4)); +_GL_FUNCDECL_SYS (getaddrinfo, int, + (const char *restrict nodename, + const char *restrict servname, + const struct addrinfo *restrict hints, + struct addrinfo **restrict res) + _GL_ARG_NONNULL ((4))); # endif +_GL_CXXALIAS_SYS (getaddrinfo, int, + (const char *restrict nodename, + const char *restrict servname, + const struct addrinfo *restrict hints, + struct addrinfo **restrict res)); +_GL_CXXALIASWARN (getaddrinfo); # if !@HAVE_DECL_FREEADDRINFO@ /* Free `addrinfo' structure AI including associated storage. For more details, see the POSIX:2001 specification . */ -extern void freeaddrinfo (struct addrinfo *ai) _GL_ARG_NONNULL ((1)); +_GL_FUNCDECL_SYS (freeaddrinfo, void, (struct addrinfo *ai) + _GL_ARG_NONNULL ((1))); # endif +_GL_CXXALIAS_SYS (freeaddrinfo, void, (struct addrinfo *ai)); +_GL_CXXALIASWARN (freeaddrinfo); -# if !@HAVE_DECL_GAI_STRERROR@ +# if @REPLACE_GAI_STRERROR@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef gai_strerror +# define gai_strerror rpl_gai_strerror +# endif +_GL_FUNCDECL_RPL (gai_strerror, const char *, (int ecode)); +_GL_CXXALIAS_RPL (gai_strerror, const char *, (int ecode)); +# else +# if !@HAVE_DECL_GAI_STRERROR@ /* Convert error return from getaddrinfo() to a string. For more details, see the POSIX:2001 specification . */ -extern const char *gai_strerror (int ecode); +_GL_FUNCDECL_SYS (gai_strerror, const char *, (int ecode)); +# endif +_GL_CXXALIAS_SYS (gai_strerror, const char *, (int ecode)); # endif +_GL_CXXALIASWARN (gai_strerror); # if !@HAVE_DECL_GETNAMEINFO@ /* Convert socket address to printable node and service names. For more details, see the POSIX:2001 specification . */ -extern int getnameinfo (const struct sockaddr *restrict sa, socklen_t salen, +_GL_FUNCDECL_SYS (getnameinfo, int, + (const struct sockaddr *restrict sa, socklen_t salen, + char *restrict node, socklen_t nodelen, + char *restrict service, socklen_t servicelen, + int flags) + _GL_ARG_NONNULL ((1))); +# endif +/* Need to cast, because on glibc systems, the seventh parameter is + unsigned int flags. */ +_GL_CXXALIAS_SYS_CAST (getnameinfo, int, + (const struct sockaddr *restrict sa, socklen_t salen, char *restrict node, socklen_t nodelen, char *restrict service, socklen_t servicelen, - int flags) - _GL_ARG_NONNULL ((1)); -# endif + int flags)); +_GL_CXXALIASWARN (getnameinfo); /* Possible flags for getnameinfo. */ # ifndef NI_NUMERICHOST diff -r 04ce36b456cc -r 6758fa38915e lib/nonblocking.c --- a/lib/nonblocking.c Fri Apr 01 16:04:45 2011 -0700 +++ b/lib/nonblocking.c Fri May 06 08:15:59 2011 -0700 @@ -113,7 +113,7 @@ # include -# if !O_NONBLOCK +# if GNULIB_defined_O_NONBLOCK # error Please port nonblocking to your platform # endif diff -r 04ce36b456cc -r 6758fa38915e lib/open.c --- a/lib/open.c Fri Apr 01 16:04:45 2011 -0700 +++ b/lib/open.c Fri May 06 08:15:59 2011 -0700 @@ -63,6 +63,15 @@ va_end (arg); } +#if GNULIB_defined_O_NONBLOCK + /* The only known platform that lacks O_NONBLOCK is mingw, but it + also lacks named pipes and Unix sockets, which are the only two + file types that require non-blocking handling in open(). + Therefore, it is safe to ignore O_NONBLOCK here. It is handy + that mingw also lacks openat(), so that is also covered here. */ + flags &= ~O_NONBLOCK; +#endif + #if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ if (strcmp (filename, "/dev/null") == 0) filename = "NUL"; diff -r 04ce36b456cc -r 6758fa38915e lib/parse-datetime.y diff -r 04ce36b456cc -r 6758fa38915e lib/passfd.c --- a/lib/passfd.c Fri Apr 01 16:04:45 2011 -0700 +++ b/lib/passfd.c Fri May 06 08:15:59 2011 -0700 @@ -24,20 +24,23 @@ #include #include #include -#include #include #include -#if HAVE_SYS_UN_H -# include -#endif #include "cloexec.h" +/* The code that uses CMSG_FIRSTHDR is enabled on + Linux, MacOS X, FreeBSD, OpenBSD, NetBSD, AIX, OSF/1, Cygwin. + The code that uses HAVE_STRUCT_MSGHDR_MSG_ACCRIGHTS is enabled on + HP-UX, IRIX, Solaris. */ + +/* MSG_CMSG_CLOEXEC is defined only on Linux, as of 2011. */ #ifndef MSG_CMSG_CLOEXEC # define MSG_CMSG_CLOEXEC 0 #endif +#if HAVE_SENDMSG /* sendfd sends the file descriptor fd along the socket to a process calling recvfd on the other end. @@ -46,24 +49,24 @@ int sendfd (int sock, int fd) { - char send = 0; + char byte = 0; struct iovec iov; struct msghdr msg; -#if HAVE_UNIXSOCKET_SCM_RIGHTS_BSD44_WAY +# ifdef CMSG_FIRSTHDR struct cmsghdr *cmsg; char buf[CMSG_SPACE (sizeof fd)]; -#endif +# endif /* send at least one char */ memset (&msg, 0, sizeof msg); - iov.iov_base = &send; + iov.iov_base = &byte; iov.iov_len = 1; msg.msg_iov = &iov; msg.msg_iovlen = 1; msg.msg_name = NULL; msg.msg_namelen = 0; -#if HAVE_UNIXSOCKET_SCM_RIGHTS_BSD44_WAY +# ifdef CMSG_FIRSTHDR msg.msg_control = buf; msg.msg_controllen = sizeof buf; cmsg = CMSG_FIRSTHDR (&msg); @@ -72,19 +75,29 @@ cmsg->cmsg_len = CMSG_LEN (sizeof fd); /* Initialize the payload: */ memcpy (CMSG_DATA (cmsg), &fd, sizeof fd); -#elif HAVE_UNIXSOCKET_SCM_RIGHTS_BSD43_WAY +# elif HAVE_STRUCT_MSGHDR_MSG_ACCRIGHTS msg.msg_accrights = &fd; msg.msg_accrightslen = sizeof fd; -#else +# else errno = ENOSYS; return -1; -#endif +# endif if (sendmsg (sock, &msg, 0) != iov.iov_len) return -1; return 0; } +#else +int +sendfd (int sock _GL_UNUSED, int fd _GL_UNUSED) +{ + errno = ENOSYS; + return -1; +} +#endif + +#if HAVE_RECVMSG /* recvfd receives a file descriptor through the socket. The flags are a bitmask, possibly including O_CLOEXEC (defined in ). @@ -93,15 +106,15 @@ int recvfd (int sock, int flags) { - char recv = 0; + char byte = 0; struct iovec iov; struct msghdr msg; int fd = -1; -#if HAVE_UNIXSOCKET_SCM_RIGHTS_BSD44_WAY +# ifdef CMSG_FIRSTHDR struct cmsghdr *cmsg; char buf[CMSG_SPACE (sizeof fd)]; int flags_recvmsg = flags & O_CLOEXEC ? MSG_CMSG_CLOEXEC : 0; -#endif +# endif if ((flags & ~O_CLOEXEC) != 0) { @@ -111,14 +124,14 @@ /* send at least one char */ memset (&msg, 0, sizeof msg); - iov.iov_base = &recv; + iov.iov_base = &byte; iov.iov_len = 1; msg.msg_iov = &iov; msg.msg_iovlen = 1; msg.msg_name = NULL; msg.msg_namelen = 0; -#if HAVE_UNIXSOCKET_SCM_RIGHTS_BSD44_WAY +# ifdef CMSG_FIRSTHDR msg.msg_control = buf; msg.msg_controllen = sizeof buf; cmsg = CMSG_FIRSTHDR (&msg); @@ -156,7 +169,7 @@ } } -#elif HAVE_UNIXSOCKET_SCM_RIGHTS_BSD43_WAY +# elif HAVE_STRUCT_MSGHDR_MSG_ACCRIGHTS msg.msg_accrights = &fd; msg.msg_accrightslen = sizeof fd; if (recvmsg (sock, &msg, 0) < 0) @@ -173,9 +186,17 @@ return -1; } } -#else +# else errno = ENOSYS; -#endif +# endif return fd; } +#else +int +recvfd (int sock _GL_UNUSED, int flags _GL_UNUSED) +{ + errno = ENOSYS; + return -1; +} +#endif diff -r 04ce36b456cc -r 6758fa38915e lib/pipe-filter-aux.h --- a/lib/pipe-filter-aux.h Fri Apr 01 16:04:45 2011 -0700 +++ b/lib/pipe-filter-aux.h Fri May 06 08:15:59 2011 -0700 @@ -102,9 +102,6 @@ #endif /* Non-blocking I/O. */ -#ifndef O_NONBLOCK -# define O_NONBLOCK O_NDELAY -#endif #if HAVE_SELECT # define IS_EAGAIN(errcode) 0 #else diff -r 04ce36b456cc -r 6758fa38915e lib/pipe2.c --- a/lib/pipe2.c Fri Apr 01 16:04:45 2011 -0700 +++ b/lib/pipe2.c Fri May 06 08:15:59 2011 -0700 @@ -24,6 +24,7 @@ #include #include "binary-io.h" +#include "nonblocking.h" #if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ /* Native Woe32 API. */ @@ -55,34 +56,37 @@ } #endif -#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ -/* Native Woe32 API. */ - /* Check the supported flags. */ - if ((flags & ~(O_CLOEXEC | O_BINARY | O_TEXT)) != 0) + if ((flags & ~(O_CLOEXEC | O_NONBLOCK | O_BINARY | O_TEXT)) != 0) { errno = EINVAL; return -1; } - return _pipe (fd, 4096, flags); +#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ +/* Native Woe32 API. */ + + if (_pipe (fd, 4096, flags & ~O_NONBLOCK) < 0) + return -1; + + if (flags & O_NONBLOCK) + { + if (set_nonblocking_flag (fd[0], true) != 0 + || set_nonblocking_flag (fd[1], true) != 0) + goto fail; + } + + return 0; #else /* Unix API. */ - /* Check the supported flags. */ - if ((flags & ~(O_CLOEXEC | O_NONBLOCK | O_TEXT | O_BINARY)) != 0) - { - errno = EINVAL; - return -1; - } - if (pipe (fd) < 0) return -1; /* POSIX says that initially, the O_NONBLOCK and FD_CLOEXEC flags are cleared on - both fd[0] amd fd[1]. */ + both fd[0] and fd[1]. */ if (flags & O_NONBLOCK) { @@ -121,6 +125,8 @@ return 0; +#endif + fail: { int saved_errno = errno; @@ -129,6 +135,4 @@ errno = saved_errno; return -1; } - -#endif } diff -r 04ce36b456cc -r 6758fa38915e lib/progreloc.c --- a/lib/progreloc.c Fri Apr 01 16:04:45 2011 -0700 +++ b/lib/progreloc.c Fri May 06 08:15:59 2011 -0700 @@ -16,6 +16,7 @@ along with this program. If not, see . */ +#define _GL_USE_STDLIB_ALLOC 1 #include /* Specification. */ @@ -94,7 +95,6 @@ #undef close /* Use the system functions, not the gnulib overrides in this file. */ -#undef malloc #undef sprintf #undef set_program_name diff -r 04ce36b456cc -r 6758fa38915e lib/propername.c diff -r 04ce36b456cc -r 6758fa38915e lib/quotearg.c --- a/lib/quotearg.c Fri Apr 01 16:04:45 2011 -0700 +++ b/lib/quotearg.c Fri May 06 08:15:59 2011 -0700 @@ -168,10 +168,10 @@ static struct quoting_options quoting_options_from_style (enum quoting_style style) { - struct quoting_options o; + struct quoting_options o = { 0 }; + if (style == custom_quoting_style) + abort (); o.style = style; - o.flags = 0; - memset (o.quote_these_too, 0, sizeof o.quote_these_too); return o; } diff -r 04ce36b456cc -r 6758fa38915e lib/read.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/read.c Fri May 06 08:15:59 2011 -0700 @@ -0,0 +1,59 @@ +/* POSIX compatible read() function. + Copyright (C) 2008-2011 Free Software Foundation, Inc. + Written by Bruno Haible , 2011. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +#include + +/* Specification. */ +#include + +/* Replace this function only if module 'nonblocking' is requested. */ +#if GNULIB_NONBLOCKING + +# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ + +# include +# include + +# define WIN32_LEAN_AND_MEAN /* avoid including junk */ +# include + +ssize_t +rpl_read (int fd, void *buf, size_t count) +#undef read +{ + ssize_t ret = read (fd, buf, count); + + if (ret < 0 + && GetLastError () == ERROR_NO_DATA) + { + HANDLE h = (HANDLE) _get_osfhandle (fd); + if (GetFileType (h) == FILE_TYPE_PIPE) + { + /* h is a pipe or socket. */ + DWORD state; + if (GetNamedPipeHandleState (h, &state, NULL, NULL, NULL, NULL, 0) + && (state & PIPE_NOWAIT) != 0) + /* h is a pipe in non-blocking mode. + Change errno from EINVAL to EAGAIN. */ + errno = EAGAIN; + } + } + return ret; +} + +# endif +#endif diff -r 04ce36b456cc -r 6758fa38915e lib/realloc.c --- a/lib/realloc.c Fri Apr 01 16:04:45 2011 -0700 +++ b/lib/realloc.c Fri May 06 08:15:59 2011 -0700 @@ -18,6 +18,7 @@ /* written by Jim Meyering and Bruno Haible */ +#define _GL_USE_STDLIB_ALLOC 1 #include /* Only the AC_FUNC_REALLOC macro defines 'realloc' already in config.h. */ @@ -34,23 +35,10 @@ # define SYSTEM_MALLOC_GLIBC_COMPATIBLE 1 #endif -/* Below we want to call the system's malloc and realloc. - Undefine the symbols here so that including provides a - declaration of malloc(), not of rpl_malloc(), and likewise for realloc. */ -#undef malloc -#undef realloc - -/* Specification. */ #include #include -/* Below we want to call the system's malloc and realloc. - Undefine the symbols, if they were defined by gnulib's - replacement. */ -#undef malloc -#undef realloc - /* Change the size of an allocated block of memory P to N bytes, with error checking. If N is zero, change it to 1. If P is NULL, use malloc. */ diff -r 04ce36b456cc -r 6758fa38915e lib/relocatable.c --- a/lib/relocatable.c Fri Apr 01 16:04:45 2011 -0700 +++ b/lib/relocatable.c Fri May 06 08:15:59 2011 -0700 @@ -25,6 +25,7 @@ # define _GNU_SOURCE 1 #endif +#define _GL_USE_STDLIB_ALLOC 1 #include /* Specification. */ @@ -86,9 +87,6 @@ # define FILE_SYSTEM_PREFIX_LEN(P) 0 #endif -/* Use the system functions, not the gnulib overrides in this file. */ -#undef malloc - /* Original installation prefix. */ static char *orig_prefix; static size_t orig_prefix_len; diff -r 04ce36b456cc -r 6758fa38915e lib/relocwrapper.c --- a/lib/relocwrapper.c Fri Apr 01 16:04:45 2011 -0700 +++ b/lib/relocwrapper.c Fri May 06 08:15:59 2011 -0700 @@ -20,7 +20,9 @@ -> progname -> progreloc -> areadlink - -> readlink + -> careadlinkat + -> allocator + -> readlink -> canonicalize-lgpl -> malloca -> readlink @@ -43,6 +45,7 @@ libc functions, no gettext(), no error(), no xmalloc(), no xsetenv(). */ +#define _GL_USE_STDLIB_ALLOC 1 #include #include @@ -58,7 +61,6 @@ /* Use the system functions, not the gnulib overrides in this file. */ #undef fprintf -#undef malloc /* Return a copy of the filename, with an extra ".bin" at the end. More generally, it replaces "${EXEEXT}" at the end with ".bin${EXEEXT}". */ diff -r 04ce36b456cc -r 6758fa38915e lib/save-cwd.c --- a/lib/save-cwd.c Fri Apr 01 16:04:45 2011 -0700 +++ b/lib/save-cwd.c Fri May 06 08:15:59 2011 -0700 @@ -50,7 +50,8 @@ The `raison d'etre' for this interface is that the working directory is sometimes inaccessible, and getcwd is not robust or as efficient. So, we prefer to use the open/fchdir approach, but fall back on - getcwd if necessary. + getcwd if necessary. This module works for most cases with just + the getcwd-lgpl module, but to be truly robust, use the getcwd module. Some systems lack fchdir altogether: e.g., OS/2, pre-2001 Cygwin, SCO Xenix. Also, SunOS 4 and Irix 5.3 provide the function, yet it diff -r 04ce36b456cc -r 6758fa38915e lib/setenv.c --- a/lib/setenv.c Fri Apr 01 16:04:45 2011 -0700 +++ b/lib/setenv.c Fri May 06 08:15:59 2011 -0700 @@ -15,6 +15,7 @@ along with this program. If not, see . */ #if !_LIBC +# define _GL_USE_STDLIB_ALLOC 1 # include #endif @@ -64,10 +65,6 @@ # define clearenv __clearenv # define tfind __tfind # define tsearch __tsearch -#else -/* Use the system functions, not the gnulib overrides in this file. */ -# undef malloc -# undef realloc #endif /* In the GNU C library implementation we try to be more clever and diff -r 04ce36b456cc -r 6758fa38915e lib/signal.in.h --- a/lib/signal.in.h Fri Apr 01 16:04:45 2011 -0700 +++ b/lib/signal.in.h Fri May 06 08:15:59 2011 -0700 @@ -66,6 +66,20 @@ # endif #endif +/* Define sighandler_t, the type of signal handlers. A GNU extension. */ +#if !@HAVE_SIGHANDLER_T@ +# ifdef __cplusplus +extern "C" { +# endif +# if !GNULIB_defined_sighandler_t +typedef void (*sighandler_t) (int); +# define GNULIB_defined_sighandler_t 1 +# endif +# ifdef __cplusplus +} +# endif +#endif + #if @GNULIB_SIGNAL_H_SIGPIPE@ # ifndef SIGPIPE diff -r 04ce36b456cc -r 6758fa38915e lib/sockets.c --- a/lib/sockets.c Fri Apr 01 16:04:45 2011 -0700 +++ b/lib/sockets.c Fri May 06 08:15:59 2011 -0700 @@ -27,13 +27,15 @@ /* This includes winsock2.h on MinGW. */ # include -# include "close-hook.h" +# include "fd-hook.h" /* Get set_winsock_errno, FD_TO_SOCKET etc. */ # include "w32sock.h" static int -close_fd_maybe_socket (int fd, const struct close_hook *remaining_list) +close_fd_maybe_socket (const struct fd_hook *remaining_list, + gl_close_fn primary, + int fd) { SOCKET sock; WSANETWORKEVENTS ev; @@ -64,10 +66,38 @@ } else /* Some other type of file descriptor. */ - return execute_close_hooks (fd, remaining_list); + return execute_close_hooks (remaining_list, primary, fd); } -static struct close_hook close_sockets_hook; +static int +ioctl_fd_maybe_socket (const struct fd_hook *remaining_list, + gl_ioctl_fn primary, + int fd, int request, void *arg) +{ + SOCKET sock; + WSANETWORKEVENTS ev; + + /* Test whether fd refers to a socket. */ + sock = FD_TO_SOCKET (fd); + ev.lNetworkEvents = 0xDEADBEEF; + WSAEnumNetworkEvents (sock, NULL, &ev); + if (ev.lNetworkEvents != 0xDEADBEEF) + { + /* fd refers to a socket. */ + if (ioctlsocket (sock, request, arg) < 0) + { + set_winsock_errno (); + return -1; + } + else + return 0; + } + else + /* Some other type of file descriptor. */ + return execute_ioctl_hooks (remaining_list, primary, fd, request, arg); +} + +static struct fd_hook fd_sockets_hook; static int initialized_sockets_version /* = 0 */; @@ -90,7 +120,8 @@ return 2; if (initialized_sockets_version == 0) - register_close_hook (close_fd_maybe_socket, &close_sockets_hook); + register_fd_hook (close_fd_maybe_socket, ioctl_fd_maybe_socket, + &fd_sockets_hook); initialized_sockets_version = version; } @@ -107,7 +138,7 @@ initialized_sockets_version = 0; - unregister_close_hook (&close_sockets_hook); + unregister_fd_hook (&fd_sockets_hook); err = WSACleanup (); if (err != 0) diff -r 04ce36b456cc -r 6758fa38915e lib/stat-time.h --- a/lib/stat-time.h Fri Apr 01 16:04:45 2011 -0700 +++ b/lib/stat-time.h Fri May 06 08:15:59 2011 -0700 @@ -175,7 +175,7 @@ using zero. Attempt to work around this problem. Alas, this can report failure even for valid time stamps. Also, NetBSD sometimes returns junk in the birth time fields; work around this - bug if it it is detected. There's no need to detect negative + bug if it is detected. There's no need to detect negative tv_nsec junk as negative tv_nsec already indicates an error. */ if (t.tv_sec == 0 || 1000000000 <= t.tv_nsec) t.tv_nsec = -1; diff -r 04ce36b456cc -r 6758fa38915e lib/stdio-read.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/stdio-read.c Fri May 06 08:15:59 2011 -0700 @@ -0,0 +1,148 @@ +/* POSIX compatible FILE stream read function. + Copyright (C) 2008-2011 Free Software Foundation, Inc. + Written by Bruno Haible , 2011. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +#include + +/* Specification. */ +#include + +/* Replace these functions only if module 'nonblocking' is requested. */ +#if GNULIB_NONBLOCKING + +/* On native Windows platforms, when read() is called on a non-blocking pipe + with an empty buffer, ReadFile() fails with error GetLastError() = + ERROR_NO_DATA, and read() in consequence fails with error EINVAL. This + read() function is at the basis of the function which fills the buffer of + a FILE stream. */ + +# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ + +# include +# include + +# define WIN32_LEAN_AND_MEAN /* avoid including junk */ +# include + +# define CALL_WITH_ERRNO_FIX(RETTYPE, EXPRESSION, FAILED) \ + if (ferror (stream)) \ + return (EXPRESSION); \ + else \ + { \ + RETTYPE ret; \ + SetLastError (0); \ + ret = (EXPRESSION); \ + if (FAILED) \ + { \ + if (GetLastError () == ERROR_NO_DATA && ferror (stream)) \ + { \ + int fd = fileno (stream); \ + if (fd >= 0) \ + { \ + HANDLE h = (HANDLE) _get_osfhandle (fd); \ + if (GetFileType (h) == FILE_TYPE_PIPE) \ + { \ + /* h is a pipe or socket. */ \ + DWORD state; \ + if (GetNamedPipeHandleState (h, &state, NULL, NULL, \ + NULL, NULL, 0) \ + && (state & PIPE_NOWAIT) != 0) \ + /* h is a pipe in non-blocking mode. \ + Change errno from EINVAL to EAGAIN. */ \ + errno = EAGAIN; \ + } \ + } \ + } \ + } \ + return ret; \ + } + +int +scanf (const char *format, ...) +{ + int retval; + va_list args; + + va_start (args, format); + retval = vfscanf (stdin, format, args); + va_end (args); + + return retval; +} + +int +fscanf (FILE *stream, const char *format, ...) +{ + int retval; + va_list args; + + va_start (args, format); + retval = vfscanf (stream, format, args); + va_end (args); + + return retval; +} + +int +vscanf (const char *format, va_list args) +{ + return vfscanf (stdin, format, args); +} + +int +vfscanf (FILE *stream, const char *format, va_list args) +#undef vfscanf +{ + CALL_WITH_ERRNO_FIX (int, vfscanf (stream, format, args), ret == EOF) +} + +int +getchar (void) +{ + return fgetc (stdin); +} + +int +fgetc (FILE *stream) +#undef fgetc +{ + CALL_WITH_ERRNO_FIX (int, fgetc (stream), ret == EOF) +} + +char * +fgets (char *s, int n, FILE *stream) +#undef fgets +{ + CALL_WITH_ERRNO_FIX (char *, fgets (s, n, stream), ret == NULL) +} + +char * +gets (char *s) +#undef gets +{ + FILE *stream = stdin; + CALL_WITH_ERRNO_FIX (char *, gets (s), ret == NULL) +} + +size_t +fread (void *ptr, size_t s, size_t n, FILE *stream) +#undef fread +{ + CALL_WITH_ERRNO_FIX (size_t, fread (ptr, s, n, stream), ret < n) +} + +# endif +#endif diff -r 04ce36b456cc -r 6758fa38915e lib/stdio-write.c --- a/lib/stdio-write.c Fri Apr 01 16:04:45 2011 -0700 +++ b/lib/stdio-write.c Fri May 06 08:15:59 2011 -0700 @@ -20,8 +20,9 @@ /* Specification. */ #include -/* Replace these functions only if module 'sigpipe' is requested. */ -#if GNULIB_SIGPIPE +/* Replace these functions only if module 'nonblocking' or module 'sigpipe' is + requested. */ +#if GNULIB_NONBLOCKING || GNULIB_SIGPIPE /* On native Windows platforms, SIGPIPE does not exist. When write() is called on a pipe with no readers, WriteFile() fails with error @@ -38,26 +39,73 @@ # define WIN32_LEAN_AND_MEAN /* avoid including junk */ # include +# if GNULIB_NONBLOCKING +# define CLEAR_ERRNO \ + errno = 0; +# define HANDLE_ENOSPC \ + if (errno == ENOSPC && ferror (stream)) \ + { \ + int fd = fileno (stream); \ + if (fd >= 0) \ + { \ + HANDLE h = (HANDLE) _get_osfhandle (fd); \ + if (GetFileType (h) == FILE_TYPE_PIPE) \ + { \ + /* h is a pipe or socket. */ \ + DWORD state; \ + if (GetNamedPipeHandleState (h, &state, NULL, NULL, \ + NULL, NULL, 0) \ + && (state & PIPE_NOWAIT) != 0) \ + /* h is a pipe in non-blocking mode. \ + Change errno from ENOSPC to EAGAIN. */ \ + errno = EAGAIN; \ + } \ + } \ + } \ + else +# else +# define CLEAR_ERRNO +# define HANDLE_ENOSPC +# endif + +# if GNULIB_SIGPIPE +# define CLEAR_LastError \ + SetLastError (0); +# define HANDLE_ERROR_NO_DATA \ + if (GetLastError () == ERROR_NO_DATA && ferror (stream)) \ + { \ + int fd = fileno (stream); \ + if (fd >= 0 \ + && GetFileType ((HANDLE) _get_osfhandle (fd)) \ + == FILE_TYPE_PIPE) \ + { \ + /* Try to raise signal SIGPIPE. */ \ + raise (SIGPIPE); \ + /* If it is currently blocked or ignored, change errno from \ + EINVAL to EPIPE. */ \ + errno = EPIPE; \ + } \ + } \ + else +# else +# define CLEAR_LastError +# define HANDLE_ERROR_NO_DATA +# endif + # define CALL_WITH_SIGPIPE_EMULATION(RETTYPE, EXPRESSION, FAILED) \ if (ferror (stream)) \ return (EXPRESSION); \ else \ { \ RETTYPE ret; \ - SetLastError (0); \ + CLEAR_ERRNO \ + CLEAR_LastError \ ret = (EXPRESSION); \ - if (FAILED && GetLastError () == ERROR_NO_DATA && ferror (stream)) \ + if (FAILED) \ { \ - int fd = fileno (stream); \ - if (fd >= 0 \ - && GetFileType ((HANDLE) _get_osfhandle (fd)) == FILE_TYPE_PIPE)\ - { \ - /* Try to raise signal SIGPIPE. */ \ - raise (SIGPIPE); \ - /* If it is currently blocked or ignored, change errno from \ - EINVAL to EPIPE. */ \ - errno = EPIPE; \ - } \ + HANDLE_ENOSPC \ + HANDLE_ERROR_NO_DATA \ + ; \ } \ return ret; \ } diff -r 04ce36b456cc -r 6758fa38915e lib/stdio.in.h --- a/lib/stdio.in.h Fri Apr 01 16:04:45 2011 -0700 +++ b/lib/stdio.in.h Fri May 06 08:15:59 2011 -0700 @@ -87,6 +87,25 @@ #define _GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM(formatstring_parameter, first_argument) \ _GL_ATTRIBUTE_FORMAT ((__printf__, formatstring_parameter, first_argument)) +/* _GL_ATTRIBUTE_FORMAT_SCANF + indicates to GCC that the function takes a format string and arguments, + where the format string directives are the ones standardized by ISO C99 + and POSIX. */ +#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4) +# define _GL_ATTRIBUTE_FORMAT_SCANF(formatstring_parameter, first_argument) \ + _GL_ATTRIBUTE_FORMAT ((__gnu_scanf__, formatstring_parameter, first_argument)) +#else +# define _GL_ATTRIBUTE_FORMAT_SCANF(formatstring_parameter, first_argument) \ + _GL_ATTRIBUTE_FORMAT ((__scanf__, formatstring_parameter, first_argument)) +#endif + +/* _GL_ATTRIBUTE_FORMAT_SCANF_SYSTEM is like _GL_ATTRIBUTE_FORMAT_SCANF, + except that it indicates to GCC that the supported format string directives + are the ones of the system scanf(), rather than the ones standardized by + ISO C99 and POSIX. */ +#define _GL_ATTRIBUTE_FORMAT_SCANF_SYSTEM(formatstring_parameter, first_argument) \ + _GL_ATTRIBUTE_FORMAT ((__scanf__, formatstring_parameter, first_argument)) + /* Solaris 10 declares renameat in , not in . */ /* But in any case avoid namespace pollution on glibc systems. */ #if (@GNULIB_RENAMEAT@ || defined GNULIB_POSIXCHECK) && defined __sun \ @@ -175,11 +194,34 @@ "use gnulib module fflush for portable POSIX compliance"); #endif -/* It is very rare that the developer ever has full control of stdin, - so any use of gets warrants an unconditional warning. Assume it is - always declared, since it is required by C89. */ -#undef gets -_GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead"); +#if @GNULIB_FGETC@ +# if @REPLACE_STDIO_READ_FUNCS@ && @GNULIB_STDIO_H_NONBLOCKING@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef fgetc +# define fgetc rpl_fgetc +# endif +_GL_FUNCDECL_RPL (fgetc, int, (FILE *stream) _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (fgetc, int, (FILE *stream)); +# else +_GL_CXXALIAS_SYS (fgetc, int, (FILE *stream)); +# endif +_GL_CXXALIASWARN (fgetc); +#endif + +#if @GNULIB_FGETS@ +# if @REPLACE_STDIO_READ_FUNCS@ && @GNULIB_STDIO_H_NONBLOCKING@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef fgets +# define fgets rpl_fgets +# endif +_GL_FUNCDECL_RPL (fgets, char *, (char *s, int n, FILE *stream) + _GL_ARG_NONNULL ((1, 3))); +_GL_CXXALIAS_RPL (fgets, char *, (char *s, int n, FILE *stream)); +# else +_GL_CXXALIAS_SYS (fgets, char *, (char *s, int n, FILE *stream)); +# endif +_GL_CXXALIASWARN (fgets); +#endif #if @GNULIB_FOPEN@ # if @REPLACE_FOPEN@ @@ -203,7 +245,7 @@ #if @GNULIB_FPRINTF_POSIX@ || @GNULIB_FPRINTF@ # if (@GNULIB_FPRINTF_POSIX@ && @REPLACE_FPRINTF@) \ - || (@GNULIB_FPRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@) + || (@GNULIB_FPRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && (@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@)) # if !(defined __cplusplus && defined GNULIB_NAMESPACE) # define fprintf rpl_fprintf # endif @@ -262,7 +304,7 @@ #endif #if @GNULIB_FPUTC@ -# if @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@ +# if @REPLACE_STDIO_WRITE_FUNCS@ && (@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@) # if !(defined __cplusplus && defined GNULIB_NAMESPACE) # undef fputc # define fputc rpl_fputc @@ -276,7 +318,7 @@ #endif #if @GNULIB_FPUTS@ -# if @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@ +# if @REPLACE_STDIO_WRITE_FUNCS@ && (@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@) # if !(defined __cplusplus && defined GNULIB_NAMESPACE) # undef fputs # define fputs rpl_fputs @@ -290,6 +332,21 @@ _GL_CXXALIASWARN (fputs); #endif +#if @GNULIB_FREAD@ +# if @REPLACE_STDIO_READ_FUNCS@ && @GNULIB_STDIO_H_NONBLOCKING@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef fread +# define fread rpl_fread +# endif +_GL_FUNCDECL_RPL (fread, size_t, (void *ptr, size_t s, size_t n, FILE *stream) + _GL_ARG_NONNULL ((4))); +_GL_CXXALIAS_RPL (fread, size_t, (void *ptr, size_t s, size_t n, FILE *stream)); +# else +_GL_CXXALIAS_SYS (fread, size_t, (void *ptr, size_t s, size_t n, FILE *stream)); +# endif +_GL_CXXALIASWARN (fread); +#endif + #if @GNULIB_FREOPEN@ # if @REPLACE_FREOPEN@ # if !(defined __cplusplus && defined GNULIB_NAMESPACE) @@ -314,6 +371,22 @@ "use gnulib module freopen for portability"); #endif +#if @GNULIB_FSCANF@ +# if @REPLACE_STDIO_READ_FUNCS@ && @GNULIB_STDIO_H_NONBLOCKING@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef fscanf +# define fscanf rpl_fscanf +# endif +_GL_FUNCDECL_RPL (fscanf, int, (FILE *stream, const char *format, ...) + _GL_ATTRIBUTE_FORMAT_SCANF_SYSTEM (2, 3) + _GL_ARG_NONNULL ((1, 2))); +_GL_CXXALIAS_RPL (fscanf, int, (FILE *stream, const char *format, ...)); +# else +_GL_CXXALIAS_SYS (fscanf, int, (FILE *stream, const char *format, ...)); +# endif +_GL_CXXALIASWARN (fscanf); +#endif + /* Set up the following warnings, based on which modules are in use. GNU Coding Standards discourage the use of fseek, since it imposes @@ -506,7 +579,7 @@ #if @GNULIB_FWRITE@ -# if @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@ +# if @REPLACE_STDIO_WRITE_FUNCS@ && (@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@) # if !(defined __cplusplus && defined GNULIB_NAMESPACE) # undef fwrite # define fwrite rpl_fwrite @@ -540,6 +613,34 @@ _GL_CXXALIASWARN (fwrite); #endif +#if @GNULIB_GETC@ +# if @REPLACE_STDIO_READ_FUNCS@ && @GNULIB_STDIO_H_NONBLOCKING@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef getc +# define getc rpl_fgetc +# endif +_GL_FUNCDECL_RPL (fgetc, int, (FILE *stream) _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL_1 (getc, rpl_fgetc, int, (FILE *stream)); +# else +_GL_CXXALIAS_SYS (getc, int, (FILE *stream)); +# endif +_GL_CXXALIASWARN (getc); +#endif + +#if @GNULIB_GETCHAR@ +# if @REPLACE_STDIO_READ_FUNCS@ && @GNULIB_STDIO_H_NONBLOCKING@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef getchar +# define getchar rpl_getchar +# endif +_GL_FUNCDECL_RPL (getchar, int, (void)); +_GL_CXXALIAS_RPL (getchar, int, (void)); +# else +_GL_CXXALIAS_SYS (getchar, int, (void)); +# endif +_GL_CXXALIASWARN (getchar); +#endif + #if @GNULIB_GETDELIM@ /* Read input, up to (and including) the next occurrence of DELIMITER, from STREAM, store it in *LINEPTR (and NUL-terminate it). @@ -616,6 +717,26 @@ # endif #endif +#if @GNULIB_GETS@ +# if @REPLACE_STDIO_READ_FUNCS@ && @GNULIB_STDIO_H_NONBLOCKING@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef gets +# define gets rpl_gets +# endif +_GL_FUNCDECL_RPL (gets, char *, (char *s) _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (gets, char *, (char *s)); +# else +_GL_CXXALIAS_SYS (gets, char *, (char *s)); +# undef gets +# endif +_GL_CXXALIASWARN (gets); +/* It is very rare that the developer ever has full control of stdin, + so any use of gets warrants an unconditional warning. Assume it is + always declared, since it is required by C89. */ +_GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead"); +#endif + + #if @GNULIB_OBSTACK_PRINTF@ || @GNULIB_OBSTACK_PRINTF_POSIX@ struct obstack; /* Grow an obstack with formatted output. Return the number of @@ -711,7 +832,7 @@ #if @GNULIB_PRINTF_POSIX@ || @GNULIB_PRINTF@ # if (@GNULIB_PRINTF_POSIX@ && @REPLACE_PRINTF@) \ - || (@GNULIB_PRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@) + || (@GNULIB_PRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && (@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@)) # if defined __GNUC__ # if !(defined __cplusplus && defined GNULIB_NAMESPACE) /* Don't break __attribute__((format(printf,M,N))). */ @@ -760,7 +881,7 @@ #endif #if @GNULIB_PUTC@ -# if @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@ +# if @REPLACE_STDIO_WRITE_FUNCS@ && (@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@) # if !(defined __cplusplus && defined GNULIB_NAMESPACE) # undef putc # define putc rpl_fputc @@ -774,7 +895,7 @@ #endif #if @GNULIB_PUTCHAR@ -# if @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@ +# if @REPLACE_STDIO_WRITE_FUNCS@ && (@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@) # if !(defined __cplusplus && defined GNULIB_NAMESPACE) # undef putchar # define putchar rpl_putchar @@ -788,7 +909,7 @@ #endif #if @GNULIB_PUTS@ -# if @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@ +# if @REPLACE_STDIO_WRITE_FUNCS@ && (@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@) # if !(defined __cplusplus && defined GNULIB_NAMESPACE) # undef puts # define puts rpl_puts @@ -872,6 +993,37 @@ # endif #endif +#if @GNULIB_SCANF@ +# if @REPLACE_STDIO_READ_FUNCS@ && @GNULIB_STDIO_H_NONBLOCKING@ +# if defined __GNUC__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef scanf +/* Don't break __attribute__((format(scanf,M,N))). */ +# define scanf __scanf__ +# endif +_GL_FUNCDECL_RPL_1 (__scanf__, int, + (const char *format, ...) + __asm__ (@ASM_SYMBOL_PREFIX@ + _GL_STDIO_MACROEXPAND_AND_STRINGIZE(rpl_scanf)) + _GL_ATTRIBUTE_FORMAT_SCANF_SYSTEM (1, 2) + _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL_1 (scanf, __scanf__, int, (const char *format, ...)); +# else +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef scanf +# define scanf rpl_scanf +# endif +_GL_FUNCDECL_RPL (scanf, int, (const char *format, ...) + _GL_ATTRIBUTE_FORMAT_SCANF_SYSTEM (1, 2) + _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (scanf, int, (const char *format, ...)); +# endif +# else +_GL_CXXALIAS_SYS (scanf, int, (const char *format, ...)); +# endif +_GL_CXXALIASWARN (scanf); +#endif + #if @GNULIB_SNPRINTF@ # if @REPLACE_SNPRINTF@ # if !(defined __cplusplus && defined GNULIB_NAMESPACE) @@ -1031,7 +1183,7 @@ #if @GNULIB_VFPRINTF_POSIX@ || @GNULIB_VFPRINTF@ # if (@GNULIB_VFPRINTF_POSIX@ && @REPLACE_VFPRINTF@) \ - || (@GNULIB_VFPRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@) + || (@GNULIB_VFPRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && (@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@)) # if !(defined __cplusplus && defined GNULIB_NAMESPACE) # define vfprintf rpl_vfprintf # endif @@ -1065,9 +1217,28 @@ "POSIX compliance"); #endif +#if @GNULIB_VFSCANF@ +# if @REPLACE_STDIO_READ_FUNCS@ && @GNULIB_STDIO_H_NONBLOCKING@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef vfscanf +# define vfscanf rpl_vfscanf +# endif +_GL_FUNCDECL_RPL (vfscanf, int, + (FILE *stream, const char *format, va_list args) + _GL_ATTRIBUTE_FORMAT_SCANF_SYSTEM (2, 0) + _GL_ARG_NONNULL ((1, 2))); +_GL_CXXALIAS_RPL (vfscanf, int, + (FILE *stream, const char *format, va_list args)); +# else +_GL_CXXALIAS_SYS (vfscanf, int, + (FILE *stream, const char *format, va_list args)); +# endif +_GL_CXXALIASWARN (vfscanf); +#endif + #if @GNULIB_VPRINTF_POSIX@ || @GNULIB_VPRINTF@ # if (@GNULIB_VPRINTF_POSIX@ && @REPLACE_VPRINTF@) \ - || (@GNULIB_VPRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@) + || (@GNULIB_VPRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && (@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@)) # if !(defined __cplusplus && defined GNULIB_NAMESPACE) # define vprintf rpl_vprintf # endif @@ -1100,6 +1271,22 @@ "POSIX compliance"); #endif +#if @GNULIB_VSCANF@ +# if @REPLACE_STDIO_READ_FUNCS@ && @GNULIB_STDIO_H_NONBLOCKING@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef vscanf +# define vscanf rpl_vscanf +# endif +_GL_FUNCDECL_RPL (vscanf, int, (const char *format, va_list args) + _GL_ATTRIBUTE_FORMAT_SCANF_SYSTEM (1, 0) + _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (vscanf, int, (const char *format, va_list args)); +# else +_GL_CXXALIAS_SYS (vscanf, int, (const char *format, va_list args)); +# endif +_GL_CXXALIASWARN (vscanf); +#endif + #if @GNULIB_VSNPRINTF@ # if @REPLACE_VSNPRINTF@ # if !(defined __cplusplus && defined GNULIB_NAMESPACE) diff -r 04ce36b456cc -r 6758fa38915e lib/stdlib.in.h --- a/lib/stdlib.in.h Fri Apr 01 16:04:45 2011 -0700 +++ b/lib/stdlib.in.h Fri May 06 08:15:59 2011 -0700 @@ -81,8 +81,9 @@ # endif #endif -#if (@GNULIB_MKSTEMP@ || @GNULIB_GETSUBOPT@ || defined GNULIB_POSIXCHECK) && ! defined __GLIBC__ && !((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__) +#if (@GNULIB_MKSTEMP@ || @GNULIB_MKSTEMPS@ || @GNULIB_GETSUBOPT@ || defined GNULIB_POSIXCHECK) && ! defined __GLIBC__ && !((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__) /* On MacOS X 10.3, only declares mkstemp. */ +/* On MacOS X 10.5, only declares mkstemps. */ /* On Cygwin 1.7.1, only declares getsubopt. */ /* But avoid namespace pollution on glibc systems and native Windows. */ # include @@ -255,9 +256,14 @@ # endif #endif +/* If _GL_USE_STDLIB_ALLOC is nonzero, the including module does not + rely on GNU or POSIX semantics for malloc and realloc (for example, + by never specifying a zero size), so it does not need malloc or + realloc to be redefined. */ #if @GNULIB_MALLOC_POSIX@ # if @REPLACE_MALLOC@ -# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# if !((defined __cplusplus && defined GNULIB_NAMESPACE) \ + || _GL_USE_STDLIB_ALLOC) # undef malloc # define malloc rpl_malloc # endif @@ -267,7 +273,7 @@ _GL_CXXALIAS_SYS (malloc, void *, (size_t size)); # endif _GL_CXXALIASWARN (malloc); -#elif defined GNULIB_POSIXCHECK +#elif defined GNULIB_POSIXCHECK && !_GL_USE_STDLIB_ALLOC # undef malloc /* Assume malloc is always declared. */ _GL_WARN_ON_USE (malloc, "malloc is not POSIX compliant everywhere - " @@ -531,7 +537,8 @@ #if @GNULIB_REALLOC_POSIX@ # if @REPLACE_REALLOC@ -# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# if !((defined __cplusplus && defined GNULIB_NAMESPACE) \ + || _GL_USE_STDLIB_ALLOC) # undef realloc # define realloc rpl_realloc # endif @@ -541,7 +548,7 @@ _GL_CXXALIAS_SYS (realloc, void *, (void *ptr, size_t size)); # endif _GL_CXXALIASWARN (realloc); -#elif defined GNULIB_POSIXCHECK +#elif defined GNULIB_POSIXCHECK && !_GL_USE_STDLIB_ALLOC # undef realloc /* Assume realloc is always declared. */ _GL_WARN_ON_USE (realloc, "realloc is not POSIX compliant everywhere - " diff -r 04ce36b456cc -r 6758fa38915e lib/string.in.h --- a/lib/string.in.h Fri Apr 01 16:04:45 2011 -0700 +++ b/lib/string.in.h Fri May 06 08:15:59 2011 -0700 @@ -277,17 +277,28 @@ /* Find the first occurrence of C in S or the final NUL byte. */ #if @GNULIB_STRCHRNUL@ -# if ! @HAVE_STRCHRNUL@ +# if @REPLACE_STRCHRNUL@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# define strchrnul rpl_strchrnul +# endif +_GL_FUNCDECL_RPL (strchrnul, char *, (const char *__s, int __c_in) + _GL_ATTRIBUTE_PURE + _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (strchrnul, char *, + (const char *str, int ch)); +# else +# if ! @HAVE_STRCHRNUL@ _GL_FUNCDECL_SYS (strchrnul, char *, (char const *__s, int __c_in) _GL_ATTRIBUTE_PURE _GL_ARG_NONNULL ((1))); -# endif +# endif /* On some systems, this function is defined as an overloaded function: extern "C++" { const char * std::strchrnul (const char *, int); } extern "C++" { char * std::strchrnul (char *, int); } */ _GL_CXXALIAS_SYS_CAST2 (strchrnul, char *, (char const *__s, int __c_in), char const *, (char const *__s, int __c_in)); +# endif # if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \ && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)) _GL_CXXALIASWARN1 (strchrnul, char *, (char *__s, int __c_in)); diff -r 04ce36b456cc -r 6758fa38915e lib/strnlen1.c diff -r 04ce36b456cc -r 6758fa38915e lib/strptime.c --- a/lib/strptime.c Fri Apr 01 16:04:45 2011 -0700 +++ b/lib/strptime.c Fri May 06 08:15:59 2011 -0700 @@ -200,7 +200,7 @@ day_of_the_week (struct tm *tm) { /* We know that January 1st 1970 was a Thursday (= 4). Compute the - the difference between this data in the one on TM and so determine + difference between this data in the one on TM and so determine the weekday. */ int corr_year = 1900 + tm->tm_year - (tm->tm_mon < 2); int wday = (-473 diff -r 04ce36b456cc -r 6758fa38915e lib/strtol.c --- a/lib/strtol.c Fri Apr 01 16:04:45 2011 -0700 +++ b/lib/strtol.c Fri May 06 08:15:59 2011 -0700 @@ -186,9 +186,8 @@ # define LOCALE_PARAM_PROTO #endif -#include - #ifdef USE_WIDE_CHAR +# include # include # define L_(Ch) L##Ch # define UCHAR_TYPE wint_t diff -r 04ce36b456cc -r 6758fa38915e lib/sys_socket.in.h --- a/lib/sys_socket.in.h Fri Apr 01 16:04:45 2011 -0700 +++ b/lib/sys_socket.in.h Fri May 06 08:15:59 2011 -0700 @@ -108,6 +108,12 @@ #endif +/* Get struct iovec. */ +/* But avoid namespace pollution on glibc systems. */ +#if ! defined __GLIBC__ +# include +#endif + #if @HAVE_SYS_SOCKET_H@ /* A platform that has . */ @@ -146,7 +152,6 @@ suggests that getaddrinfo should be available on all Windows releases. */ - # if @HAVE_WINSOCK2_H@ # include # endif @@ -177,6 +182,16 @@ # endif +/* Rudimentary 'struct msghdr'; this works as long as you don't try to + access msg_control or msg_controllen. */ +struct msghdr { + void *msg_name; + socklen_t msg_namelen; + struct iovec *msg_iov; + int msg_iovlen; + int msg_flags; +}; + #endif #if @HAVE_WINSOCK2_H@ diff -r 04ce36b456cc -r 6758fa38915e lib/sys_uio.in.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/sys_uio.in.h Fri May 06 08:15:59 2011 -0700 @@ -0,0 +1,64 @@ +/* Substitute for . + Copyright (C) 2011 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software Foundation, + Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + +# if __GNUC__ >= 3 +@PRAGMA_SYSTEM_HEADER@ +# endif +@PRAGMA_COLUMNS@ + +#ifndef _GL_SYS_UIO_H + +#if @HAVE_SYS_UIO_H@ + +/* On OpenBSD 4.4, assumes prior inclusion of . */ +# include + +/* The include_next requires a split double-inclusion guard. */ +# @INCLUDE_NEXT@ @NEXT_SYS_UIO_H@ + +#endif + +#ifndef _GL_SYS_UIO_H +#define _GL_SYS_UIO_H + +#if !@HAVE_SYS_UIO_H@ +/* A platform that lacks . */ +/* Get 'ssize_t'. */ +# include + +# ifdef __cplusplus +extern "C" { +# endif + +# if !GNULIB_defined_struct_iovec +/* All known platforms that lack also lack any declaration + of struct iovec in any other header. */ +struct iovec { + void *iov_base; + size_t iov_len; +}; +# define GNULIB_defined_struct_iovec 1 +# endif + +# ifdef __cplusplus +} +# endif + +#endif + +#endif /* _GL_SYS_UIO_H */ +#endif /* _GL_SYS_UIO_H */ diff -r 04ce36b456cc -r 6758fa38915e lib/unistd.in.h --- a/lib/unistd.in.h Fri Apr 01 16:04:45 2011 -0700 +++ b/lib/unistd.in.h Fri May 06 08:15:59 2011 -0700 @@ -97,7 +97,8 @@ # include #endif -#if (@GNULIB_WRITE@ || @GNULIB_READLINK@ || @GNULIB_READLINKAT@ \ +#if (@GNULIB_READ@ || @GNULIB_WRITE@ \ + || @GNULIB_READLINK@ || @GNULIB_READLINKAT@ \ || @GNULIB_PREAD@ || @GNULIB_PWRITE@ || defined GNULIB_POSIXCHECK) /* Get ssize_t. */ # include @@ -1105,6 +1106,28 @@ #endif +#if @GNULIB_READ@ +/* Read up to COUNT bytes from file descriptor FD into the buffer starting + at BUF. See the POSIX:2001 specification + . */ +# if @REPLACE_READ@ && @GNULIB_UNISTD_H_NONBLOCKING@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef read +# define read rpl_read +# endif +_GL_FUNCDECL_RPL (read, ssize_t, (int fd, void *buf, size_t count) + _GL_ARG_NONNULL ((2))); +_GL_CXXALIAS_RPL (read, ssize_t, (int fd, void *buf, size_t count)); +# else +/* Need to cast, because on mingw, the third parameter is + unsigned int count + and the return type is 'int'. */ +_GL_CXXALIAS_SYS_CAST (read, ssize_t, (int fd, void *buf, size_t count)); +# endif +_GL_CXXALIASWARN (read); +#endif + + #if @GNULIB_READLINK@ /* Read the contents of the symbolic link FILE and place the first BUFSIZE bytes of it into BUF. Return the number of bytes placed into BUF if @@ -1359,7 +1382,7 @@ /* Write up to COUNT bytes starting at BUF to file descriptor FD. See the POSIX:2001 specification . */ -# if @REPLACE_WRITE@ && @GNULIB_UNISTD_H_SIGPIPE@ +# if @REPLACE_WRITE@ && (@GNULIB_UNISTD_H_NONBLOCKING@ || @GNULIB_UNISTD_H_SIGPIPE@) # if !(defined __cplusplus && defined GNULIB_NAMESPACE) # undef write # define write rpl_write diff -r 04ce36b456cc -r 6758fa38915e lib/uniwidth/width.c diff -r 04ce36b456cc -r 6758fa38915e lib/utimecmp.c --- a/lib/utimecmp.c Fri Apr 01 16:04:45 2011 -0700 +++ b/lib/utimecmp.c Fri May 06 08:15:59 2011 -0700 @@ -33,7 +33,6 @@ #include "stat-time.h" #include "utimens.h" #include "verify.h" -#include "xalloc.h" #ifndef MAX # define MAX(a, b) ((a) > (b) ? (a) : (b)) @@ -122,7 +121,9 @@ /* Things to watch out for: The code uses a static hash table internally and is not safe in the - presence of signals, multiple threads, etc. + presence of signals, multiple threads, etc. However, memory pressure + that prevents use of the hash table is not fatal - we just fall back + to redoing the computations on every call in that case. int and long int might be 32 bits. Many of the calculations store numbers up to 2 billion, and multiply by 10; they have to avoid @@ -143,12 +144,13 @@ { /* Look up the time stamp resolution for the destination device. */ - /* Hash table for devices. */ + /* Hash table for caching information learned about devices. */ static Hash_table *ht; /* Information about the destination file system. */ static struct fs_res *new_dst_res; - struct fs_res *dst_res; + struct fs_res *dst_res = NULL; + struct fs_res tmp_dst_res; /* Time stamp resolution in nanoseconds. */ int res; @@ -163,24 +165,46 @@ if (src_s <= dst_s - 2) return 1; + /* Try to do a hash lookup, but fall back to stack variables and + recomputation on low memory situations. */ if (! ht) ht = hash_initialize (16, NULL, dev_info_hash, dev_info_compare, free); - if (! new_dst_res) + if (ht) { - new_dst_res = xmalloc (sizeof *new_dst_res); - new_dst_res->resolution = 2 * BILLION; - new_dst_res->exact = false; + if (! new_dst_res) + { + new_dst_res = malloc (sizeof *new_dst_res); + if (!new_dst_res) + goto low_memory; + new_dst_res->resolution = 2 * BILLION; + new_dst_res->exact = false; + } + new_dst_res->dev = dst_stat->st_dev; + dst_res = hash_insert (ht, new_dst_res); + if (! dst_res) + goto low_memory; + + if (dst_res == new_dst_res) + { + /* NEW_DST_RES is now in use in the hash table, so allocate a + new entry next time. */ + new_dst_res = NULL; + } } - new_dst_res->dev = dst_stat->st_dev; - dst_res = hash_insert (ht, new_dst_res); - if (! dst_res) - xalloc_die (); - - if (dst_res == new_dst_res) + else { - /* NEW_DST_RES is now in use in the hash table, so allocate a - new entry next time. */ - new_dst_res = NULL; + low_memory: + if (ht) + { + tmp_dst_res.dev = dst_stat->st_dev; + dst_res = hash_lookup (ht, &tmp_dst_res); + } + if (!dst_res) + { + dst_res = &tmp_dst_res; + dst_res->resolution = 2 * BILLION; + dst_res->exact = false; + } } res = dst_res->resolution; diff -r 04ce36b456cc -r 6758fa38915e lib/verify.h --- a/lib/verify.h Fri Apr 01 16:04:45 2011 -0700 +++ b/lib/verify.h Fri May 06 08:15:59 2011 -0700 @@ -17,21 +17,41 @@ /* Written by Paul Eggert, Bruno Haible, and Jim Meyering. */ -#ifndef VERIFY_H -# define VERIFY_H 1 +#ifndef _GL_VERIFY_H +# define _GL_VERIFY_H + + +/* Define _GL_HAVE__STATIC_ASSERT to 1 if _Static_assert works as per the + C1X draft N1548 section 6.7.10. This is supported by GCC 4.6.0 and + later, in C mode, and its use here generates easier-to-read diagnostics + when verify (R) fails. + + Define _GL_HAVE_STATIC_ASSERT to 1 if static_assert works as per the + C++0X draft N3242 section 7.(4). + This will likely be supported by future GCC versions, in C++ mode. + + Use this only with GCC. If we were willing to slow 'configure' + down we could also use it with other compilers, but since this + affects only the quality of diagnostics, why bother? */ +# if (4 < __GNUC__ || (__GNUC__ == 4 && 6 <= __GNUC_MINOR__)) && !defined __cplusplus +# define _GL_HAVE__STATIC_ASSERT 1 +# endif +/* The condition (99 < __GNUC__) is temporary, until we know about the + first G++ release that supports static_assert. */ +# if (99 < __GNUC__) && defined __cplusplus +# define _GL_HAVE_STATIC_ASSERT 1 +# endif /* Each of these macros verifies that its argument R is nonzero. To be portable, R should be an integer constant expression. Unlike assert (R), there is no run-time overhead. - There are two macros, since no single macro can be used in all - contexts in C. verify_true (R) is for scalar contexts, including - integer constant expression contexts. verify (R) is for declaration - contexts, e.g., the top level. + If _Static_assert works, verify (R) uses it directly. Similarly, + _GL_VERIFY_TRUE works by packaging a _Static_assert inside a struct + that is an operand of sizeof. - Symbols ending in "__" are private to this header. - - The code below uses several ideas. + The code below uses several ideas for C++ compilers, and for C + compilers that do not support _Static_assert: * The first step is ((R) ? 1 : -1). Given an expression R, of integral or boolean or floating-point type, this yields an @@ -39,7 +59,9 @@ constant and nonnegative. * Next this expression W is wrapped in a type - struct verify_type__ { unsigned int verify_error_if_negative_size__: W; }. + struct _gl_verify_type { + unsigned int _gl_verify_error_if_negative: W; + }. If W is negative, this yields a compile-time error. No compiler can deal with a bit-field of negative size. @@ -53,7 +75,7 @@ void function (int n) { verify (n < 0); } - * For the verify macro, the struct verify_type__ will need to + * For the verify macro, the struct _gl_verify_type will need to somehow be embedded into a declaration. To be portable, this declaration must declare an object, a constant, a function, or a typedef name. If the declared entity uses the type directly, @@ -91,11 +113,11 @@ Which of the following alternatives can be used? extern int dummy [sizeof (struct {...})]; - extern int dummy [sizeof (struct verify_type__ {...})]; + extern int dummy [sizeof (struct _gl_verify_type {...})]; extern void dummy (int [sizeof (struct {...})]); - extern void dummy (int [sizeof (struct verify_type__ {...})]); + extern void dummy (int [sizeof (struct _gl_verify_type {...})]); extern int (*dummy (void)) [sizeof (struct {...})]; - extern int (*dummy (void)) [sizeof (struct verify_type__ {...})]; + extern int (*dummy (void)) [sizeof (struct _gl_verify_type {...})]; In the second and sixth case, the struct type is exported to the outer scope; two such declarations therefore collide. GCC warns @@ -109,15 +131,9 @@ __COUNTER__ macro that can let us generate unique identifiers for each dummy function, to suppress this warning. - * This implementation exploits the fact that GCC does not warn about - the last declaration mentioned above. If a future version of GCC - introduces a warning for this, the problem could be worked around - by using code specialized to GCC, just as __COUNTER__ is already - being used if available. - - #if 4 <= __GNUC__ - # define verify(R) [another version to keep GCC happy] - #endif + * This implementation exploits the fact that older versions of GCC, + which do not support _Static_assert, also do not warn about the + last declaration mentioned above. * In C++, any struct definition inside sizeof is invalid. Use a template type to work around the problem. */ @@ -140,24 +156,75 @@ possible. */ # define _GL_GENSYM(prefix) _GL_CONCAT (prefix, _GL_COUNTER) -/* Verify requirement R at compile-time, as an integer constant expression. - Return 1. */ +/* Verify requirement R at compile-time, as an integer constant expression + that returns 1. If R is false, fail at compile-time, preferably + with a diagnostic that includes the string-literal DIAGNOSTIC. */ + +# define _GL_VERIFY_TRUE(R, DIAGNOSTIC) \ + (!!sizeof (_GL_VERIFY_TYPE (R, DIAGNOSTIC))) # ifdef __cplusplus template - struct verify_type__ { unsigned int verify_error_if_negative_size__: w; }; -# define verify_true(R) \ - (!!sizeof (verify_type__<(R) ? 1 : -1>)) + struct _gl_verify_type { + unsigned int _gl_verify_error_if_negative: w; + }; +# define _GL_VERIFY_TYPE(R, DIAGNOSTIC) \ + _gl_verify_type<(R) ? 1 : -1> +# elif defined _GL_HAVE__STATIC_ASSERT +# define _GL_VERIFY_TYPE(R, DIAGNOSTIC) \ + struct { \ + _Static_assert (R, DIAGNOSTIC); \ + int _gl_dummy; \ + } +# else +# define _GL_VERIFY_TYPE(R, DIAGNOSTIC) \ + struct { unsigned int _gl_verify_error_if_negative: (R) ? 1 : -1; } +# endif + +/* Verify requirement R at compile-time, as a declaration without a + trailing ';'. If R is false, fail at compile-time, preferably + with a diagnostic that includes the string-literal DIAGNOSTIC. + + Unfortunately, unlike C1X, this implementation must appear as an + ordinary declaration, and cannot appear inside struct { ... }. */ + +# ifdef _GL_HAVE__STATIC_ASSERT +# define _GL_VERIFY _Static_assert # else -# define verify_true(R) \ - (!!sizeof \ - (struct { unsigned int verify_error_if_negative_size__: (R) ? 1 : -1; })) +# define _GL_VERIFY(R, DIAGNOSTIC) \ + extern int (*_GL_GENSYM (_gl_verify_function) (void)) \ + [_GL_VERIFY_TRUE (R, DIAGNOSTIC)] # endif +/* _GL_STATIC_ASSERT_H is defined if this code is copied into assert.h. */ +# ifdef _GL_STATIC_ASSERT_H +# if !defined _GL_HAVE__STATIC_ASSERT && !defined _Static_assert +# define _Static_assert(R, DIAGNOSTIC) _GL_VERIFY (R, DIAGNOSTIC) +# endif +# if !defined _GL_HAVE_STATIC_ASSERT && !defined static_assert +# define static_assert _Static_assert /* Draft C1X requires this #define. */ +# endif +# else + +/* Each of these macros verifies that its argument R is nonzero. To + be portable, R should be an integer constant expression. Unlike + assert (R), there is no run-time overhead. + + There are two macros, since no single macro can be used in all + contexts in C. verify_true (R) is for scalar contexts, including + integer constant expression contexts. verify (R) is for declaration + contexts, e.g., the top level. */ + +/* Verify requirement R at compile-time, as an integer constant expression. + Return 1. */ + +# define verify_true(R) _GL_VERIFY_TRUE (R, "verify_true (" #R ")") + /* Verify requirement R at compile-time, as a declaration without a trailing ';'. */ -# define verify(R) \ - extern int (* _GL_GENSYM (verify_function) (void)) [verify_true (R)] +# define verify(R) _GL_VERIFY (R, "verify (" #R ")") + +# endif #endif diff -r 04ce36b456cc -r 6758fa38915e lib/wchar.in.h --- a/lib/wchar.in.h Fri Apr 01 16:04:45 2011 -0700 +++ b/lib/wchar.in.h Fri May 06 08:15:59 2011 -0700 @@ -61,9 +61,13 @@ . BSD/OS 4.0.1 has a bug: , and must be included before . + In some builds of uClibc, is nonexistent and wchar_t is defined + by . But avoid namespace pollution on glibc systems. */ +#if !(defined __GLIBC__ && !defined __UCLIBC__) +# include +#endif #ifndef __GLIBC__ -# include # include # include #endif diff -r 04ce36b456cc -r 6758fa38915e lib/write.c --- a/lib/write.c Fri Apr 01 16:04:45 2011 -0700 +++ b/lib/write.c Fri May 06 08:15:59 2011 -0700 @@ -20,8 +20,9 @@ /* Specification. */ #include -/* Replace this function only if module 'sigpipe' is requested. */ -#if GNULIB_SIGPIPE +/* Replace this function only if module 'nonblocking' or module 'sigpipe' is + requested. */ +#if GNULIB_NONBLOCKING || GNULIB_SIGPIPE /* On native Windows platforms, SIGPIPE does not exist. When write() is called on a pipe with no readers, WriteFile() fails with error @@ -41,21 +42,81 @@ rpl_write (int fd, const void *buf, size_t count) #undef write { - ssize_t ret = write (fd, buf, count); + for (;;) + { + ssize_t ret = write (fd, buf, count); - if (ret < 0) - { - if (GetLastError () == ERROR_NO_DATA - && GetFileType ((HANDLE) _get_osfhandle (fd)) == FILE_TYPE_PIPE) + if (ret < 0) { - /* Try to raise signal SIGPIPE. */ - raise (SIGPIPE); - /* If it is currently blocked or ignored, change errno from EINVAL - to EPIPE. */ - errno = EPIPE; +# if GNULIB_NONBLOCKING + if (errno == ENOSPC) + { + HANDLE h = (HANDLE) _get_osfhandle (fd); + if (GetFileType (h) == FILE_TYPE_PIPE) + { + /* h is a pipe or socket. */ + DWORD state; + if (GetNamedPipeHandleState (h, &state, NULL, NULL, NULL, + NULL, 0) + && (state & PIPE_NOWAIT) != 0) + { + /* h is a pipe in non-blocking mode. + We can get here in four situations: + 1. When the pipe buffer is full. + 2. When count <= pipe_buf_size and the number of + free bytes in the pipe buffer is < count. + 3. When count > pipe_buf_size and the number of free + bytes in the pipe buffer is > 0, < pipe_buf_size. + 4. When count > pipe_buf_size and the pipe buffer is + entirely empty. + The cases 1 and 2 are POSIX compliant. In cases 3 and + 4 POSIX specifies that write() must split the request + and succeed with a partial write. We fix case 4. + We don't fix case 3 because it is not essential for + programs. */ + DWORD out_size; /* size of the buffer for outgoing data */ + DWORD in_size; /* size of the buffer for incoming data */ + if (GetNamedPipeInfo (h, NULL, &out_size, &in_size, NULL)) + { + size_t reduced_count = count; + /* In theory we need only one of out_size, in_size. + But I don't know which of the two. The description + is ambiguous. */ + if (out_size != 0 && out_size < reduced_count) + reduced_count = out_size; + if (in_size != 0 && in_size < reduced_count) + reduced_count = in_size; + if (reduced_count < count) + { + /* Attempt to write only the first part. */ + count = reduced_count; + continue; + } + } + /* Change errno from ENOSPC to EAGAIN. */ + errno = EAGAIN; + } + } + } + else +# endif + { +# if GNULIB_SIGPIPE + if (GetLastError () == ERROR_NO_DATA + && GetFileType ((HANDLE) _get_osfhandle (fd)) + == FILE_TYPE_PIPE) + { + /* Try to raise signal SIGPIPE. */ + raise (SIGPIPE); + /* If it is currently blocked or ignored, change errno from + EINVAL to EPIPE. */ + errno = EPIPE; + } +# endif + } } + return ret; } - return ret; } # endif diff -r 04ce36b456cc -r 6758fa38915e lib/xalloc-oversized.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/xalloc-oversized.h Fri May 06 08:15:59 2011 -0700 @@ -0,0 +1,38 @@ +/* xalloc-oversized.h -- memory allocation size checking + + Copyright (C) 1990-2000, 2003-2004, 2006-2011 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +#ifndef XALLOC_OVERSIZED_H_ +# define XALLOC_OVERSIZED_H_ + +# include + +/* Return 1 if an array of N objects, each of size S, cannot exist due + to size arithmetic overflow. S must be positive and N must be + nonnegative. This is a macro, not an inline function, so that it + works correctly even when SIZE_MAX < N. + + By gnulib convention, SIZE_MAX represents overflow in size + calculations, so the conservative dividend to use here is + SIZE_MAX - 1, since SIZE_MAX might represent an overflowed value. + However, malloc (SIZE_MAX) fails on all known hosts where + sizeof (ptrdiff_t) <= sizeof (size_t), so do not bother to test for + exactly-SIZE_MAX allocations on such hosts; this avoids a test and + branch when S is known to be 1. */ +# define xalloc_oversized(n, s) \ + ((size_t) (sizeof (ptrdiff_t) <= sizeof (size_t) ? -1 : -2) / (s) < (n)) + +#endif /* !XALLOC_OVERSIZED_H_ */ diff -r 04ce36b456cc -r 6758fa38915e lib/xalloc.h --- a/lib/xalloc.h Fri Apr 01 16:04:45 2011 -0700 +++ b/lib/xalloc.h Fri May 06 08:15:59 2011 -0700 @@ -20,6 +20,7 @@ # include +# include "xalloc-oversized.h" # ifdef __cplusplus extern "C" { @@ -65,22 +66,6 @@ char *xstrdup (char const *str) _GL_ATTRIBUTE_MALLOC; -/* Return 1 if an array of N objects, each of size S, cannot exist due - to size arithmetic overflow. S must be positive and N must be - nonnegative. This is a macro, not an inline function, so that it - works correctly even when SIZE_MAX < N. - - By gnulib convention, SIZE_MAX represents overflow in size - calculations, so the conservative dividend to use here is - SIZE_MAX - 1, since SIZE_MAX might represent an overflowed value. - However, malloc (SIZE_MAX) fails on all known hosts where - sizeof (ptrdiff_t) <= sizeof (size_t), so do not bother to test for - exactly-SIZE_MAX allocations on such hosts; this avoids a test and - branch when S is known to be 1. */ -# define xalloc_oversized(n, s) \ - ((size_t) (sizeof (ptrdiff_t) <= sizeof (size_t) ? -1 : -2) / (s) < (n)) - - /* In the following macros, T must be an elementary or structure/union or typedef'ed type, or a pointer to such a type. To apply one of the following macros to a function pointer or array type, you need to typedef diff -r 04ce36b456cc -r 6758fa38915e lib/xgetgroups.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/xgetgroups.c Fri May 06 08:15:59 2011 -0700 @@ -0,0 +1,37 @@ +/* xgetgroups.c -- return a list of the groups a user or current process is in + + Copyright (C) 2007-2011 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +/* Extracted from coreutils' src/id.c. */ + +#include + +#include "mgetgroups.h" + +#include + +#include "xalloc.h" + +/* Like mgetgroups, but call xalloc_die on allocation failure. */ + +int +xgetgroups (char const *username, gid_t gid, gid_t **groups) +{ + int result = mgetgroups (username, gid, groups); + if (result == -1 && errno == ENOMEM) + xalloc_die (); + return result; +} diff -r 04ce36b456cc -r 6758fa38915e m4/afunix.m4 --- a/m4/afunix.m4 Fri Apr 01 16:04:45 2011 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,116 +0,0 @@ -# afunix.m4 serial 6 -dnl Copyright (C) 2011 Free Software Foundation, Inc. -dnl This file is free software; the Free Software Foundation -dnl gives unlimited permission to copy and/or distribute it, -dnl with or without modifications, as long as this notice is preserved. - -AC_DEFUN([gl_SOCKET_AFUNIX], -[ - AC_REQUIRE([gl_HEADER_SYS_SOCKET]) - AC_REQUIRE([gl_SOCKET_FAMILY_UNIX]) - - AC_MSG_CHECKING([for UNIX domain sockets SCM_RIGHTS]) - AC_CACHE_VAL([gl_cv_socket_unix_scm_rights], - [AC_COMPILE_IFELSE( - [AC_LANG_PROGRAM( - [[#include - #ifdef HAVE_SYS_SOCKET_H - #include - #endif - #ifdef HAVE_SYS_UN_H - #include - #endif - #ifdef HAVE_WINSOCK2_H - #include - #endif - ]], - [[struct cmsghdr cmh; - cmh.cmsg_level = SOL_SOCKET; - cmh.cmsg_type = SCM_RIGHTS; - if (&cmh) return 0; - ]])], - [gl_cv_socket_unix_scm_rights=yes], - [gl_cv_socket_unix_scm_rights=no]) - ]) - AC_MSG_RESULT([$gl_cv_socket_unix_scm_rights]) - if test $gl_cv_socket_unix_scm_rights = yes; then - AC_DEFINE([HAVE_UNIXSOCKET_SCM_RIGHTS], [1], - [Define to 1 if defines SCM_RIGHTS.]) - fi - - dnl Persuade AIX 5.2 to declare CMSG_SPACE, CMSG_LEN. - AC_DEFINE([_LINUX_SOURCE_COMPAT], [1], - [Define in order to get some macros on AIX systems.]) - - AC_MSG_CHECKING([for UNIX domain sockets SCM_RIGHTS that behave in BSD4.4 way]) - AC_CACHE_VAL([gl_cv_socket_unix_scm_rights_bsd44_way], - [AC_COMPILE_IFELSE( - [AC_LANG_PROGRAM( - [[#include - #include - #ifdef HAVE_SYS_SOCKET_H - #include - #endif - #ifdef HAVE_SYS_UN_H - #include - #endif - #ifdef HAVE_WINSOCK2_H - #include - #endif - ]], - [[struct msghdr msg = {0}; - struct cmsghdr *cmsg; - int myfds[1] = {0}; - char buf[CMSG_SPACE (sizeof (myfds))]; - - msg.msg_control = buf; - msg.msg_controllen = sizeof buf; - cmsg = CMSG_FIRSTHDR (&msg); - cmsg->cmsg_level = SOL_SOCKET; - cmsg->cmsg_type = SCM_RIGHTS; - cmsg->cmsg_len = CMSG_LEN (sizeof (int)); - /* fake Initialize the payload: */ - (void) CMSG_DATA (cmsg); - /* Sum of the length of all control messages in the buffer: */ - msg.msg_controllen = cmsg->cmsg_len; - return 0; - ]])], - [gl_cv_socket_unix_scm_rights_bsd44_way=yes], - [gl_cv_socket_unix_scm_rights_bsd44_way=no]) - ]) - AC_MSG_RESULT([$gl_cv_socket_unix_scm_rights_bsd44_way]) - if test $gl_cv_socket_unix_scm_rights_bsd44_way = yes; then - AC_DEFINE([HAVE_UNIXSOCKET_SCM_RIGHTS_BSD44_WAY], [1], - [Define to 1 if fd can be sent/received in the BSD4.4 way.]) - fi - - AC_MSG_CHECKING([for UNIX domain sockets SCM_RIGHTS that behave in BSD4.3 way]) - AC_CACHE_VAL([gl_cv_socket_unix_scm_rights_bsd43_way], - [AC_COMPILE_IFELSE( - [AC_LANG_PROGRAM( - [[#include - #ifdef HAVE_SYS_SOCKET_H - #include - #endif - #ifdef HAVE_SYS_UN_H - #include - #endif - #ifdef HAVE_WINSOCK2_H - #include - #endif - ]], - [[struct msghdr msg; - int fd = 0; - msg.msg_accrights = &fd; - msg.msg_accrightslen = sizeof (fd); - if (&msg) return 0; - ]])], - [gl_cv_socket_unix_scm_rights_bsd43_way=yes], - [gl_cv_socket_unix_scm_rights_bsd43_way=no]) - ]) - AC_MSG_RESULT([$gl_cv_socket_unix_scm_rights_bsd43_way]) - if test $gl_cv_socket_unix_scm_rights_bsd43_way = yes; then - AC_DEFINE([HAVE_UNIXSOCKET_SCM_RIGHTS_BSD43_WAY], [1], - [Define to 1 if fd can be sent/received in the BSD4.3 way.]) - fi -]) diff -r 04ce36b456cc -r 6758fa38915e m4/alloca.m4 --- a/m4/alloca.m4 Fri Apr 01 16:04:45 2011 -0700 +++ b/m4/alloca.m4 Fri May 06 08:15:59 2011 -0700 @@ -1,4 +1,4 @@ -# alloca.m4 serial 10 +# alloca.m4 serial 11 dnl Copyright (C) 2002-2004, 2006-2007, 2009-2011 Free Software Foundation, dnl Inc. dnl This file is free software; the Free Software Foundation @@ -36,6 +36,7 @@ ALLOCA_H=alloca.h fi AC_SUBST([ALLOCA_H]) + AM_CONDITIONAL([GL_GENERATE_ALLOCA_H], [test -n "$ALLOCA_H"]) ]) # Prerequisites of lib/alloca.c. diff -r 04ce36b456cc -r 6758fa38915e m4/argz.m4 --- a/m4/argz.m4 Fri Apr 01 16:04:45 2011 -0700 +++ b/m4/argz.m4 Fri May 06 08:15:59 2011 -0700 @@ -7,7 +7,7 @@ # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. -# serial 8 argz.m4 +# serial 9 argz.m4 AC_DEFUN([gl_FUNC_ARGZ], [gl_PREREQ_ARGZ @@ -74,6 +74,7 @@ AC_LIBOBJ([argz])])]) AC_SUBST([ARGZ_H]) +AM_CONDITIONAL([GL_GENERATE_ARGZ_H], [test -n "$ARGZ_H"]) ]) # Prerequisites of lib/argz.c. diff -r 04ce36b456cc -r 6758fa38915e m4/arpa_inet_h.m4 --- a/m4/arpa_inet_h.m4 Fri Apr 01 16:04:45 2011 -0700 +++ b/m4/arpa_inet_h.m4 Fri May 06 08:15:59 2011 -0700 @@ -1,4 +1,4 @@ -# arpa_inet_h.m4 serial 11 +# arpa_inet_h.m4 serial 12 dnl Copyright (C) 2006, 2008-2011 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,13 +38,6 @@ ]], [inet_ntop inet_pton]) ]) -dnl Unconditionally enables the replacement of . -AC_DEFUN([gl_REPLACE_ARPA_INET_H], -[ - dnl This is a no-op, because is always overridden. - : -]) - AC_DEFUN([gl_ARPA_INET_MODULE_INDICATOR], [ dnl Use AC_REQUIRE here, so that the default settings are expanded once only. diff -r 04ce36b456cc -r 6758fa38915e m4/assert_h.m4 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/m4/assert_h.m4 Fri May 06 08:15:59 2011 -0700 @@ -0,0 +1,29 @@ +# assert-h.m4 +dnl Copyright (C) 2011 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl From Paul Eggert. + +AC_DEFUN([gl_ASSERT_H], +[ + ASSERT_H= + AC_CACHE_CHECK([for static_assert], [gl_cv_static_assert], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[#include + static_assert (2 + 2 == 4, "arithmetic doesn't work"); + ]], + [[ + static_assert (sizeof (char) == 1, "sizeof doesn't work"); + ]])], + [gl_cv_static_assert=yes], + [gl_cv_static_assert=no])]) + if test $gl_cv_static_assert = no; then + ASSERT_H=assert.h + gl_NEXT_HEADERS([assert.h]) + fi + AC_SUBST([ASSERT_H]) + AM_CONDITIONAL([GL_GENERATE_ASSERT_H], [test -n "$ASSERT_H"]) +]) diff -r 04ce36b456cc -r 6758fa38915e m4/btowc.m4 --- a/m4/btowc.m4 Fri Apr 01 16:04:45 2011 -0700 +++ b/m4/btowc.m4 Fri May 06 08:15:59 2011 -0700 @@ -1,4 +1,4 @@ -# btowc.m4 serial 8 +# btowc.m4 serial 9 dnl Copyright (C) 2008-2011 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -109,7 +109,6 @@ esac fi if test $HAVE_BTOWC = 0 || test $REPLACE_BTOWC = 1; then - gl_REPLACE_WCHAR_H AC_LIBOBJ([btowc]) gl_PREREQ_BTOWC fi diff -r 04ce36b456cc -r 6758fa38915e m4/byteswap.m4 --- a/m4/byteswap.m4 Fri Apr 01 16:04:45 2011 -0700 +++ b/m4/byteswap.m4 Fri May 06 08:15:59 2011 -0700 @@ -1,4 +1,4 @@ -# byteswap.m4 serial 3 +# byteswap.m4 serial 4 dnl Copyright (C) 2005, 2007, 2009-2011 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -15,4 +15,5 @@ BYTESWAP_H='byteswap.h' ]) AC_SUBST([BYTESWAP_H]) + AM_CONDITIONAL([GL_GENERATE_BYTESWAP_H], [test -n "$BYTESWAP_H"]) ]) diff -r 04ce36b456cc -r 6758fa38915e m4/dirent_h.m4 --- a/m4/dirent_h.m4 Fri Apr 01 16:04:45 2011 -0700 +++ b/m4/dirent_h.m4 Fri May 06 08:15:59 2011 -0700 @@ -1,4 +1,4 @@ -# dirent_h.m4 serial 13 +# dirent_h.m4 serial 14 dnl Copyright (C) 2008-2011 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,13 +21,6 @@ ]], [alphasort dirfd fdopendir scandir]) ]) -dnl Unconditionally enables the replacement of . -AC_DEFUN([gl_REPLACE_DIRENT_H], -[ - dnl This is a no-op, because is always overridden. - : -]) - AC_DEFUN([gl_DIRENT_MODULE_INDICATOR], [ dnl Use AC_REQUIRE here, so that the default settings are expanded once only. diff -r 04ce36b456cc -r 6758fa38915e m4/dirfd.m4 --- a/m4/dirfd.m4 Fri Apr 01 16:04:45 2011 -0700 +++ b/m4/dirfd.m4 Fri May 06 08:15:59 2011 -0700 @@ -1,4 +1,4 @@ -# serial 19 -*- Autoconf -*- +# serial 20 -*- Autoconf -*- dnl Find out how to get the file descriptor associated with an open DIR*. @@ -12,7 +12,6 @@ AC_DEFUN([gl_FUNC_DIRFD], [ AC_REQUIRE([gl_DIRENT_H_DEFAULTS]) - gl_REPLACE_DIRENT_H dnl Persuade glibc to declare dirfd(). AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS]) diff -r 04ce36b456cc -r 6758fa38915e m4/dup2-obsolete.m4 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/m4/dup2-obsolete.m4 Fri May 06 08:15:59 2011 -0700 @@ -0,0 +1,11 @@ +# dup2-obsolete.m4 serial 1 +dnl Copyright (C) 2011 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_FUNC_DUP2_OBSOLETE], +[ + dnl The real code is in dup2.m4. + : +]) diff -r 04ce36b456cc -r 6758fa38915e m4/dup2.m4 --- a/m4/dup2.m4 Fri Apr 01 16:04:45 2011 -0700 +++ b/m4/dup2.m4 Fri May 06 08:15:59 2011 -0700 @@ -8,11 +8,17 @@ [ AC_REQUIRE([gl_UNISTD_H_DEFAULTS]) AC_REQUIRE([AC_CANONICAL_HOST]) - AC_CHECK_FUNCS_ONCE([dup2 fcntl]) - if test $ac_cv_func_dup2 = no; then - HAVE_DUP2=0 - AC_LIBOBJ([dup2]) - else + m4_ifdef([gl_FUNC_DUP2_OBSOLETE], [ + AC_CHECK_FUNCS_ONCE([dup2]) + if test $ac_cv_func_dup2 = no; then + HAVE_DUP2=0 + AC_LIBOBJ([dup2]) + fi + ], [ + AC_DEFINE([HAVE_DUP2], [1], [Define to 1 if you have the 'dup2' function.]) + ]) + AC_CHECK_FUNCS_ONCE([fcntl]) + if test $HAVE_DUP2 = 1; then AC_CACHE_CHECK([whether dup2 works], [gl_cv_func_dup2_works], [AC_RUN_IFELSE([ AC_LANG_PROGRAM([[#include @@ -63,6 +69,7 @@ AC_DEFUN([gl_REPLACE_DUP2], [ AC_REQUIRE([gl_UNISTD_H_DEFAULTS]) + AC_CHECK_FUNCS_ONCE([dup2]) if test $ac_cv_func_dup2 = yes; then REPLACE_DUP2=1 fi diff -r 04ce36b456cc -r 6758fa38915e m4/duplocale.m4 --- a/m4/duplocale.m4 Fri Apr 01 16:04:45 2011 -0700 +++ b/m4/duplocale.m4 Fri May 06 08:15:59 2011 -0700 @@ -1,4 +1,4 @@ -# duplocale.m4 serial 5 +# duplocale.m4 serial 6 dnl Copyright (C) 2009-2011 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -60,7 +60,6 @@ HAVE_DUPLOCALE=0 fi if test $REPLACE_DUPLOCALE = 1; then - gl_REPLACE_LOCALE_H AC_LIBOBJ([duplocale]) gl_PREREQ_DUPLOCALE fi diff -r 04ce36b456cc -r 6758fa38915e m4/errno_h.m4 --- a/m4/errno_h.m4 Fri Apr 01 16:04:45 2011 -0700 +++ b/m4/errno_h.m4 Fri May 06 08:15:59 2011 -0700 @@ -1,4 +1,4 @@ -# errno_h.m4 serial 8 +# errno_h.m4 serial 9 dnl Copyright (C) 2004, 2006, 2008-2011 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -54,6 +54,7 @@ ERRNO_H='errno.h' fi AC_SUBST([ERRNO_H]) + AM_CONDITIONAL([GL_GENERATE_ERRNO_H], [test -n "$ERRNO_H"]) gl_REPLACE_ERRNO_VALUE([EMULTIHOP]) gl_REPLACE_ERRNO_VALUE([ENOLINK]) gl_REPLACE_ERRNO_VALUE([EOVERFLOW]) diff -r 04ce36b456cc -r 6758fa38915e m4/fchdir.m4 --- a/m4/fchdir.m4 Fri Apr 01 16:04:45 2011 -0700 +++ b/m4/fchdir.m4 Fri May 06 08:15:59 2011 -0700 @@ -1,4 +1,4 @@ -# fchdir.m4 serial 15 +# fchdir.m4 serial 16 dnl Copyright (C) 2006-2011 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -33,7 +33,6 @@ gl_REPLACE_DUP2 dnl dup3 is already unconditionally replaced gl_REPLACE_FCNTL - gl_REPLACE_DIRENT_H AC_CACHE_CHECK([whether open can visit directories], [gl_cv_func_open_directory_works], [AC_RUN_IFELSE([AC_LANG_PROGRAM([[#include diff -r 04ce36b456cc -r 6758fa38915e m4/fclose.m4 --- a/m4/fclose.m4 Fri Apr 01 16:04:45 2011 -0700 +++ b/m4/fclose.m4 Fri May 06 08:15:59 2011 -0700 @@ -1,4 +1,4 @@ -# fclose.m4 serial 2 +# fclose.m4 serial 3 dnl Copyright (C) 2008-2011 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -6,6 +6,12 @@ AC_DEFUN([gl_FUNC_FCLOSE], [ + m4_ifdef([gl_FUNC_FFLUSH_STDIN], [ + gl_FUNC_FFLUSH_STDIN + if test $gl_cv_func_fflush_stdin = no; then + gl_REPLACE_FCLOSE + fi + ]) ]) AC_DEFUN([gl_REPLACE_FCLOSE], diff -r 04ce36b456cc -r 6758fa38915e m4/fcntl_h.m4 --- a/m4/fcntl_h.m4 Fri Apr 01 16:04:45 2011 -0700 +++ b/m4/fcntl_h.m4 Fri May 06 08:15:59 2011 -0700 @@ -31,13 +31,14 @@ AC_DEFUN([gl_FCNTL_H_DEFAULTS], [ - GNULIB_FCNTL=0; AC_SUBST([GNULIB_FCNTL]) - GNULIB_OPEN=0; AC_SUBST([GNULIB_OPEN]) - GNULIB_OPENAT=0; AC_SUBST([GNULIB_OPENAT]) + GNULIB_FCNTL=0; AC_SUBST([GNULIB_FCNTL]) + GNULIB_NONBLOCKING=0; AC_SUBST([GNULIB_NONBLOCKING]) + GNULIB_OPEN=0; AC_SUBST([GNULIB_OPEN]) + GNULIB_OPENAT=0; AC_SUBST([GNULIB_OPENAT]) dnl Assume proper GNU behavior unless another module says otherwise. - HAVE_FCNTL=1; AC_SUBST([HAVE_FCNTL]) - HAVE_OPENAT=1; AC_SUBST([HAVE_OPENAT]) - REPLACE_FCNTL=0; AC_SUBST([REPLACE_FCNTL]) - REPLACE_OPEN=0; AC_SUBST([REPLACE_OPEN]) - REPLACE_OPENAT=0; AC_SUBST([REPLACE_OPENAT]) + HAVE_FCNTL=1; AC_SUBST([HAVE_FCNTL]) + HAVE_OPENAT=1; AC_SUBST([HAVE_OPENAT]) + REPLACE_FCNTL=0; AC_SUBST([REPLACE_FCNTL]) + REPLACE_OPEN=0; AC_SUBST([REPLACE_OPEN]) + REPLACE_OPENAT=0; AC_SUBST([REPLACE_OPENAT]) ]) diff -r 04ce36b456cc -r 6758fa38915e m4/fdopendir.m4 --- a/m4/fdopendir.m4 Fri Apr 01 16:04:45 2011 -0700 +++ b/m4/fdopendir.m4 Fri May 06 08:15:59 2011 -0700 @@ -1,4 +1,4 @@ -# serial 5 +# serial 6 # See if we need to provide fdopendir. dnl Copyright (C) 2009-2011 Free Software Foundation, Inc. @@ -19,7 +19,6 @@ if test $ac_cv_func_fdopendir = no; then AC_LIBOBJ([openat-proc]) AC_LIBOBJ([fdopendir]) - gl_REPLACE_DIRENT_H HAVE_FDOPENDIR=0 else AC_CACHE_CHECK([whether fdopendir works], @@ -42,7 +41,6 @@ [gl_cv_func_fdopendir_works="guessing no"])]) if test "$gl_cv_func_fdopendir_works" != yes; then REPLACE_FDOPENDIR=1 - gl_REPLACE_DIRENT_H AC_LIBOBJ([fdopendir]) fi fi diff -r 04ce36b456cc -r 6758fa38915e m4/fflush.m4 --- a/m4/fflush.m4 Fri Apr 01 16:04:45 2011 -0700 +++ b/m4/fflush.m4 Fri May 06 08:15:59 2011 -0700 @@ -1,4 +1,4 @@ -# fflush.m4 serial 8 +# fflush.m4 serial 11 # Copyright (C) 2007-2011 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation @@ -12,6 +12,17 @@ AC_DEFUN([gl_FUNC_FFLUSH], [ + gl_FUNC_FFLUSH_STDIN + if test $gl_cv_func_fflush_stdin = no; then + gl_REPLACE_FFLUSH + fi +]) + +dnl Determine whether fflush works on input streams. +dnl Sets gl_cv_func_fflush_stdin. + +AC_DEFUN([gl_FUNC_FFLUSH_STDIN], +[ AC_CACHE_CHECK([whether fflush works on input streams], [gl_cv_func_fflush_stdin], [echo hello world > conftest.txt @@ -59,9 +70,6 @@ gl_cv_func_fflush_stdin=no]) rm conftest.txt ]) - if test $gl_cv_func_fflush_stdin = no; then - gl_REPLACE_FFLUSH - fi ]) AC_DEFUN([gl_REPLACE_FFLUSH], @@ -70,7 +78,6 @@ AC_REQUIRE([gl_STDIO_H_DEFAULTS]) REPLACE_FFLUSH=1 gl_PREREQ_FFLUSH - gl_REPLACE_FSEEKO ]) # Prerequisites of lib/fflush.c. diff -r 04ce36b456cc -r 6758fa38915e m4/float_h.m4 --- a/m4/float_h.m4 Fri Apr 01 16:04:45 2011 -0700 +++ b/m4/float_h.m4 Fri May 06 08:15:59 2011 -0700 @@ -1,4 +1,4 @@ -# float_h.m4 serial 5 +# float_h.m4 serial 6 dnl Copyright (C) 2007, 2009-2011 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -16,4 +16,5 @@ ;; esac AC_SUBST([FLOAT_H]) + AM_CONDITIONAL([GL_GENERATE_FLOAT_H], [test -n "$FLOAT_H"]) ]) diff -r 04ce36b456cc -r 6758fa38915e m4/fnmatch.m4 --- a/m4/fnmatch.m4 Fri Apr 01 16:04:45 2011 -0700 +++ b/m4/fnmatch.m4 Fri May 06 08:15:59 2011 -0700 @@ -1,4 +1,4 @@ -# Check for fnmatch - serial 5. +# Check for fnmatch - serial 6. # Copyright (C) 2000-2007, 2009-2011 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation @@ -139,6 +139,7 @@ AC_CHECK_HEADERS_ONCE([wctype.h]) fi AC_SUBST([FNMATCH_H]) + AM_CONDITIONAL([GL_GENERATE_FNMATCH_H], [test -n "$FNMATCH_H"]) ]) # Request a POSIX compliant fnmatch function with GNU extensions. diff -r 04ce36b456cc -r 6758fa38915e m4/fseeko.m4 --- a/m4/fseeko.m4 Fri Apr 01 16:04:45 2011 -0700 +++ b/m4/fseeko.m4 Fri May 06 08:15:59 2011 -0700 @@ -1,4 +1,4 @@ -# fseeko.m4 serial 11 +# fseeko.m4 serial 12 dnl Copyright (C) 2007-2011 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -23,6 +23,12 @@ gl_REPLACE_FSEEKO fi fi + m4_ifdef([gl_FUNC_FFLUSH_STDIN], [ + gl_FUNC_FFLUSH_STDIN + if test $gl_cv_func_fflush_stdin = no; then + gl_REPLACE_FSEEKO + fi + ]) ]) dnl Tests whether fseeko is available. diff -r 04ce36b456cc -r 6758fa38915e m4/getaddrinfo.m4 --- a/m4/getaddrinfo.m4 Fri Apr 01 16:04:45 2011 -0700 +++ b/m4/getaddrinfo.m4 Fri May 06 08:15:59 2011 -0700 @@ -1,4 +1,4 @@ -# getaddrinfo.m4 serial 23 +# getaddrinfo.m4 serial 25 dnl Copyright (C) 2004-2011 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -62,9 +62,7 @@ # We can't use AC_REPLACE_FUNCS here because gai_strerror may be an # inline function declared in ws2tcpip.h, so we need to get that # header included somehow. - AC_CACHE_CHECK([for gai_strerror (possibly via ws2tcpip.h)], - gl_cv_func_gai_strerror, [ - AC_LINK_IFELSE([AC_LANG_PROGRAM([[ + AC_CHECK_DECLS([gai_strerror, gai_strerrorA], [], [break], [[ #include #ifdef HAVE_SYS_SOCKET_H #include @@ -76,11 +74,32 @@ #include #endif #include -]], [[gai_strerror (NULL);]])], - [gl_cv_func_gai_strerror=yes], - [gl_cv_func_gai_strerror=no])]) - if test $gl_cv_func_gai_strerror = no; then +]]) + if test $ac_cv_have_decl_gai_strerror = no; then AC_LIBOBJ([gai_strerror]) + else + dnl check for correct signature + AC_CACHE_CHECK([for gai_strerror with POSIX signature], + [gl_cv_func_gai_strerror_posix_signature], [ + AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ +#include +#ifdef HAVE_SYS_SOCKET_H +#include +#endif +#ifdef HAVE_NETDB_H +#include +#endif +#ifdef HAVE_WS2TCPIP_H +#include +#endif +#include +extern const char *gai_strerror(int);]])], + [gl_cv_func_gai_strerror_posix_signature=yes], + [gl_cv_func_gai_strerror_posix_signature=no])]) + if test $gl_cv_func_gai_strerror_posix_signature = no; then + REPLACE_GAI_STRERROR=1 + AC_LIBOBJ([gai_strerror]) + fi fi LIBS="$gai_saved_LIBS" @@ -105,11 +124,14 @@ dnl Including sys/socket.h is wrong for Windows, but Windows does not dnl have sa_len so the result is correct anyway. - AC_CHECK_MEMBERS([struct sockaddr.sa_len], , , [#include ]) + AC_CHECK_MEMBERS([struct sockaddr.sa_len], , , [ +#include +#include +]) AC_CHECK_HEADERS_ONCE([netinet/in.h]) - AC_CHECK_DECLS([getaddrinfo, freeaddrinfo, gai_strerror, getnameinfo],,,[ + AC_CHECK_DECLS([getaddrinfo, freeaddrinfo, getnameinfo],,,[ /* sys/types.h is not needed according to POSIX, but the sys/socket.h in i386-unknown-freebsd4.10 and powerpc-apple-darwin5.5 required it. */ diff -r 04ce36b456cc -r 6758fa38915e m4/getcwd-abort-bug.m4 --- a/m4/getcwd-abort-bug.m4 Fri Apr 01 16:04:45 2011 -0700 +++ b/m4/getcwd-abort-bug.m4 Fri May 06 08:15:59 2011 -0700 @@ -1,4 +1,4 @@ -# serial 2 +# serial 4 # Determine whether getcwd aborts when the length of the working directory # name is unusually large. Any length between 4k and 16k trigger the bug # when using glibc-2.4.90-9 or older. @@ -21,6 +21,7 @@ rm -rf confdir-14B--- # Arrange for deletion of the temporary directory this test creates. ac_clean_files="$ac_clean_files confdir-14B---" + dnl Please keep this in sync with tests/test-getcwd.c. AC_RUN_IFELSE( [AC_LANG_SOURCE( [[ @@ -58,13 +59,13 @@ size_t d; /* The bug is triggered when PATH_MAX < getpagesize (), so skip - this relative expensive and invasive test if that's not true. */ + this relatively expensive and invasive test if that's not true. */ if (getpagesize () <= PATH_MAX) return 0; cwd = getcwd (NULL, 0); if (cwd == NULL) - return 0; + return 2; initial_cwd_len = strlen (cwd); free (cwd); @@ -91,15 +92,22 @@ while (0 < d--) { if (chdir ("..") < 0) - break; + { + fail = 5; + break; + } rmdir (dir_name); } - return 0; + return fail; } ]])], [gl_cv_func_getcwd_abort_bug=no], - [gl_cv_func_getcwd_abort_bug=yes], + dnl A "regular" nonzero return does not indicate this bug. + dnl An abort will provoke an exit code of something like 134 (128 + 6). + [test $? -gt 128 \ + && gl_cv_func_getcwd_abort_bug=yes \ + || gl_cv_func_getcwd_abort_bug=no], [gl_cv_func_getcwd_abort_bug=yes]) ]) AS_IF([test $gl_cv_func_getcwd_abort_bug = yes], [$1], [$2]) diff -r 04ce36b456cc -r 6758fa38915e m4/getcwd-path-max.m4 --- a/m4/getcwd-path-max.m4 Fri Apr 01 16:04:45 2011 -0700 +++ b/m4/getcwd-path-max.m4 Fri May 06 08:15:59 2011 -0700 @@ -1,10 +1,10 @@ -# serial 15 +# serial 16 # Check for several getcwd bugs with long file names. # If so, arrange to compile the wrapper function. # This is necessary for at least GNU libc on linux-2.4.19 and 2.4.20. # I've heard that this is due to a Linux kernel bug, and that it has -# been fixed between 2.4.21-pre3 and 2.4.21-pre4. */ +# been fixed between 2.4.21-pre3 and 2.4.21-pre4. # Copyright (C) 2003-2007, 2009-2011 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation @@ -21,6 +21,7 @@ gl_cv_func_getcwd_path_max, [# Arrange for deletion of the temporary directory this test creates. ac_clean_files="$ac_clean_files confdir3" + dnl Please keep this in sync with tests/test-getcwd.c. AC_RUN_IFELSE( [AC_LANG_SOURCE( [[ diff -r 04ce36b456cc -r 6758fa38915e m4/getcwd.m4 --- a/m4/getcwd.m4 Fri Apr 01 16:04:45 2011 -0700 +++ b/m4/getcwd.m4 Fri May 06 08:15:59 2011 -0700 @@ -6,10 +6,11 @@ # with or without modifications, as long as this notice is preserved. # Written by Paul Eggert. -# serial 3 +# serial 6 AC_DEFUN([gl_FUNC_GETCWD_NULL], [ + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles AC_CACHE_CHECK([whether getcwd (NULL, 0) allocates memory for result], [gl_cv_func_getcwd_null], [AC_RUN_IFELSE([AC_LANG_PROGRAM([[ @@ -19,7 +20,8 @@ # endif ]], [[ #if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ -/* mingw cwd does not start with '/', but getcwd does allocate. */ +/* mingw cwd does not start with '/', but getcwd does allocate. + However, mingw fails to honor non-zero size. */ #else if (chdir ("/") != 0) return 1; @@ -35,6 +37,9 @@ return 0; } #endif + /* If size is non-zero, allocation must fail if size is too small */ + if (getcwd (NULL, 1)) + return 5; ]])], [gl_cv_func_getcwd_null=yes], [gl_cv_func_getcwd_null=no], @@ -44,14 +49,37 @@ *-gnu*) gl_cv_func_getcwd_null="guessing yes";; # Guess yes on Cygwin. cygwin*) gl_cv_func_getcwd_null="guessing yes";; - # Guess yes on mingw. - mingw*) gl_cv_func_getcwd_null="guessing yes";; # If we don't know, assume the worst. *) gl_cv_func_getcwd_null="guessing no";; esac ]])]) ]) + +dnl Guarantee that getcwd will malloc with a NULL first argument. Assumes +dnl that either the system getcwd is robust, or that calling code is okay +dnl with spurious failures when run from a directory with an absolute name +dnl larger than 4k bytes. +dnl +dnl Assumes that getcwd exists; if you are worried about obsolete +dnl platforms that lacked getcwd(), then you need to use the GPL module. +AC_DEFUN([gl_FUNC_GETCWD_LGPL], +[ + AC_REQUIRE([gl_UNISTD_H_DEFAULTS]) + AC_REQUIRE([gl_FUNC_GETCWD_NULL]) + + case $gl_cv_func_getcwd_null in + *yes) ;; + *) + dnl Minimal replacement + REPLACE_GETCWD=1 + AC_LIBOBJ([getcwd-lgpl]) + ;; + esac +]) + +dnl Check for all known getcwd bugs; useful for a program likely to be +dnl executed from an arbitrary location. AC_DEFUN([gl_FUNC_GETCWD], [ AC_REQUIRE([gl_UNISTD_H_DEFAULTS]) @@ -70,13 +98,14 @@ case $gl_cv_func_getcwd_null,$gl_cv_func_getcwd_path_max,$gl_abort_bug in *yes,yes,no) ;; *) + dnl Full replacement, overrides LGPL replacement. REPLACE_GETCWD=1 AC_LIBOBJ([getcwd]) gl_PREREQ_GETCWD;; esac ]) -# Prerequisites of lib/getcwd.c. +# Prerequisites of lib/getcwd.c, when full replacement is in effect. AC_DEFUN([gl_PREREQ_GETCWD], [ AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) diff -r 04ce36b456cc -r 6758fa38915e m4/getdomainname.m4 --- a/m4/getdomainname.m4 Fri Apr 01 16:04:45 2011 -0700 +++ b/m4/getdomainname.m4 Fri May 06 08:15:59 2011 -0700 @@ -1,4 +1,4 @@ -# getdomainname.m4 serial 5 +# getdomainname.m4 serial 6 dnl Copyright (C) 2002-2003, 2008-2011 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 @@ dnl is discouraged, see dnl . dnl We need to avoid a collision with this function. - dnl - Otherwise is is in libc. + dnl - Otherwise it is in libc. AC_CHECK_FUNCS([getdomainname], , [ AC_CACHE_CHECK([for getdomainname in -lnsl], [gl_cv_func_getdomainname_in_libnsl], diff -r 04ce36b456cc -r 6758fa38915e m4/gethostname.m4 --- a/m4/gethostname.m4 Fri Apr 01 16:04:45 2011 -0700 +++ b/m4/gethostname.m4 Fri May 06 08:15:59 2011 -0700 @@ -1,4 +1,4 @@ -# gethostname.m4 serial 10 +# gethostname.m4 serial 11 dnl Copyright (C) 2002, 2008-2011 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -14,7 +14,7 @@ dnl Where is gethostname() defined? dnl - On native Windows, it is in ws2_32.dll. - dnl - Otherwise is is in libc. + dnl - Otherwise it is in libc. GETHOSTNAME_LIB= AC_CHECK_FUNCS([gethostname], , [ AC_CACHE_CHECK([for gethostname in winsock2.h and -lws2_32], diff -r 04ce36b456cc -r 6758fa38915e m4/glob.m4 --- a/m4/glob.m4 Fri Apr 01 16:04:45 2011 -0700 +++ b/m4/glob.m4 Fri May 06 08:15:59 2011 -0700 @@ -1,4 +1,4 @@ -# glob.m4 serial 11 +# glob.m4 serial 12 dnl Copyright (C) 2005-2007, 2009-2011 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -10,11 +10,12 @@ AC_DEFUN([gl_GLOB_SUBSTITUTE], [ + AC_LIBOBJ([glob]) gl_PREREQ_GLOB GLOB_H=glob.h - AC_LIBOBJ([glob]) AC_SUBST([GLOB_H]) + AM_CONDITIONAL([GL_GENERATE_GLOB_H], [test -n "$GLOB_H"]) ]) AC_DEFUN([gl_GLOB], @@ -65,8 +66,11 @@ rm -f conf$$-globtest if test -n "$GLOB_H"; then - gl_GLOB_SUBSTITUTE + AC_LIBOBJ([glob]) + gl_PREREQ_GLOB fi + AC_SUBST([GLOB_H]) + AM_CONDITIONAL([GL_GENERATE_GLOB_H], [test -n "$GLOB_H"]) ]) # Prerequisites of lib/glob.*. diff -r 04ce36b456cc -r 6758fa38915e m4/iconv_h.m4 --- a/m4/iconv_h.m4 Fri Apr 01 16:04:45 2011 -0700 +++ b/m4/iconv_h.m4 Fri May 06 08:15:59 2011 -0700 @@ -1,4 +1,4 @@ -# iconv_h.m4 serial 7 +# iconv_h.m4 serial 8 dnl Copyright (C) 2007-2011 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,6 +18,7 @@ [ AC_REQUIRE([gl_ICONV_H_DEFAULTS]) ICONV_H='iconv.h' + AM_CONDITIONAL([GL_GENERATE_ICONV_H], [test -n "$ICONV_H"]) ]) AC_DEFUN([gl_ICONV_MODULE_INDICATOR], @@ -36,4 +37,5 @@ REPLACE_ICONV_OPEN=0; AC_SUBST([REPLACE_ICONV_OPEN]) REPLACE_ICONV_UTF=0; AC_SUBST([REPLACE_ICONV_UTF]) ICONV_H=''; AC_SUBST([ICONV_H]) + AM_CONDITIONAL([GL_GENERATE_ICONV_H], [test -n "$ICONV_H"]) ]) diff -r 04ce36b456cc -r 6758fa38915e m4/imaxabs.m4 --- a/m4/imaxabs.m4 Fri Apr 01 16:04:45 2011 -0700 +++ b/m4/imaxabs.m4 Fri May 06 08:15:59 2011 -0700 @@ -1,4 +1,4 @@ -# imaxabs.m4 serial 1 +# imaxabs.m4 serial 2 dnl Copyright (C) 2006, 2009-2011 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -6,8 +6,10 @@ AC_DEFUN([gl_FUNC_IMAXABS], [ - AC_REQUIRE([gl_INTTYPES_H]) + AC_REQUIRE([gl_INTTYPES_H_DEFAULTS]) + AC_CHECK_DECLS_ONCE([imaxabs]) if test "$ac_cv_have_decl_imaxabs" != yes; then + HAVE_DECL_IMAXABS=0 AC_LIBOBJ([imaxabs]) gl_PREREQ_IMAXABS fi diff -r 04ce36b456cc -r 6758fa38915e m4/imaxdiv.m4 --- a/m4/imaxdiv.m4 Fri Apr 01 16:04:45 2011 -0700 +++ b/m4/imaxdiv.m4 Fri May 06 08:15:59 2011 -0700 @@ -1,4 +1,4 @@ -# imaxdiv.m4 serial 1 +# imaxdiv.m4 serial 2 dnl Copyright (C) 2006, 2009-2011 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -6,8 +6,10 @@ AC_DEFUN([gl_FUNC_IMAXDIV], [ - AC_REQUIRE([gl_INTTYPES_H]) + AC_REQUIRE([gl_INTTYPES_H_DEFAULTS]) + AC_CHECK_DECLS_ONCE([imaxdiv]) if test "$ac_cv_have_decl_imaxdiv" != yes; then + HAVE_DECL_IMAXDIV=0 AC_LIBOBJ([imaxdiv]) gl_PREREQ_IMAXDIV fi diff -r 04ce36b456cc -r 6758fa38915e m4/inet_ntop.m4 --- a/m4/inet_ntop.m4 Fri Apr 01 16:04:45 2011 -0700 +++ b/m4/inet_ntop.m4 Fri May 06 08:15:59 2011 -0700 @@ -1,4 +1,4 @@ -# inet_ntop.m4 serial 13 +# inet_ntop.m4 serial 14 dnl Copyright (C) 2005-2006, 2008-2011 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -9,8 +9,6 @@ dnl Persuade Solaris to declare inet_ntop. AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) - gl_REPLACE_ARPA_INET_H - dnl Most platforms that provide inet_ntop define it in libc. dnl Solaris 8..10 provide inet_ntop in libnsl instead. gl_save_LIBS=$LIBS diff -r 04ce36b456cc -r 6758fa38915e m4/inet_pton.m4 --- a/m4/inet_pton.m4 Fri Apr 01 16:04:45 2011 -0700 +++ b/m4/inet_pton.m4 Fri May 06 08:15:59 2011 -0700 @@ -1,4 +1,4 @@ -# inet_pton.m4 serial 11 +# inet_pton.m4 serial 12 dnl Copyright (C) 2006, 2008-2011 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -9,8 +9,6 @@ dnl Persuade Solaris to declare inet_pton. AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) - gl_REPLACE_ARPA_INET_H - dnl Most platforms that provide inet_pton define it in libc. dnl Solaris 8..10 provide inet_pton in libnsl instead. gl_save_LIBS=$LIBS diff -r 04ce36b456cc -r 6758fa38915e m4/inttypes.m4 --- a/m4/inttypes.m4 Fri Apr 01 16:04:45 2011 -0700 +++ b/m4/inttypes.m4 Fri May 06 08:15:59 2011 -0700 @@ -1,4 +1,4 @@ -# inttypes.m4 serial 18 +# inttypes.m4 serial 23 dnl Copyright (C) 2006-2011 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -9,132 +9,14 @@ AC_DEFUN([gl_INTTYPES_H], [ - AC_REQUIRE([gl_STDINT_H]) - AC_REQUIRE([gt_INTTYPES_PRI]) - AC_CHECK_HEADERS_ONCE([inttypes.h]) - AC_CHECK_DECLS_ONCE([imaxabs]) - AC_CHECK_DECLS_ONCE([imaxdiv]) - AC_CHECK_DECLS_ONCE([strtoimax]) - AC_CHECK_DECLS_ONCE([strtoumax]) - - dnl Now see if we need a substitute . - dnl A complete requires - dnl - a complete , - dnl - the existence of an , - dnl - that imaxabs, imaxdiv, strtoimax, strtoumax are declared, - dnl - some additional tests. - AC_CACHE_CHECK([whether inttypes.h conforms to C99], - [gl_cv_header_working_inttypes_h], - [gl_cv_header_working_inttypes_h=no - if test "$gl_cv_header_working_stdint_h" = yes \ - && test $ac_cv_header_inttypes_h = yes \ - && test "$ac_cv_have_decl_imaxabs" = yes \ - && test "$ac_cv_have_decl_imaxdiv" = yes \ - && test "$ac_cv_have_decl_strtoimax" = yes \ - && test "$ac_cv_have_decl_strtoumax" = yes; then - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([[ -#include -#define __STDC_LIMIT_MACROS 1 /* to make it work also in C++ mode */ -#define __STDC_CONSTANT_MACROS 1 /* to make it work also in C++ mode */ -#define __STDC_FORMAT_MACROS 1 /* to make it work also in C++ mode */ -#define _GL_JUST_INCLUDE_SYSTEM_INTTYPES_H /* work if build isn't clean */ -#include - -/* No need to duplicate the tests of stdint.m4; they are subsumed by - $gl_cv_header_working_stdint_h = yes. */ - -/* Tests for macros supposed to be defined in inttypes.h. */ + AC_REQUIRE([gl_INTTYPES_INCOMPLETE]) + gl_INTTYPES_PRI_SCN +]) -const char *k = /* implicit string concatenation */ -#ifdef INT8_MAX - PRId8 PRIi8 -#endif -#ifdef UINT8_MAX - PRIo8 PRIu8 PRIx8 PRIX8 -#endif -#ifdef INT16_MAX - PRId16 PRIi16 -#endif -#ifdef UINT16_MAX - PRIo16 PRIu16 PRIx16 PRIX16 -#endif -#ifdef INT32_MAX - PRId32 PRIi32 -#endif -#ifdef UINT32_MAX - PRIo32 PRIu32 PRIx32 PRIX32 -#endif -#ifdef INT64_MAX - PRId64 PRIi64 -#endif -#ifdef UINT64_MAX - PRIo64 PRIu64 PRIx64 PRIX64 -#endif - PRIdLEAST8 PRIiLEAST8 PRIoLEAST8 PRIuLEAST8 PRIxLEAST8 PRIXLEAST8 - PRIdLEAST16 PRIiLEAST16 PRIoLEAST16 PRIuLEAST16 PRIxLEAST16 PRIXLEAST16 - PRIdLEAST32 PRIiLEAST32 PRIoLEAST32 PRIuLEAST32 PRIxLEAST32 PRIXLEAST32 - PRIdLEAST64 PRIiLEAST64 - PRIoLEAST64 PRIuLEAST64 PRIxLEAST64 PRIXLEAST64 - PRIdFAST8 PRIiFAST8 PRIoFAST8 PRIuFAST8 PRIxFAST8 PRIXFAST8 - PRIdFAST16 PRIiFAST16 PRIoFAST16 PRIuFAST16 PRIxFAST16 PRIXFAST16 - PRIdFAST32 PRIiFAST32 PRIoFAST32 PRIuFAST32 PRIxFAST32 PRIXFAST32 - PRIdFAST64 PRIiFAST64 - PRIoFAST64 PRIuFAST64 PRIxFAST64 PRIXFAST64 - PRIdMAX PRIiMAX PRIoMAX PRIuMAX PRIxMAX PRIXMAX -#ifdef INTPTR_MAX - PRIdPTR PRIiPTR -#endif -#ifdef UINTPTR_MAX - PRIoPTR PRIuPTR PRIxPTR PRIXPTR -#endif - ; -const char *l = /* implicit string concatenation */ -#ifdef INT8_MAX - SCNd8 SCNi8 -#endif -#ifdef UINT8_MAX - SCNo8 SCNu8 SCNx8 -#endif -#ifdef INT16_MAX - SCNd16 SCNi16 -#endif -#ifdef UINT16_MAX - SCNo16 SCNu16 SCNx16 -#endif -#ifdef INT32_MAX - SCNd32 SCNi32 -#endif -#ifdef UINT32_MAX - SCNo32 SCNu32 SCNx32 -#endif -#ifdef INT64_MAX - SCNd64 SCNi64 -#endif -#ifdef UINT64_MAX - SCNo64 SCNu64 SCNx64 -#endif - SCNdLEAST8 SCNiLEAST8 SCNoLEAST8 SCNuLEAST8 SCNxLEAST8 - SCNdLEAST16 SCNiLEAST16 SCNoLEAST16 SCNuLEAST16 SCNxLEAST16 - SCNdLEAST32 SCNiLEAST32 SCNoLEAST32 SCNuLEAST32 SCNxLEAST32 - SCNdLEAST64 SCNiLEAST64 - SCNoLEAST64 SCNuLEAST64 SCNxLEAST64 - SCNdFAST8 SCNiFAST8 SCNoFAST8 SCNuFAST8 SCNxFAST8 - SCNdFAST16 SCNiFAST16 SCNoFAST16 SCNuFAST16 SCNxFAST16 - SCNdFAST32 SCNiFAST32 SCNoFAST32 SCNuFAST32 SCNxFAST32 - SCNdFAST64 SCNiFAST64 - SCNoFAST64 SCNuFAST64 SCNxFAST64 - SCNdMAX SCNiMAX SCNoMAX SCNuMAX SCNxMAX -#ifdef INTPTR_MAX - SCNdPTR SCNiPTR -#endif -#ifdef UINTPTR_MAX - SCNoPTR SCNuPTR SCNxPTR -#endif - ; - ]])], - [gl_cv_header_working_inttypes_h=yes]) - fi]) +AC_DEFUN([gl_INTTYPES_INCOMPLETE], +[ + AC_REQUIRE([gl_STDINT_H]) + AC_CHECK_HEADERS_ONCE([inttypes.h]) dnl Override always, so that the portability warnings work. AC_REQUIRE([gl_INTTYPES_H_DEFAULTS]) @@ -158,6 +40,17 @@ #endif ]) + dnl Check for declarations of anything we want to poison if the + dnl corresponding gnulib module is not in use. + gl_WARN_ON_USE_PREPARE([[#include + ]], [imaxabs imaxdiv strtoimax strtoumax]) +]) + +# Ensure that the PRI* and SCN* macros are defined appropriately. +AC_DEFUN([gl_INTTYPES_PRI_SCN], +[ + AC_REQUIRE([gt_INTTYPES_PRI]) + PRIPTR_PREFIX= if test -n "$STDINT_H"; then dnl Using the gnulib . It always defines intptr_t to 'long'. @@ -181,30 +74,6 @@ fi AC_SUBST([PRIPTR_PREFIX]) - if test "$ac_cv_have_decl_imaxabs" = yes; then - HAVE_DECL_IMAXABS=1 - else - HAVE_DECL_IMAXABS=0 - fi - - if test "$ac_cv_have_decl_imaxdiv" = yes; then - HAVE_DECL_IMAXDIV=1 - else - HAVE_DECL_IMAXDIV=0 - fi - - if test "$ac_cv_have_decl_strtoimax" = yes; then - HAVE_DECL_STRTOIMAX=1 - else - HAVE_DECL_STRTOIMAX=0 - fi - - if test "$ac_cv_have_decl_strtoumax" = yes; then - HAVE_DECL_STRTOUMAX=1 - else - HAVE_DECL_STRTOUMAX=0 - fi - gl_INTTYPES_CHECK_LONG_LONG_INT_CONDITION( [INT32_MAX_LT_INTMAX_MAX], [defined INT32_MAX && defined INTMAX_MAX], @@ -233,11 +102,6 @@ else UINT64_MAX_EQ_ULONG_MAX=-1 fi - - dnl Check for declarations of anything we want to poison if the - dnl corresponding gnulib module is not in use. - gl_WARN_ON_USE_PREPARE([[#include - ]], [imaxabs imaxdiv strtoimax strtoumax]) ]) # Define the symbol $1 to be 1 if the condition is true, 0 otherwise. @@ -299,4 +163,10 @@ HAVE_DECL_IMAXDIV=1; AC_SUBST([HAVE_DECL_IMAXDIV]) HAVE_DECL_STRTOIMAX=1; AC_SUBST([HAVE_DECL_STRTOIMAX]) HAVE_DECL_STRTOUMAX=1; AC_SUBST([HAVE_DECL_STRTOUMAX]) + INT32_MAX_LT_INTMAX_MAX=1; AC_SUBST([INT32_MAX_LT_INTMAX_MAX]) + INT64_MAX_EQ_LONG_MAX='defined _LP64'; AC_SUBST([INT64_MAX_EQ_LONG_MAX]) + PRI_MACROS_BROKEN=0; AC_SUBST([PRI_MACROS_BROKEN]) + PRIPTR_PREFIX=__PRIPTR_PREFIX; AC_SUBST([PRIPTR_PREFIX]) + UINT32_MAX_LT_UINTMAX_MAX=1; AC_SUBST([UINT32_MAX_LT_UINTMAX_MAX]) + UINT64_MAX_EQ_ULONG_MAX='defined _LP64'; AC_SUBST([UINT64_MAX_EQ_ULONG_MAX]) ]) diff -r 04ce36b456cc -r 6758fa38915e m4/ioctl.m4 --- a/m4/ioctl.m4 Fri Apr 01 16:04:45 2011 -0700 +++ b/m4/ioctl.m4 Fri May 06 08:15:59 2011 -0700 @@ -1,4 +1,4 @@ -# ioctl.m4 serial 1 +# ioctl.m4 serial 2 dnl Copyright (C) 2008-2011 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -13,7 +13,6 @@ dnl application may use it and pass file descriptors that refer to dnl sockets to the ioctl() function. So enable the support for sockets. AC_LIBOBJ([ioctl]) - gl_REPLACE_SYS_IOCTL_H else AC_CHECK_FUNCS([ioctl]) dnl On glibc systems, the second parameter is 'unsigned long int request', @@ -32,7 +31,6 @@ if test $gl_cv_func_ioctl_posix_signature != yes; then REPLACE_IOCTL=1 AC_LIBOBJ([ioctl]) - gl_REPLACE_SYS_IOCTL_H fi fi ]) diff -r 04ce36b456cc -r 6758fa38915e m4/locale_h.m4 --- a/m4/locale_h.m4 Fri Apr 01 16:04:45 2011 -0700 +++ b/m4/locale_h.m4 Fri May 06 08:15:59 2011 -0700 @@ -1,4 +1,4 @@ -# locale_h.m4 serial 13 +# locale_h.m4 serial 14 dnl Copyright (C) 2007, 2009-2011 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,12 +57,6 @@ dnl is always overridden, because of GNULIB_POSIXCHECK. gl_NEXT_HEADERS([locale.h]) - if test -n "$STDDEF_H" \ - || test $gl_cv_header_locale_h_posix2001 = no \ - || test $gl_cv_header_locale_h_needs_xlocale_h = yes; then - gl_REPLACE_LOCALE_H - fi - dnl Check for declarations of anything we want to poison if the dnl corresponding gnulib module is not in use. gl_WARN_ON_USE_PREPARE([[#include @@ -74,13 +68,6 @@ [setlocale duplocale]) ]) -dnl Unconditionally enables the replacement of . -AC_DEFUN([gl_REPLACE_LOCALE_H], -[ - dnl This is a no-op, because is always overridden. - : -]) - AC_DEFUN([gl_LOCALE_MODULE_INDICATOR], [ dnl Use AC_REQUIRE here, so that the default settings are expanded once only. diff -r 04ce36b456cc -r 6758fa38915e m4/manywarnings.m4 --- a/m4/manywarnings.m4 Fri Apr 01 16:04:45 2011 -0700 +++ b/m4/manywarnings.m4 Fri May 06 08:15:59 2011 -0700 @@ -35,74 +35,124 @@ # using gl_WARN_ADD if you want to make sure your gcc understands it. AC_DEFUN([gl_MANYWARN_ALL_GCC], [ - gl_manywarn_set= - for gl_manywarn_item in \ - -Wall \ - -W \ - -Wformat-y2k \ - -Wformat-nonliteral \ - -Wformat-security \ - -Winit-self \ - -Wmissing-include-dirs \ - -Wswitch-default \ - -Wswitch-enum \ - -Wunused \ - -Wunknown-pragmas \ - -Wstrict-aliasing \ - -Wstrict-overflow \ - -Wsystem-headers \ - -Wfloat-equal \ - -Wtraditional \ - -Wtraditional-conversion \ - -Wdeclaration-after-statement \ - -Wundef \ - -Wshadow \ - -Wunsafe-loop-optimizations \ - -Wpointer-arith \ - -Wbad-function-cast \ - -Wc++-compat \ - -Wcast-qual \ - -Wcast-align \ - -Wwrite-strings \ - -Wconversion \ - -Wsign-conversion \ - -Wlogical-op \ - -Waggregate-return \ - -Wstrict-prototypes \ - -Wold-style-definition \ - -Wmissing-prototypes \ - -Wmissing-declarations \ - -Wmissing-noreturn \ - -Wmissing-format-attribute \ - -Wpacked \ - -Wpadded \ - -Wredundant-decls \ - -Wnested-externs \ - -Wunreachable-code \ - -Winline \ - -Winvalid-pch \ - -Wlong-long \ - -Wvla \ - -Wvolatile-register-var \ - -Wdisabled-optimization \ - -Wstack-protector \ - -Woverlength-strings \ - -Wbuiltin-macro-redefined \ - -Wmudflap \ - -Wpacked-bitfield-compat \ - -Wsync-nand \ - ; do + dnl First, check if -Wno-missing-field-initializers is needed. + dnl -Wmissing-field-initializers is implied by -W, but that issues + dnl warnings with GCC version before 4.7, for the common idiom + dnl of initializing types on the stack to zero, using { 0, } + AC_REQUIRE([AC_PROG_CC]) + if test -n "$GCC"; then + + dnl First, check -W -Werror -Wno-missing-field-initializers is supported + dnl with the current $CC $CFLAGS $CPPFLAGS. + AC_MSG_CHECKING([whether -Wno-missing-field-initializers is supported]) + AC_CACHE_VAL([gl_cv_cc_nomfi_supported], [ + gl_save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -W -Werror -Wno-missing-field-initializers" + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([[]], [[]])], + [gl_cv_cc_nomfi_supported=yes], + [gl_cv_cc_nomfi_supported=no]) + CFLAGS="$gl_save_CFLAGS"]) + AC_MSG_RESULT([$gl_cv_cc_nomfi_supported]) + + if test "$gl_cv_cc_nomfi_supported" = yes; then + dnl Now check whether -Wno-missing-field-initializers is needed + dnl for the { 0, } construct. + AC_MSG_CHECKING([whether -Wno-missing-field-initializers is needed]) + AC_CACHE_VAL([gl_cv_cc_nomfi_needed], [ + gl_save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -W -Werror" + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[void f (void) + { + typedef struct { int a; int b; } s_t; + s_t s1 = { 0, }; + } + ]], + [[]])], + [gl_cv_cc_nomfi_needed=no], + [gl_cv_cc_nomfi_needed=yes]) + CFLAGS="$gl_save_CFLAGS" + ]) + AC_MSG_RESULT([$gl_cv_cc_nomfi_needed]) + fi + fi + + gl_manywarn_set= + for gl_manywarn_item in \ + -Wall \ + -W \ + -Wformat-y2k \ + -Wformat-nonliteral \ + -Wformat-security \ + -Winit-self \ + -Wmissing-include-dirs \ + -Wswitch-default \ + -Wswitch-enum \ + -Wunused \ + -Wunknown-pragmas \ + -Wstrict-aliasing \ + -Wstrict-overflow \ + -Wsystem-headers \ + -Wfloat-equal \ + -Wtraditional \ + -Wtraditional-conversion \ + -Wdeclaration-after-statement \ + -Wundef \ + -Wshadow \ + -Wunsafe-loop-optimizations \ + -Wpointer-arith \ + -Wbad-function-cast \ + -Wc++-compat \ + -Wcast-qual \ + -Wcast-align \ + -Wwrite-strings \ + -Wconversion \ + -Wsign-conversion \ + -Wlogical-op \ + -Waggregate-return \ + -Wstrict-prototypes \ + -Wold-style-definition \ + -Wmissing-prototypes \ + -Wmissing-declarations \ + -Wmissing-noreturn \ + -Wmissing-format-attribute \ + -Wpacked \ + -Wpadded \ + -Wredundant-decls \ + -Wnested-externs \ + -Wunreachable-code \ + -Winline \ + -Winvalid-pch \ + -Wlong-long \ + -Wvla \ + -Wvolatile-register-var \ + -Wdisabled-optimization \ + -Wstack-protector \ + -Woverlength-strings \ + -Wbuiltin-macro-redefined \ + -Wmudflap \ + -Wpacked-bitfield-compat \ + -Wsync-nand \ + ; do gl_manywarn_set="$gl_manywarn_set $gl_manywarn_item" done - # The following are not documented in the manual but are included in - # output from gcc --help=warnings. - for gl_manywarn_item in \ - -Wattributes \ - -Wcoverage-mismatch \ - -Wmultichar \ - -Wunused-macros \ - ; do + # The following are not documented in the manual but are included in + # output from gcc --help=warnings. + for gl_manywarn_item in \ + -Wattributes \ + -Wcoverage-mismatch \ + -Wmultichar \ + -Wunused-macros \ + ; do gl_manywarn_set="$gl_manywarn_set $gl_manywarn_item" done + + # Disable the missing-field-initializers warning if needed + if test "$gl_cv_cc_nomfi_needed" = yes; then + gl_manywarn_set="$gl_manywarn_set -Wno-missing-field-initializers" + fi + $1=$gl_manywarn_set ]) diff -r 04ce36b456cc -r 6758fa38915e m4/mbrlen.m4 --- a/m4/mbrlen.m4 Fri Apr 01 16:04:45 2011 -0700 +++ b/m4/mbrlen.m4 Fri May 06 08:15:59 2011 -0700 @@ -1,4 +1,4 @@ -# mbrlen.m4 serial 5 +# mbrlen.m4 serial 6 dnl Copyright (C) 2008, 2010-2011 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -23,7 +23,6 @@ fi fi if test $HAVE_MBRLEN = 0 || test $REPLACE_MBRLEN = 1; then - gl_REPLACE_WCHAR_H AC_LIBOBJ([mbrlen]) gl_PREREQ_MBRLEN fi diff -r 04ce36b456cc -r 6758fa38915e m4/mbrtowc.m4 --- a/m4/mbrtowc.m4 Fri Apr 01 16:04:45 2011 -0700 +++ b/m4/mbrtowc.m4 Fri May 06 08:15:59 2011 -0700 @@ -1,4 +1,4 @@ -# mbrtowc.m4 serial 22 +# mbrtowc.m4 serial 23 dnl Copyright (C) 2001-2002, 2004-2005, 2008-2011 Free Software Foundation, dnl Inc. dnl This file is free software; the Free Software Foundation @@ -54,7 +54,6 @@ fi fi if test $HAVE_MBRTOWC = 0 || test $REPLACE_MBRTOWC = 1; then - gl_REPLACE_WCHAR_H AC_LIBOBJ([mbrtowc]) gl_PREREQ_MBRTOWC fi @@ -88,9 +87,6 @@ else REPLACE_MBSTATE_T=1 fi - if test $REPLACE_MBSTATE_T = 1; then - gl_REPLACE_WCHAR_H - fi ]) dnl Test whether mbrtowc puts the state into non-initial state when parsing an diff -r 04ce36b456cc -r 6758fa38915e m4/mbsinit.m4 --- a/m4/mbsinit.m4 Fri Apr 01 16:04:45 2011 -0700 +++ b/m4/mbsinit.m4 Fri May 06 08:15:59 2011 -0700 @@ -1,4 +1,4 @@ -# mbsinit.m4 serial 5 +# mbsinit.m4 serial 6 dnl Copyright (C) 2008, 2010-2011 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,7 +28,6 @@ fi fi if test $HAVE_MBSINIT = 0 || test $REPLACE_MBSINIT = 1; then - gl_REPLACE_WCHAR_H AC_LIBOBJ([mbsinit]) gl_PREREQ_MBSINIT fi diff -r 04ce36b456cc -r 6758fa38915e m4/mbsnrtowcs.m4 --- a/m4/mbsnrtowcs.m4 Fri Apr 01 16:04:45 2011 -0700 +++ b/m4/mbsnrtowcs.m4 Fri May 06 08:15:59 2011 -0700 @@ -1,4 +1,4 @@ -# mbsnrtowcs.m4 serial 2 +# mbsnrtowcs.m4 serial 3 dnl Copyright (C) 2008, 2010-2011 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -23,7 +23,6 @@ fi fi if test $HAVE_MBSNRTOWCS = 0 || test $REPLACE_MBSNRTOWCS = 1; then - gl_REPLACE_WCHAR_H AC_LIBOBJ([mbsnrtowcs]) AC_LIBOBJ([mbsrtowcs-state]) gl_PREREQ_MBSNRTOWCS diff -r 04ce36b456cc -r 6758fa38915e m4/mbsrtowcs.m4 --- a/m4/mbsrtowcs.m4 Fri Apr 01 16:04:45 2011 -0700 +++ b/m4/mbsrtowcs.m4 Fri May 06 08:15:59 2011 -0700 @@ -1,4 +1,4 @@ -# mbsrtowcs.m4 serial 10 +# mbsrtowcs.m4 serial 11 dnl Copyright (C) 2008-2011 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -26,7 +26,6 @@ fi fi if test $HAVE_MBSRTOWCS = 0 || test $REPLACE_MBSRTOWCS = 1; then - gl_REPLACE_WCHAR_H AC_LIBOBJ([mbsrtowcs]) AC_LIBOBJ([mbsrtowcs-state]) gl_PREREQ_MBSRTOWCS diff -r 04ce36b456cc -r 6758fa38915e m4/memchr-obsolete.m4 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/m4/memchr-obsolete.m4 Fri May 06 08:15:59 2011 -0700 @@ -0,0 +1,11 @@ +# memchr-obsolete.m4 serial 1 +dnl Copyright (C) 2011 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_FUNC_MEMCHR_OBSOLETE], +[ + dnl The real code is in memchr.m4. + : +]) diff -r 04ce36b456cc -r 6758fa38915e m4/memchr.m4 --- a/m4/memchr.m4 Fri Apr 01 16:04:45 2011 -0700 +++ b/m4/memchr.m4 Fri May 06 08:15:59 2011 -0700 @@ -1,4 +1,4 @@ -# memchr.m4 serial 10 +# memchr.m4 serial 11 dnl Copyright (C) 2002-2004, 2009-2011 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -11,10 +11,16 @@ AC_CHECK_HEADERS_ONCE([sys/mman.h]) AC_CHECK_FUNCS_ONCE([mprotect]) - dnl These days, we assume memchr is present. But just in case... AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS]) - AC_CHECK_FUNCS_ONCE([memchr]) - if test $ac_cv_func_memchr = yes; then + m4_ifdef([gl_FUNC_MEMCHR_OBSOLETE], [ + dnl These days, we assume memchr is present. But if support for old + dnl platforms is desired: + AC_CHECK_FUNCS_ONCE([memchr]) + if test $ac_cv_func_memchr = no; then + HAVE_MEMCHR=0 + fi + ]) + if test $HAVE_MEMCHR = 1; then # Detect platform-specific bugs in some versions of glibc: # memchr should not dereference anything with length 0 # http://bugzilla.redhat.com/499689 @@ -73,8 +79,6 @@ if test "$gl_cv_func_memchr_works" != yes; then REPLACE_MEMCHR=1 fi - else - HAVE_MEMCHR=0 fi if test $HAVE_MEMCHR = 0 || test $REPLACE_MEMCHR = 1; then AC_LIBOBJ([memchr]) diff -r 04ce36b456cc -r 6758fa38915e m4/mkstemp.m4 --- a/m4/mkstemp.m4 Fri Apr 01 16:04:45 2011 -0700 +++ b/m4/mkstemp.m4 Fri May 06 08:15:59 2011 -0700 @@ -1,4 +1,4 @@ -#serial 19 +#serial 20 # Copyright (C) 2001, 2003-2007, 2009-2011 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation @@ -10,6 +10,8 @@ # Other systems lack mkstemp altogether. # On OSF1/Tru64 V4.0F, the system-provided mkstemp function can create # only 32 files per process. +# On some hosts, mkstemp creates files with mode 0666, which is a security +# problem and a violation of POSIX 2008. # On systems like the above, arrange to use the replacement function. AC_DEFUN([gl_FUNC_MKSTEMP], [ @@ -30,6 +32,7 @@ off_t large = (off_t) 4294967295u; if (large < 0) large = 2147483647; + umask (0); for (i = 0; i < 70; i++) { char templ[] = "conftest.mkstemp/coXXXXXX"; @@ -39,18 +42,24 @@ result |= 1; else { + struct stat st; if (lseek (fd, large, SEEK_SET) != large) result |= 2; - close (fd); + if (fstat (fd, &st) < 0) + result |= 4; + else if (st.st_mode & 0077) + result |= 8; + if (close (fd)) + result |= 16; } } return result;]])], [gl_cv_func_working_mkstemp=yes], [gl_cv_func_working_mkstemp=no], - [gl_cv_func_working_mkstemp=no]) + [gl_cv_func_working_mkstemp="guessing no"]) rm -rf conftest.mkstemp ]) - if test $gl_cv_func_working_mkstemp != yes; then + if test "$gl_cv_func_working_mkstemp" != yes; then REPLACE_MKSTEMP=1 AC_LIBOBJ([mkstemp]) gl_PREREQ_MKSTEMP diff -r 04ce36b456cc -r 6758fa38915e m4/netdb_h.m4 --- a/m4/netdb_h.m4 Fri Apr 01 16:04:45 2011 -0700 +++ b/m4/netdb_h.m4 Fri May 06 08:15:59 2011 -0700 @@ -1,4 +1,4 @@ -# netdb_h.m4 serial 10 +# netdb_h.m4 serial 11 dnl Copyright (C) 2008-2011 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -26,6 +26,8 @@ dnl Use AC_REQUIRE here, so that the default settings are expanded once only. AC_REQUIRE([gl_NETDB_H_DEFAULTS]) gl_MODULE_INDICATOR_SET_VARIABLE([$1]) + dnl Define it also as a C macro, for the benefit of the unit tests. + gl_MODULE_INDICATOR_FOR_TESTS([$1]) ]) AC_DEFUN([gl_NETDB_H_DEFAULTS], @@ -37,4 +39,5 @@ HAVE_DECL_GAI_STRERROR=1; AC_SUBST([HAVE_DECL_GAI_STRERROR]) HAVE_DECL_GETADDRINFO=1; AC_SUBST([HAVE_DECL_GETADDRINFO]) HAVE_DECL_GETNAMEINFO=1; AC_SUBST([HAVE_DECL_GETNAMEINFO]) + REPLACE_GAI_STRERROR=0; AC_SUBST([REPLACE_GAI_STRERROR]) ]) diff -r 04ce36b456cc -r 6758fa38915e m4/netinet_in_h.m4 --- a/m4/netinet_in_h.m4 Fri Apr 01 16:04:45 2011 -0700 +++ b/m4/netinet_in_h.m4 Fri May 06 08:15:59 2011 -0700 @@ -1,4 +1,4 @@ -# netinet_in_h.m4 serial 4 +# netinet_in_h.m4 serial 5 dnl Copyright (C) 2006-2011 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,4 +27,5 @@ AC_SUBST([HAVE_NETINET_IN_H]) fi AC_SUBST([NETINET_IN_H]) + AM_CONDITIONAL([GL_GENERATE_NETINET_IN_H], [test -n "$NETINET_IN_H"]) ]) diff -r 04ce36b456cc -r 6758fa38915e m4/nonblocking.m4 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/m4/nonblocking.m4 Fri May 06 08:15:59 2011 -0700 @@ -0,0 +1,29 @@ +# nonblocking.m4 serial 2 +dnl Copyright (C) 2011 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl Tests whether non-blocking I/O is natively supported by read(), write(). +dnl Sets gl_cv_have_nonblocking. +dnl Also tests whether open() supports O_NONBLOCK. +dnl Sets gl_cv_have_open_O_NONBLOCK. +AC_DEFUN([gl_NONBLOCKING_IO], +[ + dnl Use AC_REQUIRE here, so that the default behavior below is expanded + dnl once only, before all statements that occur in other macros. + AC_REQUIRE([gl_NONBLOCKING_IO_BODY]) +]) + +AC_DEFUN([gl_NONBLOCKING_IO_BODY], +[ + AC_REQUIRE([AC_CANONICAL_HOST]) + case "$host_os" in + mingw*) gl_cv_have_nonblocking=no ;; + *) gl_cv_have_nonblocking=yes ;; + esac + case "$host_os" in + mingw*) gl_cv_have_open_O_NONBLOCK=no ;; + *) gl_cv_have_open_O_NONBLOCK=yes ;; + esac +]) diff -r 04ce36b456cc -r 6758fa38915e m4/open.m4 --- a/m4/open.m4 Fri Apr 01 16:04:45 2011 -0700 +++ b/m4/open.m4 Fri May 06 08:15:59 2011 -0700 @@ -1,4 +1,4 @@ -# open.m4 serial 11 +# open.m4 serial 12 dnl Copyright (C) 2007-2011 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -62,6 +62,15 @@ esac ;; esac + dnl Replace open() for supporting the gnulib-defined O_NONBLOCK flag. + m4_ifdef([gl_NONBLOCKING_IO], [ + if test $REPLACE_OPEN = 0; then + gl_NONBLOCKING_IO + if test $gl_cv_have_open_O_NONBLOCK != yes; then + gl_REPLACE_OPEN + fi + fi + ]) ]) AC_DEFUN([gl_REPLACE_OPEN], diff -r 04ce36b456cc -r 6758fa38915e m4/passfd.m4 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/m4/passfd.m4 Fri May 06 08:15:59 2011 -0700 @@ -0,0 +1,23 @@ +# passfd.m4 serial 8 +dnl Copyright (C) 2011 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_PASSFD], +[ + AC_REQUIRE([gl_HEADER_SYS_SOCKET]) + AC_CHECK_FUNCS_ONCE([recvmsg sendmsg]) + + dnl Persuade AIX 5.2 to declare CMSG_SPACE, CMSG_LEN. + dnl CMSG_FIRSTHDR is POSIX 2008, but CMSG_SPACE is only in RFC 3542. + AC_DEFINE([_LINUX_SOURCE_COMPAT], [1], + [Define in order to get some macros on AIX systems.]) + + dnl Passfd prefers the POSIX use of msg.msg_control if the CMSG_* macros + dnl are present, but can fall back to BSD 4.3 style of msg.msg_accrights. + AC_CHECK_MEMBERS([struct msghdr.msg_accrights], [], [], [[ + #include + #include + ]]) +]) diff -r 04ce36b456cc -r 6758fa38915e m4/poll.m4 --- a/m4/poll.m4 Fri Apr 01 16:04:45 2011 -0700 +++ b/m4/poll.m4 Fri May 06 08:15:59 2011 -0700 @@ -1,4 +1,4 @@ -# poll.m4 serial 12 +# poll.m4 serial 13 dnl Copyright (c) 2003, 2005-2007, 2009-2011 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -63,7 +63,6 @@ fi fi if test $HAVE_POLL = 0 || test $REPLACE_POLL = 1; then - gl_REPLACE_POLL_H AC_LIBOBJ([poll]) gl_PREREQ_POLL else diff -r 04ce36b456cc -r 6758fa38915e m4/poll_h.m4 --- a/m4/poll_h.m4 Fri Apr 01 16:04:45 2011 -0700 +++ b/m4/poll_h.m4 Fri May 06 08:15:59 2011 -0700 @@ -1,4 +1,4 @@ -# poll_h.m4 serial 1 +# poll_h.m4 serial 2 dnl Copyright (C) 2010-2011 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,7 +17,6 @@ HAVE_POLL_H=1 else HAVE_POLL_H=0 - gl_REPLACE_POLL_H fi AC_SUBST([HAVE_POLL_H]) @@ -30,13 +29,6 @@ [poll]) ]) -dnl Unconditionally enables the replacement of . -AC_DEFUN([gl_REPLACE_POLL_H], -[ - dnl This is a no-op, because is always overridden. - : -]) - AC_DEFUN([gl_POLL_MODULE_INDICATOR], [ dnl Use AC_REQUIRE here, so that the default settings are expanded once only. diff -r 04ce36b456cc -r 6758fa38915e m4/pthread.m4 --- a/m4/pthread.m4 Fri Apr 01 16:04:45 2011 -0700 +++ b/m4/pthread.m4 Fri May 06 08:15:59 2011 -0700 @@ -30,7 +30,11 @@ test $ac_cv_type_pthread_t != yes || test $ac_cv_type_pthread_spinlock_t != yes; then PTHREAD_H='pthread.h' + else + PTHREAD_H= fi + AC_SUBST([PTHREAD_H]) + AM_CONDITIONAL([GL_GENERATE_PTHREAD_H], [test -n "$PTHREAD_H"]) LIB_PTHREAD= if test $ac_cv_header_pthread_h = yes; then @@ -53,5 +57,4 @@ HAVE_PTHREAD_H=1; AC_SUBST([HAVE_PTHREAD_H]) HAVE_PTHREAD_T=1; AC_SUBST([HAVE_PTHREAD_T]) HAVE_PTHREAD_SPINLOCK_T=1; AC_SUBST([HAVE_PTHREAD_SPINLOCK_T]) - PTHREAD_H=''; AC_SUBST([PTHREAD_H]) ]) diff -r 04ce36b456cc -r 6758fa38915e m4/read.m4 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/m4/read.m4 Fri May 06 08:15:59 2011 -0700 @@ -0,0 +1,20 @@ +# read.m4 serial 1 +dnl Copyright (C) 2011 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_FUNC_READ], +[ + AC_REQUIRE([gl_UNISTD_H_DEFAULTS]) + dnl This ifdef is just an optimization, to avoid performing a configure + dnl check whose result is not used. It does not make the test of + dnl GNULIB_UNISTD_H_NONBLOCKING or GNULIB_NONBLOCKING redundant. + m4_ifdef([gl_NONBLOCKING_IO], [ + gl_NONBLOCKING_IO + if test $gl_cv_have_nonblocking != yes; then + REPLACE_READ=1 + AC_LIBOBJ([read]) + fi + ]) +]) diff -r 04ce36b456cc -r 6758fa38915e m4/sched_h.m4 --- a/m4/sched_h.m4 Fri Apr 01 16:04:45 2011 -0700 +++ b/m4/sched_h.m4 Fri May 06 08:15:59 2011 -0700 @@ -1,4 +1,4 @@ -# sched_h.m4 serial 3 +# sched_h.m4 serial 4 dnl Copyright (C) 2008-2011 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -32,4 +32,5 @@ AC_SUBST([HAVE_STRUCT_SCHED_PARAM]) ]) AC_SUBST([SCHED_H]) + AM_CONDITIONAL([GL_GENERATE_SCHED_H], [test -n "$SCHED_H"]) ]) diff -r 04ce36b456cc -r 6758fa38915e m4/selinux-context-h.m4 --- a/m4/selinux-context-h.m4 Fri Apr 01 16:04:45 2011 -0700 +++ b/m4/selinux-context-h.m4 Fri May 06 08:15:59 2011 -0700 @@ -1,4 +1,4 @@ -# serial 2 -*- Autoconf -*- +# serial 3 -*- Autoconf -*- # Copyright (C) 2006-2007, 2009-2011 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -18,4 +18,5 @@ SELINUX_CONTEXT_H=selinux/context.h fi AC_SUBST([SELINUX_CONTEXT_H]) + AM_CONDITIONAL([GL_GENERATE_SELINUX_CONTEXT_H], [test -n "$SELINUX_CONTEXT_H"]) ]) diff -r 04ce36b456cc -r 6758fa38915e m4/setlocale.m4 --- a/m4/setlocale.m4 Fri Apr 01 16:04:45 2011 -0700 +++ b/m4/setlocale.m4 Fri May 06 08:15:59 2011 -0700 @@ -1,4 +1,4 @@ -# setlocale.m4 serial 1 +# setlocale.m4 serial 2 dnl Copyright (C) 2011 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -14,7 +14,6 @@ mingw*) REPLACE_SETLOCALE=1 ;; esac if test $REPLACE_SETLOCALE = 1; then - gl_REPLACE_LOCALE_H AC_LIBOBJ([setlocale]) gl_PREREQ_SETLOCALE fi diff -r 04ce36b456cc -r 6758fa38915e m4/signal_h.m4 --- a/m4/signal_h.m4 Fri Apr 01 16:04:45 2011 -0700 +++ b/m4/signal_h.m4 Fri May 06 08:15:59 2011 -0700 @@ -1,4 +1,4 @@ -# signal_h.m4 serial 11 +# signal_h.m4 serial 12 dnl Copyright (C) 2007-2011 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -8,14 +8,22 @@ [ AC_REQUIRE([gl_SIGNAL_H_DEFAULTS]) gl_NEXT_HEADERS([signal.h]) + # AIX declares sig_atomic_t to already include volatile, and C89 compilers # then choke on 'volatile sig_atomic_t'. C99 requires that it compile. AC_CHECK_TYPE([volatile sig_atomic_t], [], [HAVE_TYPE_VOLATILE_SIG_ATOMIC_T=0], [[ #include ]]) + AC_REQUIRE([AC_TYPE_UID_T]) + dnl Persuade glibc to define sighandler_t. + AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS]) + AC_CHECK_TYPE([sighandler_t], [], [HAVE_SIGHANDLER_T=0], [[ +#include + ]]) + dnl Check for declarations of anything we want to poison if the dnl corresponding gnulib module is not in use. gl_WARN_ON_USE_PREPARE([[#include @@ -46,4 +54,5 @@ AC_SUBST([HAVE_STRUCT_SIGACTION_SA_SIGACTION]) HAVE_TYPE_VOLATILE_SIG_ATOMIC_T=1; AC_SUBST([HAVE_TYPE_VOLATILE_SIG_ATOMIC_T]) + HAVE_SIGHANDLER_T=1; AC_SUBST([HAVE_SIGHANDLER_T]) ]) diff -r 04ce36b456cc -r 6758fa38915e m4/spawn_h.m4 --- a/m4/spawn_h.m4 Fri Apr 01 16:04:45 2011 -0700 +++ b/m4/spawn_h.m4 Fri May 06 08:15:59 2011 -0700 @@ -1,4 +1,4 @@ -# spawn_h.m4 serial 12 +# spawn_h.m4 serial 13 dnl Copyright (C) 2008-2011 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,7 +28,6 @@ HAVE_SPAWN_H=0 HAVE_POSIX_SPAWNATTR_T=0 HAVE_POSIX_SPAWN_FILE_ACTIONS_T=0 - gl_REPLACE_SPAWN_H fi AC_SUBST([HAVE_SPAWN_H]) @@ -65,13 +64,6 @@ fi ]) -dnl Unconditionally enables the replacement of . -AC_DEFUN([gl_REPLACE_SPAWN_H], -[ - dnl This is a no-op, because is always overridden. - : -]) - AC_DEFUN([gl_SPAWN_MODULE_INDICATOR], [ dnl Use AC_REQUIRE here, so that the default settings are expanded once only. diff -r 04ce36b456cc -r 6758fa38915e m4/stdarg.m4 --- a/m4/stdarg.m4 Fri Apr 01 16:04:45 2011 -0700 +++ b/m4/stdarg.m4 Fri May 06 08:15:59 2011 -0700 @@ -1,4 +1,4 @@ -# stdarg.m4 serial 5 +# stdarg.m4 serial 6 dnl Copyright (C) 2006, 2008-2011 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -9,8 +9,8 @@ AC_DEFUN([gl_STDARG_H], [ - STDARG_H=''; AC_SUBST([STDARG_H]) - NEXT_STDARG_H=''; AC_SUBST([NEXT_STDARG_H]) + STDARG_H='' + NEXT_STDARG_H='' AC_MSG_CHECKING([for va_copy]) AC_CACHE_VAL([gl_cv_func_va_copy], [ AC_COMPILE_IFELSE( @@ -72,4 +72,7 @@ fi fi fi + AC_SUBST([STDARG_H]) + AM_CONDITIONAL([GL_GENERATE_STDARG_H], [test -n "$STDARG_H"]) + AC_SUBST([NEXT_STDARG_H]) ]) diff -r 04ce36b456cc -r 6758fa38915e m4/stdbool.m4 --- a/m4/stdbool.m4 Fri Apr 01 16:04:45 2011 -0700 +++ b/m4/stdbool.m4 Fri May 06 08:15:59 2011 -0700 @@ -5,7 +5,7 @@ dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. -#serial 4 +#serial 5 # Prepare for substituting if it is not supported. @@ -21,6 +21,7 @@ STDBOOL_H='stdbool.h' fi AC_SUBST([STDBOOL_H]) + AM_CONDITIONAL([GL_GENERATE_STDBOOL_H], [test -n "$STDBOOL_H"]) if test "$ac_cv_type__Bool" = yes; then HAVE__BOOL=1 diff -r 04ce36b456cc -r 6758fa38915e m4/stddef_h.m4 --- a/m4/stddef_h.m4 Fri Apr 01 16:04:45 2011 -0700 +++ b/m4/stddef_h.m4 Fri May 06 08:15:59 2011 -0700 @@ -1,5 +1,5 @@ dnl A placeholder for POSIX 2008 , for platforms that have issues. -# stddef_h.m4 serial 3 +# stddef_h.m4 serial 4 dnl Copyright (C) 2009-2011 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -9,6 +9,7 @@ [ AC_REQUIRE([gl_STDDEF_H_DEFAULTS]) AC_REQUIRE([gt_TYPE_WCHAR_T]) + STDDEF_H= if test $gt_cv_c_wchar_t = no; then HAVE_WCHAR_T=0 STDDEF_H=stddef.h @@ -24,6 +25,8 @@ REPLACE_NULL=1 STDDEF_H=stddef.h fi + AC_SUBST([STDDEF_H]) + AM_CONDITIONAL([GL_GENERATE_STDDEF_H], [test -n "$STDDEF_H"]) if test -n "$STDDEF_H"; then gl_NEXT_HEADERS([stddef.h]) fi @@ -41,5 +44,4 @@ dnl Assume proper GNU behavior unless another module says otherwise. REPLACE_NULL=0; AC_SUBST([REPLACE_NULL]) HAVE_WCHAR_T=1; AC_SUBST([HAVE_WCHAR_T]) - STDDEF_H=''; AC_SUBST([STDDEF_H]) ]) diff -r 04ce36b456cc -r 6758fa38915e m4/stdint.m4 --- a/m4/stdint.m4 Fri Apr 01 16:04:45 2011 -0700 +++ b/m4/stdint.m4 Fri May 06 08:15:59 2011 -0700 @@ -1,4 +1,4 @@ -# stdint.m4 serial 39 +# stdint.m4 serial 40 dnl Copyright (C) 2001-2011 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -305,6 +305,7 @@ STDINT_H=stdint.h fi AC_SUBST([STDINT_H]) + AM_CONDITIONAL([GL_GENERATE_STDINT_H], [test -n "$STDINT_H"]) ]) dnl gl_STDINT_BITSIZEOF(TYPES, INCLUDES) diff -r 04ce36b456cc -r 6758fa38915e m4/stdio_h.m4 --- a/m4/stdio_h.m4 Fri Apr 01 16:04:45 2011 -0700 +++ b/m4/stdio_h.m4 Fri May 06 08:15:59 2011 -0700 @@ -1,4 +1,4 @@ -# stdio_h.m4 serial 33 +# stdio_h.m4 serial 37 dnl Copyright (C) 2007-2011 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -9,6 +9,30 @@ AC_REQUIRE([gl_STDIO_H_DEFAULTS]) AC_REQUIRE([AC_C_INLINE]) gl_NEXT_HEADERS([stdio.h]) + + dnl No need to create extra modules for these functions. Everyone who uses + dnl likely needs them. + GNULIB_FSCANF=1 + GNULIB_SCANF=1 + GNULIB_FGETC=1 + GNULIB_GETC=1 + GNULIB_GETCHAR=1 + GNULIB_FGETS=1 + GNULIB_GETS=1 + GNULIB_FREAD=1 + 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 + dnl is not used. But it does not make the test of GNULIB_STDIO_H_NONBLOCKING + dnl or GNULIB_NONBLOCKING redundant. + m4_ifdef([gl_NONBLOCKING_IO], [ + gl_NONBLOCKING_IO + if test $gl_cv_have_nonblocking != yes; then + REPLACE_STDIO_READ_FUNCS=1 + AC_LIBOBJ([stdio-read]) + fi + ]) + dnl No need to create extra modules for these functions. Everyone who uses dnl likely needs them. GNULIB_FPRINTF=1 @@ -21,9 +45,11 @@ GNULIB_FPUTS=1 GNULIB_PUTS=1 GNULIB_FWRITE=1 - dnl This ifdef is just an optimization, to avoid performing a configure - dnl check whose result is not used. It does not make the test of - dnl GNULIB_STDIO_H_SIGPIPE or GNULIB_SIGPIPE redundant. + 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 + dnl is not used. But it does not make the test of GNULIB_STDIO_H_SIGPIPE or + dnl GNULIB_SIGPIPE redundant. m4_ifdef([gl_SIGNAL_SIGPIPE], [ gl_SIGNAL_SIGPIPE if test $gl_cv_header_signal_h_SIGPIPE != yes; then @@ -31,6 +57,18 @@ AC_LIBOBJ([stdio-write]) fi ]) + 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 + dnl is not used. But it does not make the test of GNULIB_STDIO_H_NONBLOCKING + dnl or GNULIB_NONBLOCKING redundant. + m4_ifdef([gl_NONBLOCKING_IO], [ + gl_NONBLOCKING_IO + if test $gl_cv_have_nonblocking != yes; then + REPLACE_STDIO_WRITE_FUNCS=1 + AC_LIBOBJ([stdio-write]) + fi + ]) dnl Check for declarations of anything we want to poison if the dnl corresponding gnulib module is not in use, and which is not @@ -54,20 +92,27 @@ GNULIB_DPRINTF=0; AC_SUBST([GNULIB_DPRINTF]) GNULIB_FCLOSE=0; AC_SUBST([GNULIB_FCLOSE]) GNULIB_FFLUSH=0; AC_SUBST([GNULIB_FFLUSH]) + GNULIB_FGETC=0; AC_SUBST([GNULIB_FGETC]) + GNULIB_FGETS=0; AC_SUBST([GNULIB_FGETS]) GNULIB_FOPEN=0; AC_SUBST([GNULIB_FOPEN]) GNULIB_FPRINTF=0; AC_SUBST([GNULIB_FPRINTF]) GNULIB_FPRINTF_POSIX=0; AC_SUBST([GNULIB_FPRINTF_POSIX]) GNULIB_FPURGE=0; AC_SUBST([GNULIB_FPURGE]) GNULIB_FPUTC=0; AC_SUBST([GNULIB_FPUTC]) GNULIB_FPUTS=0; AC_SUBST([GNULIB_FPUTS]) + GNULIB_FREAD=0; AC_SUBST([GNULIB_FREAD]) GNULIB_FREOPEN=0; AC_SUBST([GNULIB_FREOPEN]) + GNULIB_FSCANF=0; AC_SUBST([GNULIB_FSCANF]) GNULIB_FSEEK=0; AC_SUBST([GNULIB_FSEEK]) GNULIB_FSEEKO=0; AC_SUBST([GNULIB_FSEEKO]) GNULIB_FTELL=0; AC_SUBST([GNULIB_FTELL]) GNULIB_FTELLO=0; AC_SUBST([GNULIB_FTELLO]) GNULIB_FWRITE=0; AC_SUBST([GNULIB_FWRITE]) + GNULIB_GETC=0; AC_SUBST([GNULIB_GETC]) + GNULIB_GETCHAR=0; AC_SUBST([GNULIB_GETCHAR]) GNULIB_GETDELIM=0; AC_SUBST([GNULIB_GETDELIM]) GNULIB_GETLINE=0; AC_SUBST([GNULIB_GETLINE]) + GNULIB_GETS=0; AC_SUBST([GNULIB_GETS]) GNULIB_OBSTACK_PRINTF=0; AC_SUBST([GNULIB_OBSTACK_PRINTF]) GNULIB_OBSTACK_PRINTF_POSIX=0; AC_SUBST([GNULIB_OBSTACK_PRINTF_POSIX]) GNULIB_PERROR=0; AC_SUBST([GNULIB_PERROR]) @@ -80,11 +125,15 @@ GNULIB_REMOVE=0; AC_SUBST([GNULIB_REMOVE]) GNULIB_RENAME=0; AC_SUBST([GNULIB_RENAME]) GNULIB_RENAMEAT=0; AC_SUBST([GNULIB_RENAMEAT]) + GNULIB_SCANF=0; AC_SUBST([GNULIB_SCANF]) GNULIB_SNPRINTF=0; AC_SUBST([GNULIB_SNPRINTF]) GNULIB_SPRINTF_POSIX=0; AC_SUBST([GNULIB_SPRINTF_POSIX]) + GNULIB_STDIO_H_NONBLOCKING=0; AC_SUBST([GNULIB_STDIO_H_NONBLOCKING]) GNULIB_STDIO_H_SIGPIPE=0; AC_SUBST([GNULIB_STDIO_H_SIGPIPE]) GNULIB_TMPFILE=0; AC_SUBST([GNULIB_TMPFILE]) GNULIB_VASPRINTF=0; AC_SUBST([GNULIB_VASPRINTF]) + GNULIB_VFSCANF=0; AC_SUBST([GNULIB_VFSCANF]) + GNULIB_VSCANF=0; AC_SUBST([GNULIB_VSCANF]) GNULIB_VDPRINTF=0; AC_SUBST([GNULIB_VDPRINTF]) GNULIB_VFPRINTF=0; AC_SUBST([GNULIB_VFPRINTF]) GNULIB_VFPRINTF_POSIX=0; AC_SUBST([GNULIB_VFPRINTF_POSIX]) @@ -129,6 +178,7 @@ REPLACE_RENAMEAT=0; AC_SUBST([REPLACE_RENAMEAT]) REPLACE_SNPRINTF=0; AC_SUBST([REPLACE_SNPRINTF]) REPLACE_SPRINTF=0; AC_SUBST([REPLACE_SPRINTF]) + REPLACE_STDIO_READ_FUNCS=0; AC_SUBST([REPLACE_STDIO_READ_FUNCS]) REPLACE_STDIO_WRITE_FUNCS=0; AC_SUBST([REPLACE_STDIO_WRITE_FUNCS]) REPLACE_TMPFILE=0; AC_SUBST([REPLACE_TMPFILE]) REPLACE_VASPRINTF=0; AC_SUBST([REPLACE_VASPRINTF]) diff -r 04ce36b456cc -r 6758fa38915e m4/strchrnul.m4 --- a/m4/strchrnul.m4 Fri Apr 01 16:04:45 2011 -0700 +++ b/m4/strchrnul.m4 Fri May 06 08:15:59 2011 -0700 @@ -1,4 +1,4 @@ -# strchrnul.m4 serial 7 +# strchrnul.m4 serial 8 dnl Copyright (C) 2003, 2007, 2009-2011 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -10,9 +10,42 @@ AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS]) AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS]) - AC_REPLACE_FUNCS([strchrnul]) + AC_CHECK_FUNCS([strchrnul]) if test $ac_cv_func_strchrnul = no; then HAVE_STRCHRNUL=0 + else + AC_CACHE_CHECK([whether strchrnul works], + [gl_cv_func_strchrnul_works], + [AC_RUN_IFELSE([AC_LANG_PROGRAM([[ +#include /* for strchrnul */ +]], [[const char *buf = "a"; + return strchrnul (buf, 'b') != buf + 1; + ]])], + [gl_cv_func_strchrnul_works=yes], + [gl_cv_func_strchrnul_works=no], + [dnl Cygwin 1.7.9 introduced strchrnul, but it was broken until 1.7.10 + AC_EGREP_CPP([Lucky user], + [ +#if defined __CYGWIN__ + #include + #if CYGWIN_VERSION_DLL_COMBINED > CYGWIN_VERSION_DLL_MAKE_COMBINED (1007, 9) + Lucky user + #endif +#else + Lucky user +#endif + ], + [gl_cv_func_strchrnul_works="guessing yes"], + [gl_cv_func_strchrnul_works="guessing no"]) + ]) + ]) + case "$gl_cv_func_strchrnul_works" in + *yes) ;; + *) REPLACE_STRCHRNUL=1 ;; + esac + fi + if test $HAVE_STRCHRNUL = 0 || test $REPLACE_STRCHRNUL = 1; then + AC_LIBOBJ([strchrnul]) gl_PREREQ_STRCHRNUL fi ]) diff -r 04ce36b456cc -r 6758fa38915e m4/string_h.m4 --- a/m4/string_h.m4 Fri Apr 01 16:04:45 2011 -0700 +++ b/m4/string_h.m4 Fri May 06 08:15:59 2011 -0700 @@ -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 19 +# serial 20 # Written by Paul Eggert. @@ -104,6 +104,7 @@ REPLACE_STRDUP=0; AC_SUBST([REPLACE_STRDUP]) REPLACE_STRSTR=0; AC_SUBST([REPLACE_STRSTR]) REPLACE_STRCASESTR=0; AC_SUBST([REPLACE_STRCASESTR]) + REPLACE_STRCHRNUL=0; AC_SUBST([REPLACE_STRCHRNUL]) REPLACE_STRERROR=0; AC_SUBST([REPLACE_STRERROR]) REPLACE_STRERROR_R=0; AC_SUBST([REPLACE_STRERROR_R]) REPLACE_STRNCAT=0; AC_SUBST([REPLACE_STRNCAT]) diff -r 04ce36b456cc -r 6758fa38915e m4/strtod-obsolete.m4 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/m4/strtod-obsolete.m4 Fri May 06 08:15:59 2011 -0700 @@ -0,0 +1,11 @@ +# strtod-obsolete.m4 serial 1 +dnl Copyright (C) 2011 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_FUNC_STRTOD_OBSOLETE], +[ + dnl The real code is in strtod.m4. + : +]) diff -r 04ce36b456cc -r 6758fa38915e m4/strtod.m4 --- a/m4/strtod.m4 Fri Apr 01 16:04:45 2011 -0700 +++ b/m4/strtod.m4 Fri May 06 08:15:59 2011 -0700 @@ -1,4 +1,4 @@ -# strtod.m4 serial 19 +# strtod.m4 serial 20 dnl Copyright (C) 2002-2003, 2006-2011 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -7,15 +7,18 @@ AC_DEFUN([gl_FUNC_STRTOD], [ AC_REQUIRE([gl_STDLIB_H_DEFAULTS]) - dnl Test whether strtod is declared. - dnl Don't call AC_FUNC_STRTOD, because it does not have the right guess - dnl when cross-compiling. - dnl Don't call AC_CHECK_FUNCS([strtod]) because it would collide with the - dnl ac_cv_func_strtod variable set by the AC_FUNC_STRTOD macro. - AC_CHECK_DECLS_ONCE([strtod]) - if test $ac_cv_have_decl_strtod != yes; then - HAVE_STRTOD=0 - else + m4_ifdef([gl_FUNC_STRTOD_OBSOLETE], [ + dnl Test whether strtod is declared. + dnl Don't call AC_FUNC_STRTOD, because it does not have the right guess + dnl when cross-compiling. + dnl Don't call AC_CHECK_FUNCS([strtod]) because it would collide with the + dnl ac_cv_func_strtod variable set by the AC_FUNC_STRTOD macro. + AC_CHECK_DECLS_ONCE([strtod]) + if test $ac_cv_have_decl_strtod != yes; then + HAVE_STRTOD=0 + fi + ]) + if test $HAVE_STRTOD = 1; then AC_CACHE_CHECK([whether strtod obeys C99], [gl_cv_func_strtod_works], [AC_RUN_IFELSE([AC_LANG_PROGRAM([[ #include diff -r 04ce36b456cc -r 6758fa38915e m4/strtoimax.m4 --- a/m4/strtoimax.m4 Fri Apr 01 16:04:45 2011 -0700 +++ b/m4/strtoimax.m4 Fri May 06 08:15:59 2011 -0700 @@ -1,4 +1,4 @@ -# strtoimax.m4 serial 8 +# strtoimax.m4 serial 9 dnl Copyright (C) 2002-2004, 2006, 2009-2011 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -6,16 +6,12 @@ AC_DEFUN([gl_FUNC_STRTOIMAX], [ - AC_CACHE_CHECK([whether defines strtoimax as a macro], - gl_cv_func_strtoimax_macro, - [AC_EGREP_CPP([inttypes_h_defines_strtoimax], [#include -#ifdef strtoimax - inttypes_h_defines_strtoimax -#endif], - gl_cv_func_strtoimax_macro=yes, - gl_cv_func_strtoimax_macro=no)]) + AC_REQUIRE([gl_INTTYPES_H_DEFAULTS]) - if test "$gl_cv_func_strtoimax_macro" != yes; then + AC_CHECK_DECLS_ONCE([strtoimax]) + if test "$ac_cv_have_decl_strtoimax" != yes; then + HAVE_DECL_STRTOIMAX=0 + AC_REPLACE_FUNCS([strtoimax]) if test $ac_cv_func_strtoimax = no; then gl_PREREQ_STRTOIMAX diff -r 04ce36b456cc -r 6758fa38915e m4/strtoumax.m4 --- a/m4/strtoumax.m4 Fri Apr 01 16:04:45 2011 -0700 +++ b/m4/strtoumax.m4 Fri May 06 08:15:59 2011 -0700 @@ -1,4 +1,4 @@ -# strtoumax.m4 serial 8 +# strtoumax.m4 serial 9 dnl Copyright (C) 2002-2004, 2006, 2009-2011 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -6,16 +6,12 @@ AC_DEFUN([gl_FUNC_STRTOUMAX], [ - AC_CACHE_CHECK([whether defines strtoumax as a macro], - gl_cv_func_strtoumax_macro, - [AC_EGREP_CPP([inttypes_h_defines_strtoumax], [#include -#ifdef strtoumax - inttypes_h_defines_strtoumax -#endif], - gl_cv_func_strtoumax_macro=yes, - gl_cv_func_strtoumax_macro=no)]) + AC_REQUIRE([gl_INTTYPES_H_DEFAULTS]) - if test "$gl_cv_func_strtoumax_macro" != yes; then + AC_CHECK_DECLS_ONCE([strtoumax]) + if test "$ac_cv_have_decl_strtoumax" != yes; then + HAVE_DECL_STRTOUMAX=0 + AC_REPLACE_FUNCS([strtoumax]) if test $ac_cv_func_strtoumax = no; then gl_PREREQ_STRTOUMAX diff -r 04ce36b456cc -r 6758fa38915e m4/sys_ioctl_h.m4 --- a/m4/sys_ioctl_h.m4 Fri Apr 01 16:04:45 2011 -0700 +++ b/m4/sys_ioctl_h.m4 Fri May 06 08:15:59 2011 -0700 @@ -1,4 +1,4 @@ -# sys_ioctl_h.m4 serial 9 +# sys_ioctl_h.m4 serial 10 dnl Copyright (C) 2008-2011 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,13 +44,6 @@ ]], [ioctl]) ]) -dnl Unconditionally enables the replacement of . -AC_DEFUN([gl_REPLACE_SYS_IOCTL_H], -[ - dnl This is a no-op, because is always overridden. - : -]) - AC_DEFUN([gl_SYS_IOCTL_MODULE_INDICATOR], [ dnl Use AC_REQUIRE here, so that the default settings are expanded once only. diff -r 04ce36b456cc -r 6758fa38915e m4/sys_uio_h.m4 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/m4/sys_uio_h.m4 Fri May 06 08:15:59 2011 -0700 @@ -0,0 +1,31 @@ +# sys_uio_h.m4 serial 1 +dnl Copyright (C) 2011 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_HEADER_SYS_UIO], +[ + AC_REQUIRE([gl_SYS_UIO_H_DEFAULTS]) + dnl is always overridden, because of GNULIB_POSIXCHECK. + gl_CHECK_NEXT_HEADERS([sys/uio.h]) + if test $ac_cv_header_sys_uio_h = yes; then + HAVE_SYS_UIO_H=1 + else + HAVE_SYS_UIO_H=0 + fi + AC_SUBST([HAVE_SYS_UIO_H]) +]) + +AC_DEFUN([gl_SYS_UIO_MODULE_INDICATOR], +[ + dnl Use AC_REQUIRE here, so that the default settings are expanded once only. + AC_REQUIRE([gl_SYS_UIO_H_DEFAULTS]) + gl_MODULE_INDICATOR_SET_VARIABLE([$1]) + dnl Define it also as a C macro, for the benefit of the unit tests. + gl_MODULE_INDICATOR_FOR_TESTS([$1]) +]) + +AC_DEFUN([gl_SYS_UIO_H_DEFAULTS], +[ +]) diff -r 04ce36b456cc -r 6758fa38915e m4/sysexits.m4 --- a/m4/sysexits.m4 Fri Apr 01 16:04:45 2011 -0700 +++ b/m4/sysexits.m4 Fri May 06 08:15:59 2011 -0700 @@ -1,4 +1,4 @@ -# sysexits.m4 serial 5 +# sysexits.m4 serial 6 dnl Copyright (C) 2003, 2005, 2007, 2009-2011 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,4 +40,5 @@ fi AC_SUBST([HAVE_SYSEXITS_H]) AC_SUBST([SYSEXITS_H]) + AM_CONDITIONAL([GL_GENERATE_SYSEXITS_H], [test -n "$SYSEXITS_H"]) ]) diff -r 04ce36b456cc -r 6758fa38915e m4/unistd_h.m4 --- a/m4/unistd_h.m4 Fri Apr 01 16:04:45 2011 -0700 +++ b/m4/unistd_h.m4 Fri May 06 08:15:59 2011 -0700 @@ -1,4 +1,4 @@ -# unistd_h.m4 serial 53 +# unistd_h.m4 serial 55 dnl Copyright (C) 2006-2011 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,47 +52,49 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS], [ - GNULIB_CHOWN=0; AC_SUBST([GNULIB_CHOWN]) - GNULIB_CLOSE=0; AC_SUBST([GNULIB_CLOSE]) - GNULIB_DUP2=0; AC_SUBST([GNULIB_DUP2]) - GNULIB_DUP3=0; AC_SUBST([GNULIB_DUP3]) - GNULIB_ENVIRON=0; AC_SUBST([GNULIB_ENVIRON]) - GNULIB_EUIDACCESS=0; AC_SUBST([GNULIB_EUIDACCESS]) - GNULIB_FACCESSAT=0; AC_SUBST([GNULIB_FACCESSAT]) - GNULIB_FCHDIR=0; AC_SUBST([GNULIB_FCHDIR]) - GNULIB_FCHOWNAT=0; AC_SUBST([GNULIB_FCHOWNAT]) - GNULIB_FSYNC=0; AC_SUBST([GNULIB_FSYNC]) - GNULIB_FTRUNCATE=0; AC_SUBST([GNULIB_FTRUNCATE]) - GNULIB_GETCWD=0; AC_SUBST([GNULIB_GETCWD]) - GNULIB_GETDOMAINNAME=0; AC_SUBST([GNULIB_GETDOMAINNAME]) - GNULIB_GETDTABLESIZE=0; AC_SUBST([GNULIB_GETDTABLESIZE]) - GNULIB_GETGROUPS=0; AC_SUBST([GNULIB_GETGROUPS]) - GNULIB_GETHOSTNAME=0; AC_SUBST([GNULIB_GETHOSTNAME]) - GNULIB_GETLOGIN=0; AC_SUBST([GNULIB_GETLOGIN]) - GNULIB_GETLOGIN_R=0; AC_SUBST([GNULIB_GETLOGIN_R]) - GNULIB_GETPAGESIZE=0; AC_SUBST([GNULIB_GETPAGESIZE]) - GNULIB_GETUSERSHELL=0; AC_SUBST([GNULIB_GETUSERSHELL]) - GNULIB_LCHOWN=0; AC_SUBST([GNULIB_LCHOWN]) - GNULIB_LINK=0; AC_SUBST([GNULIB_LINK]) - GNULIB_LINKAT=0; AC_SUBST([GNULIB_LINKAT]) - GNULIB_LSEEK=0; AC_SUBST([GNULIB_LSEEK]) - GNULIB_PIPE=0; AC_SUBST([GNULIB_PIPE]) - GNULIB_PIPE2=0; AC_SUBST([GNULIB_PIPE2]) - GNULIB_PREAD=0; AC_SUBST([GNULIB_PREAD]) - GNULIB_PWRITE=0; AC_SUBST([GNULIB_PWRITE]) - GNULIB_READLINK=0; AC_SUBST([GNULIB_READLINK]) - GNULIB_READLINKAT=0; AC_SUBST([GNULIB_READLINKAT]) - GNULIB_RMDIR=0; AC_SUBST([GNULIB_RMDIR]) - GNULIB_SLEEP=0; AC_SUBST([GNULIB_SLEEP]) - GNULIB_SYMLINK=0; AC_SUBST([GNULIB_SYMLINK]) - GNULIB_SYMLINKAT=0; AC_SUBST([GNULIB_SYMLINKAT]) - GNULIB_TTYNAME_R=0; AC_SUBST([GNULIB_TTYNAME_R]) - GNULIB_UNISTD_H_GETOPT=0; AC_SUBST([GNULIB_UNISTD_H_GETOPT]) - GNULIB_UNISTD_H_SIGPIPE=0; AC_SUBST([GNULIB_UNISTD_H_SIGPIPE]) - GNULIB_UNLINK=0; AC_SUBST([GNULIB_UNLINK]) - GNULIB_UNLINKAT=0; AC_SUBST([GNULIB_UNLINKAT]) - GNULIB_USLEEP=0; AC_SUBST([GNULIB_USLEEP]) - GNULIB_WRITE=0; AC_SUBST([GNULIB_WRITE]) + GNULIB_CHOWN=0; AC_SUBST([GNULIB_CHOWN]) + GNULIB_CLOSE=0; AC_SUBST([GNULIB_CLOSE]) + GNULIB_DUP2=0; AC_SUBST([GNULIB_DUP2]) + GNULIB_DUP3=0; AC_SUBST([GNULIB_DUP3]) + GNULIB_ENVIRON=0; AC_SUBST([GNULIB_ENVIRON]) + GNULIB_EUIDACCESS=0; AC_SUBST([GNULIB_EUIDACCESS]) + GNULIB_FACCESSAT=0; AC_SUBST([GNULIB_FACCESSAT]) + GNULIB_FCHDIR=0; AC_SUBST([GNULIB_FCHDIR]) + GNULIB_FCHOWNAT=0; AC_SUBST([GNULIB_FCHOWNAT]) + GNULIB_FSYNC=0; AC_SUBST([GNULIB_FSYNC]) + GNULIB_FTRUNCATE=0; AC_SUBST([GNULIB_FTRUNCATE]) + GNULIB_GETCWD=0; AC_SUBST([GNULIB_GETCWD]) + GNULIB_GETDOMAINNAME=0; AC_SUBST([GNULIB_GETDOMAINNAME]) + GNULIB_GETDTABLESIZE=0; AC_SUBST([GNULIB_GETDTABLESIZE]) + GNULIB_GETGROUPS=0; AC_SUBST([GNULIB_GETGROUPS]) + GNULIB_GETHOSTNAME=0; AC_SUBST([GNULIB_GETHOSTNAME]) + GNULIB_GETLOGIN=0; AC_SUBST([GNULIB_GETLOGIN]) + GNULIB_GETLOGIN_R=0; AC_SUBST([GNULIB_GETLOGIN_R]) + GNULIB_GETPAGESIZE=0; AC_SUBST([GNULIB_GETPAGESIZE]) + GNULIB_GETUSERSHELL=0; AC_SUBST([GNULIB_GETUSERSHELL]) + GNULIB_LCHOWN=0; AC_SUBST([GNULIB_LCHOWN]) + GNULIB_LINK=0; AC_SUBST([GNULIB_LINK]) + GNULIB_LINKAT=0; AC_SUBST([GNULIB_LINKAT]) + GNULIB_LSEEK=0; AC_SUBST([GNULIB_LSEEK]) + GNULIB_PIPE=0; AC_SUBST([GNULIB_PIPE]) + GNULIB_PIPE2=0; AC_SUBST([GNULIB_PIPE2]) + GNULIB_PREAD=0; AC_SUBST([GNULIB_PREAD]) + GNULIB_PWRITE=0; AC_SUBST([GNULIB_PWRITE]) + GNULIB_READ=0; AC_SUBST([GNULIB_READ]) + GNULIB_READLINK=0; AC_SUBST([GNULIB_READLINK]) + GNULIB_READLINKAT=0; AC_SUBST([GNULIB_READLINKAT]) + GNULIB_RMDIR=0; AC_SUBST([GNULIB_RMDIR]) + GNULIB_SLEEP=0; AC_SUBST([GNULIB_SLEEP]) + GNULIB_SYMLINK=0; AC_SUBST([GNULIB_SYMLINK]) + GNULIB_SYMLINKAT=0; AC_SUBST([GNULIB_SYMLINKAT]) + GNULIB_TTYNAME_R=0; AC_SUBST([GNULIB_TTYNAME_R]) + GNULIB_UNISTD_H_GETOPT=0; AC_SUBST([GNULIB_UNISTD_H_GETOPT]) + GNULIB_UNISTD_H_NONBLOCKING=0; AC_SUBST([GNULIB_UNISTD_H_NONBLOCKING]) + GNULIB_UNISTD_H_SIGPIPE=0; AC_SUBST([GNULIB_UNISTD_H_SIGPIPE]) + GNULIB_UNLINK=0; AC_SUBST([GNULIB_UNLINK]) + GNULIB_UNLINKAT=0; AC_SUBST([GNULIB_UNLINKAT]) + GNULIB_USLEEP=0; AC_SUBST([GNULIB_USLEEP]) + GNULIB_WRITE=0; AC_SUBST([GNULIB_WRITE]) dnl Assume proper GNU behavior unless another module says otherwise. HAVE_CHOWN=1; AC_SUBST([HAVE_CHOWN]) HAVE_DUP2=1; AC_SUBST([HAVE_DUP2]) @@ -147,6 +149,7 @@ REPLACE_LSEEK=0; AC_SUBST([REPLACE_LSEEK]) REPLACE_PREAD=0; AC_SUBST([REPLACE_PREAD]) REPLACE_PWRITE=0; AC_SUBST([REPLACE_PWRITE]) + REPLACE_READ=0; AC_SUBST([REPLACE_READ]) REPLACE_READLINK=0; AC_SUBST([REPLACE_READLINK]) REPLACE_RMDIR=0; AC_SUBST([REPLACE_RMDIR]) REPLACE_SLEEP=0; AC_SUBST([REPLACE_SLEEP]) diff -r 04ce36b456cc -r 6758fa38915e m4/wchar_h.m4 --- a/m4/wchar_h.m4 Fri Apr 01 16:04:45 2011 -0700 +++ b/m4/wchar_h.m4 Fri May 06 08:15:59 2011 -0700 @@ -7,7 +7,7 @@ dnl Written by Eric Blake. -# wchar_h.m4 serial 38 +# wchar_h.m4 serial 39 AC_DEFUN([gl_WCHAR_H], [ @@ -119,13 +119,6 @@ fi ]) -dnl Unconditionally enables the replacement of . -AC_DEFUN([gl_REPLACE_WCHAR_H], -[ - dnl This is a no-op, because is always overridden. - : -]) - AC_DEFUN([gl_WCHAR_MODULE_INDICATOR], [ dnl Use AC_REQUIRE here, so that the default settings are expanded once only. diff -r 04ce36b456cc -r 6758fa38915e m4/wcrtomb.m4 --- a/m4/wcrtomb.m4 Fri Apr 01 16:04:45 2011 -0700 +++ b/m4/wcrtomb.m4 Fri May 06 08:15:59 2011 -0700 @@ -1,4 +1,4 @@ -# wcrtomb.m4 serial 8 +# wcrtomb.m4 serial 9 dnl Copyright (C) 2008-2011 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -89,7 +89,6 @@ fi fi if test $HAVE_WCRTOMB = 0 || test $REPLACE_WCRTOMB = 1; then - gl_REPLACE_WCHAR_H AC_LIBOBJ([wcrtomb]) gl_PREREQ_WCRTOMB fi diff -r 04ce36b456cc -r 6758fa38915e m4/wcsnrtombs.m4 --- a/m4/wcsnrtombs.m4 Fri Apr 01 16:04:45 2011 -0700 +++ b/m4/wcsnrtombs.m4 Fri May 06 08:15:59 2011 -0700 @@ -1,4 +1,4 @@ -# wcsnrtombs.m4 serial 3 +# wcsnrtombs.m4 serial 4 dnl Copyright (C) 2008-2011 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,7 +20,6 @@ fi fi if test $HAVE_WCSNRTOMBS = 0 || test $REPLACE_WCSNRTOMBS = 1; then - gl_REPLACE_WCHAR_H AC_LIBOBJ([wcsnrtombs]) AC_LIBOBJ([wcsrtombs-state]) gl_PREREQ_WCSNRTOMBS diff -r 04ce36b456cc -r 6758fa38915e m4/wcsrtombs.m4 --- a/m4/wcsrtombs.m4 Fri Apr 01 16:04:45 2011 -0700 +++ b/m4/wcsrtombs.m4 Fri May 06 08:15:59 2011 -0700 @@ -1,4 +1,4 @@ -# wcsrtombs.m4 serial 8 +# wcsrtombs.m4 serial 9 dnl Copyright (C) 2008-2011 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,7 +35,6 @@ fi fi if test $HAVE_WCSRTOMBS = 0 || test $REPLACE_WCSRTOMBS = 1; then - gl_REPLACE_WCHAR_H AC_LIBOBJ([wcsrtombs]) AC_LIBOBJ([wcsrtombs-state]) gl_PREREQ_WCSRTOMBS diff -r 04ce36b456cc -r 6758fa38915e m4/wctob.m4 --- a/m4/wctob.m4 Fri Apr 01 16:04:45 2011 -0700 +++ b/m4/wctob.m4 Fri May 06 08:15:59 2011 -0700 @@ -1,4 +1,4 @@ -# wctob.m4 serial 7 +# wctob.m4 serial 8 dnl Copyright (C) 2008-2011 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -11,7 +11,6 @@ AC_CHECK_FUNCS_ONCE([wctob]) if test $ac_cv_func_wctob = no; then HAVE_DECL_WCTOB=0 - gl_REPLACE_WCHAR_H AC_LIBOBJ([wctob]) gl_PREREQ_WCTOB else @@ -103,7 +102,6 @@ *) REPLACE_WCTOB=1 ;; esac if test $REPLACE_WCTOB = 1; then - gl_REPLACE_WCHAR_H AC_LIBOBJ([wctob]) gl_PREREQ_WCTOB else @@ -121,7 +119,6 @@ ]) if test $ac_cv_have_decl_wctob != yes; then HAVE_DECL_WCTOB=0 - gl_REPLACE_WCHAR_H fi fi fi diff -r 04ce36b456cc -r 6758fa38915e m4/wcwidth.m4 --- a/m4/wcwidth.m4 Fri Apr 01 16:04:45 2011 -0700 +++ b/m4/wcwidth.m4 Fri May 06 08:15:59 2011 -0700 @@ -1,4 +1,4 @@ -# wcwidth.m4 serial 18 +# wcwidth.m4 serial 19 dnl Copyright (C) 2006-2011 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,10 +93,6 @@ if test $ac_cv_func_wcwidth != yes || test $REPLACE_WCWIDTH = 1; then AC_LIBOBJ([wcwidth]) fi - if test $ac_cv_func_wcwidth != yes || test $REPLACE_WCWIDTH = 1 \ - || test $HAVE_DECL_WCWIDTH = 0; then - gl_REPLACE_WCHAR_H - fi dnl We don't substitute HAVE_WCWIDTH. We assume that if the system does not dnl have the wcwidth function, then it does not declare it. ]) diff -r 04ce36b456cc -r 6758fa38915e m4/write.m4 --- a/m4/write.m4 Fri Apr 01 16:04:45 2011 -0700 +++ b/m4/write.m4 Fri May 06 08:15:59 2011 -0700 @@ -1,4 +1,4 @@ -# write.m4 serial 1 +# write.m4 serial 2 dnl Copyright (C) 2008-2011 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -14,7 +14,15 @@ gl_SIGNAL_SIGPIPE if test $gl_cv_header_signal_h_SIGPIPE != yes; then REPLACE_WRITE=1 - AC_LIBOBJ([write]) fi ]) + m4_ifdef([gl_NONBLOCKING_IO], [ + gl_NONBLOCKING_IO + if test $gl_cv_have_nonblocking != yes; then + REPLACE_WRITE=1 + fi + ]) + if test $REPLACE_WRITE = 1; then + AC_LIBOBJ([write]) + fi ]) diff -r 04ce36b456cc -r 6758fa38915e modules/accept --- a/modules/accept Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/accept Fri May 06 08:15:59 2011 -0700 @@ -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]) diff -r 04ce36b456cc -r 6758fa38915e modules/acosl --- a/modules/acosl Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/acosl Fri May 06 08:15:59 2011 -0700 @@ -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 @@ -24,7 +24,7 @@ $(ACOSL_LIBM) License: -GPL +LGPL Maintainer: Paolo Bonzini diff -r 04ce36b456cc -r 6758fa38915e modules/alloca-opt --- a/modules/alloca-opt Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/alloca-opt Fri May 06 08:15:59 2011 -0700 @@ -20,12 +20,17 @@ # We need the following in order to create when the system # doesn't have one that works with the given compiler. -alloca.h: alloca.in.h +if GL_GENERATE_ALLOCA_H +alloca.h: alloca.in.h $(top_builddir)/config.status $(AM_V_GEN)rm -f $@-t $@ && \ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ cat $(srcdir)/alloca.in.h; \ } > $@-t && \ mv -f $@-t $@ +else +alloca.h: $(top_builddir)/config.status + rm -f $@ +endif MOSTLYCLEANFILES += alloca.h alloca.h-t Include: diff -r 04ce36b456cc -r 6758fa38915e modules/allocator --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/modules/allocator Fri May 06 08:15:59 2011 -0700 @@ -0,0 +1,22 @@ +Description: +Storage allocators. + +Files: +lib/allocator.h +lib/allocator.c + +Depends-on: + +configure.ac: + +Makefile.am: +lib_SOURCES += allocator.c + +Include: +"allocator.h" + +License: +LGPLv2+ + +Maintainer: +all diff -r 04ce36b456cc -r 6758fa38915e modules/areadlink --- a/modules/areadlink Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/areadlink Fri May 06 08:15:59 2011 -0700 @@ -6,10 +6,7 @@ lib/areadlink.c Depends-on: -readlink -ssize_t -stdint -unistd +careadlinkat configure.ac: diff -r 04ce36b456cc -r 6758fa38915e modules/areadlinkat --- a/modules/areadlinkat Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/areadlinkat Fri May 06 08:15:59 2011 -0700 @@ -7,7 +7,7 @@ Depends-on: areadlink -stdint +careadlinkat readlinkat configure.ac: diff -r 04ce36b456cc -r 6758fa38915e modules/areadlinkat-tests --- a/modules/areadlinkat-tests Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/areadlinkat-tests Fri May 06 08:15:59 2011 -0700 @@ -13,4 +13,3 @@ Makefile.am: TESTS += test-areadlinkat check_PROGRAMS += test-areadlinkat -test_areadlinkat_LDADD = $(LDADD) @LIBINTL@ diff -r 04ce36b456cc -r 6758fa38915e modules/argmatch --- a/modules/argmatch Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/argmatch Fri May 06 08:15:59 2011 -0700 @@ -11,10 +11,10 @@ error quotearg quote -exit exitfail verify stdbool +stdlib memcmp configure.ac: diff -r 04ce36b456cc -r 6758fa38915e modules/argz --- a/modules/argz Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/argz Fri May 06 08:15:59 2011 -0700 @@ -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 @@ -25,12 +25,17 @@ # We need the following in order to create when the system # doesn't have one that works with the given compiler. -argz.h: argz.in.h +if GL_GENERATE_ARGZ_H +argz.h: argz.in.h $(top_builddir)/config.status $(AM_V_GEN)rm -f $@-t $@ && \ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ cat $(srcdir)/argz.in.h; \ } > $@-t && \ mv -f $@-t $@ +else +argz.h: $(top_builddir)/config.status + rm -f $@ +endif MOSTLYCLEANFILES += argz.h argz.h-t Include: diff -r 04ce36b456cc -r 6758fa38915e modules/arpa_inet --- a/modules/arpa_inet Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/arpa_inet Fri May 06 08:15:59 2011 -0700 @@ -23,7 +23,7 @@ # We need the following in order to create when the system # doesn't have one. -arpa/inet.h: arpa_inet.in.h $(CXXDEFS_H) $(WARN_ON_USE_H) $(ARG_NONNULL_H) +arpa/inet.h: arpa_inet.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_USE_H) $(ARG_NONNULL_H) $(AM_V_at)$(MKDIR_P) arpa $(AM_V_GEN)rm -f $@-t $@ && \ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ diff -r 04ce36b456cc -r 6758fa38915e modules/asinl --- a/modules/asinl Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/asinl Fri May 06 08:15:59 2011 -0700 @@ -8,7 +8,7 @@ Depends-on: math extensions -sqrtl +sqrtl [test $HAVE_ASINL = 0] configure.ac: gl_FUNC_ASINL @@ -23,7 +23,7 @@ $(ASINL_LIBM) License: -GPL +LGPL Maintainer: Paolo Bonzini diff -r 04ce36b456cc -r 6758fa38915e modules/assert-h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/modules/assert-h Fri May 06 08:15:59 2011 -0700 @@ -0,0 +1,47 @@ +Description: +An that conforms to C1X. + +Files: +lib/assert.in.h +lib/verify.h +m4/assert_h.m4 + +Depends-on: +include_next + +configure.ac: +gl_ASSERT_H + +Makefile.am: +BUILT_SOURCES += $(ASSERT_H) + +# We need the following in order to create when the system +# doesn't have one that works with the given compiler. +if GL_GENERATE_ASSERT_H +assert.h: assert.in.h verify.h $(top_builddir)/config.status + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ + sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ + -e 's|@''NEXT_ASSERT_H''@|$(NEXT_ASSERT_H)|g' \ + < $(srcdir)/assert.in.h && \ + sed -e 's|_gl_verify|_gl_static_assert|g' \ + -e 's|_GL_VERIFY|_GL_STATIC_ASSERT|g' \ + < $(srcdir)/verify.h; \ + } > $@-t && \ + mv $@-t $@ +else +assert.h: $(top_builddir)/config.status + rm -f $@ +endif +MOSTLYCLEANFILES += assert.h assert.h-t + +Include: + + +License: +LGPLv2+ + +Maintainer: +Paul Eggert diff -r 04ce36b456cc -r 6758fa38915e modules/atanl --- a/modules/atanl Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/atanl Fri May 06 08:15:59 2011 -0700 @@ -8,7 +8,7 @@ Depends-on: math extensions -isnanl +isnanl [test $HAVE_ATANL = 0] configure.ac: gl_FUNC_ATANL @@ -23,7 +23,7 @@ $(ATANL_LIBM) License: -GPL +LGPL Maintainer: Paolo Bonzini diff -r 04ce36b456cc -r 6758fa38915e modules/atoll --- a/modules/atoll Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/atoll Fri May 06 08:15:59 2011 -0700 @@ -7,7 +7,7 @@ m4/longlong.m4 Depends-on: -strtoll +strtoll [test $HAVE_ATOLL = 0] configure.ac: gl_FUNC_ATOLL diff -r 04ce36b456cc -r 6758fa38915e modules/binary-io --- a/modules/binary-io Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/binary-io Fri May 06 08:15:59 2011 -0700 @@ -16,7 +16,7 @@ "binary-io.h" License: -LGPL +LGPLv2+ Maintainer: Bruno Haible diff -r 04ce36b456cc -r 6758fa38915e modules/bind --- a/modules/bind Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/bind Fri May 06 08:15:59 2011 -0700 @@ -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]) diff -r 04ce36b456cc -r 6758fa38915e modules/btowc --- a/modules/btowc Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/btowc Fri May 06 08:15:59 2011 -0700 @@ -8,7 +8,7 @@ Depends-on: wchar -mbtowc +mbtowc [test $HAVE_BTOWC = 0 || test $REPLACE_BTOWC = 1] configure.ac: gl_FUNC_BTOWC diff -r 04ce36b456cc -r 6758fa38915e modules/byteswap --- a/modules/byteswap Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/byteswap Fri May 06 08:15:59 2011 -0700 @@ -18,12 +18,17 @@ # We need the following in order to create when the system # doesn't have one. -byteswap.h: byteswap.in.h +if GL_GENERATE_BYTESWAP_H +byteswap.h: byteswap.in.h $(top_builddir)/config.status $(AM_V_GEN)rm -f $@-t $@ && \ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ cat $(srcdir)/byteswap.in.h; \ } > $@-t && \ mv -f $@-t $@ +else +byteswap.h: $(top_builddir)/config.status + rm -f $@ +endif MOSTLYCLEANFILES += byteswap.h byteswap.h-t Include: diff -r 04ce36b456cc -r 6758fa38915e modules/canonicalize-lgpl --- a/modules/canonicalize-lgpl Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/canonicalize-lgpl Fri May 06 08:15:59 2011 -0700 @@ -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 diff -r 04ce36b456cc -r 6758fa38915e modules/careadlinkat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/modules/careadlinkat Fri May 06 08:15:59 2011 -0700 @@ -0,0 +1,27 @@ +Description: +Read symbolic links into a buffer without size limitation, relative to fd. + +Files: +lib/careadlinkat.c +lib/careadlinkat.h + +Depends-on: +allocator +readlink +ssize_t +unistd + +configure.ac: +AC_CHECK_FUNCS_ONCE([readlinkat]) + +Makefile.am: +lib_SOURCES += careadlinkat.c + +Include: +"careadlinkat.h" + +License: +LGPLv2+ + +Maintainer: +Paul Eggert, Bruno Haible, Jim Meyering diff -r 04ce36b456cc -r 6758fa38915e modules/ceil --- a/modules/ceil Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/ceil Fri May 06 08:15:59 2011 -0700 @@ -7,7 +7,7 @@ Depends-on: math -float +float [test $REPLACE_CEIL = 1] configure.ac: gl_FUNC_CEIL diff -r 04ce36b456cc -r 6758fa38915e modules/ceilf --- a/modules/ceilf Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/ceilf Fri May 06 08:15:59 2011 -0700 @@ -9,7 +9,7 @@ Depends-on: math extensions -float +float [test $HAVE_DECL_CEILF = 0 || test $REPLACE_CEILF = 1] configure.ac: gl_FUNC_CEILF diff -r 04ce36b456cc -r 6758fa38915e modules/ceill --- a/modules/ceill Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/ceill Fri May 06 08:15:59 2011 -0700 @@ -9,7 +9,7 @@ Depends-on: math extensions -float +float [test $HAVE_DECL_CEILL = 0 || test $REPLACE_CEILL = 1] configure.ac: gl_FUNC_CEILL diff -r 04ce36b456cc -r 6758fa38915e modules/chdir-long --- a/modules/chdir-long Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/chdir-long Fri May 06 08:15:59 2011 -0700 @@ -7,14 +7,16 @@ m4/chdir-long.m4 Depends-on: -atexit -fchdir -fcntl-h -openat -memchr -mempcpy -memrchr -stdbool +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 diff -r 04ce36b456cc -r 6758fa38915e modules/chown --- a/modules/chown Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/chown Fri May 06 08:15:59 2011 -0700 @@ -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 diff -r 04ce36b456cc -r 6758fa38915e modules/close --- a/modules/close Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/close Fri May 06 08:15:59 2011 -0700 @@ -7,7 +7,7 @@ Depends-on: unistd -close-hook +fd-hook [test $REPLACE_CLOSE = 1] fclose configure.ac: diff -r 04ce36b456cc -r 6758fa38915e modules/close-hook --- a/modules/close-hook Fri Apr 01 16:04:45 2011 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,23 +0,0 @@ -Description: -Hook for making close() extensible. - -Files: -lib/close-hook.h -lib/close-hook.c - -Depends-on: -unistd - -configure.ac: - -Makefile.am: -lib_SOURCES += close-hook.c - -Include: -"close-hook.h" - -License: -LGPLv2+ - -Maintainer: -Bruno Haible diff -r 04ce36b456cc -r 6758fa38915e modules/connect --- a/modules/connect Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/connect Fri May 06 08:15:59 2011 -0700 @@ -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]) diff -r 04ce36b456cc -r 6758fa38915e modules/copy-file --- a/modules/copy-file Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/copy-file Fri May 06 08:15:59 2011 -0700 @@ -10,11 +10,11 @@ acl binary-io error -exit full-write gettext-h open safe-read +stdlib unistd xalloc diff -r 04ce36b456cc -r 6758fa38915e modules/cosl --- a/modules/cosl Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/cosl Fri May 06 08:15:59 2011 -0700 @@ -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 @@ -29,7 +29,7 @@ $(ACOSL_LIBM) License: -GPL +LGPL Maintainer: Paolo Bonzini diff -r 04ce36b456cc -r 6758fa38915e modules/ctype --- a/modules/ctype Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/ctype Fri May 06 08:15:59 2011 -0700 @@ -20,7 +20,7 @@ # We need the following in order to create when the system # doesn't have one that works with the given compiler. -ctype.h: ctype.in.h $(CXXDEFS_H) $(WARN_ON_USE_H) +ctype.h: ctype.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_USE_H) $(AM_V_GEN)rm -f $@-t $@ && \ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ diff -r 04ce36b456cc -r 6758fa38915e modules/dirent --- a/modules/dirent Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/dirent Fri May 06 08:15:59 2011 -0700 @@ -22,7 +22,7 @@ # We need the following in order to create when the system # doesn't have one that works with the given compiler. -dirent.h: dirent.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) +dirent.h: dirent.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) $(AM_V_GEN)rm -f $@-t $@ && \ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ diff -r 04ce36b456cc -r 6758fa38915e modules/dirent-safer-tests --- a/modules/dirent-safer-tests Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/dirent-safer-tests Fri May 06 08:15:59 2011 -0700 @@ -10,6 +10,3 @@ Makefile.am: TESTS += test-dirent-safer check_PROGRAMS += test-dirent-safer -# Link with libintl when needed. dirent-safer uses fdopendir if it is present, -# and fdopendir indirectly depends on xgetcwd -> xalloc-die -> gettext-h. -test_dirent_safer_LDADD = $(LDADD) $(LIBINTL) diff -r 04ce36b456cc -r 6758fa38915e modules/dirfd --- a/modules/dirfd Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/dirfd Fri May 06 08:15:59 2011 -0700 @@ -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 diff -r 04ce36b456cc -r 6758fa38915e modules/dprintf --- a/modules/dprintf Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/dprintf Fri May 06 08:15:59 2011 -0700 @@ -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 diff -r 04ce36b456cc -r 6758fa38915e modules/dprintf-posix --- a/modules/dprintf-posix Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/dprintf-posix Fri May 06 08:15:59 2011 -0700 @@ -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 diff -r 04ce36b456cc -r 6758fa38915e modules/dup2 --- a/modules/dup2 Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/dup2 Fri May 06 08:15:59 2011 -0700 @@ -7,6 +7,7 @@ Depends-on: unistd +dup2-obsolete configure.ac: gl_FUNC_DUP2 diff -r 04ce36b456cc -r 6758fa38915e modules/dup2-obsolete --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/modules/dup2-obsolete Fri May 06 08:15:59 2011 -0700 @@ -0,0 +1,28 @@ +Description: +dup2() function for old platforms. + +Status: +obsolete + +Notice: +This module is obsolete. + +Files: +m4/dup2-obsolete.m4 + +Depends-on: +dup2 + +configure.ac: +gl_FUNC_DUP2_OBSOLETE + +Makefile.am: + +Include: + + +License: +LGPLv2+ + +Maintainer: +Bruno Haible diff -r 04ce36b456cc -r 6758fa38915e modules/errno --- a/modules/errno Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/errno Fri May 06 08:15:59 2011 -0700 @@ -19,7 +19,8 @@ # We need the following in order to create when the system # doesn't have one that is POSIX compliant. -errno.h: errno.in.h +if GL_GENERATE_ERRNO_H +errno.h: errno.in.h $(top_builddir)/config.status $(AM_V_GEN)rm -f $@-t $@ && \ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ @@ -35,6 +36,10 @@ < $(srcdir)/errno.in.h; \ } > $@-t && \ mv $@-t $@ +else +errno.h: $(top_builddir)/config.status + rm -f $@ +endif MOSTLYCLEANFILES += errno.h errno.h-t Include: diff -r 04ce36b456cc -r 6758fa38915e modules/error --- a/modules/error Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/error Fri May 06 08:15:59 2011 -0700 @@ -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 diff -r 04ce36b456cc -r 6758fa38915e modules/euidaccess --- a/modules/euidaccess Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/euidaccess Fri May 06 08:15:59 2011 -0700 @@ -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 diff -r 04ce36b456cc -r 6758fa38915e modules/execute --- a/modules/execute Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/execute Fri May 06 08:15:59 2011 -0700 @@ -11,7 +11,6 @@ cloexec dup2 error -exit fatal-signal wait-process gettext-h @@ -25,6 +24,7 @@ posix_spawnattr_setflags posix_spawnattr_destroy stdbool +stdlib strpbrk unistd environ diff -r 04ce36b456cc -r 6758fa38915e modules/exit --- a/modules/exit Fri Apr 01 16:04:45 2011 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,26 +0,0 @@ -Description: -exit() function: program termination. - -Status: -obsolete - -Notice: -This module is obsolete. It will be removed on 2011-01-01. Use 'stdlib'. - -Files: - -Depends-on: -stdlib - -configure.ac: - -Makefile.am: - -Include: - - -License: -LGPLv2+ - -Maintainer: -Bruno Haible diff -r 04ce36b456cc -r 6758fa38915e modules/exitfail --- a/modules/exitfail Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/exitfail Fri May 06 08:15:59 2011 -0700 @@ -6,7 +6,7 @@ lib/exitfail.c Depends-on: -exit +stdlib configure.ac: diff -r 04ce36b456cc -r 6758fa38915e modules/expl --- a/modules/expl Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/expl Fri May 06 08:15:59 2011 -0700 @@ -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 @@ -24,7 +24,7 @@ $(EXPL_LIBM) License: -GPL +LGPL Maintainer: Paolo Bonzini diff -r 04ce36b456cc -r 6758fa38915e modules/faccessat --- a/modules/faccessat Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/faccessat Fri May 06 08:15:59 2011 -0700 @@ -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 diff -r 04ce36b456cc -r 6758fa38915e modules/fchdir --- a/modules/fchdir Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/fchdir Fri May 06 08:15:59 2011 -0700 @@ -6,21 +6,23 @@ m4/fchdir.m4 Depends-on: -close -dirent -dirfd -dup2 -fcntl -fcntl-h -include_next -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 diff -r 04ce36b456cc -r 6758fa38915e modules/fchdir-tests --- a/modules/fchdir-tests Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/fchdir-tests Fri May 06 08:15:59 2011 -0700 @@ -4,7 +4,8 @@ tests/macros.h Depends-on: -getcwd +cloexec +getcwd-lgpl configure.ac: diff -r 04ce36b456cc -r 6758fa38915e modules/fclose --- a/modules/fclose Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/fclose Fri May 06 08:15:59 2011 -0700 @@ -7,7 +7,9 @@ Depends-on: stdio -close +close [test $REPLACE_FCLOSE = 1] +freading [test $REPLACE_FCLOSE = 1] +lseek [test $REPLACE_FCLOSE = 1] configure.ac: gl_FUNC_FCLOSE diff -r 04ce36b456cc -r 6758fa38915e modules/fclose-tests --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/modules/fclose-tests Fri May 06 08:15:59 2011 -0700 @@ -0,0 +1,10 @@ +Files: +tests/test-fclose.c + +Depends-on: + +configure.ac: + +Makefile.am: +TESTS += test-fclose +check_PROGRAMS += test-fclose diff -r 04ce36b456cc -r 6758fa38915e modules/fcntl --- a/modules/fcntl Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/fcntl Fri May 06 08:15:59 2011 -0700 @@ -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 diff -r 04ce36b456cc -r 6758fa38915e modules/fcntl-h --- a/modules/fcntl-h Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/fcntl-h Fri May 06 08:15:59 2011 -0700 @@ -24,7 +24,7 @@ # We need the following in order to create when the system # doesn't have one that works with the given compiler. -fcntl.h: fcntl.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) +fcntl.h: fcntl.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) $(AM_V_GEN)rm -f $@-t $@ && \ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ @@ -32,6 +32,7 @@ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ -e 's|@''NEXT_FCNTL_H''@|$(NEXT_FCNTL_H)|g' \ -e 's|@''GNULIB_FCNTL''@|$(GNULIB_FCNTL)|g' \ + -e 's|@''GNULIB_NONBLOCKING''@|$(GNULIB_NONBLOCKING)|g' \ -e 's|@''GNULIB_OPEN''@|$(GNULIB_OPEN)|g' \ -e 's|@''GNULIB_OPENAT''@|$(GNULIB_OPENAT)|g' \ -e 's|@''HAVE_FCNTL''@|$(HAVE_FCNTL)|g' \ diff -r 04ce36b456cc -r 6758fa38915e modules/fd-hook --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/modules/fd-hook Fri May 06 08:15:59 2011 -0700 @@ -0,0 +1,23 @@ +Description: +Hook for making file descriptor functions (close(), ioctl()) extensible. + +Files: +lib/fd-hook.h +lib/fd-hook.c + +Depends-on: +unistd + +configure.ac: + +Makefile.am: +lib_SOURCES += fd-hook.c + +Include: +"fd-hook.h" + +License: +LGPLv2+ + +Maintainer: +Bruno Haible diff -r 04ce36b456cc -r 6758fa38915e modules/fdopendir --- a/modules/fdopendir Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/fdopendir Fri May 06 08:15:59 2011 -0700 @@ -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 diff -r 04ce36b456cc -r 6758fa38915e modules/fdopendir-tests --- a/modules/fdopendir-tests Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/fdopendir-tests Fri May 06 08:15:59 2011 -0700 @@ -12,4 +12,3 @@ Makefile.am: TESTS += test-fdopendir check_PROGRAMS += test-fdopendir -test_fdopendir_LDADD = $(LDADD) @LIBINTL@ diff -r 04ce36b456cc -r 6758fa38915e modules/fdutimensat-tests --- a/modules/fdutimensat-tests Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/fdutimensat-tests Fri May 06 08:15:59 2011 -0700 @@ -19,4 +19,4 @@ Makefile.am: TESTS += test-fdutimensat check_PROGRAMS += test-fdutimensat -test_fdutimensat_LDADD = $(LDADD) $(LIB_CLOCK_GETTIME) @LIBINTL@ +test_fdutimensat_LDADD = $(LDADD) $(LIB_CLOCK_GETTIME) diff -r 04ce36b456cc -r 6758fa38915e modules/fflush --- a/modules/fflush Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/fflush Fri May 06 08:15:59 2011 -0700 @@ -7,19 +7,20 @@ m4/fflush.m4 Depends-on: -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]) configure.ac: gl_FUNC_FFLUSH +gl_MODULE_INDICATOR([fflush]) gl_STDIO_MODULE_INDICATOR([fflush]) Makefile.am: @@ -28,7 +29,7 @@ License: -GPL +LGPL Maintainer: Eric Blake diff -r 04ce36b456cc -r 6758fa38915e modules/filenamecat-lgpl --- a/modules/filenamecat-lgpl Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/filenamecat-lgpl Fri May 06 08:15:59 2011 -0700 @@ -18,7 +18,7 @@ "filenamecat.h" License: -GPL +LGPLv2+ Maintainer: Jim Meyering diff -r 04ce36b456cc -r 6758fa38915e modules/float --- a/modules/float Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/float Fri May 06 08:15:59 2011 -0700 @@ -19,7 +19,8 @@ # We need the following in order to create when the system # doesn't have one that works with the given compiler. -float.h: float.in.h +if GL_GENERATE_FLOAT_H +float.h: float.in.h $(top_builddir)/config.status $(AM_V_GEN)rm -f $@-t $@ && \ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ @@ -29,6 +30,10 @@ < $(srcdir)/float.in.h; \ } > $@-t && \ mv $@-t $@ +else +float.h: $(top_builddir)/config.status + rm -f $@ +endif MOSTLYCLEANFILES += float.h float.h-t Include: diff -r 04ce36b456cc -r 6758fa38915e modules/floor --- a/modules/floor Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/floor Fri May 06 08:15:59 2011 -0700 @@ -7,7 +7,7 @@ Depends-on: math -float +float [test $REPLACE_FLOOR = 1] configure.ac: gl_FUNC_FLOOR diff -r 04ce36b456cc -r 6758fa38915e modules/floorf --- a/modules/floorf Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/floorf Fri May 06 08:15:59 2011 -0700 @@ -9,7 +9,7 @@ Depends-on: math extensions -float +float [test $HAVE_DECL_FLOORF = 0 || test $REPLACE_FLOORF = 1] configure.ac: gl_FUNC_FLOORF diff -r 04ce36b456cc -r 6758fa38915e modules/floorl --- a/modules/floorl Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/floorl Fri May 06 08:15:59 2011 -0700 @@ -9,7 +9,7 @@ Depends-on: math extensions -float +float [test $HAVE_DECL_FLOORL = 0 || test $REPLACE_FLOORL = 1] configure.ac: gl_FUNC_FLOORL diff -r 04ce36b456cc -r 6758fa38915e modules/fnmatch --- a/modules/fnmatch Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/fnmatch Fri May 06 08:15:59 2011 -0700 @@ -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 @@ -31,13 +31,18 @@ # We need the following in order to create when the system # doesn't have one that supports the required API. -fnmatch.h: fnmatch.in.h $(ARG_NONNULL_H) +if GL_GENERATE_FNMATCH_H +fnmatch.h: fnmatch.in.h $(top_builddir)/config.status $(ARG_NONNULL_H) $(AM_V_GEN)rm -f $@-t $@ && \ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ sed -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ < $(srcdir)/fnmatch.in.h; \ } > $@-t && \ mv -f $@-t $@ +else +fnmatch.h: $(top_builddir)/config.status + rm -f $@ +endif MOSTLYCLEANFILES += fnmatch.h fnmatch.h-t Include: diff -r 04ce36b456cc -r 6758fa38915e modules/fopen --- a/modules/fopen Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/fopen Fri May 06 08:15:59 2011 -0700 @@ -7,7 +7,7 @@ Depends-on: stdio -unistd +unistd [test $REPLACE_FOPEN = 1] configure.ac: gl_FUNC_FOPEN diff -r 04ce36b456cc -r 6758fa38915e modules/fprintf-posix --- a/modules/fprintf-posix Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/fprintf-posix Fri May 06 08:15:59 2011 -0700 @@ -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 diff -r 04ce36b456cc -r 6758fa38915e modules/freading --- a/modules/freading Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/freading Fri May 06 08:15:59 2011 -0700 @@ -20,8 +20,7 @@ "freading.h" License: -LGPL +LGPLv2+ Maintainer: Eric Blake - diff -r 04ce36b456cc -r 6758fa38915e modules/frexp --- a/modules/frexp Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/frexp Fri May 06 08:15:59 2011 -0700 @@ -7,7 +7,7 @@ Depends-on: math -isnand-nolibm +isnand-nolibm [test $gl_func_frexp != yes] configure.ac: gl_FUNC_FREXP diff -r 04ce36b456cc -r 6758fa38915e modules/frexp-nolibm --- a/modules/frexp-nolibm Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/frexp-nolibm Fri May 06 08:15:59 2011 -0700 @@ -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 diff -r 04ce36b456cc -r 6758fa38915e modules/frexpl --- a/modules/frexpl Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/frexpl Fri May 06 08:15:59 2011 -0700 @@ -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 diff -r 04ce36b456cc -r 6758fa38915e modules/frexpl-nolibm --- a/modules/frexpl-nolibm Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/frexpl-nolibm Fri May 06 08:15:59 2011 -0700 @@ -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 diff -r 04ce36b456cc -r 6758fa38915e modules/fseek --- a/modules/fseek Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/fseek Fri May 06 08:15:59 2011 -0700 @@ -6,8 +6,8 @@ m4/fseek.m4 Depends-on: -fseeko stdio +fseeko [test $REPLACE_FSEEK = 1] configure.ac: gl_FUNC_FSEEK diff -r 04ce36b456cc -r 6758fa38915e modules/fsusage --- a/modules/fsusage Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/fsusage Fri May 06 08:15:59 2011 -0700 @@ -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 diff -r 04ce36b456cc -r 6758fa38915e modules/ftell --- a/modules/ftell Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/ftell Fri May 06 08:15:59 2011 -0700 @@ -6,9 +6,9 @@ m4/ftell.m4 Depends-on: -ftello stdio errno +ftello [test $REPLACE_FTELL = 1] configure.ac: gl_FUNC_FTELL diff -r 04ce36b456cc -r 6758fa38915e modules/ftello --- a/modules/ftello Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/ftello Fri May 06 08:15:59 2011 -0700 @@ -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]) diff -r 04ce36b456cc -r 6758fa38915e modules/full-read --- a/modules/full-read Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/full-read Fri May 06 08:15:59 2011 -0700 @@ -4,10 +4,10 @@ Files: lib/full-read.h lib/full-read.c +lib/full-write.c Depends-on: safe-read -full-write configure.ac: diff -r 04ce36b456cc -r 6758fa38915e modules/futimens --- a/modules/futimens Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/futimens Fri May 06 08:15:59 2011 -0700 @@ -7,8 +7,8 @@ Depends-on: sys_stat -utimens extensions +utimens [test $HAVE_FUTIMENS = 0 || test $REPLACE_FUTIMENS = 1] configure.ac: gl_FUNC_FUTIMENS @@ -23,7 +23,7 @@ $(LIB_CLOCK_GETTIME) License: -GPL +LGPL Maintainer: Eric Blake diff -r 04ce36b456cc -r 6758fa38915e modules/getcwd --- a/modules/getcwd Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/getcwd Fri May 06 08:15:59 2011 -0700 @@ -8,18 +8,19 @@ 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 +gl_MODULE_INDICATOR([getcwd]) gl_UNISTD_MODULE_INDICATOR([getcwd]) Makefile.am: diff -r 04ce36b456cc -r 6758fa38915e modules/getcwd-lgpl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/modules/getcwd-lgpl Fri May 06 08:15:59 2011 -0700 @@ -0,0 +1,25 @@ +Description: +Ensure getcwd(NULL, 0) returns a buffer allocated by malloc(). + +Files: +lib/getcwd-lgpl.c +m4/getcwd.m4 + +Depends-on: +unistd +strdup [test $REPLACE_GETCWD = 1] + +configure.ac: +gl_FUNC_GETCWD_LGPL +gl_UNISTD_MODULE_INDICATOR([getcwd]) + +Makefile.am: + +Include: + + +License: +LGPLv2+ + +Maintainer: +Eric Blake diff -r 04ce36b456cc -r 6758fa38915e modules/getcwd-lgpl-tests --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/modules/getcwd-lgpl-tests Fri May 06 08:15:59 2011 -0700 @@ -0,0 +1,12 @@ +Files: +tests/test-getcwd-lgpl.c +tests/signature.h +tests/macros.h + +Depends-on: + +configure.ac: + +Makefile.am: +TESTS += test-getcwd-lgpl +check_PROGRAMS += test-getcwd-lgpl diff -r 04ce36b456cc -r 6758fa38915e modules/getcwd-tests --- a/modules/getcwd-tests Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/getcwd-tests Fri May 06 08:15:59 2011 -0700 @@ -1,9 +1,11 @@ Files: tests/test-getcwd.c -tests/signature.h -tests/macros.h Depends-on: +errno +fcntl-h +getcwd-lgpl +sys_stat configure.ac: diff -r 04ce36b456cc -r 6758fa38915e modules/getdelim --- a/modules/getdelim Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/getdelim Fri May 06 08:15:59 2011 -0700 @@ -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 diff -r 04ce36b456cc -r 6758fa38915e modules/getdomainname --- a/modules/getdomainname Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/getdomainname Fri May 06 08:15:59 2011 -0700 @@ -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 diff -r 04ce36b456cc -r 6758fa38915e modules/getgroups --- a/modules/getgroups Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/getgroups Fri May 06 08:15:59 2011 -0700 @@ -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 @@ -20,7 +20,7 @@ License: -GPL +LGPL Maintainer: Jim Meyering, Eric Blake diff -r 04ce36b456cc -r 6758fa38915e modules/gethostname --- a/modules/gethostname Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/gethostname Fri May 06 08:15:59 2011 -0700 @@ -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 diff -r 04ce36b456cc -r 6758fa38915e modules/getline --- a/modules/getline Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/getline Fri May 06 08:15:59 2011 -0700 @@ -6,9 +6,9 @@ m4/getline.m4 Depends-on: +stdio extensions -getdelim -stdio +getdelim [test $REPLACE_GETLINE = 1] configure.ac: gl_FUNC_GETLINE diff -r 04ce36b456cc -r 6758fa38915e modules/getlogin_r --- a/modules/getlogin_r Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/getlogin_r Fri May 06 08:15:59 2011 -0700 @@ -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 diff -r 04ce36b456cc -r 6758fa38915e modules/getopt-posix --- a/modules/getopt-posix Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/getopt-posix Fri May 06 08:15:59 2011 -0700 @@ -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 @@ -26,7 +26,7 @@ # We need the following in order to create when the system # doesn't have one that works with the given compiler. -getopt.h: getopt.in.h $(ARG_NONNULL_H) +getopt.h: getopt.in.h $(top_builddir)/config.status $(ARG_NONNULL_H) $(AM_V_GEN)rm -f $@-t $@ && \ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ sed -e 's|@''HAVE_GETOPT_H''@|$(HAVE_GETOPT_H)|g' \ diff -r 04ce36b456cc -r 6758fa38915e modules/getpeername --- a/modules/getpeername Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/getpeername Fri May 06 08:15:59 2011 -0700 @@ -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]) diff -r 04ce36b456cc -r 6758fa38915e modules/getsockname --- a/modules/getsockname Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/getsockname Fri May 06 08:15:59 2011 -0700 @@ -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]) diff -r 04ce36b456cc -r 6758fa38915e modules/getsockopt --- a/modules/getsockopt Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/getsockopt Fri May 06 08:15:59 2011 -0700 @@ -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]) diff -r 04ce36b456cc -r 6758fa38915e modules/getsubopt --- a/modules/getsubopt Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/getsubopt Fri May 06 08:15:59 2011 -0700 @@ -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 diff -r 04ce36b456cc -r 6758fa38915e modules/gettext --- a/modules/gettext Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/gettext Fri May 06 08:15:59 2011 -0700 @@ -1,6 +1,9 @@ Description: Translate messages to user's native language. +Notice: +You must add an invocation of AM_GNU_GETTEXT([external]) to configure.ac. + Files: m4/codeset.m4 m4/fcntl-o.m4 diff -r 04ce36b456cc -r 6758fa38915e modules/getusershell --- a/modules/getusershell Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/getusershell Fri May 06 08:15:59 2011 -0700 @@ -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 diff -r 04ce36b456cc -r 6758fa38915e modules/git-merge-changelog --- a/modules/git-merge-changelog Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/git-merge-changelog Fri May 06 08:15:59 2011 -0700 @@ -7,6 +7,7 @@ Depends-on: getopt-gnu stdbool +stdlib progname error read-file diff -r 04ce36b456cc -r 6758fa38915e modules/glob --- a/modules/glob Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/glob Fri May 06 08:15:59 2011 -0700 @@ -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 @@ -37,7 +37,8 @@ # We need the following in order to create when the system # doesn't have one that works with the given compiler. -glob.h: glob.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) +if GL_GENERATE_GLOB_H +glob.h: glob.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) $(AM_V_GEN)rm -f $@-t $@ && \ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ sed -e 's|@''HAVE_SYS_CDEFS_H''@|$(HAVE_SYS_CDEFS_H)|g' \ @@ -47,6 +48,10 @@ < $(srcdir)/glob.in.h; \ } > $@-t && \ mv -f $@-t $@ +else +glob.h: $(top_builddir)/config.status + rm -f $@ +endif MOSTLYCLEANFILES += glob.h glob.h-t Include: diff -r 04ce36b456cc -r 6758fa38915e modules/gnumakefile --- a/modules/gnumakefile Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/gnumakefile Fri May 06 08:15:59 2011 -0700 @@ -14,9 +14,9 @@ # builds, so use a shell variable to bypass this. GNUmakefile=GNUmakefile m4_if(m4_version_compare([2.61a.100], - m4_defn([m4_PACKAGE_VERSION])), [1], [], + m4_defn([m4_PACKAGE_VERSION])), [1], [], [AC_CONFIG_LINKS([$GNUmakefile:$GNUmakefile], [], - [GNUmakefile=$GNUmakefile])]) + [GNUmakefile=$GNUmakefile])]) Makefile.am: distclean-local: clean-GNUmakefile diff -r 04ce36b456cc -r 6758fa38915e modules/grantpt --- a/modules/grantpt Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/grantpt Fri May 06 08:15:59 2011 -0700 @@ -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 diff -r 04ce36b456cc -r 6758fa38915e modules/hash --- a/modules/hash Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/hash Fri May 06 08:15:59 2011 -0700 @@ -1,5 +1,5 @@ Description: -Parametrizable hash table. +Parameterizable hash table. Files: lib/hash.c @@ -10,7 +10,7 @@ bitrotate stdbool stdint -xalloc +xalloc-oversized configure.ac: gl_HASH diff -r 04ce36b456cc -r 6758fa38915e modules/hash-tests --- a/modules/hash-tests Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/hash-tests Fri May 06 08:15:59 2011 -0700 @@ -7,11 +7,9 @@ inttostr progname stdbool -xalloc configure.ac: Makefile.am: TESTS += test-hash check_PROGRAMS += test-hash -test_hash_LDADD = $(LDADD) @LIBINTL@ diff -r 04ce36b456cc -r 6758fa38915e modules/iconv-h --- a/modules/iconv-h Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/iconv-h Fri May 06 08:15:59 2011 -0700 @@ -22,7 +22,8 @@ # We need the following in order to create when the system # doesn't have one that works with the given compiler. -iconv.h: iconv.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) +if GL_GENERATE_ICONV_H +iconv.h: iconv.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) $(AM_V_GEN)rm -f $@-t $@ && \ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ @@ -40,6 +41,10 @@ < $(srcdir)/iconv.in.h; \ } > $@-t && \ mv $@-t $@ +else +iconv.h: $(top_builddir)/config.status + rm -f $@ +endif MOSTLYCLEANFILES += iconv.h iconv.h-t Include: diff -r 04ce36b456cc -r 6758fa38915e modules/iconv_open --- a/modules/iconv_open Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/iconv_open Fri May 06 08:15:59 2011 -0700 @@ -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 diff -r 04ce36b456cc -r 6758fa38915e modules/iconv_open-utf --- a/modules/iconv_open-utf Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/iconv_open-utf Fri May 06 08:15:59 2011 -0700 @@ -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 diff -r 04ce36b456cc -r 6758fa38915e modules/imaxabs --- a/modules/imaxabs Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/imaxabs Fri May 06 08:15:59 2011 -0700 @@ -6,7 +6,7 @@ m4/imaxabs.m4 Depends-on: -inttypes +inttypes-incomplete configure.ac: gl_FUNC_IMAXABS diff -r 04ce36b456cc -r 6758fa38915e modules/imaxdiv --- a/modules/imaxdiv Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/imaxdiv Fri May 06 08:15:59 2011 -0700 @@ -6,7 +6,7 @@ m4/imaxdiv.m4 Depends-on: -inttypes +inttypes-incomplete configure.ac: gl_FUNC_IMAXDIV diff -r 04ce36b456cc -r 6758fa38915e modules/inet_ntop --- a/modules/inet_ntop Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/inet_ntop Fri May 06 08:15:59 2011 -0700 @@ -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 diff -r 04ce36b456cc -r 6758fa38915e modules/inet_pton --- a/modules/inet_pton Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/inet_pton Fri May 06 08:15:59 2011 -0700 @@ -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 diff -r 04ce36b456cc -r 6758fa38915e modules/inttypes --- a/modules/inttypes Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/inttypes Fri May 06 08:15:59 2011 -0700 @@ -2,16 +2,10 @@ An that nearly conforms to C99. Files: -lib/inttypes.in.h m4/inttypes-pri.m4 -m4/inttypes.m4 Depends-on: -arg-nonnull -include_next -multiarch -stdint -warn-on-use +inttypes-incomplete configure.ac: gl_INTTYPES_H diff -r 04ce36b456cc -r 6758fa38915e modules/inttypes-incomplete --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/modules/inttypes-incomplete Fri May 06 08:15:59 2011 -0700 @@ -0,0 +1,62 @@ +Description: +An that conforms to C99 except for PRI* and SCN* macros. + +Files: +lib/inttypes.in.h +m4/inttypes.m4 + +Depends-on: +arg-nonnull +include_next +multiarch +stdint +warn-on-use + +configure.ac: +gl_INTTYPES_INCOMPLETE + +Makefile.am: +BUILT_SOURCES += inttypes.h + +# We need the following in order to create when the system +# doesn't have one that works with the given compiler. +inttypes.h: inttypes.in.h $(top_builddir)/config.status $(WARN_ON_USE_H) $(ARG_NONNULL_H) + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + sed -e 's/@''HAVE_INTTYPES_H''@/$(HAVE_INTTYPES_H)/g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ + -e 's|@''NEXT_INTTYPES_H''@|$(NEXT_INTTYPES_H)|g' \ + -e 's/@''PRI_MACROS_BROKEN''@/$(PRI_MACROS_BROKEN)/g' \ + -e 's/@''APPLE_UNIVERSAL_BUILD''@/$(APPLE_UNIVERSAL_BUILD)/g' \ + -e 's/@''HAVE_LONG_LONG_INT''@/$(HAVE_LONG_LONG_INT)/g' \ + -e 's/@''HAVE_UNSIGNED_LONG_LONG_INT''@/$(HAVE_UNSIGNED_LONG_LONG_INT)/g' \ + -e 's/@''PRIPTR_PREFIX''@/$(PRIPTR_PREFIX)/g' \ + -e 's/@''GNULIB_IMAXABS''@/$(GNULIB_IMAXABS)/g' \ + -e 's/@''GNULIB_IMAXDIV''@/$(GNULIB_IMAXDIV)/g' \ + -e 's/@''GNULIB_STRTOIMAX''@/$(GNULIB_STRTOIMAX)/g' \ + -e 's/@''GNULIB_STRTOUMAX''@/$(GNULIB_STRTOUMAX)/g' \ + -e 's/@''HAVE_DECL_IMAXABS''@/$(HAVE_DECL_IMAXABS)/g' \ + -e 's/@''HAVE_DECL_IMAXDIV''@/$(HAVE_DECL_IMAXDIV)/g' \ + -e 's/@''HAVE_DECL_STRTOIMAX''@/$(HAVE_DECL_STRTOIMAX)/g' \ + -e 's/@''HAVE_DECL_STRTOUMAX''@/$(HAVE_DECL_STRTOUMAX)/g' \ + -e 's/@''INT32_MAX_LT_INTMAX_MAX''@/$(INT32_MAX_LT_INTMAX_MAX)/g' \ + -e 's/@''INT64_MAX_EQ_LONG_MAX''@/$(INT64_MAX_EQ_LONG_MAX)/g' \ + -e 's/@''UINT32_MAX_LT_UINTMAX_MAX''@/$(UINT32_MAX_LT_UINTMAX_MAX)/g' \ + -e 's/@''UINT64_MAX_EQ_ULONG_MAX''@/$(UINT64_MAX_EQ_ULONG_MAX)/g' \ + -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ + -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \ + < $(srcdir)/inttypes.in.h; \ + } > $@-t && \ + mv $@-t $@ +MOSTLYCLEANFILES += inttypes.h inttypes.h-t + +Include: + + +License: +LGPLv2+ + +Maintainer: +all diff -r 04ce36b456cc -r 6758fa38915e modules/ioctl --- a/modules/ioctl Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/ioctl Fri May 06 08:15:59 2011 -0700 @@ -8,8 +8,9 @@ Depends-on: sys_ioctl -sys_socket -errno +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 diff -r 04ce36b456cc -r 6758fa38915e modules/isapipe --- a/modules/isapipe Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/isapipe Fri May 06 08:15:59 2011 -0700 @@ -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 diff -r 04ce36b456cc -r 6758fa38915e modules/isfinite --- a/modules/isfinite Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/isfinite Fri May 06 08:15:59 2011 -0700 @@ -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 @@ -23,7 +23,7 @@ License: -GPL +LGPL Maintainer: Ben Pfaff diff -r 04ce36b456cc -r 6758fa38915e modules/isinf --- a/modules/isinf Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/isinf Fri May 06 08:15:59 2011 -0700 @@ -7,9 +7,9 @@ m4/check-math-lib.m4 Depends-on: -float math extensions +float [test $REPLACE_ISINF = 1] configure.ac: gl_ISINF diff -r 04ce36b456cc -r 6758fa38915e modules/langinfo --- a/modules/langinfo Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/langinfo Fri May 06 08:15:59 2011 -0700 @@ -21,7 +21,7 @@ # We need the following in order to create an empty placeholder for # when the system doesn't have one. -langinfo.h: langinfo.in.h $(CXXDEFS_H) $(WARN_ON_USE_H) +langinfo.h: langinfo.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_USE_H) $(AM_V_GEN)rm -f $@-t $@ && \ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ sed -e 's|@''HAVE_LANGINFO_H''@|$(HAVE_LANGINFO_H)|g' \ diff -r 04ce36b456cc -r 6758fa38915e modules/lchown --- a/modules/lchown Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/lchown Fri May 06 08:15:59 2011 -0700 @@ -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 diff -r 04ce36b456cc -r 6758fa38915e modules/ldexpl --- a/modules/ldexpl Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/ldexpl Fri May 06 08:15:59 2011 -0700 @@ -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 diff -r 04ce36b456cc -r 6758fa38915e modules/link --- a/modules/link Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/link Fri May 06 08:15:59 2011 -0700 @@ -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 diff -r 04ce36b456cc -r 6758fa38915e modules/linkat --- a/modules/linkat Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/linkat Fri May 06 08:15:59 2011 -0700 @@ -7,23 +7,24 @@ m4/linkat.m4 Depends-on: -areadlink -areadlinkat -dirname-lgpl -errno +unistd extensions -fcntl-h -filenamecat-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 diff -r 04ce36b456cc -r 6758fa38915e modules/linkat-tests --- a/modules/linkat-tests Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/linkat-tests Fri May 06 08:15:59 2011 -0700 @@ -7,14 +7,13 @@ Depends-on: ignore-value areadlink-with-size -filenamecat +filenamecat-lgpl +getcwd-lgpl progname same-inode -xgetcwd configure.ac: Makefile.am: TESTS += test-linkat check_PROGRAMS += test-linkat -test_linkat_LDADD = $(LDADD) @LIBINTL@ diff -r 04ce36b456cc -r 6758fa38915e modules/listen --- a/modules/listen Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/listen Fri May 06 08:15:59 2011 -0700 @@ -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]) diff -r 04ce36b456cc -r 6758fa38915e modules/locale --- a/modules/locale Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/locale Fri May 06 08:15:59 2011 -0700 @@ -23,7 +23,7 @@ # We need the following in order to create when the system # doesn't have one that provides all definitions. -locale.h: locale.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) +locale.h: locale.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) $(AM_V_GEN)rm -f $@-t $@ && \ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ diff -r 04ce36b456cc -r 6758fa38915e modules/logl --- a/modules/logl Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/logl Fri May 06 08:15:59 2011 -0700 @@ -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 @@ -25,7 +25,7 @@ $(LOGL_LIBM) License: -GPL +LGPL Maintainer: Paolo Bonzini diff -r 04ce36b456cc -r 6758fa38915e modules/long-options --- a/modules/long-options Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/long-options Fri May 06 08:15:59 2011 -0700 @@ -8,6 +8,7 @@ Depends-on: getopt-gnu +stdlib version-etc configure.ac: diff -r 04ce36b456cc -r 6758fa38915e modules/lstat --- a/modules/lstat Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/lstat Fri May 06 08:15:59 2011 -0700 @@ -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 diff -r 04ce36b456cc -r 6758fa38915e modules/math --- a/modules/math Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/math Fri May 06 08:15:59 2011 -0700 @@ -21,7 +21,7 @@ # We need the following in order to create when the system # doesn't have one that works with the given compiler. -math.h: math.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) +math.h: math.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) $(AM_V_GEN)rm -f $@-t $@ && \ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ sed -e 's|@''INCLUDE_NEXT_AS_FIRST_DIRECTIVE''@|$(INCLUDE_NEXT_AS_FIRST_DIRECTIVE)|g' \ diff -r 04ce36b456cc -r 6758fa38915e modules/mbrlen --- a/modules/mbrlen Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/mbrlen Fri May 06 08:15:59 2011 -0700 @@ -8,8 +8,8 @@ Depends-on: wchar -mbrtowc extensions +mbrtowc [test $HAVE_MBRLEN = 0 || test $REPLACE_MBRLEN = 1] configure.ac: gl_FUNC_MBRLEN diff -r 04ce36b456cc -r 6758fa38915e modules/mbrtowc --- a/modules/mbrtowc Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/mbrtowc Fri May 06 08:15:59 2011 -0700 @@ -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 diff -r 04ce36b456cc -r 6758fa38915e modules/mbsinit --- a/modules/mbsinit Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/mbsinit Fri May 06 08:15:59 2011 -0700 @@ -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 diff -r 04ce36b456cc -r 6758fa38915e modules/mbsnrtowcs --- a/modules/mbsnrtowcs Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/mbsnrtowcs Fri May 06 08:15:59 2011 -0700 @@ -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 diff -r 04ce36b456cc -r 6758fa38915e modules/mbsrtowcs --- a/modules/mbsrtowcs Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/mbsrtowcs Fri May 06 08:15:59 2011 -0700 @@ -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 diff -r 04ce36b456cc -r 6758fa38915e modules/mbtowc --- a/modules/mbtowc Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/mbtowc Fri May 06 08:15:59 2011 -0700 @@ -8,8 +8,8 @@ Depends-on: stdlib -mbrtowc -wchar +mbrtowc [test $REPLACE_MBTOWC = 1] +wchar [test $REPLACE_MBTOWC = 1] configure.ac: gl_FUNC_MBTOWC diff -r 04ce36b456cc -r 6758fa38915e modules/memchr --- a/modules/memchr Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/memchr Fri May 06 08:15:59 2011 -0700 @@ -10,6 +10,7 @@ Depends-on: extensions string +memchr-obsolete configure.ac: gl_FUNC_MEMCHR diff -r 04ce36b456cc -r 6758fa38915e modules/memchr-obsolete --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/modules/memchr-obsolete Fri May 06 08:15:59 2011 -0700 @@ -0,0 +1,28 @@ +Description: +memchr() function for old platforms. + +Status: +obsolete + +Notice: +This module is obsolete. + +Files: +m4/memchr-obsolete.m4 + +Depends-on: +memchr + +configure.ac: +gl_FUNC_MEMCHR_OBSOLETE + +Makefile.am: + +Include: + + +License: +LGPLv2+ + +Maintainer: +Bruno Haible diff -r 04ce36b456cc -r 6758fa38915e modules/memcmp --- a/modules/memcmp Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/memcmp Fri May 06 08:15:59 2011 -0700 @@ -12,7 +12,7 @@ m4/memcmp.m4 Depends-on: -stdint +stdint [test $ac_cv_func_memcmp_working = no] configure.ac: gl_FUNC_MEMCMP diff -r 04ce36b456cc -r 6758fa38915e modules/mgetgroups --- a/modules/mgetgroups Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/mgetgroups Fri May 06 08:15:59 2011 -0700 @@ -10,7 +10,7 @@ getgroups getugroups realloc-gnu -xalloc +xalloc-oversized configure.ac: gl_MGETGROUPS diff -r 04ce36b456cc -r 6758fa38915e modules/mkdir --- a/modules/mkdir Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/mkdir Fri May 06 08:15:59 2011 -0700 @@ -6,8 +6,8 @@ m4/mkdir.m4 Depends-on: -dirname-lgpl sys_stat +dirname-lgpl [test $REPLACE_MKDIR = 1] configure.ac: gl_FUNC_MKDIR diff -r 04ce36b456cc -r 6758fa38915e modules/mkdtemp --- a/modules/mkdtemp Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/mkdtemp Fri May 06 08:15:59 2011 -0700 @@ -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 diff -r 04ce36b456cc -r 6758fa38915e modules/mkfifo --- a/modules/mkfifo Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/mkfifo Fri May 06 08:15:59 2011 -0700 @@ -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 diff -r 04ce36b456cc -r 6758fa38915e modules/mkfifoat --- a/modules/mkfifoat Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/mkfifoat Fri May 06 08:15:59 2011 -0700 @@ -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 diff -r 04ce36b456cc -r 6758fa38915e modules/mkfifoat-tests --- a/modules/mkfifoat-tests Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/mkfifoat-tests Fri May 06 08:15:59 2011 -0700 @@ -13,4 +13,3 @@ Makefile.am: TESTS += test-mkfifoat check_PROGRAMS += test-mkfifoat -test_mkfifoat_LDADD = $(LDADD) @LIBINTL@ diff -r 04ce36b456cc -r 6758fa38915e modules/mknod --- a/modules/mknod Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/mknod Fri May 06 08:15:59 2011 -0700 @@ -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 diff -r 04ce36b456cc -r 6758fa38915e modules/mkostemp --- a/modules/mkostemp Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/mkostemp Fri May 06 08:15:59 2011 -0700 @@ -7,9 +7,9 @@ m4/mkostemp.m4 Depends-on: +stdlib extensions -stdlib -tempname +tempname [test $HAVE_MKOSTEMP = 0] configure.ac: gl_FUNC_MKOSTEMP diff -r 04ce36b456cc -r 6758fa38915e modules/mkostemps --- a/modules/mkostemps Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/mkostemps Fri May 06 08:15:59 2011 -0700 @@ -7,9 +7,9 @@ m4/mkostemps.m4 Depends-on: +stdlib extensions -stdlib -tempname +tempname [test $HAVE_MKOSTEMPS = 0] configure.ac: gl_FUNC_MKOSTEMPS diff -r 04ce36b456cc -r 6758fa38915e modules/mkstemp --- a/modules/mkstemp Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/mkstemp Fri May 06 08:15:59 2011 -0700 @@ -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 diff -r 04ce36b456cc -r 6758fa38915e modules/mkstemps --- a/modules/mkstemps Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/mkstemps Fri May 06 08:15:59 2011 -0700 @@ -6,9 +6,9 @@ m4/mkstemps.m4 Depends-on: +stdlib extensions -stdlib -tempname +tempname [test $HAVE_MKSTEMPS = 0] configure.ac: gl_FUNC_MKSTEMPS diff -r 04ce36b456cc -r 6758fa38915e modules/mktime --- a/modules/mktime Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/mktime Fri May 06 08:15:59 2011 -0700 @@ -8,7 +8,7 @@ Depends-on: multiarch -time_r +time_r [test $REPLACE_MKTIME = 1] configure.ac: gl_FUNC_MKTIME diff -r 04ce36b456cc -r 6758fa38915e modules/nanosleep --- a/modules/nanosleep Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/nanosleep Fri May 06 08:15:59 2011 -0700 @@ -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 @@ -30,7 +30,7 @@ $(LIB_NANOSLEEP) License: -GPL +LGPL Maintainer: Jim Meyering diff -r 04ce36b456cc -r 6758fa38915e modules/netdb --- a/modules/netdb Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/netdb Fri May 06 08:15:59 2011 -0700 @@ -6,6 +6,7 @@ m4/netdb_h.m4 Depends-on: +c++defs include_next arg-nonnull warn-on-use @@ -21,7 +22,7 @@ # We need the following in order to create when the system # doesn't have one that works with the given compiler. -netdb.h: netdb.in.h $(ARG_NONNULL_H) $(WARN_ON_USE_H) +netdb.h: netdb.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) $(AM_V_GEN)rm -f $@-t $@ && \ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ @@ -35,6 +36,8 @@ -e 's|@''HAVE_DECL_GAI_STRERROR''@|$(HAVE_DECL_GAI_STRERROR)|g' \ -e 's|@''HAVE_DECL_GETADDRINFO''@|$(HAVE_DECL_GETADDRINFO)|g' \ -e 's|@''HAVE_DECL_GETNAMEINFO''@|$(HAVE_DECL_GETNAMEINFO)|g' \ + -e 's|@''REPLACE_GAI_STRERROR''@|$(REPLACE_GAI_STRERROR)|g' \ + -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \ < $(srcdir)/netdb.in.h; \ diff -r 04ce36b456cc -r 6758fa38915e modules/netdb-c++-tests --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/modules/netdb-c++-tests Fri May 06 08:15:59 2011 -0700 @@ -0,0 +1,19 @@ +Files: +tests/test-netdb-c++.cc +tests/signature.h + +Status: +c++-test + +Depends-on: +ansi-c++-opt + +configure.ac: + +Makefile.am: +if ANSICXX +TESTS += test-netdb-c++ +check_PROGRAMS += test-netdb-c++ +test_netdb_c___SOURCES = test-netdb-c++.cc +test_netdb_c___LDADD = $(LDADD) $(GETADDRINFO_LIB) +endif diff -r 04ce36b456cc -r 6758fa38915e modules/netdb-tests --- a/modules/netdb-tests Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/netdb-tests Fri May 06 08:15:59 2011 -0700 @@ -2,6 +2,7 @@ tests/test-netdb.c Depends-on: +netdb-c++-tests configure.ac: diff -r 04ce36b456cc -r 6758fa38915e modules/netinet_in --- a/modules/netinet_in Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/netinet_in Fri May 06 08:15:59 2011 -0700 @@ -21,7 +21,8 @@ # We need the following in order to create when the system # doesn't have one. -netinet/in.h: netinet_in.in.h +if GL_GENERATE_NETINET_IN_H +netinet/in.h: netinet_in.in.h $(top_builddir)/config.status $(AM_V_at)$(MKDIR_P) netinet $(AM_V_GEN)rm -f $@-t $@ && \ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ @@ -33,6 +34,10 @@ < $(srcdir)/netinet_in.in.h; \ } > $@-t && \ mv $@-t $@ +else +netinet/in.h: $(top_builddir)/config.status + rm -f $@ +endif MOSTLYCLEANFILES += netinet/in.h netinet/in.h-t MOSTLYCLEANDIRS += netinet diff -r 04ce36b456cc -r 6758fa38915e modules/nonblocking --- a/modules/nonblocking Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/nonblocking Fri May 06 08:15:59 2011 -0700 @@ -2,16 +2,33 @@ Read, set or clear the non-blocking file descriptor flag. Files: +lib/nonblocking.h lib/nonblocking.c -lib/nonblocking.h +m4/nonblocking.m4 +lib/stdio-read.c +lib/stdio-write.c +m4/asm-underscore.m4 Depends-on: fcntl-h ioctl stdbool +stdio sys_socket +unistd configure.ac: +gl_NONBLOCKING_IO +gl_FCNTL_MODULE_INDICATOR([nonblocking]) +dnl Define the C macro GNULIB_NONBLOCKING to 1. +gl_MODULE_INDICATOR([nonblocking]) +dnl Define the substituted variable GNULIB_STDIO_H_NONBLOCKING to 1. +AC_REQUIRE([gl_STDIO_H_DEFAULTS]) +AC_REQUIRE([gl_ASM_SYMBOL_PREFIX]) +GNULIB_STDIO_H_NONBLOCKING=1 +dnl Define the substituted variable GNULIB_UNISTD_H_NONBLOCKING to 1. +AC_REQUIRE([gl_UNISTD_H_DEFAULTS]) +GNULIB_UNISTD_H_NONBLOCKING=1 Makefile.am: lib_SOURCES += nonblocking.c diff -r 04ce36b456cc -r 6758fa38915e modules/nonblocking-pipe-tests --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/modules/nonblocking-pipe-tests Fri May 06 08:15:59 2011 -0700 @@ -0,0 +1,34 @@ +Files: +tests/test-nonblocking-pipe.sh +tests/test-nonblocking-pipe-main.c +tests/test-nonblocking-pipe-child.c +tests/test-nonblocking-pipe.h +tests/test-nonblocking-writer.h +tests/test-nonblocking-reader.h +tests/test-nonblocking-misc.h +tests/macros.h + +Depends-on: +stdbool +unistd +nonblocking +wait-process +pipe-posix +dup2 +environ +posix_spawnp +binary-io +gettimeofday +snprintf +vsnprintf +strerror +ssize_t +usleep +read +write + +configure.ac: + +Makefile.am: +TESTS += test-nonblocking-pipe.sh +check_PROGRAMS += test-nonblocking-pipe-main test-nonblocking-pipe-child diff -r 04ce36b456cc -r 6758fa38915e modules/nonblocking-socket-tests --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/modules/nonblocking-socket-tests Fri May 06 08:15:59 2011 -0700 @@ -0,0 +1,46 @@ +Files: +tests/test-nonblocking-socket.sh +tests/test-nonblocking-socket-main.c +tests/test-nonblocking-socket-child.c +tests/test-nonblocking-socket.h +tests/test-nonblocking-writer.h +tests/test-nonblocking-reader.h +tests/test-nonblocking-misc.h +tests/socket-server.h +tests/socket-client.h +tests/macros.h + +Depends-on: +stdbool +unistd +sys_socket +nonblocking +wait-process +environ +posix_spawnp +netinet_in +arpa_inet +socket +setsockopt +bind +getsockname +listen +accept +getsockopt +connect +gettimeofday +snprintf +vsnprintf +strerror +ssize_t +usleep +read +write + +configure.ac: + +Makefile.am: +TESTS += test-nonblocking-socket.sh +check_PROGRAMS += test-nonblocking-socket-main test-nonblocking-socket-child +test_nonblocking_socket_main_LDADD = $(LDADD) $(LIBSOCKET) +test_nonblocking_socket_child_LDADD = $(LDADD) $(LIBSOCKET) diff -r 04ce36b456cc -r 6758fa38915e modules/nonblocking-tests --- a/modules/nonblocking-tests Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/nonblocking-tests Fri May 06 08:15:59 2011 -0700 @@ -5,11 +5,12 @@ Depends-on: close pipe-posix -socket +nonblocking-pipe-tests +nonblocking-socket-tests configure.ac: Makefile.am: TESTS += test-nonblocking check_PROGRAMS += test-nonblocking -test_nonblocking_LDADD = $(LDADD) @LIBSOCKET@ +test_nonblocking_LDADD = $(LDADD) $(LIBSOCKET) diff -r 04ce36b456cc -r 6758fa38915e modules/obstack --- a/modules/obstack Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/obstack Fri May 06 08:15:59 2011 -0700 @@ -7,9 +7,9 @@ Depends-on: gettext-h -exit exitfail stdint +stdlib configure.ac: AC_FUNC_OBSTACK diff -r 04ce36b456cc -r 6758fa38915e modules/open --- a/modules/open Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/open Fri May 06 08:15:59 2011 -0700 @@ -8,7 +8,7 @@ Depends-on: fcntl-h -stat +stat [test $REPLACE_OPEN = 1] configure.ac: gl_FUNC_OPEN diff -r 04ce36b456cc -r 6758fa38915e modules/openat --- a/modules/openat Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/openat Fri May 06 08:15:59 2011 -0700 @@ -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 diff -r 04ce36b456cc -r 6758fa38915e modules/openat-safer-tests --- a/modules/openat-safer-tests Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/openat-safer-tests Fri May 06 08:15:59 2011 -0700 @@ -9,4 +9,3 @@ Makefile.am: TESTS += test-openat-safer check_PROGRAMS += test-openat-safer -test_openat_safer_LDADD = $(LDADD) @LIBINTL@ diff -r 04ce36b456cc -r 6758fa38915e modules/openat-tests --- a/modules/openat-tests Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/openat-tests Fri May 06 08:15:59 2011 -0700 @@ -31,8 +31,3 @@ TESTS += test-fchownat test-fstatat test-mkdirat test-openat test-unlinkat check_PROGRAMS += test-fchownat test-fstatat test-mkdirat test-openat \ test-unlinkat -test_fchownat_LDADD = $(LDADD) @LIBINTL@ -test_fstatat_LDADD = $(LDADD) @LIBINTL@ -test_mkdirat_LDADD = $(LDADD) @LIBINTL@ -test_openat_LDADD = $(LDADD) @LIBINTL@ -test_unlinkat_LDADD = $(LDADD) @LIBINTL@ diff -r 04ce36b456cc -r 6758fa38915e modules/pagealign_alloc --- a/modules/pagealign_alloc Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/pagealign_alloc Fri May 06 08:15:59 2011 -0700 @@ -9,10 +9,10 @@ Depends-on: error -exit extensions getpagesize gettext-h +stdlib xalloc unistd diff -r 04ce36b456cc -r 6758fa38915e modules/passfd --- a/modules/passfd Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/passfd Fri May 06 08:15:59 2011 -0700 @@ -4,17 +4,15 @@ Files: lib/passfd.h lib/passfd.c -m4/afunix.m4 -m4/sockpfaf.m4 +m4/passfd.m4 Depends-on: cloexec sys_socket socketlib -extensions configure.ac: -gl_SOCKET_AFUNIX +gl_PASSFD Makefile.am: lib_SOURCES += passfd.c diff -r 04ce36b456cc -r 6758fa38915e modules/passfd-tests --- a/modules/passfd-tests Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/passfd-tests Fri May 06 08:15:59 2011 -0700 @@ -3,9 +3,11 @@ tests/macros.h Depends-on: +sys_wait configure.ac: AC_CHECK_DECLS_ONCE([alarm]) +AC_CHECK_FUNCS_ONCE([socketpair]) Makefile.am: TESTS += test-passfd diff -r 04ce36b456cc -r 6758fa38915e modules/perror --- a/modules/perror Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/perror Fri May 06 08:15:59 2011 -0700 @@ -7,8 +7,8 @@ Depends-on: stdio -errno -strerror +errno [test $REPLACE_PERROR = 1] +strerror [test $REPLACE_PERROR = 1] configure.ac: gl_FUNC_PERROR diff -r 04ce36b456cc -r 6758fa38915e modules/pipe-filter-gi --- a/modules/pipe-filter-gi Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/pipe-filter-gi Fri May 06 08:15:59 2011 -0700 @@ -10,10 +10,11 @@ spawn-pipe wait-process error -exit +fcntl-h gettext-h stdbool stdint +stdlib sys_select unistd diff -r 04ce36b456cc -r 6758fa38915e modules/pipe-filter-ii --- a/modules/pipe-filter-ii Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/pipe-filter-ii Fri May 06 08:15:59 2011 -0700 @@ -10,10 +10,11 @@ spawn-pipe wait-process error -exit +fcntl-h gettext-h stdbool stdint +stdlib sys_select unistd diff -r 04ce36b456cc -r 6758fa38915e modules/pipe2 --- a/modules/pipe2 Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/pipe2 Fri May 06 08:15:59 2011 -0700 @@ -10,6 +10,7 @@ fcntl-h binary-io extensions +nonblocking configure.ac: gl_FUNC_PIPE2 @@ -22,7 +23,7 @@ License: -LGPL +LGPLv2+ Maintainer: Bruno Haible, Eric Blake diff -r 04ce36b456cc -r 6758fa38915e modules/pipe2-tests --- a/modules/pipe2-tests Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/pipe2-tests Fri May 06 08:15:59 2011 -0700 @@ -11,3 +11,4 @@ Makefile.am: TESTS += test-pipe2 check_PROGRAMS += test-pipe2 +test_pipe2_LDADD = $(LDADD) $(LIBSOCKET) diff -r 04ce36b456cc -r 6758fa38915e modules/poll --- a/modules/poll Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/poll Fri May 06 08:15:59 2011 -0700 @@ -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 diff -r 04ce36b456cc -r 6758fa38915e modules/poll-h --- a/modules/poll-h Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/poll-h Fri May 06 08:15:59 2011 -0700 @@ -21,7 +21,7 @@ # We need the following in order to create when the system # doesn't have one. -poll.h: poll.in.h $(CXXDEFS_H) $(WARN_ON_USE_H) +poll.h: poll.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_USE_H) $(AM_V_GEN)rm -f $@-t $@ && \ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ sed -e 's|@''HAVE_POLL_H''@|$(HAVE_POLL_H)|g' \ diff -r 04ce36b456cc -r 6758fa38915e modules/popen --- a/modules/popen Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/popen Fri May 06 08:15:59 2011 -0700 @@ -6,8 +6,8 @@ m4/popen.m4 Depends-on: -open stdio +open [test $REPLACE_POPEN = 1] configure.ac: gl_FUNC_POPEN diff -r 04ce36b456cc -r 6758fa38915e modules/posix_spawn --- a/modules/posix_spawn Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/posix_spawn Fri May 06 08:15:59 2011 -0700 @@ -7,12 +7,11 @@ Depends-on: spawn -posix_spawn-internal +posix_spawn-internal [test $HAVE_POSIX_SPAWN = 0 || test $REPLACE_POSIX_SPAWN = 1] configure.ac: gl_POSIX_SPAWN if test $HAVE_POSIX_SPAWN = 0 || test $REPLACE_POSIX_SPAWN = 1; then - gl_REPLACE_SPAWN_H AC_LIBOBJ([spawn]) gl_POSIX_SPAWN_INTERNAL fi diff -r 04ce36b456cc -r 6758fa38915e modules/posix_spawn_file_actions_addclose --- a/modules/posix_spawn_file_actions_addclose Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/posix_spawn_file_actions_addclose Fri May 06 08:15:59 2011 -0700 @@ -9,12 +9,11 @@ Depends-on: spawn -getdtablesize +getdtablesize [test $HAVE_POSIX_SPAWN = 0 || test $REPLACE_POSIX_SPAWN = 1] configure.ac: gl_POSIX_SPAWN if test $HAVE_POSIX_SPAWN = 0 || test $REPLACE_POSIX_SPAWN = 1; then - gl_REPLACE_SPAWN_H AC_LIBOBJ([spawn_faction_addclose]) fi gl_SPAWN_MODULE_INDICATOR([posix_spawn_file_actions_addclose]) diff -r 04ce36b456cc -r 6758fa38915e modules/posix_spawn_file_actions_adddup2 --- a/modules/posix_spawn_file_actions_adddup2 Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/posix_spawn_file_actions_adddup2 Fri May 06 08:15:59 2011 -0700 @@ -9,12 +9,11 @@ Depends-on: spawn -getdtablesize +getdtablesize [test $HAVE_POSIX_SPAWN = 0 || test $REPLACE_POSIX_SPAWN = 1] configure.ac: gl_POSIX_SPAWN if test $HAVE_POSIX_SPAWN = 0 || test $REPLACE_POSIX_SPAWN = 1; then - gl_REPLACE_SPAWN_H AC_LIBOBJ([spawn_faction_adddup2]) fi gl_SPAWN_MODULE_INDICATOR([posix_spawn_file_actions_adddup2]) diff -r 04ce36b456cc -r 6758fa38915e modules/posix_spawn_file_actions_addopen --- a/modules/posix_spawn_file_actions_addopen Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/posix_spawn_file_actions_addopen Fri May 06 08:15:59 2011 -0700 @@ -9,12 +9,11 @@ Depends-on: spawn -getdtablesize +getdtablesize [test $HAVE_POSIX_SPAWN = 0 || test $REPLACE_POSIX_SPAWN = 1] configure.ac: gl_POSIX_SPAWN if test $HAVE_POSIX_SPAWN = 0 || test $REPLACE_POSIX_SPAWN = 1; then - gl_REPLACE_SPAWN_H AC_LIBOBJ([spawn_faction_addopen]) fi gl_SPAWN_MODULE_INDICATOR([posix_spawn_file_actions_addopen]) diff -r 04ce36b456cc -r 6758fa38915e modules/posix_spawn_file_actions_destroy --- a/modules/posix_spawn_file_actions_destroy Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/posix_spawn_file_actions_destroy Fri May 06 08:15:59 2011 -0700 @@ -12,7 +12,6 @@ configure.ac: gl_POSIX_SPAWN if test $HAVE_POSIX_SPAWN = 0 || test $REPLACE_POSIX_SPAWN = 1; then - gl_REPLACE_SPAWN_H AC_LIBOBJ([spawn_faction_destroy]) fi gl_SPAWN_MODULE_INDICATOR([posix_spawn_file_actions_destroy]) diff -r 04ce36b456cc -r 6758fa38915e modules/posix_spawn_file_actions_init --- a/modules/posix_spawn_file_actions_init Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/posix_spawn_file_actions_init Fri May 06 08:15:59 2011 -0700 @@ -13,7 +13,6 @@ configure.ac: gl_POSIX_SPAWN if test $HAVE_POSIX_SPAWN = 0 || test $REPLACE_POSIX_SPAWN = 1; then - gl_REPLACE_SPAWN_H AC_LIBOBJ([spawn_faction_init]) fi gl_SPAWN_MODULE_INDICATOR([posix_spawn_file_actions_init]) diff -r 04ce36b456cc -r 6758fa38915e modules/posix_spawnattr_destroy --- a/modules/posix_spawnattr_destroy Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/posix_spawnattr_destroy Fri May 06 08:15:59 2011 -0700 @@ -12,7 +12,6 @@ configure.ac: gl_POSIX_SPAWN if test $HAVE_POSIX_SPAWN = 0 || test $REPLACE_POSIX_SPAWN = 1; then - gl_REPLACE_SPAWN_H AC_LIBOBJ([spawnattr_destroy]) fi gl_SPAWN_MODULE_INDICATOR([posix_spawnattr_destroy]) diff -r 04ce36b456cc -r 6758fa38915e modules/posix_spawnattr_getflags --- a/modules/posix_spawnattr_getflags Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/posix_spawnattr_getflags Fri May 06 08:15:59 2011 -0700 @@ -12,7 +12,6 @@ configure.ac: gl_POSIX_SPAWN if test $HAVE_POSIX_SPAWN = 0 || test $REPLACE_POSIX_SPAWN = 1; then - gl_REPLACE_SPAWN_H AC_LIBOBJ([spawnattr_getflags]) fi gl_SPAWN_MODULE_INDICATOR([posix_spawnattr_getflags]) diff -r 04ce36b456cc -r 6758fa38915e modules/posix_spawnattr_getpgroup --- a/modules/posix_spawnattr_getpgroup Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/posix_spawnattr_getpgroup Fri May 06 08:15:59 2011 -0700 @@ -12,7 +12,6 @@ configure.ac: gl_POSIX_SPAWN if test $HAVE_POSIX_SPAWN = 0 || test $REPLACE_POSIX_SPAWN = 1; then - gl_REPLACE_SPAWN_H AC_LIBOBJ([spawnattr_getpgroup]) fi gl_SPAWN_MODULE_INDICATOR([posix_spawnattr_getpgroup]) diff -r 04ce36b456cc -r 6758fa38915e modules/posix_spawnattr_getschedparam --- a/modules/posix_spawnattr_getschedparam Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/posix_spawnattr_getschedparam Fri May 06 08:15:59 2011 -0700 @@ -14,7 +14,6 @@ if test $HAVE_POSIX_SPAWN = 0 \ || test $REPLACE_POSIX_SPAWN = 1 \ || test $gl_cv_func_spawnattr_setschedparam = no; then - gl_REPLACE_SPAWN_H AC_LIBOBJ([spawnattr_getschedparam]) fi gl_SPAWN_MODULE_INDICATOR([posix_spawnattr_getschedparam]) diff -r 04ce36b456cc -r 6758fa38915e modules/posix_spawnattr_getschedpolicy --- a/modules/posix_spawnattr_getschedpolicy Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/posix_spawnattr_getschedpolicy Fri May 06 08:15:59 2011 -0700 @@ -14,7 +14,6 @@ if test $HAVE_POSIX_SPAWN = 0 \ || test $REPLACE_POSIX_SPAWN = 1 \ || test $gl_cv_func_spawnattr_setschedpolicy = no; then - gl_REPLACE_SPAWN_H AC_LIBOBJ([spawnattr_getschedpolicy]) fi gl_SPAWN_MODULE_INDICATOR([posix_spawnattr_getschedpolicy]) diff -r 04ce36b456cc -r 6758fa38915e modules/posix_spawnattr_getsigdefault --- a/modules/posix_spawnattr_getsigdefault Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/posix_spawnattr_getsigdefault Fri May 06 08:15:59 2011 -0700 @@ -12,7 +12,6 @@ configure.ac: gl_POSIX_SPAWN if test $HAVE_POSIX_SPAWN = 0 || test $REPLACE_POSIX_SPAWN = 1; then - gl_REPLACE_SPAWN_H AC_LIBOBJ([spawnattr_getdefault]) fi gl_SPAWN_MODULE_INDICATOR([posix_spawnattr_getsigdefault]) diff -r 04ce36b456cc -r 6758fa38915e modules/posix_spawnattr_getsigmask --- a/modules/posix_spawnattr_getsigmask Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/posix_spawnattr_getsigmask Fri May 06 08:15:59 2011 -0700 @@ -12,7 +12,6 @@ configure.ac: gl_POSIX_SPAWN if test $HAVE_POSIX_SPAWN = 0 || test $REPLACE_POSIX_SPAWN = 1; then - gl_REPLACE_SPAWN_H AC_LIBOBJ([spawnattr_getsigmask]) fi gl_SPAWN_MODULE_INDICATOR([posix_spawnattr_getsigmask]) diff -r 04ce36b456cc -r 6758fa38915e modules/posix_spawnattr_init --- a/modules/posix_spawnattr_init Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/posix_spawnattr_init Fri May 06 08:15:59 2011 -0700 @@ -12,7 +12,6 @@ configure.ac: gl_POSIX_SPAWN if test $HAVE_POSIX_SPAWN = 0 || test $REPLACE_POSIX_SPAWN = 1; then - gl_REPLACE_SPAWN_H AC_LIBOBJ([spawnattr_init]) fi gl_SPAWN_MODULE_INDICATOR([posix_spawnattr_init]) diff -r 04ce36b456cc -r 6758fa38915e modules/posix_spawnattr_setflags --- a/modules/posix_spawnattr_setflags Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/posix_spawnattr_setflags Fri May 06 08:15:59 2011 -0700 @@ -12,7 +12,6 @@ configure.ac: gl_POSIX_SPAWN if test $HAVE_POSIX_SPAWN = 0 || test $REPLACE_POSIX_SPAWN = 1; then - gl_REPLACE_SPAWN_H AC_LIBOBJ([spawnattr_setflags]) fi gl_SPAWN_MODULE_INDICATOR([posix_spawnattr_setflags]) diff -r 04ce36b456cc -r 6758fa38915e modules/posix_spawnattr_setpgroup --- a/modules/posix_spawnattr_setpgroup Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/posix_spawnattr_setpgroup Fri May 06 08:15:59 2011 -0700 @@ -11,7 +11,6 @@ configure.ac: gl_POSIX_SPAWN if test $HAVE_POSIX_SPAWN = 0 || test $REPLACE_POSIX_SPAWN = 1; then - gl_REPLACE_SPAWN_H AC_LIBOBJ([spawnattr_setpgroup]) fi gl_SPAWN_MODULE_INDICATOR([posix_spawnattr_setpgroup]) diff -r 04ce36b456cc -r 6758fa38915e modules/posix_spawnattr_setschedparam --- a/modules/posix_spawnattr_setschedparam Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/posix_spawnattr_setschedparam Fri May 06 08:15:59 2011 -0700 @@ -14,7 +14,6 @@ if test $HAVE_POSIX_SPAWN = 0 \ || test $REPLACE_POSIX_SPAWN = 1 \ || test $gl_cv_func_spawnattr_setschedparam = no; then - gl_REPLACE_SPAWN_H AC_LIBOBJ([spawnattr_setschedparam]) fi gl_SPAWN_MODULE_INDICATOR([posix_spawnattr_setschedparam]) diff -r 04ce36b456cc -r 6758fa38915e modules/posix_spawnattr_setschedpolicy --- a/modules/posix_spawnattr_setschedpolicy Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/posix_spawnattr_setschedpolicy Fri May 06 08:15:59 2011 -0700 @@ -14,7 +14,6 @@ if test $HAVE_POSIX_SPAWN = 0 \ || test $REPLACE_POSIX_SPAWN = 1 \ || test $gl_cv_func_spawnattr_setschedpolicy = no; then - gl_REPLACE_SPAWN_H AC_LIBOBJ([spawnattr_setschedpolicy]) fi gl_SPAWN_MODULE_INDICATOR([posix_spawnattr_setschedpolicy]) diff -r 04ce36b456cc -r 6758fa38915e modules/posix_spawnattr_setsigdefault --- a/modules/posix_spawnattr_setsigdefault Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/posix_spawnattr_setsigdefault Fri May 06 08:15:59 2011 -0700 @@ -12,7 +12,6 @@ configure.ac: gl_POSIX_SPAWN if test $HAVE_POSIX_SPAWN = 0 || test $REPLACE_POSIX_SPAWN = 1; then - gl_REPLACE_SPAWN_H AC_LIBOBJ([spawnattr_setdefault]) fi gl_SPAWN_MODULE_INDICATOR([posix_spawnattr_setsigdefault]) diff -r 04ce36b456cc -r 6758fa38915e modules/posix_spawnattr_setsigmask --- a/modules/posix_spawnattr_setsigmask Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/posix_spawnattr_setsigmask Fri May 06 08:15:59 2011 -0700 @@ -12,7 +12,6 @@ configure.ac: gl_POSIX_SPAWN if test $HAVE_POSIX_SPAWN = 0 || test $REPLACE_POSIX_SPAWN = 1; then - gl_REPLACE_SPAWN_H AC_LIBOBJ([spawnattr_setsigmask]) fi gl_SPAWN_MODULE_INDICATOR([posix_spawnattr_setsigmask]) diff -r 04ce36b456cc -r 6758fa38915e modules/posix_spawnp --- a/modules/posix_spawnp Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/posix_spawnp Fri May 06 08:15:59 2011 -0700 @@ -7,12 +7,11 @@ Depends-on: spawn -posix_spawn-internal +posix_spawn-internal [test $HAVE_POSIX_SPAWN = 0 || test $REPLACE_POSIX_SPAWN = 1] configure.ac: gl_POSIX_SPAWN if test $HAVE_POSIX_SPAWN = 0 || test $REPLACE_POSIX_SPAWN = 1; then - gl_REPLACE_SPAWN_H AC_LIBOBJ([spawnp]) gl_POSIX_SPAWN_INTERNAL fi diff -r 04ce36b456cc -r 6758fa38915e modules/pread --- a/modules/pread Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/pread Fri May 06 08:15:59 2011 -0700 @@ -6,9 +6,10 @@ m4/pread.m4 Depends-on: +unistd extensions -lseek -unistd +lseek [test $HAVE_PREAD = 0 || test $REPLACE_PREAD = 1] +read [test $HAVE_PREAD = 0 || test $REPLACE_PREAD = 1] configure.ac: gl_FUNC_PREAD diff -r 04ce36b456cc -r 6758fa38915e modules/printf-posix --- a/modules/printf-posix Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/printf-posix Fri May 06 08:15:59 2011 -0700 @@ -15,8 +15,8 @@ Depends-on: stdio -vfprintf-posix printf-safe +vfprintf-posix [test $REPLACE_PRINTF = 1] configure.ac: gl_FUNC_PRINTF_POSIX diff -r 04ce36b456cc -r 6758fa38915e modules/pt_chown --- a/modules/pt_chown Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/pt_chown Fri May 06 08:15:59 2011 -0700 @@ -7,6 +7,7 @@ Depends-on: ptsname +stdlib configure.ac: diff -r 04ce36b456cc -r 6758fa38915e modules/pthread --- a/modules/pthread Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/pthread Fri May 06 08:15:59 2011 -0700 @@ -20,7 +20,8 @@ # We need the following in order to create when the system # doesn't have one that works with the given compiler. -pthread.h: pthread.in.h +if GL_GENERATE_PTHREAD_H +pthread.h: pthread.in.h $(top_builddir)/config.status $(AM_V_GEN)rm -f $@-t $@ && \ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ sed -e 's|@''HAVE_PTHREAD_H''@|$(HAVE_PTHREAD_H)|g' \ @@ -33,6 +34,10 @@ < $(srcdir)/pthread.in.h; \ } > $@-t && \ mv $@-t $@ +else +pthread.h: $(top_builddir)/config.status + rm -f $@ +endif MOSTLYCLEANFILES += pthread.h pthread.h-t Include: diff -r 04ce36b456cc -r 6758fa38915e modules/ptsname --- a/modules/ptsname Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/ptsname Fri May 06 08:15:59 2011 -0700 @@ -8,7 +8,7 @@ Depends-on: stdlib extensions -ttyname_r +ttyname_r [test $HAVE_PTSNAME = 0] configure.ac: gl_FUNC_PTSNAME diff -r 04ce36b456cc -r 6758fa38915e modules/pty --- a/modules/pty Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/pty Fri May 06 08:15:59 2011 -0700 @@ -20,7 +20,7 @@ # We need the following in order to create when the system # doesn't have one that works with the given compiler. -pty.h: pty.in.h $(CXXDEFS_H) $(WARN_ON_USE_H) +pty.h: pty.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_USE_H) $(AM_V_GEN)rm -f $@-t $@ && \ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ sed -e 's|@''HAVE_PTY_H''@|$(HAVE_PTY_H)|g' \ diff -r 04ce36b456cc -r 6758fa38915e modules/putenv --- a/modules/putenv Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/putenv Fri May 06 08:15:59 2011 -0700 @@ -7,7 +7,7 @@ Depends-on: stdlib -malloc-posix +malloc-posix [test $REPLACE_PUTENV = 1] configure.ac: gl_FUNC_PUTENV diff -r 04ce36b456cc -r 6758fa38915e modules/pwrite --- a/modules/pwrite Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/pwrite Fri May 06 08:15:59 2011 -0700 @@ -6,9 +6,10 @@ m4/pwrite.m4 Depends-on: +unistd extensions -lseek -unistd +lseek [test $HAVE_PWRITE = 0 || test $REPLACE_PWRITE = 1] +write [test $HAVE_PWRITE = 0 || test $REPLACE_PWRITE = 1] configure.ac: gl_FUNC_PWRITE diff -r 04ce36b456cc -r 6758fa38915e modules/read --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/modules/read Fri May 06 08:15:59 2011 -0700 @@ -0,0 +1,24 @@ +Description: +POSIX compatible read() function: read data from a file descriptor + +Files: +lib/read.c +m4/read.m4 + +Depends-on: +unistd + +configure.ac: +gl_FUNC_READ +gl_UNISTD_MODULE_INDICATOR([read]) + +Makefile.am: + +Include: + + +License: +LGPLv2+ + +Maintainer: +Bruno Haible diff -r 04ce36b456cc -r 6758fa38915e modules/readline --- a/modules/readline Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/readline Fri May 06 08:15:59 2011 -0700 @@ -7,8 +7,8 @@ m4/readline.m4 Depends-on: -getline havelib +getline [test "$gl_cv_lib_readline" = no] configure.ac: gl_FUNC_READLINE diff -r 04ce36b456cc -r 6758fa38915e modules/readlink --- a/modules/readlink Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/readlink Fri May 06 08:15:59 2011 -0700 @@ -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 diff -r 04ce36b456cc -r 6758fa38915e modules/readlinkat --- a/modules/readlinkat Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/readlinkat Fri May 06 08:15:59 2011 -0700 @@ -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 diff -r 04ce36b456cc -r 6758fa38915e modules/readlinkat-tests --- a/modules/readlinkat-tests Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/readlinkat-tests Fri May 06 08:15:59 2011 -0700 @@ -13,4 +13,3 @@ Makefile.am: TESTS += test-readlinkat check_PROGRAMS += test-readlinkat -test_readlinkat_LDADD = $(LDADD) @LIBINTL@ diff -r 04ce36b456cc -r 6758fa38915e modules/readme-release --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/modules/readme-release Fri May 06 08:15:59 2011 -0700 @@ -0,0 +1,31 @@ +Description: +Add release instructions customized for the package. + +You should add a line like + +perl -pi -e "s/\@PACKAGE\@/$package/g" README-release + +to autogen.sh or bootstrap.conf's epilogue function to patch the +package name in. This is particularly handy for making various URLs +copy-and-pastable. + +Note that, as with any gnulib-tool supplied file, README-release can +be customized via a .diff file. This is an easy way to add +package-specific instructions. + +Files: +top/README-release + +Depends-on: + +configure.ac: + +Makefile.am: + +Include: + +License: +GPLed build tool + +Maintainer: +bug-gnulib@gnu.org diff -r 04ce36b456cc -r 6758fa38915e modules/recv --- a/modules/recv Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/recv Fri May 06 08:15:59 2011 -0700 @@ -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]) diff -r 04ce36b456cc -r 6758fa38915e modules/recvfrom --- a/modules/recvfrom Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/recvfrom Fri May 06 08:15:59 2011 -0700 @@ -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]) diff -r 04ce36b456cc -r 6758fa38915e modules/regex --- a/modules/regex Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/regex Fri May 06 08:15:59 2011 -0700 @@ -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 diff -r 04ce36b456cc -r 6758fa38915e modules/relocatable-prog-wrapper --- a/modules/relocatable-prog-wrapper Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/relocatable-prog-wrapper Fri May 06 08:15:59 2011 -0700 @@ -10,6 +10,10 @@ lib/progreloc.c lib/areadlink.h lib/areadlink.c +lib/careadlinkat.h +lib/careadlinkat.c +lib/allocator.h +lib/allocator.c lib/readlink.c lib/canonicalize-lgpl.c lib/malloca.h diff -r 04ce36b456cc -r 6758fa38915e modules/remove --- a/modules/remove Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/remove Fri May 06 08:15:59 2011 -0700 @@ -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 diff -r 04ce36b456cc -r 6758fa38915e modules/rename --- a/modules/rename Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/rename Fri May 06 08:15:59 2011 -0700 @@ -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 diff -r 04ce36b456cc -r 6758fa38915e modules/renameat --- a/modules/renameat Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/renameat Fri May 06 08:15:59 2011 -0700 @@ -7,14 +7,15 @@ m4/renameat.m4 Depends-on: +stdio extensions fcntl-h -filenamecat-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 diff -r 04ce36b456cc -r 6758fa38915e modules/renameat-tests --- a/modules/renameat-tests Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/renameat-tests Fri May 06 08:15:59 2011 -0700 @@ -7,8 +7,8 @@ Depends-on: ignore-value filenamecat +getcwd-lgpl progname -xgetcwd configure.ac: diff -r 04ce36b456cc -r 6758fa38915e modules/rmdir --- a/modules/rmdir Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/rmdir Fri May 06 08:15:59 2011 -0700 @@ -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 diff -r 04ce36b456cc -r 6758fa38915e modules/round --- a/modules/round Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/round Fri May 06 08:15:59 2011 -0700 @@ -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 diff -r 04ce36b456cc -r 6758fa38915e modules/roundf --- a/modules/roundf Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/roundf Fri May 06 08:15:59 2011 -0700 @@ -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 diff -r 04ce36b456cc -r 6758fa38915e modules/roundl --- a/modules/roundl Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/roundl Fri May 06 08:15:59 2011 -0700 @@ -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 diff -r 04ce36b456cc -r 6758fa38915e modules/rpmatch --- a/modules/rpmatch Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/rpmatch Fri May 06 08:15:59 2011 -0700 @@ -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 diff -r 04ce36b456cc -r 6758fa38915e modules/safe-read --- a/modules/safe-read Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/safe-read Fri May 06 08:15:59 2011 -0700 @@ -7,6 +7,7 @@ m4/safe-read.m4 Depends-on: +read ssize_t configure.ac: diff -r 04ce36b456cc -r 6758fa38915e modules/safe-write --- a/modules/safe-write Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/safe-write Fri May 06 08:15:59 2011 -0700 @@ -4,10 +4,12 @@ Files: lib/safe-write.h lib/safe-write.c +lib/safe-read.c m4/safe-write.m4 +m4/safe-read.m4 Depends-on: -safe-read +ssize_t write configure.ac: diff -r 04ce36b456cc -r 6758fa38915e modules/save-cwd --- a/modules/save-cwd Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/save-cwd Fri May 06 08:15:59 2011 -0700 @@ -9,7 +9,7 @@ Depends-on: chdir-long cloexec -getcwd +getcwd-lgpl fchdir stdbool unistd-safer diff -r 04ce36b456cc -r 6758fa38915e modules/savewd --- a/modules/savewd Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/savewd Fri May 06 08:15:59 2011 -0700 @@ -9,12 +9,12 @@ Depends-on: dosname errno -exit fchdir fcntl-safer fcntl-h raise stdbool +stdlib xalloc configure.ac: diff -r 04ce36b456cc -r 6758fa38915e modules/sched --- a/modules/sched Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/sched Fri May 06 08:15:59 2011 -0700 @@ -19,7 +19,8 @@ # We need the following in order to create a replacement for when # the system doesn't have one. -sched.h: sched.in.h +if GL_GENERATE_SCHED_H +sched.h: sched.in.h $(top_builddir)/config.status $(AM_V_GEN)rm -f $@-t $@ && \ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ sed -e 's|@''HAVE_SCHED_H''@|$(HAVE_SCHED_H)|g' \ @@ -31,6 +32,10 @@ < $(srcdir)/sched.in.h; \ } > $@-t && \ mv $@-t $@ +else +sched.h: $(top_builddir)/config.status + rm -f $@ +endif MOSTLYCLEANFILES += sched.h sched.h-t Include: diff -r 04ce36b456cc -r 6758fa38915e modules/search --- a/modules/search Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/search Fri May 06 08:15:59 2011 -0700 @@ -21,7 +21,7 @@ # We need the following in order to create when the system # doesn't have one that works with the given compiler. -search.h: search.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) +search.h: search.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) $(AM_V_GEN)rm -f $@-t $@ && \ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ sed -e 's|@''HAVE_SEARCH_H''@|$(HAVE_SEARCH_H)|g' \ diff -r 04ce36b456cc -r 6758fa38915e modules/select --- a/modules/select Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/select Fri May 06 08:15:59 2011 -0700 @@ -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 diff -r 04ce36b456cc -r 6758fa38915e modules/selinux-h --- a/modules/selinux-h Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/selinux-h Fri May 06 08:15:59 2011 -0700 @@ -23,7 +23,7 @@ lib_SOURCES += se-context.in.h se-selinux.in.h BUILT_SOURCES += selinux/selinux.h -selinux/selinux.h: se-selinux.in.h $(UNUSED_PARAMETER_H) +selinux/selinux.h: se-selinux.in.h $(top_builddir)/config.status $(UNUSED_PARAMETER_H) $(AM_V_at)$(MKDIR_P) selinux $(AM_V_GEN)rm -f $@-t $@ && \ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ @@ -39,7 +39,8 @@ MOSTLYCLEANFILES += selinux/selinux.h selinux/selinux.h-t BUILT_SOURCES += $(SELINUX_CONTEXT_H) -selinux/context.h: se-context.in.h $(UNUSED_PARAMETER_H) +if GL_GENERATE_SELINUX_CONTEXT_H +selinux/context.h: se-context.in.h $(top_builddir)/config.status $(UNUSED_PARAMETER_H) $(AM_V_at)$(MKDIR_P) selinux $(AM_V_GEN)rm -f $@-t $@ && \ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ @@ -48,6 +49,10 @@ } > $@-t && \ chmod a-x $@-t && \ mv $@-t $@ +else +selinux/context.h: $(top_builddir)/config.status + rm -f $@ +endif MOSTLYCLEANFILES += selinux/context.h selinux/context.h-t MOSTLYCLEANDIRS += selinux diff -r 04ce36b456cc -r 6758fa38915e modules/send --- a/modules/send Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/send Fri May 06 08:15:59 2011 -0700 @@ -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]) diff -r 04ce36b456cc -r 6758fa38915e modules/sendto --- a/modules/sendto Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/sendto Fri May 06 08:15:59 2011 -0700 @@ -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]) diff -r 04ce36b456cc -r 6758fa38915e modules/setenv --- a/modules/setenv Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/setenv Fri May 06 08:15:59 2011 -0700 @@ -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 diff -r 04ce36b456cc -r 6758fa38915e modules/setlocale --- a/modules/setlocale Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/setlocale Fri May 06 08:15:59 2011 -0700 @@ -7,7 +7,7 @@ Depends-on: locale -localename +localename [test $REPLACE_SETLOCALE = 1] configure.ac: gl_FUNC_SETLOCALE diff -r 04ce36b456cc -r 6758fa38915e modules/setsockopt --- a/modules/setsockopt Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/setsockopt Fri May 06 08:15:59 2011 -0700 @@ -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]) diff -r 04ce36b456cc -r 6758fa38915e modules/shutdown --- a/modules/shutdown Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/shutdown Fri May 06 08:15:59 2011 -0700 @@ -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]) diff -r 04ce36b456cc -r 6758fa38915e modules/sigaction --- a/modules/sigaction Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/sigaction Fri May 06 08:15:59 2011 -0700 @@ -8,7 +8,7 @@ Depends-on: signal -sigprocmask +sigprocmask [test $HAVE_SIGACTION = 0] configure.ac: gl_SIGACTION diff -r 04ce36b456cc -r 6758fa38915e modules/signal --- a/modules/signal Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/signal Fri May 06 08:15:59 2011 -0700 @@ -10,6 +10,7 @@ c++defs include_next warn-on-use +extensions configure.ac: gl_SIGNAL_H @@ -21,7 +22,7 @@ # We need the following in order to create when the system # doesn't have a complete one. -signal.h: signal.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) +signal.h: signal.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) $(AM_V_GEN)rm -f $@-t $@ && \ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ @@ -37,6 +38,7 @@ -e 's|@''HAVE_SIGACTION''@|$(HAVE_SIGACTION)|g' \ -e 's|@''HAVE_STRUCT_SIGACTION_SA_SIGACTION''@|$(HAVE_STRUCT_SIGACTION_SA_SIGACTION)|g' \ -e 's|@''HAVE_TYPE_VOLATILE_SIG_ATOMIC_T''@|$(HAVE_TYPE_VOLATILE_SIG_ATOMIC_T)|g' \ + -e 's|@''HAVE_SIGHANDLER_T''@|$(HAVE_SIGHANDLER_T)|g' \ -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \ diff -r 04ce36b456cc -r 6758fa38915e modules/signbit --- a/modules/signbit Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/signbit Fri May 06 08:15:59 2011 -0700 @@ -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 diff -r 04ce36b456cc -r 6758fa38915e modules/sigprocmask --- a/modules/sigprocmask Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/sigprocmask Fri May 06 08:15:59 2011 -0700 @@ -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 diff -r 04ce36b456cc -r 6758fa38915e modules/sinl --- a/modules/sinl Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/sinl Fri May 06 08:15:59 2011 -0700 @@ -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 @@ -29,7 +29,7 @@ $(SINL_LIBM) License: -GPL +LGPL Maintainer: Paolo Bonzini diff -r 04ce36b456cc -r 6758fa38915e modules/sleep --- a/modules/sleep Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/sleep Fri May 06 08:15:59 2011 -0700 @@ -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 diff -r 04ce36b456cc -r 6758fa38915e modules/snprintf --- a/modules/snprintf Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/snprintf Fri May 06 08:15:59 2011 -0700 @@ -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 diff -r 04ce36b456cc -r 6758fa38915e modules/snprintf-posix --- a/modules/snprintf-posix Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/snprintf-posix Fri May 06 08:15:59 2011 -0700 @@ -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 diff -r 04ce36b456cc -r 6758fa38915e modules/socket --- a/modules/socket Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/socket Fri May 06 08:15:59 2011 -0700 @@ -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]) diff -r 04ce36b456cc -r 6758fa38915e modules/sockets --- a/modules/sockets Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/sockets Fri May 06 08:15:59 2011 -0700 @@ -10,7 +10,7 @@ Depends-on: socketlib sys_socket -close-hook +fd-hook configure.ac: gl_SOCKETS diff -r 04ce36b456cc -r 6758fa38915e modules/spawn --- a/modules/spawn Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/spawn Fri May 06 08:15:59 2011 -0700 @@ -22,7 +22,7 @@ # We need the following in order to create a replacement for when # the system doesn't have one. -spawn.h: spawn.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) +spawn.h: spawn.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) $(AM_V_GEN)rm -f $@-t $@ && \ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ sed -e 's|@''HAVE_SPAWN_H''@|$(HAVE_SPAWN_H)|g' \ diff -r 04ce36b456cc -r 6758fa38915e modules/spawn-pipe --- a/modules/spawn-pipe Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/spawn-pipe Fri May 06 08:15:59 2011 -0700 @@ -12,7 +12,6 @@ dup2 environ error -exit fatal-signal gettext-h open @@ -30,6 +29,7 @@ posix_spawnattr_setflags posix_spawnattr_destroy stdbool +stdlib strpbrk unistd unistd-safer diff -r 04ce36b456cc -r 6758fa38915e modules/sprintf-posix --- a/modules/sprintf-posix Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/sprintf-posix Fri May 06 08:15:59 2011 -0700 @@ -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 diff -r 04ce36b456cc -r 6758fa38915e modules/sqrtl --- a/modules/sqrtl Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/sqrtl Fri May 06 08:15:59 2011 -0700 @@ -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 @@ -27,7 +27,7 @@ $(SQRTL_LIBM) License: -GPL +LGPL Maintainer: Paolo Bonzini diff -r 04ce36b456cc -r 6758fa38915e modules/stat --- a/modules/stat Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/stat Fri May 06 08:15:59 2011 -0700 @@ -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 diff -r 04ce36b456cc -r 6758fa38915e modules/stdarg --- a/modules/stdarg Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/stdarg Fri May 06 08:15:59 2011 -0700 @@ -26,7 +26,8 @@ # We need the following in order to create when the system # doesn't have one that works with the given compiler. -stdarg.h: stdarg.in.h +if GL_GENERATE_STDARG_H +stdarg.h: stdarg.in.h $(top_builddir)/config.status $(AM_V_GEN)rm -f $@-t $@ && \ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ @@ -36,6 +37,10 @@ < $(srcdir)/stdarg.in.h; \ } > $@-t && \ mv $@-t $@ +else +stdarg.h: $(top_builddir)/config.status + rm -f $@ +endif MOSTLYCLEANFILES += stdarg.h stdarg.h-t Include: diff -r 04ce36b456cc -r 6758fa38915e modules/stdbool --- a/modules/stdbool Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/stdbool Fri May 06 08:15:59 2011 -0700 @@ -19,12 +19,17 @@ # We need the following in order to create when the system # doesn't have one that works. -stdbool.h: stdbool.in.h +if GL_GENERATE_STDBOOL_H +stdbool.h: stdbool.in.h $(top_builddir)/config.status $(AM_V_GEN)rm -f $@-t $@ && \ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ sed -e 's/@''HAVE__BOOL''@/$(HAVE__BOOL)/g' < $(srcdir)/stdbool.in.h; \ } > $@-t && \ mv $@-t $@ +else +stdbool.h: $(top_builddir)/config.status + rm -f $@ +endif MOSTLYCLEANFILES += stdbool.h stdbool.h-t Include: diff -r 04ce36b456cc -r 6758fa38915e modules/stddef --- a/modules/stddef Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/stddef Fri May 06 08:15:59 2011 -0700 @@ -20,7 +20,8 @@ # We need the following in order to create when the system # doesn't have one that works with the given compiler. -stddef.h: stddef.in.h +if GL_GENERATE_STDDEF_H +stddef.h: stddef.in.h $(top_builddir)/config.status $(AM_V_GEN)rm -f $@-t $@ && \ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ @@ -32,6 +33,10 @@ < $(srcdir)/stddef.in.h; \ } > $@-t && \ mv $@-t $@ +else +stddef.h: $(top_builddir)/config.status + rm -f $@ +endif MOSTLYCLEANFILES += stddef.h stddef.h-t Include: diff -r 04ce36b456cc -r 6758fa38915e modules/stdint --- a/modules/stdint Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/stdint Fri May 06 08:15:59 2011 -0700 @@ -26,7 +26,8 @@ # We need the following in order to create when the system # doesn't have one that works with the given compiler. -stdint.h: stdint.in.h +if GL_GENERATE_STDINT_H +stdint.h: stdint.in.h $(top_builddir)/config.status $(AM_V_GEN)rm -f $@-t $@ && \ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ sed -e 's/@''HAVE_STDINT_H''@/$(HAVE_STDINT_H)/g' \ @@ -58,6 +59,10 @@ < $(srcdir)/stdint.in.h; \ } > $@-t && \ mv $@-t $@ +else +stdint.h: $(top_builddir)/config.status + rm -f $@ +endif MOSTLYCLEANFILES += stdint.h stdint.h-t Include: diff -r 04ce36b456cc -r 6758fa38915e modules/stdint-tests --- a/modules/stdint-tests Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/stdint-tests Fri May 06 08:15:59 2011 -0700 @@ -6,6 +6,7 @@ Depends-on: verify intprops +wchar configure.ac: gt_TYPE_WCHAR_T diff -r 04ce36b456cc -r 6758fa38915e modules/stdio --- a/modules/stdio Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/stdio Fri May 06 08:15:59 2011 -0700 @@ -22,7 +22,7 @@ # We need the following in order to create when the system # doesn't have one that works with the given compiler. -stdio.h: stdio.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) +stdio.h: stdio.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) $(AM_V_GEN)rm -f $@-t $@ && \ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ @@ -32,20 +32,27 @@ -e 's|@''GNULIB_DPRINTF''@|$(GNULIB_DPRINTF)|g' \ -e 's|@''GNULIB_FCLOSE''@|$(GNULIB_FCLOSE)|g' \ -e 's|@''GNULIB_FFLUSH''@|$(GNULIB_FFLUSH)|g' \ + -e 's|@''GNULIB_FGETC''@|$(GNULIB_FGETC)|g' \ + -e 's|@''GNULIB_FGETS''@|$(GNULIB_FGETS)|g' \ -e 's|@''GNULIB_FOPEN''@|$(GNULIB_FOPEN)|g' \ -e 's|@''GNULIB_FPRINTF''@|$(GNULIB_FPRINTF)|g' \ -e 's|@''GNULIB_FPRINTF_POSIX''@|$(GNULIB_FPRINTF_POSIX)|g' \ -e 's|@''GNULIB_FPURGE''@|$(GNULIB_FPURGE)|g' \ -e 's|@''GNULIB_FPUTC''@|$(GNULIB_FPUTC)|g' \ -e 's|@''GNULIB_FPUTS''@|$(GNULIB_FPUTS)|g' \ + -e 's|@''GNULIB_FREAD''@|$(GNULIB_FREAD)|g' \ -e 's|@''GNULIB_FREOPEN''@|$(GNULIB_FREOPEN)|g' \ + -e 's|@''GNULIB_FSCANF''@|$(GNULIB_FSCANF)|g' \ -e 's|@''GNULIB_FSEEK''@|$(GNULIB_FSEEK)|g' \ -e 's|@''GNULIB_FSEEKO''@|$(GNULIB_FSEEKO)|g' \ -e 's|@''GNULIB_FTELL''@|$(GNULIB_FTELL)|g' \ -e 's|@''GNULIB_FTELLO''@|$(GNULIB_FTELLO)|g' \ -e 's|@''GNULIB_FWRITE''@|$(GNULIB_FWRITE)|g' \ + -e 's|@''GNULIB_GETC''@|$(GNULIB_GETC)|g' \ + -e 's|@''GNULIB_GETCHAR''@|$(GNULIB_GETCHAR)|g' \ -e 's|@''GNULIB_GETDELIM''@|$(GNULIB_GETDELIM)|g' \ -e 's|@''GNULIB_GETLINE''@|$(GNULIB_GETLINE)|g' \ + -e 's|@''GNULIB_GETS''@|$(GNULIB_GETS)|g' \ -e 's|@''GNULIB_OBSTACK_PRINTF''@|$(GNULIB_OBSTACK_PRINTF)|g' \ -e 's|@''GNULIB_OBSTACK_PRINTF_POSIX''@|$(GNULIB_OBSTACK_PRINTF_POSIX)|g' \ -e 's|@''GNULIB_PERROR''@|$(GNULIB_PERROR)|g' \ @@ -58,14 +65,18 @@ -e 's|@''GNULIB_REMOVE''@|$(GNULIB_REMOVE)|g' \ -e 's|@''GNULIB_RENAME''@|$(GNULIB_RENAME)|g' \ -e 's|@''GNULIB_RENAMEAT''@|$(GNULIB_RENAMEAT)|g' \ + -e 's|@''GNULIB_SCANF''@|$(GNULIB_SCANF)|g' \ -e 's|@''GNULIB_SNPRINTF''@|$(GNULIB_SNPRINTF)|g' \ -e 's|@''GNULIB_SPRINTF_POSIX''@|$(GNULIB_SPRINTF_POSIX)|g' \ + -e 's|@''GNULIB_STDIO_H_NONBLOCKING''@|$(GNULIB_STDIO_H_NONBLOCKING)|g' \ -e 's|@''GNULIB_STDIO_H_SIGPIPE''@|$(GNULIB_STDIO_H_SIGPIPE)|g' \ -e 's|@''GNULIB_TMPFILE''@|$(GNULIB_TMPFILE)|g' \ -e 's|@''GNULIB_VASPRINTF''@|$(GNULIB_VASPRINTF)|g' \ -e 's|@''GNULIB_VDPRINTF''@|$(GNULIB_VDPRINTF)|g' \ -e 's|@''GNULIB_VFPRINTF''@|$(GNULIB_VFPRINTF)|g' \ -e 's|@''GNULIB_VFPRINTF_POSIX''@|$(GNULIB_VFPRINTF_POSIX)|g' \ + -e 's|@''GNULIB_VFSCANF''@|$(GNULIB_VFSCANF)|g' \ + -e 's|@''GNULIB_VSCANF''@|$(GNULIB_VSCANF)|g' \ -e 's|@''GNULIB_VPRINTF''@|$(GNULIB_VPRINTF)|g' \ -e 's|@''GNULIB_VPRINTF_POSIX''@|$(GNULIB_VPRINTF_POSIX)|g' \ -e 's|@''GNULIB_VSNPRINTF''@|$(GNULIB_VSNPRINTF)|g' \ @@ -107,6 +118,7 @@ -e 's|@''REPLACE_RENAMEAT''@|$(REPLACE_RENAMEAT)|g' \ -e 's|@''REPLACE_SNPRINTF''@|$(REPLACE_SNPRINTF)|g' \ -e 's|@''REPLACE_SPRINTF''@|$(REPLACE_SPRINTF)|g' \ + -e 's|@''REPLACE_STDIO_READ_FUNCS''@|$(REPLACE_STDIO_READ_FUNCS)|g' \ -e 's|@''REPLACE_STDIO_WRITE_FUNCS''@|$(REPLACE_STDIO_WRITE_FUNCS)|g' \ -e 's|@''REPLACE_TMPFILE''@|$(REPLACE_TMPFILE)|g' \ -e 's|@''REPLACE_VASPRINTF''@|$(REPLACE_VASPRINTF)|g' \ diff -r 04ce36b456cc -r 6758fa38915e modules/stdlib --- a/modules/stdlib Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/stdlib Fri May 06 08:15:59 2011 -0700 @@ -23,7 +23,7 @@ # We need the following in order to create when the system # doesn't have one that works with the given compiler. -stdlib.h: stdlib.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) +stdlib.h: stdlib.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) $(AM_V_GEN)rm -f $@-t $@ && \ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ diff -r 04ce36b456cc -r 6758fa38915e modules/strcase --- a/modules/strcase Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/strcase Fri May 06 08:15:59 2011 -0700 @@ -1,6 +1,12 @@ Description: Case-insensitive string comparison functions. +Status: +obsolete + +Notice: +This module is obsolete. + Files: lib/strcasecmp.c lib/strncasecmp.c diff -r 04ce36b456cc -r 6758fa38915e modules/strchrnul --- a/modules/strchrnul Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/strchrnul Fri May 06 08:15:59 2011 -0700 @@ -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 diff -r 04ce36b456cc -r 6758fa38915e modules/strdup-posix --- a/modules/strdup-posix Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/strdup-posix Fri May 06 08:15:59 2011 -0700 @@ -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 diff -r 04ce36b456cc -r 6758fa38915e modules/strerror --- a/modules/strerror Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/strerror Fri May 06 08:15:59 2011 -0700 @@ -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 diff -r 04ce36b456cc -r 6758fa38915e modules/strerror_r-posix --- a/modules/strerror_r-posix Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/strerror_r-posix Fri May 06 08:15:59 2011 -0700 @@ -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 diff -r 04ce36b456cc -r 6758fa38915e modules/strftime-tests --- a/modules/strftime-tests Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/strftime-tests Fri May 06 08:15:59 2011 -0700 @@ -3,7 +3,6 @@ tests/macros.h Depends-on: -strftime configure.ac: diff -r 04ce36b456cc -r 6758fa38915e modules/string --- a/modules/string Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/string Fri May 06 08:15:59 2011 -0700 @@ -23,7 +23,7 @@ # We need the following in order to create when the system # doesn't have one that works with the given compiler. -string.h: string.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) +string.h: string.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) $(AM_V_GEN)rm -f $@-t $@ && \ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ @@ -89,6 +89,7 @@ -e 's|@''REPLACE_MEMCHR''@|$(REPLACE_MEMCHR)|g' \ -e 's|@''REPLACE_MEMMEM''@|$(REPLACE_MEMMEM)|g' \ -e 's|@''REPLACE_STRCASESTR''@|$(REPLACE_STRCASESTR)|g' \ + -e 's|@''REPLACE_STRCHRNUL''@|$(REPLACE_STRCHRNUL)|g' \ -e 's|@''REPLACE_STRDUP''@|$(REPLACE_STRDUP)|g' \ -e 's|@''REPLACE_STRSTR''@|$(REPLACE_STRSTR)|g' \ -e 's|@''REPLACE_STRERROR''@|$(REPLACE_STRERROR)|g' \ diff -r 04ce36b456cc -r 6758fa38915e modules/strings --- a/modules/strings Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/strings Fri May 06 08:15:59 2011 -0700 @@ -20,7 +20,7 @@ # We need the following in order to create when the system # doesn't have one that works with the given compiler. -strings.h: strings.in.h $(WARN_ON_USE_H) $(ARG_NONNULL_H) +strings.h: strings.in.h $(top_builddir)/config.status $(WARN_ON_USE_H) $(ARG_NONNULL_H) $(AM_V_GEN)rm -f $@-t $@ && \ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ diff -r 04ce36b456cc -r 6758fa38915e modules/strndup --- a/modules/strndup Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/strndup Fri May 06 08:15:59 2011 -0700 @@ -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 diff -r 04ce36b456cc -r 6758fa38915e modules/strnlen --- a/modules/strnlen Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/strnlen Fri May 06 08:15:59 2011 -0700 @@ -6,9 +6,9 @@ m4/strnlen.m4 Depends-on: +string extensions -string -memchr +memchr-obsolete [test $HAVE_DECL_STRNLEN = 0 || test $REPLACE_STRNLEN = 1] configure.ac: gl_FUNC_STRNLEN diff -r 04ce36b456cc -r 6758fa38915e modules/strptime --- a/modules/strptime Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/strptime Fri May 06 08:15:59 2011 -0700 @@ -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 diff -r 04ce36b456cc -r 6758fa38915e modules/strsep --- a/modules/strsep Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/strsep Fri May 06 08:15:59 2011 -0700 @@ -6,9 +6,9 @@ m4/strsep.m4 Depends-on: +string extensions -string -strpbrk +strpbrk [test $HAVE_STRSEP = 0] configure.ac: gl_FUNC_STRSEP diff -r 04ce36b456cc -r 6758fa38915e modules/strsignal --- a/modules/strsignal Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/strsignal Fri May 06 08:15:59 2011 -0700 @@ -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 diff -r 04ce36b456cc -r 6758fa38915e modules/strstr-simple --- a/modules/strstr-simple Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/strstr-simple Fri May 06 08:15:59 2011 -0700 @@ -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 diff -r 04ce36b456cc -r 6758fa38915e modules/strtod --- a/modules/strtod Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/strtod Fri May 06 08:15:59 2011 -0700 @@ -7,9 +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 diff -r 04ce36b456cc -r 6758fa38915e modules/strtod-obsolete --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/modules/strtod-obsolete Fri May 06 08:15:59 2011 -0700 @@ -0,0 +1,28 @@ +Description: +strtod() function for old platforms. + +Status: +obsolete + +Notice: +This module is obsolete. + +Files: +m4/strtod-obsolete.m4 + +Depends-on: +strtod + +configure.ac: +gl_FUNC_STRTOD_OBSOLETE + +Makefile.am: + +Include: + + +License: +LGPLv2+ + +Maintainer: +Bruno Haible diff -r 04ce36b456cc -r 6758fa38915e modules/strtoimax --- a/modules/strtoimax Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/strtoimax Fri May 06 08:15:59 2011 -0700 @@ -7,10 +7,10 @@ m4/strtoimax.m4 Depends-on: -strtoll -verify -inttypes -stdint +inttypes-incomplete +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 @@ -22,7 +22,7 @@ License: -GPL +LGPL Maintainer: Paul Eggert diff -r 04ce36b456cc -r 6758fa38915e modules/strtok_r --- a/modules/strtok_r Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/strtok_r Fri May 06 08:15:59 2011 -0700 @@ -7,7 +7,7 @@ Depends-on: string -strpbrk +strpbrk [test $ac_cv_func_strtok_r = no] configure.ac: gl_FUNC_STRTOK_R diff -r 04ce36b456cc -r 6758fa38915e modules/strtol --- a/modules/strtol Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/strtol Fri May 06 08:15:59 2011 -0700 @@ -1,12 +1,17 @@ Description: strtol() function: convert string to 'long'. +Status: +obsolete + +Notice: +This module is obsolete. + Files: lib/strtol.c m4/strtol.m4 Depends-on: -wchar configure.ac: gl_FUNC_STRTOL @@ -21,4 +26,3 @@ Maintainer: glibc - diff -r 04ce36b456cc -r 6758fa38915e modules/strtoll --- a/modules/strtoll Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/strtoll Fri May 06 08:15:59 2011 -0700 @@ -2,13 +2,13 @@ strtoll() function: convert string to 'long long'. Files: +lib/strtol.c lib/strtoll.c m4/longlong.m4 m4/strtoll.m4 Depends-on: stdlib -strtol configure.ac: gl_FUNC_STRTOLL @@ -24,4 +24,3 @@ Maintainer: glibc - diff -r 04ce36b456cc -r 6758fa38915e modules/strtoul --- a/modules/strtoul Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/strtoul Fri May 06 08:15:59 2011 -0700 @@ -1,12 +1,18 @@ Description: strtoul() function: convert string to 'unsigned long'. +Status: +obsolete + +Notice: +This module is obsolete. + Files: +lib/strtol.c lib/strtoul.c m4/strtoul.m4 Depends-on: -strtol configure.ac: gl_FUNC_STRTOUL @@ -21,4 +27,3 @@ Maintainer: glibc - diff -r 04ce36b456cc -r 6758fa38915e modules/strtoull --- a/modules/strtoull Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/strtoull Fri May 06 08:15:59 2011 -0700 @@ -2,13 +2,14 @@ strtoull() function: convert string to 'unsigned long long'. Files: +lib/strtol.c +lib/strtoul.c lib/strtoull.c m4/longlong.m4 m4/strtoull.m4 Depends-on: stdlib -strtoul configure.ac: gl_FUNC_STRTOULL @@ -24,4 +25,3 @@ Maintainer: glibc - diff -r 04ce36b456cc -r 6758fa38915e modules/strtoumax --- a/modules/strtoumax Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/strtoumax Fri May 06 08:15:59 2011 -0700 @@ -2,15 +2,16 @@ strtoumax() function: convert string to 'uintmax_t'. Files: +lib/strtoimax.c lib/strtoumax.c m4/longlong.m4 m4/strtoumax.m4 Depends-on: -strtoimax -strtoull -inttypes -stdint +inttypes-incomplete +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 @@ -22,7 +23,7 @@ License: -GPL +LGPL Maintainer: Paul Eggert diff -r 04ce36b456cc -r 6758fa38915e modules/symlink --- a/modules/symlink Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/symlink Fri May 06 08:15:59 2011 -0700 @@ -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 diff -r 04ce36b456cc -r 6758fa38915e modules/symlinkat --- a/modules/symlinkat Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/symlinkat Fri May 06 08:15:59 2011 -0700 @@ -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 diff -r 04ce36b456cc -r 6758fa38915e modules/symlinkat-tests --- a/modules/symlinkat-tests Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/symlinkat-tests Fri May 06 08:15:59 2011 -0700 @@ -12,4 +12,3 @@ Makefile.am: TESTS += test-symlinkat check_PROGRAMS += test-symlinkat -test_symlinkat_LDADD = $(LDADD) @LIBINTL@ diff -r 04ce36b456cc -r 6758fa38915e modules/sys_file --- a/modules/sys_file Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/sys_file Fri May 06 08:15:59 2011 -0700 @@ -20,7 +20,7 @@ # We need the following in order to create when the system # has one that is incomplete. -sys/file.h: sys_file.in.h $(WARN_ON_USE_H) +sys/file.h: sys_file.in.h $(top_builddir)/config.status $(WARN_ON_USE_H) $(AM_V_at)$(MKDIR_P) sys $(AM_V_GEN)rm -f $@-t $@ && \ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ diff -r 04ce36b456cc -r 6758fa38915e modules/sys_ioctl --- a/modules/sys_ioctl Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/sys_ioctl Fri May 06 08:15:59 2011 -0700 @@ -22,7 +22,7 @@ # We need the following in order to create when the system # does not have a complete one. -sys/ioctl.h: sys_ioctl.in.h $(CXXDEFS_H) $(WARN_ON_USE_H) +sys/ioctl.h: sys_ioctl.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_USE_H) $(AM_V_at)$(MKDIR_P) sys $(AM_V_GEN)rm -f $@-t $@ && \ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ diff -r 04ce36b456cc -r 6758fa38915e modules/sys_select --- a/modules/sys_select Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/sys_select Fri May 06 08:15:59 2011 -0700 @@ -23,7 +23,7 @@ # We need the following in order to create when the system # doesn't have one that works with the given compiler. -sys/select.h: sys_select.in.h $(CXXDEFS_H) $(WARN_ON_USE_H) +sys/select.h: sys_select.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_USE_H) $(AM_V_at)$(MKDIR_P) sys $(AM_V_GEN)rm -f $@-t $@ && \ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ diff -r 04ce36b456cc -r 6758fa38915e modules/sys_socket --- a/modules/sys_socket Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/sys_socket Fri May 06 08:15:59 2011 -0700 @@ -13,6 +13,7 @@ errno include_next socklen +sys_uio warn-on-use configure.ac: @@ -26,7 +27,7 @@ # We need the following in order to create when the system # doesn't have one that works with the given compiler. -sys/socket.h: sys_socket.in.h $(CXXDEFS_H) $(WARN_ON_USE_H) $(ARG_NONNULL_H) +sys/socket.h: sys_socket.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_USE_H) $(ARG_NONNULL_H) $(AM_V_at)$(MKDIR_P) sys $(AM_V_GEN)rm -f $@-t $@ && \ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ diff -r 04ce36b456cc -r 6758fa38915e modules/sys_stat --- a/modules/sys_stat Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/sys_stat Fri May 06 08:15:59 2011 -0700 @@ -24,7 +24,7 @@ # We need the following in order to create when the system # has one that is incomplete. -sys/stat.h: sys_stat.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) +sys/stat.h: sys_stat.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) $(AM_V_at)$(MKDIR_P) sys $(AM_V_GEN)rm -f $@-t $@ && \ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ diff -r 04ce36b456cc -r 6758fa38915e modules/sys_time --- a/modules/sys_time Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/sys_time Fri May 06 08:15:59 2011 -0700 @@ -22,7 +22,7 @@ # We need the following in order to create when the system # doesn't have one that works with the given compiler. -sys/time.h: sys_time.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) +sys/time.h: sys_time.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) $(AM_V_at)$(MKDIR_P) sys $(AM_V_GEN)rm -f $@-t $@ && \ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ diff -r 04ce36b456cc -r 6758fa38915e modules/sys_times --- a/modules/sys_times Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/sys_times Fri May 06 08:15:59 2011 -0700 @@ -21,7 +21,7 @@ # We need the following in order to create when the system # doesn't have one that works with the given compiler. -sys/times.h: sys_times.in.h $(WARN_ON_USE_H) $(ARG_NONNULL_H) +sys/times.h: sys_times.in.h $(top_builddir)/config.status $(WARN_ON_USE_H) $(ARG_NONNULL_H) $(AM_V_at)$(MKDIR_P) sys $(AM_V_GEN)rm -f $@-t $@ && \ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ diff -r 04ce36b456cc -r 6758fa38915e modules/sys_uio --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/modules/sys_uio Fri May 06 08:15:59 2011 -0700 @@ -0,0 +1,42 @@ +Description: +A POSIX-like . + +Files: +lib/sys_uio.in.h +m4/sys_uio_h.m4 + +Depends-on: +include_next + +configure.ac: +gl_HEADER_SYS_UIO +AC_PROG_MKDIR_P + +Makefile.am: +BUILT_SOURCES += sys/uio.h + +# We need the following in order to create when the system +# doesn't have one that works with the given compiler. +sys/uio.h: sys_uio.in.h $(top_builddir)/config.status + $(AM_V_at)$(MKDIR_P) sys + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ + -e 's|@''NEXT_SYS_UIO_H''@|$(NEXT_SYS_UIO_H)|g' \ + -e 's|@''HAVE_SYS_UIO_H''@|$(HAVE_SYS_UIO_H)|g' \ + < $(srcdir)/sys_uio.in.h; \ + } > $@-t && \ + mv -f $@-t $@ +MOSTLYCLEANFILES += sys/uio.h sys/uio.h-t +MOSTLYCLEANDIRS += sys + +Include: + + +License: +LGPLv2+ + +Maintainer: +Eric Blake diff -r 04ce36b456cc -r 6758fa38915e modules/sys_uio-tests --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/modules/sys_uio-tests Fri May 06 08:15:59 2011 -0700 @@ -0,0 +1,10 @@ +Files: +tests/test-sys_uio.c + +Depends-on: + +configure.ac: + +Makefile.am: +TESTS += test-sys_uio +check_PROGRAMS += test-sys_uio diff -r 04ce36b456cc -r 6758fa38915e modules/sys_utsname --- a/modules/sys_utsname Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/sys_utsname Fri May 06 08:15:59 2011 -0700 @@ -21,7 +21,7 @@ # We need the following in order to create when the system # does not have one. -sys/utsname.h: sys_utsname.in.h $(WARN_ON_USE_H) $(ARG_NONNULL_H) +sys/utsname.h: sys_utsname.in.h $(top_builddir)/config.status $(WARN_ON_USE_H) $(ARG_NONNULL_H) $(AM_V_at)$(MKDIR_P) sys $(AM_V_GEN)rm -f $@-t $@ && \ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ diff -r 04ce36b456cc -r 6758fa38915e modules/sys_wait --- a/modules/sys_wait Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/sys_wait Fri May 06 08:15:59 2011 -0700 @@ -21,7 +21,7 @@ # We need the following in order to create when the system # has one that is incomplete. -sys/wait.h: sys_wait.in.h $(CXXDEFS_H) $(WARN_ON_USE_H) +sys/wait.h: sys_wait.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_USE_H) $(AM_V_at)$(MKDIR_P) sys $(AM_V_GEN)rm -f $@-t $@ && \ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ diff -r 04ce36b456cc -r 6758fa38915e modules/sysexits --- a/modules/sysexits Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/sysexits Fri May 06 08:15:59 2011 -0700 @@ -7,6 +7,7 @@ Depends-on: include_next +stdlib configure.ac: gl_SYSEXITS @@ -19,7 +20,8 @@ # We need the following in order to create when the system # doesn't have one that works with the given compiler. -sysexits.h: sysexits.in.h +if GL_GENERATE_SYSEXITS_H +sysexits.h: sysexits.in.h $(top_builddir)/config.status $(AM_V_GEN)rm -f $@-t $@ && \ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ sed -e 's|@''HAVE_SYSEXITS_H''@|$(HAVE_SYSEXITS_H)|g' \ @@ -30,6 +32,10 @@ < $(srcdir)/sysexits.in.h; \ } > $@-t && \ mv -f $@-t $@ +else +sysexits.h: $(top_builddir)/config.status + rm -f $@ +endif MOSTLYCLEANFILES += sysexits.h sysexits.h-t Include: diff -r 04ce36b456cc -r 6758fa38915e modules/tanl --- a/modules/tanl Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/tanl Fri May 06 08:15:59 2011 -0700 @@ -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 @@ -28,7 +28,7 @@ $(TANL_LIBM) License: -GPL +LGPL Maintainer: Paolo Bonzini diff -r 04ce36b456cc -r 6758fa38915e modules/tcgetsid --- a/modules/tcgetsid Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/tcgetsid Fri May 06 08:15:59 2011 -0700 @@ -9,7 +9,7 @@ Depends-on: termios extensions -sys_ioctl +sys_ioctl [test $ac_cv_func_tcgetsid = no] configure.ac: gl_FUNC_TCGETSID diff -r 04ce36b456cc -r 6758fa38915e modules/termios --- a/modules/termios Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/termios Fri May 06 08:15:59 2011 -0700 @@ -20,7 +20,7 @@ # We need the following in order to create when the system # version does not have all declarations. -termios.h: termios.in.h $(CXXDEFS_H) $(WARN_ON_USE_H) +termios.h: termios.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_USE_H) $(AM_V_GEN)rm -f $@-t $@ && \ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ diff -r 04ce36b456cc -r 6758fa38915e modules/time --- a/modules/time Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/time Fri May 06 08:15:59 2011 -0700 @@ -23,7 +23,7 @@ # We need the following in order to create when the system # doesn't have one that works with the given compiler. -time.h: time.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) +time.h: time.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) $(AM_V_GEN)rm -f $@-t $@ && \ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ diff -r 04ce36b456cc -r 6758fa38915e modules/tmpfile --- a/modules/tmpfile Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/tmpfile Fri May 06 08:15:59 2011 -0700 @@ -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 @@ -21,7 +21,7 @@ License: -GPL +LGPL Maintainer: Ben Pfaff diff -r 04ce36b456cc -r 6758fa38915e modules/trunc --- a/modules/trunc Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/trunc Fri May 06 08:15:59 2011 -0700 @@ -8,7 +8,7 @@ Depends-on: math extensions -float +float [test $HAVE_DECL_TRUNC = 0 || test $REPLACE_TRUNC = 1] configure.ac: gl_FUNC_TRUNC diff -r 04ce36b456cc -r 6758fa38915e modules/truncf --- a/modules/truncf Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/truncf Fri May 06 08:15:59 2011 -0700 @@ -9,7 +9,7 @@ Depends-on: math extensions -float +float [test $HAVE_DECL_TRUNCF = 0 || test $REPLACE_TRUNCF = 1] configure.ac: gl_FUNC_TRUNCF diff -r 04ce36b456cc -r 6758fa38915e modules/truncl --- a/modules/truncl Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/truncl Fri May 06 08:15:59 2011 -0700 @@ -9,7 +9,7 @@ Depends-on: math extensions -float +float [test $HAVE_DECL_TRUNCL = 0 || test $REPLACE_TRUNCL = 1] configure.ac: gl_FUNC_TRUNCL diff -r 04ce36b456cc -r 6758fa38915e modules/tzset --- a/modules/tzset Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/tzset Fri May 06 08:15:59 2011 -0700 @@ -16,7 +16,7 @@ License: -GPL +LGPL Maintainer: Jim Meyering diff -r 04ce36b456cc -r 6758fa38915e modules/uname --- a/modules/uname Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/uname Fri May 06 08:15:59 2011 -0700 @@ -7,7 +7,7 @@ Depends-on: sys_utsname -gethostname +gethostname [test $HAVE_UNAME = 0] configure.ac: gl_FUNC_UNAME diff -r 04ce36b456cc -r 6758fa38915e modules/unistd --- a/modules/unistd Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/unistd Fri May 06 08:15:59 2011 -0700 @@ -22,7 +22,7 @@ # We need the following in order to create an empty placeholder for # when the system doesn't have one. -unistd.h: unistd.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) +unistd.h: unistd.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) $(AM_V_GEN)rm -f $@-t $@ && \ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ sed -e 's|@''HAVE_UNISTD_H''@|$(HAVE_UNISTD_H)|g' \ @@ -58,6 +58,7 @@ -e 's|@''GNULIB_PIPE2''@|$(GNULIB_PIPE2)|g' \ -e 's|@''GNULIB_PREAD''@|$(GNULIB_PREAD)|g' \ -e 's|@''GNULIB_PWRITE''@|$(GNULIB_PWRITE)|g' \ + -e 's|@''GNULIB_READ''@|$(GNULIB_READ)|g' \ -e 's|@''GNULIB_READLINK''@|$(GNULIB_READLINK)|g' \ -e 's|@''GNULIB_READLINKAT''@|$(GNULIB_READLINKAT)|g' \ -e 's|@''GNULIB_RMDIR''@|$(GNULIB_RMDIR)|g' \ @@ -66,6 +67,7 @@ -e 's|@''GNULIB_SYMLINKAT''@|$(GNULIB_SYMLINKAT)|g' \ -e 's|@''GNULIB_TTYNAME_R''@|$(GNULIB_TTYNAME_R)|g' \ -e 's|@''GNULIB_UNISTD_H_GETOPT''@|$(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' \ -e 's|@''GNULIB_UNLINKAT''@|$(GNULIB_UNLINKAT)|g' \ @@ -126,6 +128,7 @@ -e 's|@''REPLACE_LSEEK''@|$(REPLACE_LSEEK)|g' \ -e 's|@''REPLACE_PREAD''@|$(REPLACE_PREAD)|g' \ -e 's|@''REPLACE_PWRITE''@|$(REPLACE_PWRITE)|g' \ + -e 's|@''REPLACE_READ''@|$(REPLACE_READ)|g' \ -e 's|@''REPLACE_READLINK''@|$(REPLACE_READLINK)|g' \ -e 's|@''REPLACE_RMDIR''@|$(REPLACE_RMDIR)|g' \ -e 's|@''REPLACE_SLEEP''@|$(REPLACE_SLEEP)|g' \ diff -r 04ce36b456cc -r 6758fa38915e modules/unlink --- a/modules/unlink Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/unlink Fri May 06 08:15:59 2011 -0700 @@ -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 diff -r 04ce36b456cc -r 6758fa38915e modules/unlockpt --- a/modules/unlockpt Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/unlockpt Fri May 06 08:15:59 2011 -0700 @@ -9,7 +9,7 @@ Depends-on: stdlib extensions -ptsname +ptsname [test $HAVE_UNLOCKPT = 0] configure.ac: gl_FUNC_UNLOCKPT diff -r 04ce36b456cc -r 6758fa38915e modules/unsetenv --- a/modules/unsetenv Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/unsetenv Fri May 06 08:15:59 2011 -0700 @@ -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 diff -r 04ce36b456cc -r 6758fa38915e modules/usleep --- a/modules/usleep Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/usleep Fri May 06 08:15:59 2011 -0700 @@ -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 diff -r 04ce36b456cc -r 6758fa38915e modules/utimecmp --- a/modules/utimecmp Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/utimecmp Fri May 06 08:15:59 2011 -0700 @@ -11,7 +11,6 @@ stat-time time utimens -xalloc intprops lstat stdbool diff -r 04ce36b456cc -r 6758fa38915e modules/utimensat --- a/modules/utimensat Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/utimensat Fri May 06 08:15:59 2011 -0700 @@ -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 diff -r 04ce36b456cc -r 6758fa38915e modules/utimensat-tests --- a/modules/utimensat-tests Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/utimensat-tests Fri May 06 08:15:59 2011 -0700 @@ -19,4 +19,4 @@ Makefile.am: TESTS += test-utimensat check_PROGRAMS += test-utimensat -test_utimensat_LDADD = $(LDADD) $(LIB_CLOCK_GETTIME) @LIBINTL@ +test_utimensat_LDADD = $(LDADD) $(LIB_CLOCK_GETTIME) diff -r 04ce36b456cc -r 6758fa38915e modules/vasprintf --- a/modules/vasprintf Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/vasprintf Fri May 06 08:15:59 2011 -0700 @@ -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 diff -r 04ce36b456cc -r 6758fa38915e modules/vdprintf --- a/modules/vdprintf Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/vdprintf Fri May 06 08:15:59 2011 -0700 @@ -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 diff -r 04ce36b456cc -r 6758fa38915e modules/vdprintf-posix --- a/modules/vdprintf-posix Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/vdprintf-posix Fri May 06 08:15:59 2011 -0700 @@ -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 diff -r 04ce36b456cc -r 6758fa38915e modules/vfprintf-posix --- a/modules/vfprintf-posix Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/vfprintf-posix Fri May 06 08:15:59 2011 -0700 @@ -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 diff -r 04ce36b456cc -r 6758fa38915e modules/vfscanf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/modules/vfscanf Fri May 06 08:15:59 2011 -0700 @@ -0,0 +1,21 @@ +Description: +vfscanf() function: parse formatted text from a stream + +Files: + +Depends-on: +stdio + +configure.ac: +gl_STDIO_MODULE_INDICATOR([vfscanf]) + +Makefile.am: + +Include: + + +License: +LGPL + +Maintainer: +Bruno Haible diff -r 04ce36b456cc -r 6758fa38915e modules/vprintf-posix --- a/modules/vprintf-posix Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/vprintf-posix Fri May 06 08:15:59 2011 -0700 @@ -14,8 +14,8 @@ Depends-on: stdio -vfprintf-posix printf-safe +vfprintf-posix [test $REPLACE_VPRINTF = 1] configure.ac: gl_FUNC_VPRINTF_POSIX diff -r 04ce36b456cc -r 6758fa38915e modules/vscanf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/modules/vscanf Fri May 06 08:15:59 2011 -0700 @@ -0,0 +1,21 @@ +Description: +vscanf() function: parse formatted text from standard input + +Files: + +Depends-on: +stdio + +configure.ac: +gl_STDIO_MODULE_INDICATOR([vscanf]) + +Makefile.am: + +Include: + + +License: +LGPL + +Maintainer: +Bruno Haible diff -r 04ce36b456cc -r 6758fa38915e modules/vsnprintf --- a/modules/vsnprintf Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/vsnprintf Fri May 06 08:15:59 2011 -0700 @@ -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 diff -r 04ce36b456cc -r 6758fa38915e modules/vsnprintf-posix --- a/modules/vsnprintf-posix Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/vsnprintf-posix Fri May 06 08:15:59 2011 -0700 @@ -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 diff -r 04ce36b456cc -r 6758fa38915e modules/vsprintf-posix --- a/modules/vsprintf-posix Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/vsprintf-posix Fri May 06 08:15:59 2011 -0700 @@ -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 diff -r 04ce36b456cc -r 6758fa38915e modules/wait-process --- a/modules/wait-process Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/wait-process Fri May 06 08:15:59 2011 -0700 @@ -10,10 +10,10 @@ Depends-on: fatal-signal error -exit xalloc gettext-h stdbool +stdlib sys_wait unistd atexit diff -r 04ce36b456cc -r 6758fa38915e modules/wchar --- a/modules/wchar Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/wchar Fri May 06 08:15:59 2011 -0700 @@ -23,7 +23,7 @@ # We need the following in order to create when the system # version does not work standalone. -wchar.h: wchar.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) +wchar.h: wchar.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) $(AM_V_GEN)rm -f $@-t $@ && \ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ diff -r 04ce36b456cc -r 6758fa38915e modules/wcrtomb --- a/modules/wcrtomb Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/wcrtomb Fri May 06 08:15:59 2011 -0700 @@ -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 diff -r 04ce36b456cc -r 6758fa38915e modules/wcscasecmp --- a/modules/wcscasecmp Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/wcscasecmp Fri May 06 08:15:59 2011 -0700 @@ -8,7 +8,7 @@ Depends-on: wchar -wctype-h +wctype-h [test $HAVE_WCSCASECMP = 0] configure.ac: gl_FUNC_WCSCASECMP diff -r 04ce36b456cc -r 6758fa38915e modules/wcscspn --- a/modules/wcscspn Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/wcscspn Fri May 06 08:15:59 2011 -0700 @@ -14,8 +14,8 @@ Depends-on: wchar -wcslen -wcschr +wcslen [test $HAVE_WCSCSPN = 0] +wcschr [test $HAVE_WCSCSPN = 0] configure.ac: gl_FUNC_WCSCSPN diff -r 04ce36b456cc -r 6758fa38915e modules/wcsdup --- a/modules/wcsdup Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/wcsdup Fri May 06 08:15:59 2011 -0700 @@ -8,8 +8,8 @@ Depends-on: wchar -wcslen -wmemcpy +wcslen [test $HAVE_WCSDUP = 0] +wmemcpy [test $HAVE_WCSDUP = 0] configure.ac: gl_FUNC_WCSDUP diff -r 04ce36b456cc -r 6758fa38915e modules/wcsncasecmp --- a/modules/wcsncasecmp Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/wcsncasecmp Fri May 06 08:15:59 2011 -0700 @@ -8,7 +8,7 @@ Depends-on: wchar -wctype-h +wctype-h [test $HAVE_WCSNCASECMP = 0] configure.ac: gl_FUNC_WCSNCASECMP diff -r 04ce36b456cc -r 6758fa38915e modules/wcsnrtombs --- a/modules/wcsnrtombs Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/wcsnrtombs Fri May 06 08:15:59 2011 -0700 @@ -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 diff -r 04ce36b456cc -r 6758fa38915e modules/wcspbrk --- a/modules/wcspbrk Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/wcspbrk Fri May 06 08:15:59 2011 -0700 @@ -14,7 +14,7 @@ Depends-on: wchar -wcschr +wcschr [test $HAVE_WCSPBRK = 0] configure.ac: gl_FUNC_WCSPBRK diff -r 04ce36b456cc -r 6758fa38915e modules/wcsrtombs --- a/modules/wcsrtombs Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/wcsrtombs Fri May 06 08:15:59 2011 -0700 @@ -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 diff -r 04ce36b456cc -r 6758fa38915e modules/wcsspn --- a/modules/wcsspn Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/wcsspn Fri May 06 08:15:59 2011 -0700 @@ -14,7 +14,7 @@ Depends-on: wchar -wcschr +wcschr [test $HAVE_WCSSPN = 0] configure.ac: gl_FUNC_WCSSPN diff -r 04ce36b456cc -r 6758fa38915e modules/wcsstr --- a/modules/wcsstr Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/wcsstr Fri May 06 08:15:59 2011 -0700 @@ -8,7 +8,7 @@ Depends-on: wchar -wcschr +wcschr [test $HAVE_WCSSTR = 0] configure.ac: gl_FUNC_WCSSTR diff -r 04ce36b456cc -r 6758fa38915e modules/wcstok --- a/modules/wcstok Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/wcstok Fri May 06 08:15:59 2011 -0700 @@ -8,8 +8,8 @@ Depends-on: wchar -wcsspn -wcspbrk +wcsspn [test $HAVE_WCSTOK = 0] +wcspbrk [test $HAVE_WCSTOK = 0] configure.ac: gl_FUNC_WCSTOK diff -r 04ce36b456cc -r 6758fa38915e modules/wcswidth --- a/modules/wcswidth Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/wcswidth Fri May 06 08:15:59 2011 -0700 @@ -9,7 +9,7 @@ Depends-on: wchar -wcwidth +wcwidth [test $HAVE_WCSWIDTH = 0 || test $REPLACE_WCSWIDTH = 1] configure.ac: gl_FUNC_WCSWIDTH diff -r 04ce36b456cc -r 6758fa38915e modules/wctob --- a/modules/wctob Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/wctob Fri May 06 08:15:59 2011 -0700 @@ -9,7 +9,7 @@ Depends-on: wchar -wctomb +wctomb [test $ac_cv_func_wctob = no || test $REPLACE_WCTOB = 1] configure.ac: gl_FUNC_WCTOB diff -r 04ce36b456cc -r 6758fa38915e modules/wctomb --- a/modules/wctomb Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/wctomb Fri May 06 08:15:59 2011 -0700 @@ -8,8 +8,8 @@ Depends-on: stdlib -wcrtomb -wchar +wcrtomb [test $REPLACE_WCTOMB = 1] +wchar [test $REPLACE_WCTOMB = 1] configure.ac: gl_FUNC_WCTOMB diff -r 04ce36b456cc -r 6758fa38915e modules/wctype --- a/modules/wctype Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/wctype Fri May 06 08:15:59 2011 -0700 @@ -14,7 +14,7 @@ Depends-on: wctype-h -iswblank +iswblank [test $HAVE_WCTYPE_T = 0] configure.ac: gl_FUNC_WCTYPE diff -r 04ce36b456cc -r 6758fa38915e modules/wctype-h --- a/modules/wctype-h Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/wctype-h Fri May 06 08:15:59 2011 -0700 @@ -19,7 +19,7 @@ # We need the following in order to create when the system # doesn't have one that works with the given compiler. -wctype.h: wctype.in.h $(CXXDEFS_H) $(WARN_ON_USE_H) +wctype.h: wctype.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_USE_H) $(AM_V_GEN)rm -f $@-t $@ && \ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ sed -e 's/@''HAVE_WCTYPE_H''@/$(HAVE_WCTYPE_H)/g' \ diff -r 04ce36b456cc -r 6758fa38915e modules/wcwidth --- a/modules/wcwidth Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/wcwidth Fri May 06 08:15:59 2011 -0700 @@ -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 diff -r 04ce36b456cc -r 6758fa38915e modules/write --- a/modules/write Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/write Fri May 06 08:15:59 2011 -0700 @@ -7,7 +7,7 @@ Depends-on: unistd -raise +raise [test $REPLACE_WRITE = 1] configure.ac: gl_FUNC_WRITE diff -r 04ce36b456cc -r 6758fa38915e modules/xalloc --- a/modules/xalloc Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/xalloc Fri May 06 08:15:59 2011 -0700 @@ -9,6 +9,7 @@ Depends-on: inline xalloc-die +xalloc-oversized configure.ac: gl_XALLOC diff -r 04ce36b456cc -r 6758fa38915e modules/xalloc-oversized --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/modules/xalloc-oversized Fri May 06 08:15:59 2011 -0700 @@ -0,0 +1,20 @@ +Description: +Check for memory allocation overflow. Also see xalloc. + +Files: +lib/xalloc-oversized.h + +Depends-on: + +configure.ac: + +Makefile.am: + +Include: +"xalloc-oversized.h" + +License: +GPL + +Maintainer: +all diff -r 04ce36b456cc -r 6758fa38915e modules/xgetgroups --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/modules/xgetgroups Fri May 06 08:15:59 2011 -0700 @@ -0,0 +1,25 @@ +Description: +Return the group IDs of a user or current process in malloc'd storage, with +out-of-memory checking. + +Files: +lib/xgetgroups.c + +Depends-on: +mgetgroups +xalloc + +configure.ac: +gl_MODULE_INDICATOR([xgetgroups]) + +Makefile.am: +lib_SOURCES += xgetgroups.c + +Include: +"mgetgroups.h" + +License: +GPL + +Maintainer: +Jim Meyering, Eric Blake diff -r 04ce36b456cc -r 6758fa38915e modules/xsetenv --- a/modules/xsetenv Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/xsetenv Fri May 06 08:15:59 2011 -0700 @@ -10,8 +10,8 @@ setenv unsetenv error -exit gettext-h +stdlib configure.ac: diff -r 04ce36b456cc -r 6758fa38915e modules/xstrtol --- a/modules/xstrtol Fri Apr 01 16:04:45 2011 -0700 +++ b/modules/xstrtol Fri May 06 08:15:59 2011 -0700 @@ -14,7 +14,7 @@ getopt-gnu gettext-h intprops -inttypes +inttypes-incomplete configure.ac: gl_XSTRTOL diff -r 04ce36b456cc -r 6758fa38915e tests/socket-client.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/socket-client.h Fri May 06 08:15:59 2011 -0700 @@ -0,0 +1,57 @@ +/* Create sockets for use in tests (client side). + Copyright (C) 2011 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +/* Written by Bruno Haible , 2011. */ + +#include +#include +#include +#include + +/* Creates a client socket, by connecting to a server on the given port. */ +static int +create_client_socket (int port) +{ + int client_socket; + + /* Create a client socket. */ + client_socket = socket (PF_INET, SOCK_STREAM, IPPROTO_TCP); + ASSERT (client_socket >= 0); + /* Connect to the server process at the specified port. */ + { + struct sockaddr_in addr; + + memset (&addr, 0, sizeof (addr)); /* needed on AIX and OSF/1 */ + addr.sin_family = AF_INET; + #if 0 /* Unoptimized */ + inet_pton (AF_INET, "127.0.0.1", &addr.sin_addr); + #elif 0 /* Nearly optimized */ + addr.sin_addr.s_addr = htonl (0x7F000001); /* 127.0.0.1 */ + #else /* Fully optimized */ + { + unsigned char dotted[4] = { 127, 0, 0, 1 }; /* 127.0.0.1 */ + memcpy (&addr.sin_addr.s_addr, dotted, 4); + } + #endif + addr.sin_port = htons (port); + + ASSERT (connect (client_socket, + (const struct sockaddr *) &addr, sizeof (addr)) + == 0); + } + + return client_socket; +} diff -r 04ce36b456cc -r 6758fa38915e tests/socket-server.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/socket-server.h Fri May 06 08:15:59 2011 -0700 @@ -0,0 +1,117 @@ +/* Create sockets for use in tests (server side). + Copyright (C) 2011 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +/* Written by Bruno Haible , 2011. */ + +#include +#include +#include +#include + +/* Creates a server that can be used to listen on incoming + connections. It uses the IPv4 protocol. + If PORT is 0, a port is assigned by the kernel. + Returns the server. Returns the chosen port in *PPORT. */ +static int +create_server (int port, unsigned int max_backlog, int *pport) +{ + int server; + + /* Create a server socket. */ + server = socket (PF_INET, SOCK_STREAM, IPPROTO_TCP); + if (server < 0) + { + fputs ("Skipping test: cannot create server socket: socket() failed\n", + stderr); + exit (77); + } + /* Bind it to a local IPv4 address. */ + if (port != 0) + { + /* Set an option for the next bind() call: Avoid an EADDRINUSE error + in case there are TIME_WAIT or CLOSE_WAIT sockets hanging around on + the port. (Sockets in LISTEN or ESTABLISHED state on the same port + will still yield an error.) */ + unsigned int flag = 1; + if (setsockopt (server, SOL_SOCKET, SO_REUSEADDR, &flag, + sizeof (flag)) + < 0) + { + fputs ("Skipping test: cannot create server socket: setsockopt() failed\n", + stderr); + exit (77); + } + } + { + struct sockaddr_in addr; + + memset (&addr, 0, sizeof (addr)); /* needed on AIX and OSF/1 */ + addr.sin_family = AF_INET; + #if 0 /* Unoptimized */ + inet_pton (AF_INET, "127.0.0.1", &addr.sin_addr); + #elif 0 /* Nearly optimized */ + addr.sin_addr.s_addr = htonl (0x7F000001); /* 127.0.0.1 */ + #else /* Fully optimized */ + { + unsigned char dotted[4] = { 127, 0, 0, 1 }; /* 127.0.0.1 */ + memcpy (&addr.sin_addr.s_addr, dotted, 4); + } + #endif + addr.sin_port = htons (port); + + if (bind (server, (const struct sockaddr *) &addr, sizeof (addr)) < 0) + { + fputs ("Skipping test: cannot create server socket: bind() failed\n", + stderr); + exit (77); + } + } + if (port == 0) + { + /* Get the port that was assigned by bind(). */ + struct sockaddr_in addr; + socklen_t addrlen = sizeof (addr); + + if (getsockname (server, (struct sockaddr *) &addr, &addrlen) < 0) + { + fputs ("Skipping test: cannot create server socket: getsockname() failed\n", + stderr); + exit (77); + } + port = ntohs (addr.sin_port); + } + /* Start listening for a connection from the child process. */ + if (listen (server, max_backlog) < 0) + { + fputs ("Skipping test: cannot create server socket: listen() failed\n", + stderr); + exit (77); + } + + *pport = port; + return server; +} + +/* Creates a server socket, by accepting a connection to a server. */ +static int +create_server_socket (int server) +{ + struct sockaddr_storage addr; + socklen_t addrlen = sizeof (addr); + int connected_socket = accept (server, (struct sockaddr *) &addr, &addrlen); + ASSERT (connected_socket >= 0); + return connected_socket; +} diff -r 04ce36b456cc -r 6758fa38915e tests/test-chown.h --- a/tests/test-chown.h Fri Apr 01 16:04:45 2011 -0700 +++ b/tests/test-chown.h Fri May 06 08:15:59 2011 -0700 @@ -38,7 +38,7 @@ int result; /* Solaris 8 is interesting - if the current process belongs to - multiple groups, the current directory is owned by a a group that + multiple groups, the current directory is owned by a group that the current process belongs to but different than getegid(), and the current directory does not have the S_ISGID bit, then regular files created in the directory belong to the directory's group, @@ -71,7 +71,7 @@ ASSERT (close (creat (BASE "dir/file", 0600)) == 0); ASSERT (stat (BASE "dir/file", &st1) == 0); ASSERT (st1.st_uid != (uid_t) -1); - ASSERT (st1.st_gid != (uid_t) -1); + ASSERT (st1.st_gid != (gid_t) -1); ASSERT (st1.st_gid == getegid ()); /* Sanity check of error cases. */ diff -r 04ce36b456cc -r 6758fa38915e tests/test-fclose.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/test-fclose.c Fri May 06 08:15:59 2011 -0700 @@ -0,0 +1,93 @@ +/* Test of fclose module. + Copyright (C) 2011 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software Foundation, + Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + +/* Written by Eric Blake. */ + +#include + +#include + +#include "signature.h" +SIGNATURE_CHECK (fclose, int, (FILE *)); + +#include +#include +#include +#include +#include + +#include "macros.h" + +#define BASE "test-fclose.t" + +int +main (int argc, char **argv) +{ + const char buf[] = "hello world"; + int fd; + int fd2; + FILE *f; + + /* Prepare a seekable file. */ + fd = open (BASE, O_RDWR | O_CREAT | O_TRUNC, 0600); + ASSERT (0 <= fd); + ASSERT (write (fd, buf, sizeof buf) == sizeof buf); + ASSERT (lseek (fd, 1, SEEK_SET) == 1); + + /* Create an output stream visiting the file; when it is closed, all + other file descriptors visiting the file must see the new file + position. */ + fd2 = dup (fd); + ASSERT (0 <= fd2); + f = fdopen (fd2, "w"); + ASSERT (f); + ASSERT (fputc (buf[1], f) == buf[1]); + ASSERT (fclose (f) == 0); + errno = 0; + ASSERT (lseek (fd2, 0, SEEK_CUR) == -1); + ASSERT (errno == EBADF); + ASSERT (lseek (fd, 0, SEEK_CUR) == 2); + +#if GNULIB_FFLUSH + /* Likewise for an input stream, but only when we know fflush works + on input streams. */ + fd2 = dup (fd); + ASSERT (0 <= fd2); + f = fdopen (fd2, "r"); + ASSERT (f); + ASSERT (fgetc (f) == buf[2]); + ASSERT (fclose (f) == 0); + errno = 0; + ASSERT (lseek (fd2, 0, SEEK_CUR) == -1); + ASSERT (errno == EBADF); + ASSERT (lseek (fd, 0, SEEK_CUR) == 3); +#endif + + /* Test that fclose() sets errno if someone else closes the stream + fd behind the back of stdio. */ + f = fdopen (fd, "w+"); + ASSERT (f); + ASSERT (close (fd) == 0); + errno = 0; + ASSERT (fclose (f) == EOF); + ASSERT (errno == EBADF); + + /* Clean up. */ + ASSERT (remove (BASE) == 0); + + return 0; +} diff -r 04ce36b456cc -r 6758fa38915e tests/test-fcntl-h.c --- a/tests/test-fcntl-h.c Fri Apr 01 16:04:45 2011 -0700 +++ b/tests/test-fcntl-h.c Fri May 06 08:15:59 2011 -0700 @@ -29,10 +29,88 @@ int sk[] = { SEEK_CUR, SEEK_END, SEEK_SET }; /* Check that the FD_* macros are defined. */ -int fd = FD_CLOEXEC; +int i = FD_CLOEXEC; int main (void) { - return 0; + /* Ensure no overlap in SEEK_*. */ + switch (0) + { + case SEEK_CUR: + case SEEK_END: + case SEEK_SET: + ; + } + + /* Ensure no dangerous overlap in non-zero gnulib-defined replacements. */ + switch (O_RDONLY) + { + /* Access modes */ + case O_RDONLY: + case O_WRONLY: + case O_RDWR: +#if O_EXEC && O_EXEC != O_RDONLY + case O_EXEC: +#endif +#if O_SEARCH && O_EXEC != O_SEARCH && O_SEARCH != O_RDONLY + case O_SEARCH: +#endif + i = O_ACCMODE == (O_RDONLY | O_WRONLY | O_RDWR | O_EXEC | O_SEARCH); + break; + + /* Everyone should have these */ + case O_CREAT: + case O_EXCL: + case O_TRUNC: + case O_APPEND: + break; + + /* These might be 0 or O_RDONLY, only test non-zero versions. */ +#if O_CLOEXEC + case O_CLOEXEC: +#endif +#if O_DIRECT + case O_DIRECT: +#endif +#if O_DIRECTORY + case O_DIRECTORY: +#endif +#if O_DSYNC + case O_DSYNC: +#endif +#if O_NOATIME + case O_NOATIME: +#endif +#if O_NONBLOCK + case O_NONBLOCK: +#endif +#if O_NOCTTY + case O_NOCTTY: +#endif +#if O_NOFOLLOW + case O_NOFOLLOW: +#endif +#if O_NOLINKS + case O_NOLINKS: +#endif +#if O_RSYNC && O_RSYNC != O_DSYNC + case O_RSYNC: +#endif +#if O_SYNC && O_SYNC != O_RSYNC + case O_SYNC: +#endif +#if O_TTY_INIT + case O_TTY_INIT: +#endif +#if O_BINARY + case O_BINARY: +#endif +#if O_TEXT + case O_TEXT: +#endif + ; + } + + return !i; } diff -r 04ce36b456cc -r 6758fa38915e tests/test-getaddrinfo.c --- a/tests/test-getaddrinfo.c Fri Apr 01 16:04:45 2011 -0700 +++ b/tests/test-getaddrinfo.c Fri May 06 08:15:59 2011 -0700 @@ -107,7 +107,7 @@ #endif /* Provide details if errno was set. */ if (res == EAI_SYSTEM) - dbgprintf ("system error: %s\n", strerror (err)); + fprintf (stderr, "system error: %s\n", strerror (err)); return 1; } diff -r 04ce36b456cc -r 6758fa38915e tests/test-getcwd-lgpl.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/test-getcwd-lgpl.c Fri May 06 08:15:59 2011 -0700 @@ -0,0 +1,87 @@ +/* Test of getcwd() function. + Copyright (C) 2009-2011 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +#include + +#include + +#include "signature.h" +SIGNATURE_CHECK (getcwd, char *, (char *, size_t)); + +#include +#include +#include +#include + +#include "macros.h" + +int +main (int argc, char **argv) +{ + char *pwd1; + char *pwd2; + /* If the user provides an argument, attempt to chdir there first. */ + if (1 < argc) + { + if (chdir (argv[1]) == 0) + printf ("changed to directory %s\n", argv[1]); + } + + pwd1 = getcwd (NULL, 0); + ASSERT (pwd1 && *pwd1); + if (1 < argc) + printf ("cwd=%s\n", pwd1); + + /* Make sure the result is usable. */ + ASSERT (chdir (pwd1) == 0); + ASSERT (chdir (".//./.") == 0); + + /* Make sure that result is normalized. */ + pwd2 = getcwd (NULL, 0); + ASSERT (pwd2); + ASSERT (strcmp (pwd1, pwd2) == 0); + free (pwd2); + { + size_t len = strlen (pwd1); + ssize_t i = len - 10; + if (i < 1) + i = 1; + pwd2 = getcwd (NULL, len + 1); + ASSERT (pwd2); + free (pwd2); + pwd2 = malloc (len + 2); + for ( ; i <= len; i++) + { + errno = 0; + ASSERT (getcwd (pwd2, i) == NULL); + ASSERT (errno == ERANGE); + errno = 0; + ASSERT (getcwd (NULL, i) == NULL); + ASSERT (errno == ERANGE); + } + ASSERT (getcwd (pwd2, len + 1) == pwd2); + pwd2[len] = '/'; + pwd2[len + 1] = '\0'; + } + ASSERT (strstr (pwd2, "/./") == NULL); + ASSERT (strstr (pwd2, "/../") == NULL); + ASSERT (strstr (pwd2 + 1 + (pwd2[1] == '/'), "//") == NULL); + + free (pwd1); + free (pwd2); + + return 0; +} diff -r 04ce36b456cc -r 6758fa38915e tests/test-getcwd.c --- a/tests/test-getcwd.c Fri Apr 01 16:04:45 2011 -0700 +++ b/tests/test-getcwd.c Fri May 06 08:15:59 2011 -0700 @@ -18,59 +18,206 @@ #include -#include "signature.h" -SIGNATURE_CHECK (getcwd, char *, (char *, size_t)); - +#include +#include +#include #include #include #include +#include #include "macros.h" +#if ! HAVE_GETPAGESIZE +# define getpagesize() 0 +#endif + +/* This size is chosen to be larger than PATH_MAX (4k), yet smaller than + the 16kB pagesize on ia64 linux. Those conditions make the code below + trigger a bug in glibc's getcwd implementation before 2.4.90-10. */ +#define TARGET_LEN (5 * 1024) + +/* Keep this test in sync with m4/getcwd-abort-bug.m4. */ +static int +test_abort_bug (void) +{ + char const *dir_name = "confdir-14B---"; + char *cwd; + size_t initial_cwd_len; + int fail = 0; + size_t desired_depth; + size_t d; + + /* The bug is triggered when PATH_MAX < getpagesize (), so skip + this relatively expensive and invasive test if that's not true. */ + if (getpagesize () <= PATH_MAX) + return 0; + + cwd = getcwd (NULL, 0); + if (cwd == NULL) + return 2; + + initial_cwd_len = strlen (cwd); + free (cwd); + desired_depth = ((TARGET_LEN - 1 - initial_cwd_len) + / (1 + strlen (dir_name))); + for (d = 0; d < desired_depth; d++) + { + if (mkdir (dir_name, S_IRWXU) < 0 || chdir (dir_name) < 0) + { + fail = 3; /* Unable to construct deep hierarchy. */ + break; + } + } + + /* If libc has the bug in question, this invocation of getcwd + results in a failed assertion. */ + cwd = getcwd (NULL, 0); + if (cwd == NULL) + fail = 4; /* getcwd failed. This is ok, and expected. */ + free (cwd); + + /* Call rmdir first, in case the above chdir failed. */ + rmdir (dir_name); + while (0 < d--) + { + if (chdir ("..") < 0) + { + fail = 5; + break; + } + rmdir (dir_name); + } + + return fail; +} + +/* The length of this name must be 8. */ +#define DIR_NAME "confdir3" +#define DIR_NAME_LEN 8 +#define DIR_NAME_SIZE (DIR_NAME_LEN + 1) + +/* The length of "../". */ +#define DOTDOTSLASH_LEN 3 + +/* Leftover bytes in the buffer, to work around library or OS bugs. */ +#define BUF_SLOP 20 + +/* Keep this test in sync with m4/getcwd-path-max.m4. */ +static int +test_long_name (void) +{ +#ifndef PATH_MAX + /* The Hurd doesn't define this, so getcwd can't exhibit the bug -- + at least not on a local file system. And if we were to start worrying + about remote file systems, we'd have to enable the wrapper function + all of the time, just to be safe. That's not worth the cost. */ + return 0; +#elif ((INT_MAX / (DIR_NAME_SIZE / DOTDOTSLASH_LEN + 1) \ + - DIR_NAME_SIZE - BUF_SLOP) \ + <= PATH_MAX) + /* FIXME: Assuming there's a system for which this is true, + this should be done in a compile test. */ + return 0; +#else + char buf[PATH_MAX * (DIR_NAME_SIZE / DOTDOTSLASH_LEN + 1) + + DIR_NAME_SIZE + BUF_SLOP]; + char *cwd = getcwd (buf, PATH_MAX); + size_t initial_cwd_len; + size_t cwd_len; + int fail = 0; + size_t n_chdirs = 0; + + if (cwd == NULL) + return 10; + + cwd_len = initial_cwd_len = strlen (cwd); + + while (1) + { + size_t dotdot_max = PATH_MAX * (DIR_NAME_SIZE / DOTDOTSLASH_LEN); + char *c = NULL; + + cwd_len += DIR_NAME_SIZE; + /* If mkdir or chdir fails, it could be that this system cannot create + any file with an absolute name longer than PATH_MAX, such as cygwin. + If so, leave fail as 0, because the current working directory can't + be too long for getcwd if it can't even be created. For other + errors, be pessimistic and consider that as a failure, too. */ + if (mkdir (DIR_NAME, S_IRWXU) < 0 || chdir (DIR_NAME) < 0) + { + if (! (errno == ERANGE || errno == ENAMETOOLONG)) + fail = 20; + break; + } + + if (PATH_MAX <= cwd_len && cwd_len < PATH_MAX + DIR_NAME_SIZE) + { + c = getcwd (buf, PATH_MAX); + if (!c && errno == ENOENT) + { + fail = 11; + break; + } + if (c || ! (errno == ERANGE || errno == ENAMETOOLONG)) + { + fail = 21; + break; + } + } + + if (dotdot_max <= cwd_len - initial_cwd_len) + { + if (dotdot_max + DIR_NAME_SIZE < cwd_len - initial_cwd_len) + break; + c = getcwd (buf, cwd_len + 1); + if (!c) + { + if (! (errno == ERANGE || errno == ENOENT + || errno == ENAMETOOLONG)) + { + fail = 22; + break; + } + if (AT_FDCWD || errno == ERANGE || errno == ENOENT) + { + fail = 12; + break; + } + } + } + + if (c && strlen (c) != cwd_len) + { + fail = 23; + break; + } + ++n_chdirs; + } + + /* Leaving behind such a deep directory is not polite. + So clean up here, right away, even though the driving + shell script would also clean up. */ + { + size_t i; + + /* Try rmdir first, in case the chdir failed. */ + rmdir (DIR_NAME); + for (i = 0; i <= n_chdirs; i++) + { + if (chdir ("..") < 0) + break; + if (rmdir (DIR_NAME) != 0) + break; + } + } + + return fail; +#endif +} + int main (int argc, char **argv) { - char *pwd1; - char *pwd2; - /* If the user provides an argument, attempt to chdir there first. */ - if (1 < argc) - { - if (chdir (argv[1]) == 0) - printf ("changed to directory %s\n", argv[1]); - } - - pwd1 = getcwd (NULL, 0); - ASSERT (pwd1 && *pwd1); - if (1 < argc) - printf ("cwd=%s\n", pwd1); - - /* Make sure the result is usable. */ - ASSERT (chdir (pwd1) == 0); - ASSERT (chdir ("././.") == 0); - - /* Make sure that result is normalized. */ - pwd2 = getcwd (NULL, 0); - ASSERT (pwd2); - ASSERT (strcmp (pwd1, pwd2) == 0); - free (pwd2); - { - size_t len = strlen (pwd1); - ssize_t i = len - 10; - if (i < 0) - i = 0; - pwd2 = malloc (len + 2); - for ( ; i < len; i++) - ASSERT (getcwd (pwd2, i) == NULL); - pwd2 = getcwd (pwd2, len + 1); - ASSERT (pwd2); - pwd2[len] = '/'; - pwd2[len + 1] = '\0'; - } - ASSERT (strstr (pwd2, "/./") == NULL); - ASSERT (strstr (pwd2, "/../") == NULL); - - free (pwd1); - free (pwd2); - - return 0; + return test_abort_bug () + test_long_name (); } diff -r 04ce36b456cc -r 6758fa38915e tests/test-hash.c --- a/tests/test-hash.c Fri Apr 01 16:04:45 2011 -0700 +++ b/tests/test-hash.c Fri May 06 08:15:59 2011 -0700 @@ -20,7 +20,6 @@ #include "hash.h" #include "hash-pjw.h" #include "inttostr.h" -#include "xalloc.h" #include #include @@ -114,8 +113,10 @@ ASSERT (ht); insert_new (ht, "a"); { - char *str1 = xstrdup ("a"); - char *str2 = hash_insert (ht, str1); + char *str1 = strdup ("a"); + char *str2; + ASSERT (str1); + str2 = hash_insert (ht, str1); ASSERT (str1 != str2); ASSERT (STREQ (str1, str2)); free (str1); @@ -161,7 +162,8 @@ ht = hash_initialize (sz, NULL, NULL, NULL, NULL); ASSERT (ht); { - char *str = xstrdup ("a"); + char *str = strdup ("a"); + ASSERT (str); insert_new (ht, "a"); insert_new (ht, str); ASSERT (hash_lookup (ht, str) == str); @@ -206,7 +208,9 @@ { char buf[50]; char const *p = uinttostr (i, buf); - insert_new (ht, xstrdup (p)); + char *p_dup = strdup (p); + ASSERT (p_dup); + insert_new (ht, p_dup); } break; diff -r 04ce36b456cc -r 6758fa38915e tests/test-lchown.h --- a/tests/test-lchown.h Fri Apr 01 16:04:45 2011 -0700 +++ b/tests/test-lchown.h Fri May 06 08:15:59 2011 -0700 @@ -46,7 +46,7 @@ int result; /* Solaris 8 is interesting - if the current process belongs to - multiple groups, the current directory is owned by a a group that + multiple groups, the current directory is owned by a group that the current process belongs to but different than getegid(), and the current directory does not have the S_ISGID bit, then regular files created in the directory belong to the directory's group, diff -r 04ce36b456cc -r 6758fa38915e tests/test-linkat.c --- a/tests/test-linkat.c Fri Apr 01 16:04:45 2011 -0700 +++ b/tests/test-linkat.c Fri May 06 08:15:59 2011 -0700 @@ -34,7 +34,6 @@ #include "areadlink.h" #include "filenamecat.h" #include "same-inode.h" -#include "xgetcwd.h" #include "ignore-value.h" #include "macros.h" @@ -119,7 +118,8 @@ ASSERT (mkdir (BASE "sub1", 0700) == 0); ASSERT (mkdir (BASE "sub2", 0700) == 0); ASSERT (close (creat (BASE "00", 0600)) == 0); - cwd = xgetcwd (); + cwd = getcwd (NULL, 0); + ASSERT (cwd); dfd = open (BASE "sub1", O_RDONLY); ASSERT (0 <= dfd); @@ -140,9 +140,11 @@ for (i = 0; i < 32; i++) { int fd1 = (i & 8) ? dfd : AT_FDCWD; - char *file1 = file_name_concat ((i & 4) ? ".." : cwd, BASE "xx", NULL); + char *file1 = mfile_name_concat ((i & 4) ? ".." : cwd, BASE "xx", NULL); int fd2 = (i & 2) ? dfd : AT_FDCWD; - char *file2 = file_name_concat ((i & 1) ? ".." : cwd, BASE "xx", NULL); + char *file2 = mfile_name_concat ((i & 1) ? ".." : cwd, BASE "xx", NULL); + ASSERT (file1); + ASSERT (file2); flag = (i & 0x10 ? AT_SYMLINK_FOLLOW : 0); ASSERT (sprintf (strchr (file1, '\0') - 2, "%02d", i) == 2); diff -r 04ce36b456cc -r 6758fa38915e tests/test-netdb-c++.cc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/test-netdb-c++.cc Fri May 06 08:15:59 2011 -0700 @@ -0,0 +1,42 @@ +/* Test of substitute in C++ mode. + Copyright (C) 2011 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +/* Written by Bruno Haible , 2011. */ + +#define GNULIB_NAMESPACE gnulib +#include + +#include + +#include "signature.h" + + +#if GNULIB_TEST_GETADDRINFO +SIGNATURE_CHECK (GNULIB_NAMESPACE::getaddrinfo, int, + (const char *, const char *, const struct addrinfo *, + struct addrinfo **)); +SIGNATURE_CHECK (GNULIB_NAMESPACE::freeaddrinfo, void, (struct addrinfo *)); +SIGNATURE_CHECK (GNULIB_NAMESPACE::gai_strerror, const char *, (int)); +SIGNATURE_CHECK (GNULIB_NAMESPACE::getnameinfo, int, + (const struct sockaddr *, socklen_t, char *, socklen_t, + char *, socklen_t, int)); +#endif + + +int +main () +{ +} diff -r 04ce36b456cc -r 6758fa38915e tests/test-nonblocking-misc.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/test-nonblocking-misc.h Fri May 06 08:15:59 2011 -0700 @@ -0,0 +1,108 @@ +/* Test for nonblocking read and write. + + Copyright (C) 2011 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +/* Whether to print debugging messages. */ +#define ENABLE_DEBUGGING 0 + +/* Delay (in microseconds) to sleep when write() or read() returned -1 with + errno = EAGAIN. */ +#define SMALL_DELAY 10000 + +/* Return a memory area, filled with the data to be transferred. */ +static unsigned char * +init_data (size_t data_block_size) +{ + unsigned char *data; + unsigned int i; + + data = (unsigned char *) malloc (2 * data_block_size); + ASSERT (data != NULL); + + for (i = 0; i < 2 * data_block_size; i++) + data[i] = (unsigned char) (i * i + (7 * i) % 61 + 4); + + return data; +} + +#if ENABLE_DEBUGGING +# include +static int dbgfprintf (FILE *fp, const char *format, ...) + _GL_ATTRIBUTE_FORMAT_PRINTF (2, 3); +static int +dbgfprintf (FILE *fp, const char *format, ...) +{ + /* Accumulate the entire line in a buffer, so that the output on fp + is done atomically. */ + char line[1024]; + size_t line_len; + struct timeval current_time; + va_list args; + int ret; + + line_len = 0; + gettimeofday (¤t_time, NULL); + ret = snprintf (line, sizeof (line), "%.6f ", + current_time.tv_sec + (double) current_time.tv_usec * 1e-6); + if (ret < 0) + return -1; + line_len = strlen (line); + + va_start (args, format); + ret = vsnprintf (line + line_len, sizeof (line) - line_len, format, args); + va_end (args); + if (ret < 0) + return -1; + line_len += strlen (line + line_len); + + ret = fwrite (line, 1, line_len, fp); + + /* Make sure the debugging information is output, so that the order of the + messages reflects the timeline of events, and so that the output is not + lost if the program crashes afterwards (relevant on mingw). */ + fflush (fp); + return ret; +} +#else +# define dbgfprintf if (1) ; else fprintf +#endif + +/* Return a textual description of the error code ERR, if FAILED is true. + Return an empty string if FAILED is false. */ +static const char * +dbgstrerror (bool failed, int err) +{ + static char buf[256]; + if (failed) + { + sprintf (buf, " %d %s", err, strerror (err)); + return buf; + } + else + return ""; +} + +#define TIMING_DECLS \ + struct timeval before_time; \ + struct timeval after_time; \ + double spent_time; +#define START_TIMING \ + gettimeofday (&before_time, NULL); +#define END_TIMING \ + gettimeofday (&after_time, NULL); \ + spent_time = \ + (after_time.tv_sec - before_time.tv_sec) \ + + ((double) after_time.tv_usec - (double) before_time.tv_usec) * 1e-6; diff -r 04ce36b456cc -r 6758fa38915e tests/test-nonblocking-pipe-child.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/test-nonblocking-pipe-child.c Fri May 06 08:15:59 2011 -0700 @@ -0,0 +1,50 @@ +/* Child program invoked by test-nonblocking-pipe-main. + + Copyright (C) 2011 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +#include + +#include +#include +#include +#include +#include +#include + +#include "binary-io.h" + +#include "macros.h" +#include "test-nonblocking-pipe.h" +#define PROG_ROLE "child" +#include "test-nonblocking-reader.h" + +int +main (int argc, char *argv[]) +{ + int test = atoi (argv[1]); + + /* Close unused file descriptors. */ + close (STDOUT_FILENO); + + /* STDIN_FILENO was created as binary in the parent process. But since an + fd's mode is stored in the process, not in the kernel, on native Windows + we need to set it as binary in the child process again. */ + SET_BINARY (STDIN_FILENO); + + main_reader_loop (test, PIPE_DATA_BLOCK_SIZE, STDIN_FILENO); + + return 0; +} diff -r 04ce36b456cc -r 6758fa38915e tests/test-nonblocking-pipe-main.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/test-nonblocking-pipe-main.c Fri May 06 08:15:59 2011 -0700 @@ -0,0 +1,110 @@ +/* Test for nonblocking read and write on pipes. + + Copyright (C) 2011 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +#include + +#include +#include +#include +#include +#include +#include + +#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ +# include +#else +# include +#endif + +#include "nonblocking.h" +#include "wait-process.h" + +#include "macros.h" +#include "test-nonblocking-pipe.h" +#define PROG_ROLE "main" +#include "test-nonblocking-writer.h" + +int +main (int argc, char *argv[]) +{ + const char *child_path = argv[1]; + int test = atoi (argv[2]); + int fd[2]; + int child; + int exitcode; + + /* Create a pipe. */ + ASSERT (pipe (fd) >= 0); + + /* Map fd[0] to STDIN_FILENO and fd[1] to STDOUT_FILENO, because on Windows, + the only three file descriptors that are inherited by child processes are + STDIN_FILENO, STDOUT_FILENO, STDERR_FILENO. */ + if (fd[0] != STDIN_FILENO) + { + ASSERT (dup2 (fd[0], STDIN_FILENO) >= 0); + close (fd[0]); + } + if (fd[1] != STDOUT_FILENO) + { + ASSERT (dup2 (fd[1], STDOUT_FILENO) >= 0); + close (fd[1]); + } + + /* Prepare the file descriptors. */ + if (test & 1) + ASSERT (set_nonblocking_flag (STDOUT_FILENO, true) >= 0); + if (test & 2) + ASSERT (set_nonblocking_flag (STDIN_FILENO, true) >= 0); + + /* Spawn the child process. */ + { + const char *child_argv[3]; + + child_argv[0] = child_path; + child_argv[1] = argv[2]; + child_argv[2] = NULL; + +#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ + child = spawnvpe (P_NOWAIT, child_path, child_argv, + (const char **) environ); + ASSERT (child >= 0); +#else + { + pid_t child_pid; + int err = + posix_spawnp (&child_pid, child_path, NULL, NULL, (char **) child_argv, + environ); + ASSERT (err == 0); + child = child_pid; + } +#endif + } + + /* Close unused file descriptors. */ + close (STDIN_FILENO); + + exitcode = + main_writer_loop (test, PIPE_DATA_BLOCK_SIZE, STDOUT_FILENO, false); + + { + int err = + wait_subprocess (child, child_path, false, false, false, false, NULL); + ASSERT (err == 0); + } + + return exitcode; +} diff -r 04ce36b456cc -r 6758fa38915e tests/test-nonblocking-pipe.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/test-nonblocking-pipe.h Fri May 06 08:15:59 2011 -0700 @@ -0,0 +1,38 @@ +/* Test for nonblocking read and write. + + Copyright (C) 2011 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +/* A data block ought to be larger than the size of the in-kernel buffer. + Working values of PIPE_DATA_BLOCK_SIZE, depending on kernel: + + Platform PIPE_DATA_BLOCK_SIZE + + Linux >= 63489 + FreeBSD, OpenBSD, MacOS X >= 65537 + AIX >= 32769 + HP-UX >= 8193 + IRIX >= 10241 + OSF/1 >= 262145 + Solaris <= 7 >= 10241 + Solaris >= 8 >= 20481 + Cygwin >= 65537 + native Win32 >= 4097 (depends on the _pipe argument) + */ +#if defined __osf__ +# define PIPE_DATA_BLOCK_SIZE 270000 +#else +# define PIPE_DATA_BLOCK_SIZE 70000 +#endif diff -r 04ce36b456cc -r 6758fa38915e tests/test-nonblocking-pipe.sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/test-nonblocking-pipe.sh Fri May 06 08:15:59 2011 -0700 @@ -0,0 +1,17 @@ +#!/bin/sh + +# Note: This test fails on Cygwin 1.5.x, because the non-blocking flag has +# apparently no effect on STDOUT_FILENO. It is fixed in Cygwin 1.7. + +# Test blocking write() with blocking read(). +# Commented out because this test succeeds on all platforms anyway. +#./test-nonblocking-pipe-main${EXEEXT} ./test-nonblocking-pipe-child${EXEEXT} 0 || exit 1 + +# Test non-blocking write() with blocking read(). +./test-nonblocking-pipe-main${EXEEXT} ./test-nonblocking-pipe-child${EXEEXT} 1 || exit 1 + +# Test blocking write() with non-blocking read(). +./test-nonblocking-pipe-main${EXEEXT} ./test-nonblocking-pipe-child${EXEEXT} 2 || exit 1 + +# Test non-blocking write() with non-blocking read(). +./test-nonblocking-pipe-main${EXEEXT} ./test-nonblocking-pipe-child${EXEEXT} 3 || exit 1 diff -r 04ce36b456cc -r 6758fa38915e tests/test-nonblocking-reader.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/test-nonblocking-reader.h Fri May 06 08:15:59 2011 -0700 @@ -0,0 +1,200 @@ +/* The reader part of a test program for non-blocking communication. + + Copyright (C) 2011 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +/* This program implements 4 tests: + + test == 0: + Test blocking write() with blocking read(). + + Timeline Main process Child process + 0 s Start Start, read(10000) + 1 s write(20000) Return from read(10000) + 2 s Next read(10000) + 2 s Return from write(20000) Return from read(10000) + + test == 1: + Test non-blocking write() with blocking read(). + + Timeline Main process Child process + 0 s Start Start, read(10000) + 1 s write(20000) Return from read(10000) + Return with at least 10000, + Repeatedly continue + write() of the rest + 2 s Next read(10000) + 2 s Return from write(10000) Return from read(10000) + + test == 2: + Test blocking write() with non-blocking read(). + + Timeline Main process Child process + 0 s Start Start, read(10000) + repeatedly polling + 1 s write(20000) Return from read(10000) + 2 s Next read(10000) + 2 s Return from write(20000) Return from read(10000) + + test == 3: + Test non-blocking write() with non-blocking read(). + */ + +#include "test-nonblocking-misc.h" + +static ssize_t +full_read (size_t fd, void *buf, size_t count) +{ + size_t bytes_read; + + bytes_read = 0; + while (bytes_read < count) + { + TIMING_DECLS + ssize_t ret; + int saved_errno; + + dbgfprintf (stderr, "%s: >> read (%lu)\n", PROG_ROLE, + (unsigned long) (count - bytes_read)); + START_TIMING + ret = read (fd, (char *) buf + bytes_read, count - bytes_read); + saved_errno = errno; + END_TIMING + dbgfprintf (stderr, "%s: << read -> %ld%s\n", PROG_ROLE, + (long) ret, dbgstrerror (ret < 0, saved_errno)); + if (ret < 0) + return -1; + else + { + ASSERT (ret > 0); + bytes_read += ret; + } + } + return bytes_read; +} + +static ssize_t +full_read_from_nonblocking_fd (size_t fd, void *buf, size_t count) +{ + size_t bytes_read; + + bytes_read = 0; + while (bytes_read < count) + { + TIMING_DECLS + ssize_t ret; + int saved_errno; + + dbgfprintf (stderr, "%s: >> read (%lu)\n", PROG_ROLE, + (unsigned long) (count - bytes_read)); + START_TIMING + ret = read (fd, (char *) buf + bytes_read, count - bytes_read); + saved_errno = errno; + END_TIMING + dbgfprintf (stderr, "%s: << read -> %ld%s\n", PROG_ROLE, + (long) ret, dbgstrerror (ret < 0, saved_errno)); + /* This assertion fails if the non-blocking flag is effectively not set + on fd. */ + ASSERT (spent_time < 0.5); + if (ret < 0) + { + ASSERT (saved_errno == EAGAIN); + usleep (SMALL_DELAY); + } + else + { + ASSERT (ret > 0); + bytes_read += ret; + } + } + return bytes_read; +} + +/* Execute the reader loop. */ +static void +main_reader_loop (int test, size_t data_block_size, int fd) +{ + unsigned char *expected; + unsigned char *data; + + /* Set up the expected data. */ + expected = init_data (data_block_size); + + data = (unsigned char *) malloc (2 * data_block_size); + ASSERT (data != NULL); + + switch (test) + { + TIMING_DECLS + ssize_t ret; + + case 0: /* Test blocking write() with blocking read(). */ + case 1: /* Test non-blocking write() with blocking read(). */ + START_TIMING + ret = full_read (fd, data, data_block_size); + END_TIMING + ASSERT (ret == data_block_size); + ASSERT (memcmp (data, expected, data_block_size) == 0); + ASSERT (spent_time > 0.5); + /* This assertion fails if data_block_size is very large and + ENABLE_DEBUGGING is 1. */ + ASSERT (spent_time < 1.5); + + usleep (1000000); + + START_TIMING + ret = full_read (fd, data, data_block_size); + END_TIMING + ASSERT (ret == data_block_size); + ASSERT (memcmp (data, expected + data_block_size, data_block_size) == 0); + /* This assertion fails if data_block_size is much larger than needed + and SMALL_DELAY is too large. */ + ASSERT (spent_time < 0.5); + + break; + + case 2: /* Test blocking write() with non-blocking read(). */ + case 3: /* Test non-blocking write() with non-blocking read(). */ + START_TIMING + ret = full_read_from_nonblocking_fd (fd, data, data_block_size); + END_TIMING + ASSERT (ret == data_block_size); + ASSERT (memcmp (data, expected, data_block_size) == 0); + ASSERT (spent_time > 0.5); + /* This assertion fails if data_block_size is much larger than needed + and SMALL_DELAY is too large, or if data_block_size is very large and + ENABLE_DEBUGGING is 1. */ + ASSERT (spent_time < 1.5); + + usleep (1000000); + + START_TIMING + ret = full_read_from_nonblocking_fd (fd, data, data_block_size); + END_TIMING + ASSERT (ret == data_block_size); + ASSERT (memcmp (data, expected + data_block_size, data_block_size) == 0); + /* This assertion fails if data_block_size is much larger than needed + and SMALL_DELAY is too large. */ + ASSERT (spent_time < 0.5); + + break; + + default: + abort (); + } + + free (data); + free (expected); +} diff -r 04ce36b456cc -r 6758fa38915e tests/test-nonblocking-socket-child.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/test-nonblocking-socket-child.c Fri May 06 08:15:59 2011 -0700 @@ -0,0 +1,52 @@ +/* Child program invoked by test-nonblocking-socket-main. + + Copyright (C) 2011 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +#include + +#include +#include +#include +#include +#include +#include + +#include "nonblocking.h" + +#include "macros.h" +#include "socket-client.h" +#include "test-nonblocking-socket.h" +#define PROG_ROLE "child" +#include "test-nonblocking-reader.h" + +int +main (int argc, char *argv[]) +{ + int test = atoi (argv[1]); + int port = atoi (argv[2]); + int client_socket; + + /* Create a client socket. */ + client_socket = create_client_socket (port); + + /* Prepare the file descriptor. */ + if (test & 2) + ASSERT (set_nonblocking_flag (client_socket, true) >= 0); + + main_reader_loop (test, SOCKET_DATA_BLOCK_SIZE, client_socket); + + return 0; +} diff -r 04ce36b456cc -r 6758fa38915e tests/test-nonblocking-socket-main.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/test-nonblocking-socket-main.c Fri May 06 08:15:59 2011 -0700 @@ -0,0 +1,121 @@ +/* Test for nonblocking read and write on sockets. + + Copyright (C) 2011 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +#include + +#include +#include +#include +#include +#include +#include +#include + +#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ +# include +#else +# include +#endif + +#include "nonblocking.h" +#include "wait-process.h" + +#include "macros.h" +#include "socket-server.h" +#include "test-nonblocking-socket.h" +#define PROG_ROLE "main" +#include "test-nonblocking-writer.h" + +int +main (int argc, char *argv[]) +{ + const char *child_path = argv[1]; + int test = atoi (argv[2]); + int server; + int port; + int child; + int server_socket; + int exitcode; + + /* Create a server socket. */ + server = create_server (0, 1, &port); + + /* Spawn the child process. */ + { + char port_arg[10+1]; + const char *child_argv[4]; + + sprintf (port_arg, "%u", port); + child_argv[0] = child_path; + child_argv[1] = argv[2]; + child_argv[2] = port_arg; + child_argv[3] = NULL; + +#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ + child = spawnvpe (P_NOWAIT, child_path, child_argv, + (const char **) environ); + ASSERT (child >= 0); +#else + { + pid_t child_pid; + int err = + posix_spawnp (&child_pid, child_path, NULL, NULL, (char **) child_argv, + environ); + ASSERT (err == 0); + child = child_pid; + } +#endif + } + + /* Accept a connection from the child process. */ + server_socket = create_server_socket (server); + + /* Prepare the file descriptor. */ + if (test & 1) + ASSERT (set_nonblocking_flag (server_socket, true) >= 0); + +#if ENABLE_DEBUGGING +# ifdef SO_SNDBUF + { + int value; + socklen_t value_len = sizeof (value); + if (getsockopt (server_socket, SOL_SOCKET, SO_SNDBUF, &value, &value_len) >= 0) + fprintf (stderr, "SO_SNDBUF = %d\n", value); + } +# endif +# ifdef SO_RCVBUF + { + int value; + socklen_t value_len = sizeof (value); + if (getsockopt (server_socket, SOL_SOCKET, SO_RCVBUF, &value, &value_len) >= 0) + fprintf (stderr, "SO_RCVBUF = %d\n", value); + } +# endif +#endif + + exitcode = + main_writer_loop (test, SOCKET_DATA_BLOCK_SIZE, server_socket, + SOCKET_HAS_LARGE_BUFFER); + + { + int err = + wait_subprocess (child, child_path, false, false, false, false, NULL); + ASSERT (err == 0); + } + + return exitcode; +} diff -r 04ce36b456cc -r 6758fa38915e tests/test-nonblocking-socket.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/test-nonblocking-socket.h Fri May 06 08:15:59 2011 -0700 @@ -0,0 +1,51 @@ +/* Test for nonblocking read and write. + + Copyright (C) 2011 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +/* A data block ought to be larger than the size of the in-kernel buffer. + Working values of SOCKET_DATA_BLOCK_SIZE, depending on kernel: + + Platform SOCKET_DATA_BLOCK_SIZE + + Linux >= 7350000 (depends on circumstances) + FreeBSD >= 107521 + OpenBSD >= 28673 + MacOS X >= 680000 (depends on circumstances) + AIX 5.1 >= 125713 + AIX 7.1 >= 200000 (depends on circumstances) + HP-UX >= 114689 + IRIX >= 61089 + OSF/1 >= 122881 + Solaris 7 >= 63000 (depends on circumstances) + Solaris 8 >= 49153 + Solaris 9 >= 73729 + Solaris 10 >= 98305 + Solaris 11 2010-11 >= 73729 + Cygwin 1.5.x >= 66294401 but then write() fails with ENOBUFS + Cygwin 1.7.x >= 163838 (depends on circumstances) + native Win32 >= 66294401 + */ +#define SOCKET_DATA_BLOCK_SIZE 1000000 + +/* On Linux, MacOS X, Cygwin 1.5.x, native Win32, + sockets have very large buffers in the kernel, so that write() calls + succeed before the reader has started reading, even if fd is blocking + and the amount of data is larger than 1 MB. */ +#if defined __linux__ || (defined __APPLE__ && defined __MACH__) || (defined _WIN32 || defined __WIN32__) || defined __CYGWIN__ +# define SOCKET_HAS_LARGE_BUFFER 1 +#else +# define SOCKET_HAS_LARGE_BUFFER 0 +#endif diff -r 04ce36b456cc -r 6758fa38915e tests/test-nonblocking-socket.sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/test-nonblocking-socket.sh Fri May 06 08:15:59 2011 -0700 @@ -0,0 +1,13 @@ +#!/bin/sh + +# Test blocking write() with blocking read(). +./test-nonblocking-socket-main${EXEEXT} ./test-nonblocking-socket-child${EXEEXT} 0 || exit 1 + +# Test non-blocking write() with blocking read(). +./test-nonblocking-socket-main${EXEEXT} ./test-nonblocking-socket-child${EXEEXT} 1 || exit 1 + +# Test blocking write() with non-blocking read(). +./test-nonblocking-socket-main${EXEEXT} ./test-nonblocking-socket-child${EXEEXT} 2 || exit 1 + +# Test non-blocking write() with non-blocking read(). +./test-nonblocking-socket-main${EXEEXT} ./test-nonblocking-socket-child${EXEEXT} 3 || exit 1 diff -r 04ce36b456cc -r 6758fa38915e tests/test-nonblocking-writer.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/test-nonblocking-writer.h Fri May 06 08:15:59 2011 -0700 @@ -0,0 +1,186 @@ +/* The writer part of a test program for non-blocking communication. + + Copyright (C) 2011 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +/* This program implements 4 tests: + + test == 0: + Test blocking write() with blocking read(). + + Timeline Main process Child process + 0 s Start Start, read(10000) + 1 s write(20000) Return from read(10000) + 2 s Next read(10000) + 2 s Return from write(20000) Return from read(10000) + + test == 1: + Test non-blocking write() with blocking read(). + + Timeline Main process Child process + 0 s Start Start, read(10000) + 1 s write(20000) Return from read(10000) + Return with at least 10000, + Repeatedly continue + write() of the rest + 2 s Next read(10000) + 2 s Return from write(10000) Return from read(10000) + + test == 2: + Test blocking write() with non-blocking read(). + + Timeline Main process Child process + 0 s Start Start, read(10000) + repeatedly polling + 1 s write(20000) Return from read(10000) + 2 s Next read(10000) + 2 s Return from write(20000) Return from read(10000) + + test == 3: + Test non-blocking write() with non-blocking read(). + */ + +#include "test-nonblocking-misc.h" + +/* Execute the writer loop. + Returns 0 if successful, 1 if data_block_size is too small. */ +static int +main_writer_loop (int test, size_t data_block_size, int fd, + bool has_large_buffer) +{ + int too_small = 0; + unsigned char *data; + + /* Set up the data to transfer. */ + data = init_data (data_block_size); + + switch (test) + { + TIMING_DECLS + ssize_t ret; + + case 0: /* Test blocking write() with blocking read(). */ + case 2: /* Test blocking write() with non-blocking read(). */ + { + int saved_errno; + + usleep (1000000); + + dbgfprintf (stderr, "%s:1: >> write (%lu)\n", PROG_ROLE, + (unsigned long) 2 * data_block_size); + START_TIMING + ret = write (fd, data, 2 * data_block_size); + saved_errno = errno; + END_TIMING + dbgfprintf (stderr, "%s:1: << write -> %ld%s\n", PROG_ROLE, + (long) ret, dbgstrerror (ret < 0, saved_errno)); + ASSERT (ret == 2 * data_block_size); + if (!has_large_buffer) + { + /* This assertion fails if data_block_size is too small. */ + if (!(spent_time > 0.5)) + { + fprintf (stderr, + "%s:1: spent_time = %g, data_block_size too small\n", + PROG_ROLE, spent_time); + too_small = 1; + } + } + ASSERT (spent_time < 1.5); + } + break; + + case 1: /* Test non-blocking write() with blocking read(). */ + case 3: /* Test non-blocking write() with non-blocking read(). */ + { + size_t bytes_written; + int saved_errno; + + usleep (1000000); + + bytes_written = 0; + while (bytes_written < 2 * data_block_size) + { + dbgfprintf (stderr, "%s:2: >> write (%lu)\n", PROG_ROLE, + (unsigned long) (2 * data_block_size - bytes_written)); + START_TIMING + ret = write (fd, data + bytes_written, + 2 * data_block_size - bytes_written); + saved_errno = errno; + END_TIMING + dbgfprintf (stderr, "%s:2: << write -> %ld%s\n", PROG_ROLE, + (long) ret, dbgstrerror (ret < 0, saved_errno)); + if (ret < 0 && bytes_written >= data_block_size) + { + ASSERT (saved_errno == EAGAIN); + ASSERT (spent_time < 0.5); + break; + } + /* This assertion fails if the non-blocking flag is effectively not + set on fd. */ + ASSERT (spent_time < 0.5); + if (ret < 0) + { + ASSERT (saved_errno == EAGAIN); + usleep (SMALL_DELAY); + } + else + { + /* This assertion fails if data_block_size is too small. */ + if (!(ret > 0)) + { + fprintf (stderr, + "%s:1: spent_time = %g, data_block_size too small\n", + PROG_ROLE, spent_time); + too_small = 1; + } + bytes_written += ret; + } + } + ASSERT (bytes_written >= data_block_size); + + while (bytes_written < 2 * data_block_size) + { + dbgfprintf (stderr, "%s:3: >> write (%lu)\n", PROG_ROLE, + (unsigned long) (2 * data_block_size - bytes_written)); + START_TIMING + ret = write (fd, data + bytes_written, + 2 * data_block_size - bytes_written); + saved_errno = errno; + END_TIMING + dbgfprintf (stderr, "%s:3: << write -> %ld%s\n", PROG_ROLE, + (long) ret, dbgstrerror (ret < 0, saved_errno)); + ASSERT (spent_time < 0.5); + if (ret < 0) + { + ASSERT (saved_errno == EAGAIN); + usleep (SMALL_DELAY); + } + else + { + ASSERT (ret > 0); + bytes_written += ret; + } + } + } + break; + + default: + abort (); + } + + free (data); + return too_small; +} diff -r 04ce36b456cc -r 6758fa38915e tests/test-nonblocking.c --- a/tests/test-nonblocking.c Fri Apr 01 16:04:45 2011 -0700 +++ b/tests/test-nonblocking.c Fri May 06 08:15:59 2011 -0700 @@ -33,13 +33,6 @@ const char *file = "test-nonblock.tmp"; int fd_file; int fd_pipe[2]; - int fd_sock; - bool sock_works = true; - -#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ - /* For now, we can't get nonblocking status of windows sockets. */ - sock_works = false; -#endif fd_file = creat (file, 0600); @@ -79,28 +72,39 @@ ASSERT (close (fd_pipe[1]) == 0); #if GNULIB_TEST_PIPE2 - /* mingw still lacks O_NONBLOCK replacement. */ ASSERT (pipe2 (fd_pipe, O_NONBLOCK) == 0); - ASSERT (get_nonblocking_flag (fd_pipe[0]) == !!O_NONBLOCK); - ASSERT (get_nonblocking_flag (fd_pipe[1]) == !!O_NONBLOCK); + ASSERT (get_nonblocking_flag (fd_pipe[0]) == 1); + ASSERT (get_nonblocking_flag (fd_pipe[1]) == 1); ASSERT (close (fd_pipe[0]) == 0); ASSERT (close (fd_pipe[1]) == 0); #endif /* GNULIB_TEST_PIPE2 */ - /* Test sockets. */ - fd_sock = socket (AF_INET, SOCK_STREAM, 0); - ASSERT (get_nonblocking_flag (fd_sock) == (sock_works ? 0 : -1)); - ASSERT (set_nonblocking_flag (fd_sock, true) == 0); - ASSERT (get_nonblocking_flag (fd_sock) == (sock_works ? 1 : -1)); - ASSERT (set_nonblocking_flag (fd_sock, false) == 0); - ASSERT (get_nonblocking_flag (fd_sock) == (sock_works ? 0 : -1)); - ASSERT (close (fd_sock) == 0); +#if GNULIB_TEST_SOCKET + { + /* Test sockets. */ + bool sock_works = true; + int fd_sock; + +# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ + /* For now, we can't get nonblocking status of windows sockets. */ + sock_works = false; +# endif -#if SOCK_NONBLOCK - fd_sock = socket (AF_INET, SOCK_STREAM | SOCK_NONBLOCK, 0); - ASSERT (get_nonblocking_flag (fd_sock) == (sock_works ? 1 : -1)); - ASSERT (close (fd_sock) == 0); -#endif /* SOCK_NONBLOCK */ + fd_sock = socket (AF_INET, SOCK_STREAM, 0); + ASSERT (get_nonblocking_flag (fd_sock) == (sock_works ? 0 : -1)); + ASSERT (set_nonblocking_flag (fd_sock, true) == 0); + ASSERT (get_nonblocking_flag (fd_sock) == (sock_works ? 1 : -1)); + ASSERT (set_nonblocking_flag (fd_sock, false) == 0); + ASSERT (get_nonblocking_flag (fd_sock) == (sock_works ? 0 : -1)); + ASSERT (close (fd_sock) == 0); + +# if SOCK_NONBLOCK + fd_sock = socket (AF_INET, SOCK_STREAM | SOCK_NONBLOCK, 0); + ASSERT (get_nonblocking_flag (fd_sock) == (sock_works ? 1 : -1)); + ASSERT (close (fd_sock) == 0); +# endif /* SOCK_NONBLOCK */ + } +#endif /* GNULIB_TEST_SOCKET */ /* Test error handling. */ { diff -r 04ce36b456cc -r 6758fa38915e tests/test-open.h --- a/tests/test-open.h Fri Apr 01 16:04:45 2011 -0700 +++ b/tests/test-open.h Fri May 06 08:15:59 2011 -0700 @@ -63,6 +63,12 @@ ASSERT (write (fd, "c", 1) == 1); ASSERT (close (fd) == 0); + /* Although O_NONBLOCK on regular files can be ignored, it must not + cause a failure. */ + fd = func (BASE "file", O_NONBLOCK | O_RDONLY); + ASSERT (0 <= fd); + ASSERT (close (fd) == 0); + /* Symlink handling, where supported. */ if (symlink (BASE "file", BASE "link") != 0) { diff -r 04ce36b456cc -r 6758fa38915e tests/test-passfd.c --- a/tests/test-passfd.c Fri Apr 01 16:04:45 2011 -0700 +++ b/tests/test-passfd.c Fri May 06 08:15:59 2011 -0700 @@ -18,6 +18,7 @@ #include "passfd.h" +#include #include #include #include @@ -33,6 +34,7 @@ int main () { +#if HAVE_SOCKETPAIR int pair[2]; int ret; pid_t pid; @@ -41,11 +43,11 @@ int fd; struct stat st; -#if HAVE_DECL_ALARM +# if HAVE_DECL_ALARM /* Avoid hanging on failure. */ signal (SIGALRM, SIG_DFL); alarm (5); -#endif +# endif fdnull = open ("/dev/null", O_RDWR); if (fdnull < 0) @@ -115,4 +117,17 @@ } return 0; } +#else + errno = 0; + ASSERT(sendfd (0, 0) == -1); + ASSERT(errno == ENOSYS); + + errno = 0; + ASSERT(recvfd (0, 0) == -1); + ASSERT(errno == ENOSYS); + + fputs ("skipping test: socketpair not supported on this system\n", + stderr); + return 77; +#endif } diff -r 04ce36b456cc -r 6758fa38915e tests/test-pipe2.c --- a/tests/test-pipe2.c Fri Apr 01 16:04:45 2011 -0700 +++ b/tests/test-pipe2.c Fri May 06 08:15:59 2011 -0700 @@ -33,6 +33,7 @@ #include "binary-io.h" #include "macros.h" +#include "nonblocking.h" /* Return true if FD is open. */ static bool @@ -67,49 +68,23 @@ #endif } -/* Return true if FD is in non-blocking mode. */ -static bool -is_nonblocking (int fd) -{ -#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ - /* We don't use the non-blocking mode for sockets here. */ - return 0; -#else - int flags; - ASSERT ((flags = fcntl (fd, F_GETFL)) >= 0); - return (flags & O_NONBLOCK) != 0; -#endif -} - int main () { int use_nonblocking; int use_cloexec; -#if !((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__) for (use_nonblocking = 0; use_nonblocking <= 1; use_nonblocking++) -#else - use_nonblocking = 0; -#endif -#if O_CLOEXEC - for (use_cloexec = 0; use_cloexec <= 1; use_cloexec++) -#else - use_cloexec = 0; -#endif + for (use_cloexec = 0; use_cloexec <= !!O_CLOEXEC; use_cloexec++) { int o_flags; int fd[2]; o_flags = 0; -#if !((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__) if (use_nonblocking) o_flags |= O_NONBLOCK; -#endif -#if O_CLOEXEC if (use_cloexec) o_flags |= O_CLOEXEC; -#endif fd[0] = -1; fd[1] = -1; @@ -131,14 +106,17 @@ } if (use_nonblocking) { - ASSERT (is_nonblocking (fd[0])); - ASSERT (is_nonblocking (fd[1])); + ASSERT (get_nonblocking_flag (fd[0]) == 1); + ASSERT (get_nonblocking_flag (fd[1]) == 1); } else { - ASSERT (!is_nonblocking (fd[0])); - ASSERT (!is_nonblocking (fd[1])); + ASSERT (get_nonblocking_flag (fd[0]) == 0); + ASSERT (get_nonblocking_flag (fd[1]) == 0); } + + ASSERT (close (fd[0]) == 0); + ASSERT (close (fd[1]) == 0); } return 0; diff -r 04ce36b456cc -r 6758fa38915e tests/test-renameat.c --- a/tests/test-renameat.c Fri Apr 01 16:04:45 2011 -0700 +++ b/tests/test-renameat.c Fri May 06 08:15:59 2011 -0700 @@ -33,7 +33,6 @@ #include #include "filenamecat.h" -#include "xgetcwd.h" #include "ignore-value.h" #include "macros.h" @@ -79,7 +78,8 @@ dfd = creat (BASE "00", 0600); ASSERT (0 <= dfd); ASSERT (close (dfd) == 0); - cwd = xgetcwd (); + cwd = getcwd (NULL, 0); + ASSERT (cwd); dfd = open (BASE "sub1", O_RDONLY); ASSERT (0 <= dfd); diff -r 04ce36b456cc -r 6758fa38915e tests/test-stdio-c++.cc --- a/tests/test-stdio-c++.cc Fri Apr 01 16:04:45 2011 -0700 +++ b/tests/test-stdio-c++.cc Fri May 06 08:15:59 2011 -0700 @@ -36,6 +36,14 @@ SIGNATURE_CHECK (GNULIB_NAMESPACE::fflush, int, (FILE *)); #endif +#if GNULIB_TEST_FGETC +SIGNATURE_CHECK (GNULIB_NAMESPACE::fgetc, int, (FILE *)); +#endif + +#if GNULIB_TEST_FGETS +SIGNATURE_CHECK (GNULIB_NAMESPACE::fgets, char *, (char *, int, FILE *)); +#endif + #if GNULIB_TEST_FOPEN SIGNATURE_CHECK (GNULIB_NAMESPACE::fopen, FILE *, (const char *, const char *)); @@ -57,11 +65,20 @@ SIGNATURE_CHECK (GNULIB_NAMESPACE::fputs, int, (const char *, FILE *)); #endif +#if GNULIB_TEST_FREAD +SIGNATURE_CHECK (GNULIB_NAMESPACE::fread, size_t, + (void *, size_t, size_t, FILE *)); +#endif + #if GNULIB_TEST_FREOPEN SIGNATURE_CHECK (GNULIB_NAMESPACE::freopen, FILE *, (const char *, const char *, FILE *)); #endif +#if GNULIB_TEST_FSCANF +SIGNATURE_CHECK (GNULIB_NAMESPACE::fscanf, int, (FILE *, const char *, ...)); +#endif + #if GNULIB_TEST_FSEEK SIGNATURE_CHECK (GNULIB_NAMESPACE::fseek, int, (FILE *, long, int)); #endif @@ -83,6 +100,14 @@ (const void *, size_t, size_t, FILE *)); #endif +#if GNULIB_TEST_GETC +SIGNATURE_CHECK (GNULIB_NAMESPACE::getc, int, (FILE *)); +#endif + +#if GNULIB_TEST_GETCHAR +SIGNATURE_CHECK (GNULIB_NAMESPACE::getchar, int, (void)); +#endif + #if GNULIB_TEST_GETDELIM SIGNATURE_CHECK (GNULIB_NAMESPACE::getdelim, ssize_t, (char **, size_t *, int, FILE *)); @@ -93,6 +118,10 @@ (char **, size_t *, FILE *)); #endif +#if GNULIB_TEST_GETS +SIGNATURE_CHECK (GNULIB_NAMESPACE::gets, char *, (char *)); +#endif + #if GNULIB_TEST_OBSTACK_PRINTF || GNULIB_TEST_OBSTACK_PRINTF_POSIX SIGNATURE_CHECK (GNULIB_NAMESPACE::obstack_printf, int, (struct obstack *, const char *, ...)); @@ -140,6 +169,10 @@ (int, char const *, int, char const *)); #endif +#if GNULIB_TEST_SCANF +SIGNATURE_CHECK (GNULIB_NAMESPACE::scanf, int, (const char *, ...)); +#endif + #if GNULIB_TEST_SNPRINTF SIGNATURE_CHECK (GNULIB_NAMESPACE::snprintf, int, (char *, size_t, const char *, ...)); @@ -170,10 +203,19 @@ (FILE *, const char *, va_list)); #endif +#if GNULIB_TEST_VFSCANF +SIGNATURE_CHECK (GNULIB_NAMESPACE::vfscanf, int, + (FILE *, const char *, va_list)); +#endif + #if GNULIB_TEST_VPRINTF_POSIX || GNULIB_TEST_VPRINTF SIGNATURE_CHECK (GNULIB_NAMESPACE::vprintf, int, (const char *, va_list)); #endif +#if GNULIB_TEST_VSCANF +SIGNATURE_CHECK (GNULIB_NAMESPACE::vscanf, int, (const char *, va_list)); +#endif + #if GNULIB_TEST_VSNPRINTF SIGNATURE_CHECK (GNULIB_NAMESPACE::vsnprintf, int, (char *, size_t, const char *, va_list)); diff -r 04ce36b456cc -r 6758fa38915e tests/test-sys_socket.c --- a/tests/test-sys_socket.c Fri Apr 01 16:04:45 2011 -0700 +++ b/tests/test-sys_socket.c Fri May 06 08:15:59 2011 -0700 @@ -30,6 +30,12 @@ /* Check that the 'socklen_t' type is defined. */ socklen_t t1; +/* Check that 'struct iovec' is defined. */ +struct iovec io; + +/* Check that a minimal set of 'struct msghdr' is defined. */ +struct msghdr msg; + int main (void) { @@ -51,10 +57,8 @@ x.ss_family = 42; i = 42; + msg.msg_iov = &io; - /* Tell the compiler that these variables are used. */ - (void) x; - (void) i; - - return 0; + return (x.ss_family - i + msg.msg_namelen + msg.msg_iov->iov_len + + msg.msg_iovlen); } diff -r 04ce36b456cc -r 6758fa38915e tests/test-sys_uio.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/test-sys_uio.c Fri May 06 08:15:59 2011 -0700 @@ -0,0 +1,32 @@ +/* Test of substitute. + Copyright (C) 2011 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +/* Written by Eric Blake , 2011. */ + +#include + +#include + +/* Check that necessary types are defined. */ +size_t a; +ssize_t b; +struct iovec c; + +int +main (void) +{ + return a + b + !!c.iov_base + c.iov_len; +} diff -r 04ce36b456cc -r 6758fa38915e top/README-release --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/top/README-release Fri May 06 08:15:59 2011 -0700 @@ -0,0 +1,89 @@ +Here are most of the steps we (maintainers) follow when making a release. + +* start from a clean, up-to-date git directory. + + git checkout master; git pull + +* Run ./configure && make maintainer-clean + +* Ensure that the desired versions of autoconf, automake, etc. + are in your PATH. See the buildreq list in bootstrap.conf for + the complete list. + +* Ensure that you're on "master" with no uncommitted diffs. + This should produce no output: git checkout master; git diff + +* Ensure that you've pushed all changes that belong in the release + and that the NixOS/Hydra autobuilder is reporting all is well: + + http://hydra.nixos.org/jobset/gnu/@PACKAGE@-master + +* Run bootstrap one last time. This downloads any new translations: + + ./bootstrap + +* Pre-release testing: + Ensure that make check syntax-check succeeds. + +* Run "make distcheck" + +* Set the date, version number, and release type [stable/alpha/beta] on + line 3 of NEWS, commit that, and tag the release by running e.g., + + build-aux/do-release-commit-and-tag X.Y stable + +* Run the following to create release tarballs. Your choice selects the + corresponding upload-to destination in the emitted gnupload command. + The different destinations are specified in cfg.mk. See the definitions + of gnu_ftp_host-{alpha,beta,stable}. + + # "TYPE" must be stable, beta or alpha + make TYPE + +* Test the tarball. copy it to a few odd-ball systems and ensure that + it builds and passes all tests. + +* While that's happening, write the release announcement that you will + soon post. Start with the template, $HOME/announce-@PACKAGE@-X.Y + that was just created by that "make" command. + +Once all the builds and tests have passed, + +* Run the gnupload command that was suggested by your "make stable" run above. + +* Wait a few minutes (maybe up to 30?) and then use the release URLs to + download all tarball/signature pairs and use gpg --verify to ensure + that they're all valid. + +* Push the NEWS-updating changes and the new tag: + + v=$(cat .prev-version) + git push origin master tag v$v + +* Announce it on Savannah first, so you can include the preferable + savannah.org announcement link in the email message. + + From here: + https://savannah.gnu.org/projects/@PACKAGE@/ + click on the "submit news", then write something like the following: + (If there is no such button, then enable "News" for the project via + the Main -> "Select Features" menu item, or via this link: + https://savannah.gnu.org/project/admin/editgroupfeatures.php?group=@PACKAGE@) + + Subject: @PACKAGE@-X.Y released [stable] + +verbatim+ + ...paste the announcement here... + -verbatim- + + Then go here to approve it: + https://savannah.gnu.org/news/approve.php?group=@PACKAGE@ + +* Send the announcement email message. + +* After each non-alpha release, update the on-line manual accessible via + + http://www.gnu.org/software/@PACKAGE@/manual/ + + by running this: + + build-aux/gnu-web-doc-update diff -r 04ce36b456cc -r 6758fa38915e top/maint.mk --- a/top/maint.mk Fri Apr 01 16:04:45 2011 -0700 +++ b/top/maint.mk Fri May 06 08:15:59 2011 -0700 @@ -33,7 +33,6 @@ GIT = git VC = $(GIT) -VC-tag = git tag -s -m '$(VERSION)' 'v$(VERSION)' -u '$(gpg_key_ID)' VC_LIST = $(build_aux)/vc-list-files -C $(srcdir) @@ -823,8 +822,8 @@ END { exit defined $$fail } sc_prohibit_empty_lines_at_EOF: @perl -le '$(require_exactly_one_NL_at_EOF_)' $$($(VC_LIST_EXCEPT)) \ - || { echo '$(ME): empty line(s) or no newline at EOF' \ - 1>&2; exit 1; } || :; \ + || { echo '$(ME): empty line(s) or no newline at EOF' \ + 1>&2; exit 1; } || : # Make sure we don't use st_blocks. Use ST_NBLOCKS instead. # This is a bit of a kludge, since it prevents use of the string @@ -841,6 +840,31 @@ halt='do not define S_IS* macros; include ' \ $(_sc_search_regexp) +prohibit_doubled_word_RE_ ?= \ + /\b(then?|[iao]n|i[fst]|but|f?or|at|and|[dt]o)\s+\1\b/gims +prohibit_doubled_word_ = \ + -e 'while ($(prohibit_doubled_word_RE_))' \ + -e ' {' \ + -e ' $$n = ($$` =~ tr/\n/\n/ + 1);' \ + -e ' ($$v = $$&) =~ s/\n/\\n/g;' \ + -e ' print "$$ARGV:$$n:$$v\n";' \ + -e ' }' + +# Define this to a regular expression that matches +# any filename:dd:match lines you want to ignore. +# The default is to ignore no matches. +ignore_doubled_word_match_RE_ ?= ^$$ + +sc_prohibit_doubled_word: + @perl -n -0777 $(prohibit_doubled_word_) $$($(VC_LIST_EXCEPT)) \ + | grep -vE '$(ignore_doubled_word_match_RE_)' \ + | grep . && { echo '$(ME): doubled words' 1>&2; exit 1; } || : + +sc_prohibit_can_not: + @prohibit='\' \ + halt='use "cannot", not "can'' not"' \ + $(_sc_search_regexp) + _ptm1 = use "test C1 && test C2", not "test C1 -''a C2" _ptm2 = use "test C1 || test C2", not "test C1 -''o C2" # Using test's -a and -o operators is not portable. @@ -917,16 +941,23 @@ # Ensure that we use only the standard $(VAR) notation, # not @...@ in Makefile.am, now that we can rely on automake # to emit a definition for each substituted variable. -# We use perl rather than "grep -nE ..." to exempt a single -# use of an @...@-delimited variable name in src/Makefile.am. +# However, there is still one case in which @VAR@ use is not just +# legitimate, but actually required: when augmenting an automake-defined +# variable with a prefix. For example, gettext uses this: +# MAKEINFO = env LANG= LC_MESSAGES= LC_ALL= LANGUAGE= @MAKEINFO@ +# otherwise, makeinfo would put German or French (current locale) +# navigation hints in the otherwise-English documentation. +# # Allow the package to add exceptions via a hook in cfg.mk; # for example, @PRAGMA_SYSTEM_HEADER@ can be permitted by # setting this to ' && !/PRAGMA_SYSTEM_HEADER/'. _makefile_at_at_check_exceptions ?= sc_makefile_at_at_check: - @perl -ne '/\@[A-Z_0-9]+\@/'$(_makefile_at_at_check_exceptions) \ + @perl -ne '/\@[A-Z_0-9]+\@/' \ + -e ' && !/([A-Z_0-9]+)\s+=.*\@\1\@$$/' \ + -e ''$(_makefile_at_at_check_exceptions) \ -e 'and (print "$$ARGV:$$.: $$_"), $$m=1; END {exit !$$m}' \ - $$($(VC_LIST_EXCEPT) | grep -E '(^|/)Makefile\.am$$') \ + $$($(VC_LIST_EXCEPT) | grep -E '(^|/)(Makefile\.am|[^/]+\.mk)$$') \ && { echo '$(ME): use $$(...), not @...@' 1>&2; exit 1; } || : news-check: NEWS @@ -1092,11 +1123,20 @@ | sed -n '/.*key ID \([0-9A-F]*\)/s//\1/p'; rm -f .ann-sig) translation_project_ ?= coordinator@translationproject.org -announcement_Cc_ ?= $(translation_project_), $(PACKAGE_BUGREPORT) -announcement_mail_headers_ ?= \ -To: info-gnu@gnu.org \ -Cc: $(announcement_Cc_) \ -Mail-Followup-To: $(PACKAGE_BUGREPORT) + +# Make info-gnu the default only for a stable release. +ifeq ($(RELEASE_TYPE),stable) + announcement_Cc_ ?= $(translation_project_), $(PACKAGE_BUGREPORT) + announcement_mail_headers_ ?= \ + To: info-gnu@gnu.org \ + Cc: $(announcement_Cc_) \ + Mail-Followup-To: $(PACKAGE_BUGREPORT) +else + announcement_Cc_ ?= $(translation_project_) + announcement_mail_headers_ ?= \ + To: $(PACKAGE_BUGREPORT) \ + Cc: $(announcement_Cc_) +endif announcement: NEWS ChangeLog $(rel-files) @$(build_aux)/announce-gen \ diff -r 04ce36b456cc -r 6758fa38915e users.txt --- a/users.txt Fri Apr 01 16:04:45 2011 -0700 +++ b/users.txt Fri May 06 08:15:59 2011 -0700 @@ -7,6 +7,7 @@ anubis http://cvs.sv.gnu.org/viewcvs/anubis/anubis/ augeas http://augeas.net/ autobuild http://josefsson.org/autobuild/ + barcode http://git.sv.gnu.org/cgit/barcode.git/ bison http://git.sv.gnu.org/gitweb/?p=bison.git clisp http://clisp.cvs.sourceforge.net/clisp/clisp/ coreutils http://git.sv.gnu.org/gitweb/?p=coreutils.git