Jose E. Marchesi [Sun, 28 Mar 2010 11:35:24 +0000 (13:35 +0200)]
maint.mk: match 0 or more whitespace-before-function-call '('
* top/maint.mk (sc_error_exit_success): Relax regexp to match uses
that have zero or two-and-more spaces between the function name
and the open parenthesis.
(sc_error_message_warn_fatal): Likewise.
(sc_error_message_uppercase): Likewise.
(sc_error_message_period): Likewise.
Eric Blake [Wed, 31 Mar 2010 21:33:55 +0000 (15:33 -0600)]
maint.mk: check for [ as well as test
A word on the regex: \<\[ never matches, so the match instead
looks for a leading space in that case. Although configure.ac
should generally use test instead of [ (because the latter has
to be spelled [[ because of m4 processing), libvirt had a case
of the latter that would have been detected with this rule.
* top/maint.mk (sc_prohibit_test_minus_ao): Extend test.
Based on a libvirt report by Matthias Bolte.
Eric Blake [Tue, 30 Mar 2010 21:56:17 +0000 (15:56 -0600)]
gnumakefile: don't squelch _version output
Borrowing from a trick I discovered on the libvirt list.
More details about how this trick works:
GNU make parses all Makefiles, then checks whether they are
up-to-date, all before making anything else; if any Makefile
timestamps change, then it restarts with the original arguments and
repeats the check for up-to-date Makefiles (assuming that this time
the check will pass). Since all the rules are parsed before Makefile
is updated, proceeding without reloading Makefiles would result in the
use of the stale $(VERSION) string that was in effect when we first
started, so we must update a timestamp to force the reload. However,
if we made Makefile depend on _version, we would end up running
_version twice. So instead, we make _version run a recursive make to
update Makefile (the recursive make skips the rules for checking
whether the version string needs an update, avoiding any extra runs of
_version), then ensure that GNUmakefile has an updated timestamp to
force the reload of the updated Makefile.
* top/GNUmakefile (GNUmakefile): Create one-shot dependency rather
than using $(shell) to run _version target.
(_autoreconf): Run verbosely, by default.
Eric Blake [Tue, 30 Mar 2010 14:47:41 +0000 (08:47 -0600)]
maint: improve module indicators
* m4/gnulib-common.m4 (gl_MODULE_INDICATOR_SET_VARIABLE)
(gl_MODULE_INDICATOR, gl_MODULE_INDICATOR_FOR_TESTS): Fit in 80
columns, and avoid extra macro expansion.
Eric Blake [Mon, 29 Mar 2010 21:08:59 +0000 (15:08 -0600)]
fdopendir: work around FreeBSD bug
Without a declaration, at least tar would core dump on 64-bit
FreeBSD because gcc only used 32 bits of the resulting pointer.
* m4/dirent_h.m4 (gl_DIRENT_H_DEFAULTS): New witness.
* m4/fdopendir.m4 (gl_FUNC_FDOPENDIR): Set it.
* modules/dirent (Makefile.am): Substitute it.
* lib/dirent.in.h (fdopendir): Supply missing FreeBSD
declaration.
* doc/posix-functions/fdopendir.texi (fdopendir): Document the
fix.
Reported by Christian Weisgerber <naddy@mips.inka.de>.
Eric Blake [Thu, 25 Mar 2010 22:28:02 +0000 (16:28 -0600)]
maint: use pragma consistently across replacement headers
Several headers set #pragma GCC system_header prior to checking
any multiple inclusion guards; maintenance is easiest if all
replacement headers follow the same paradigm.
Eric Blake [Wed, 24 Mar 2010 23:25:49 +0000 (17:25 -0600)]
arpa/inet: fix mingw compilation warning
Mingw doesn't have <arpa/inet.h>, so a conditional use of the
pragma was never encountered, and led to mingw's gcc issuing
warnings about duplicate declarations under -Wredundant-decls.
Making the #pragma unconditional (as was already done in at
least fcntl.in.h) shuts up gcc.
* lib/arpa_inet.in.h (system_header): Hoist to be unconditional.
Reported by Matthew Bolte.
Eric Blake [Fri, 19 Mar 2010 22:57:28 +0000 (16:57 -0600)]
gethostname: fix build on mingw
Since commit 4e86671a, gethostname failed to compile on mingw.
Gnulib's sys/socket.h includes winsock2.h, which then includes
unistd.h prior to declaring gethostname. The fix is to ensure
that our replacement unistd.h does not declare any replacements
until we are sure that winsock2.h is completely included.
* lib/unistd.in.h (includes): Work around fact that mingw
<winsock2.h> re-includes <unistd.h>, by avoiding any
redeclarations if we are being included by <winsock2.h>.
Reported by Matthias Bolte.
Jim Meyering [Fri, 19 Mar 2010 20:26:36 +0000 (21:26 +0100)]
regcomp.c: make non-_LIBC implementation of build_range_exp consistent
The _LIBC implementation of build_range_exp correctly honors the
RE_NO_EMPTY_RANGES flag when checking for reversed range endpoints.
However, the non-_LIBC implementation would ignore that syntax-bit
flag and return REG_ERANGE unconditionally.
This change makes it honor that flag.
* lib/regcomp.c (build_range_exp) [!_LIBC]: Add a parameter: "syntax".
Make two pointer parameters "const".
Use "syntax" bits in order to honor RE_NO_EMPTY_RANGES.
(parse_bracket_exp): Update caller.
Jim Meyering [Fri, 19 Mar 2010 20:43:30 +0000 (21:43 +0100)]
regex.m4: correct the reversed range endpoint ([b-a]) test
* m4/regex.m4: When requiring that [b-a] evoke failure,
use RE_NO_EMPTY_RANGES. This makes this entire configure-time
test pass once again for x86-based systems.
Eric Blake [Thu, 18 Mar 2010 19:49:25 +0000 (13:49 -0600)]
forkpty, openpty: split functions into new modules
The pty module was doing too much - replacing the header and checking
for functions. In the future, when we provide a working forkpty for
Solaris and HP-UX, and a stub for mingw, then the separation will be
even more useful.
* modules/pty (Makefile.am): Substitute new witnesses.
(Libraries): Move library detection...
* modules/forkpty: ...into new module.
* modules/openpty: Another new module.
* modules/pty-tests: Rename and split...
* modules/forkpty-tests: ...to this...
* modules/openpty-tests: ...and this.
* tests/test-pty.c: Rename and split...
* tests/test-forkpty.c: ...to this...
* tests/test-openpty.c: ...and this.
* m4/pty_h.m4 (gl_PTY_H_DEFAULTS): Add new witnesses.
(gl_PTY): Split library searching...
* m4/pty.m4 (gl_PTY_LIB): ...into new file.
(gl_FORKPTY, gl_OPENPTY): New macros.
* lib/pty.in.h (forkpty, openpty): Honor new witnesses.
* NEWS: Mention the split.
* MODULES.html.sh (Misc): Document the modules.
* doc/glibc-functions/forkpty.texi (forkpty): Likewise.
* doc/glibc-functions/openpty.texi (openpty): Likewise.
Eric Blake [Thu, 18 Mar 2010 16:23:10 +0000 (10:23 -0600)]
pty: improve replacement header
Build pty.h in the same way as all other replacement headers.
* lib/pty.in.h: New file.
* modules/pty (Files): Ship it.
(Makefile.am): Always build replacement.
* m4/pty.m4: Rename...
* m4/pty_h.m4: ...to this.
(gl_PTY): Modernize setting of witness macros; update check of
forkpty to take proper advantage of cache.
(gl_PTY_MODULE_INDICATOR, gl_PTY_H_DEFAULTS): New macros.