maint.mk: fix strict vs. lazy variable issues with RELEASE
* top/maint.mk (equal): New function.
(member_check): Strip the result to avoid spurious spaces.
(url_dir_list): Do not use ifeq, which is strict, as it will
require RELEASE_TYPE to be defined.
(announcement_Cc_, announcement_mail_headers_): Likewise: instead
of relying on ifeq, use $(release_type) to dispatch (lazily) onto...
(announcement_Cc_alpha,announcement_mail_headers_alpha)
(announcement_Cc_beta,announcement_mail_headers_beta)
(announcement_Cc_stable,announcement_mail_headers_stable): these.
(release): Do not depend on $(release-type), as it forces its
evaluation. Bounce to it.
See <http://lists.gnu.org/archive/html/bug-gnulib/2012-08/msg00028.html>.
Do not depend simply on the current $(VERSION), as there may have been
new commits since the tarball generation. Rather, rely on $(RELEASE),
as "make release-commit" already does.
For consistency, add "make release RELEASE='X.Y TYPE'" as an alias for
"make TYPE".
* top/maint.mk (upload_command, upload, release): New.
(RELEASE_TYPE): If undefined, default to the second word of $(RELEASE).
(VERSION): first word of $(RELEASE) is always right.
(emit_upload_commands): Adjust.
* top/README-release: Update.
With help from Jim Meyering.
http://lists.gnu.org/archive/html/bug-gnulib/2012-09/msg00132.html
* top/maint.mk (_empty, _sp): Move their definition earlier.
(member-check, release-type): New.
Use the latter instead of $(RELEASE_TYPE).
Remove now useless local checks.
Paul Eggert [Mon, 24 Sep 2012 19:41:27 +0000 (12:41 -0700)]
localename: port gl_locale_name_thread_unsafe to FreeBSD
* lib/localename.c (gl_locale_name_thread_unsafe): Port to FreeBSD,
and use the simpler FreeBSD implementation on Mac OS X as well.
Original idea suggested by Ed Maste in
<http://lists.gnu.org/archive/html/bug-gnulib/2012-09/msg00094.html>.
Paul Eggert [Thu, 30 Aug 2012 05:17:49 +0000 (22:17 -0700)]
pipe-filter-gi, pipe-filter-ii: better use of 'inline'
* lib/pipe-filter-aux.c: New file.
* lib/pipe-filter-aux.h (PIPE_FILTER_AUX_INLINE): New macro.
Replace all uses of 'static inline' with it.
Use _GL_INLINE_HEADER_BEGIN, _GL_INLINE_HEADER_END.
* lib/pipe-filter-gi.c (filter_init, filter_cleanup)
(filter_retcode): No real need for inline here.
* modules/pipe-filter-gi, modules/pipe-filter-ii:
(Files): Add lib/pipe-filter-aux.c.
(Depends-on): Add extern-inline.
(configure.ac): Do not require AC_C_INLINE.
(lib_SOURCES): Add pipe-filter-aux.c.
Paul Eggert [Thu, 30 Aug 2012 00:59:49 +0000 (17:59 -0700)]
sockets, sys_stat: remove AC_C_INLINE in MSVC-only cases
* m4/sockets.m4 (gl_SOCKETS):
* m4/sys_stat_h.m4 (gl_HEADER_SYS_STAT_H):
Remove AC_C_INLINE. Here, 'inline' is used only in MSVC
environments where it's already guaranteed to work, so we needn't
check for it at 'configure'-time.
Paul Eggert [Tue, 28 Aug 2012 05:57:47 +0000 (22:57 -0700)]
misc: don't limit commentary to inline functions
* lib/binary-io.h, lib/malloca.h, lib/safe-alloc.c:
* lib/xalloc-oversized.h, lib/xsize.h:
Contrast macros to functions in general, not just to inline functions,
when the commentary does not apply only to inline functions.
Jim Meyering [Thu, 20 Sep 2012 12:02:36 +0000 (14:02 +0200)]
non-recursive-gnulib-prefix-hack: new module
* build-aux/prefix-gnulib-mk: Copied from coreutils, derived from
the file that originated in Bison.
* m4/non-recursive-gnulib-prefix-hack.m4: Likewise, this code is
largely copied from a snippet that resided in bison's configure.ac.
* modules/non-recursive-gnulib-prefix-hack: New file.
* MODULES.html.sh (Support for maintaining and releasing projects):
Add it.
Jim Meyering [Tue, 18 Sep 2012 14:25:19 +0000 (16:25 +0200)]
maint.mk: generalize _gl_tight_scope for non-recursive make
* top/maint.mk (_gl_tight_scope): Remove a hard-coded assumption
that *.h would describe additional .h files in the directory
specified by $(_gl_TS_dir). I.e., add this...
(_gl_TS_other_headers): New variable.
Jim Meyering [Tue, 18 Sep 2012 06:49:59 +0000 (08:49 +0200)]
maint.mk: exempt trailing blanks found in "binary" files
* top/maint.mk (sc_trailing_blank): Filter out any matches found in
"binary" files, as reported by grep. Suggested by Richard W.M. Jones
in http://thread.gmane.org/gmane.comp.emulators.guestfs/1902
Jim Meyering [Mon, 17 Sep 2012 09:38:36 +0000 (11:38 +0200)]
maint.mk: sc_prohibit_path_max_allocation: don't FP for UNIX_PATH_MAX
* top/maint.mk (sc_prohibit_path_max_allocation): Avoid false-positive
match for symbols like UNIX_PATH_MAX. Reported by Richard W.M. Jones
in http://thread.gmane.org/gmane.comp.emulators.guestfs/1902
Jim Meyering [Mon, 17 Sep 2012 09:34:44 +0000 (11:34 +0200)]
maint.mk: teach sc_prohibit_magic_number_exit to accept 77
* top/maint.mk (sc_prohibit_magic_number_exit): Do not complain about
uses like "exit (77)". "77" is automake's "skip this test" exit code.
It is not in the same category as "exit (0)" or "exit (1)", and
besides, I know of no symbolic name for that 77. Reported by
Richard W.M. Jones in
http://thread.gmane.org/gmane.comp.emulators.guestfs/1902
Jim Meyering [Mon, 17 Sep 2012 09:25:00 +0000 (11:25 +0200)]
maint.mk: relax sc_prohibit_strcmp, to avoid a false positive
* top/maint.mk (sc_prohibit_strcmp): Relax regexp, so as to match
all uses of #define, not just those that start in column 1.
Richard W.M. Jones reported a false positive in
http://thread.gmane.org/gmane.comp.emulators.guestfs/1902
Paul Eggert [Sun, 16 Sep 2012 17:47:43 +0000 (10:47 -0700)]
localcharset: work around Mac OS X bug with UTF-8 and MB_CUR_MAX
* lib/localcharset.c (locale_charset) [DARWIN7]:
Return "ASCII" if the system reports "UTF-8" and MB_CUR_MAX <= 1,
as these two values are incompatible. Problem reported by Max Horn.
For more discussion, please see
<http://lists.gnu.org/archive/html/bug-gnulib/2012-09/msg00061.html>.
Paul Eggert [Sun, 16 Sep 2012 17:37:16 +0000 (10:37 -0700)]
doc: document sticky-EOF issue
* doc/posix-functions/fgetc.texi (fgetc):
* doc/posix-functions/fgets.texi (fgets):
* doc/posix-functions/fread.texi (fread):
* doc/posix-functions/fscanf.texi (fscanf):
* doc/posix-functions/getc.texi (getc):
* doc/posix-functions/getchar.texi (getchar):
* doc/posix-functions/scanf.texi (scanf):
Mention that glibc and default Solaris do not conform to
C99 and POSIX-2001 or later, with respect to how getchar
etc. behave when feof reports nonzero.
Joachim Schmitz [Thu, 13 Sep 2012 06:55:08 +0000 (08:55 +0200)]
poll: fix for systems that can't recv() on a non-socket
* lib/poll.c: if recv returns ENOTSOCK, assume the descriptor
is readable. In this case POLLHUP will not be supported.
* doc/posix-functions/poll.texi: Document this.
Paolo Bonzini [Thu, 13 Sep 2012 06:51:16 +0000 (08:51 +0200)]
poll/select: document portability problems not fixed by Gnulib.
* doc/posix-functions/poll.texi: poll does not work well on
pipes under Windows. It has the same limitations as select on
BeOS.
* doc/posix-functions/select.texi: select does not work well
on pipes under Windows.
Paul Eggert [Mon, 10 Sep 2012 20:37:18 +0000 (13:37 -0700)]
fcntl-h: check for AIX 7.1 bug with O_NOFOLLOW and O_CREAT
* m4/fcntl-o.m4 (gl_FCNTL_O_FLAGS): Check for AIX 7.1 bug
that caused a GNU tar test failure. Problem reported by Jez Wain; see
<http://lists.gnu.org/archive/html/bug-tar/2012-07/msg00018.html>.
Eric Blake [Thu, 6 Sep 2012 22:25:29 +0000 (16:25 -0600)]
net_if: give more details about the bug being fixed
Jasper Lievisse Adriaanse reported that NetBSD 5.2 also has
the same bug. Also, when writing configure tests that use
<net/if.h> (such as for 'struct ifreq'), it is useful to know
what pre-requisite headers are needed within that test.
In file included from foo.c:2:
/usr/include/net/if.h:112: error: expected specifier-qualifier-list before 'u_int'
...
/usr/include/net/if.h:674: error: field 'dstaddr' has incomplete type
In file included from /usr/include/net/if.h:691,
from foo.c:2:
/usr/include/net/if_arp.h:79: error: field 'arp_pa' has incomplete type
/usr/include/net/if_arp.h:80: error: field 'arp_ha' has incomplete type
*** Error code 1
We already had a test program for systems with the if_* functions
(including OpenBSD); but in adding this module, I had to enhance
that test to also work on platforms like mingw where we are now
providing a new header.
* modules/net_if: New module, borrowing ideas from netinet_in.
* m4/net_if_h.m4: New file.
* lib/net_if.in.h: Likewise.
* doc/posix-headers/net_if.texi (net/if.h): Document it.
* MODULES.html.sh (lacking POSIX:2008): Likewise.
* tests/test-net_if.c: Make function checks conditional.
Reported by Jasper Lievisse Adriaanse <jasper@humppa.nl>.
for all releases of FreeBSD until 8.3, and all OpenBSD ever released.
The reason is that those systems do not provide `utmp.ut_pid', thus
making the macro UT_PID(u) identical to naught, and then turning
the predicate
UT_PID (u) <= 0
found in desirable_utmp_entry(), into a permanent true clause.
This makes desirable_utmp_entry() discard every legitimate
user's UTMP entry for said BSD releases. NetBSD and DragonflyBSD
are not touched by this malfunction.
Copyright-paperwork-exempt: yes
* lib/readutmp.c (desirable_utmp_entry) <READ_UTMP_CHECK_PIDS>:
Use `UT_PID (u) > 0' as absolute condition.
Jim Meyering [Tue, 4 Sep 2012 09:36:38 +0000 (11:36 +0200)]
fts: reduce two or more trailing slashes to just one, usually
* lib/fts.c (fts_open): Upon initialization, if a name ends in two
or more slashes, trim all but the final one. But if a name consists
solely of two slashes, don't modify it. If it consists solely of
three or more slashes, strip all but one.
This is part of the solution to a minor problem with rm:
it would print a bogus ELOOP diagnostic when failing to remove
the slash-decorated name of a symlink-to-directory:
$ mkdir d && ln -s d s && env rm -r s/
rm: cannot remove 's': Too many levels of symbolic links
With the change below and a trivial don't-trim-trailing-slashes
adjustment to remove.c, it does this:
$ env rm -r s/
rm: cannot remove 's/': Not a directory
Paul Eggert [Wed, 29 Aug 2012 14:52:32 +0000 (07:52 -0700)]
stdbool: be more compatible with mixed C/C++ compiles
* lib/stdbool.in.h (_Bool, true, false) [__cplusplus]:
Define to bool, true, false, respectively, as GCC's builtin
stdbool.h does. Problem reported by Michael Goffioul in
<http://lists.gnu.org/archive/html/bug-gnulib/2012-08/msg00143.html>.
Paul Eggert [Fri, 24 Aug 2012 23:42:56 +0000 (16:42 -0700)]
doc: remove fdl-1.2.texi
It is no longer used or maintained, and its use of @acronym
is problematic. See the thread containing
<http://lists.gnu.org/archive/html/bug-gnulib/2012-08/msg00134.html>.
* config/srclist.txt: Remove doc/old-licenses/fdl-1.2.texi.
* doc/old-licenses/fdl-1.2.texi: Remove.
Paul Eggert [Fri, 24 Aug 2012 10:29:39 +0000 (03:29 -0700)]
execinfo: port to FreeBSD
* m4/execinfo.m4 (gl_EXECINFO_H): Set LIB_EXECINFO to -lexecinfo
if needed, as in FreeBSD. Reported by Bastien Roucariès in
<http://lists.gnu.org/archive/html/bug-gnulib/2012-08/msg00113.html>.
* modules/execinfo (Link): Add $(LIB_EXECINFO).
Paul Eggert [Fri, 24 Aug 2012 09:19:57 +0000 (02:19 -0700)]
doc: do not use @acronym
* doc/inet_ntoa.texi (inet_ntoa):
* doc/parse-datetime.texi (Seconds since the Epoch)
(Specifying time zone rules):
* doc/posix-functions/inet_ntoa.texi (inet_ntoa):
Don't use @acronym. Problem reported by John Darlington in
<http://lists.gnu.org/archive/html/bug-gnulib/2012-08/msg00124.html>.
Paul Eggert [Thu, 23 Aug 2012 23:40:05 +0000 (16:40 -0700)]
stdnoreturn: port to newer GCCs
* m4/stdnoreturn.m4 (gl_STDNORETURN_H): Avoid problems with
bleeding-edge GCC that complains about 'int _Noreturn foo (void);'.
Problem reported by Jim Meyering in
<http://lists.gnu.org/archive/html/bug-gnulib/2012-08/msg00121.html>.
Also, rename the 'test' function to a void a clash with the
already-supplied 'main' function; this fixes a bug that incorrectly
rejected GCC 4.7.1's <stdnoreturn.h>.
* doc/posix-headers/stdnoreturn.texi (stdnoreturn.h):
Document GCC problem.
Paul Eggert [Wed, 22 Aug 2012 08:47:05 +0000 (01:47 -0700)]
execinfo: new module
This is for Emacs. Currently, it provides a no-effect stub
on all platforms where it does not already work.
It already works on glibc-based systems, and on Solaris 11.
* lib/execinfo.c, lib/execinfo.in.h, m4/execinfo.m4, modules/execinfo:
New files.
* doc/glibc-headers/execinfo.texi (execinfo.h):
* MODULES.html.sh (Misc): Document it.
Paul Eggert [Tue, 21 Aug 2012 00:01:18 +0000 (17:01 -0700)]
extern-inline: support old GCC 'inline'
* m4/extern-inline.m4 (gl_EXTERN_INLINE): Use pre-C99 GCC 'inline'
if available. This applies to GCC versions 2.7 through 4.2, or
when newer GCC is using -fgnu89-inline. The goal is to address
some of the performance issues mentioned by Bruno Haible in
<http://lists.gnu.org/archive/html/bug-gnulib/2012-08/msg00097.html>.
Bruno Haible [Sun, 19 Aug 2012 12:13:11 +0000 (14:13 +0200)]
gnulib-tool: Improve coding style.
* gnulib-tool (func_emit_tests_Makefile_am): Set perhapsLT, like in
func_emit_lib_Makefile_am.
Reported and fix suggested by Dmitriy Selyutin <ghostman.sd@gmail.com>.
Bruno Haible [Tue, 14 Aug 2012 23:29:28 +0000 (01:29 +0200)]
gnulib-tool: Fix indentation of generated gnulib-comp.m4 file.
* gnulib-tool (func_emit_autoconf_snippet): Initialize indentation
from argument.
Reported and fix suggested by Dmitriy Selyutin <ghostman.sd@gmail.com>.
Eric Blake [Sat, 11 Aug 2012 13:34:00 +0000 (07:34 -0600)]
count-leading-zeros: use a lookup table on non-gcc compilers
While this only affects non-gcc compilers, we can assume that
lookups are faster than conditionals, even if it results in
a slightly larger executable size.
* lib/count-leading-zeros.h (count_leading_zeros_32): Use an
alternate implementation, suggested by Jim Meyering.
Eric Blake [Fri, 10 Aug 2012 22:51:08 +0000 (16:51 -0600)]
count-leading-zeros: new module
I needed gcc's clz to determine the most significant bit of a
number (useful for things like truncating to a power of 2),
and was surprised it is not a standardized function (the
opposite direction of finding the least significant bit is
given by ffs). This borrows heavily from the design of the
count-one-bits module.
* modules/count-leading-zeros: New module.
* m4/count-leading-zeros.m4: New file.
* lib/count-leading-zeros.h: Likewise.
* modules/count-leading-zeros-tests: New test.
* tests/test-count-leading-zeros.c: New file.
* MODULES.html.sh (Integer arithmetic functions): Document it.
Jim Meyering [Sun, 5 Aug 2012 09:19:19 +0000 (11:19 +0200)]
maint.mk: sc_prohibit_magic_number_exit: avoid new false positives
* top/maint.mk (sc_prohibit_magic_number_exit): Also filter out matches
for /error ?([^,]*)/. This avoids false-positives for strings like
"Unknown error (252)", introduced via commit v0.0-7538-g92875a6.
* modules/gnumakefile [Makefile.am]: The makefiles generated by
Automake-NG always contain a definition of VPATH, even in non-VPATH
builds (its value being simply '.' in that case). So, in the
'clean-GNUmakefile' rule, to determine whether running under a
VPATH setup, compare '$(srcdir)' to '.' rather than checking whether
'$(VPATH)' expands to the empty string.
Paul Eggert [Thu, 2 Aug 2012 21:17:33 +0000 (14:17 -0700)]
stat-time, timespec, u64: support naive out-of-dir builds
* lib/stat-time.c, lib/timespec.c, lib/u64.c:
Use '#include "foo.h"', not '#include <foo.h>', when including
one's own interface. This works better when configuring with
out-of-directory builds, since packages need not add an
otherwise-unnecessary -I$(topdir_src)/lib to DEFAULT_INCLUDES.
Paul Eggert [Sat, 28 Jul 2012 14:23:54 +0000 (07:23 -0700)]
utimens: use extern-inline
* lib/utimens.c (_GL_UTIMENS_INLINE): Define when including utimens.h.
* lib/utimens.h: Add copyright notice, since this is now large enough
to copyright. Use _GL_INLINE_HEADER_BEGIN, _GL_INLINE_HEADER_END.
(_GL_UTIMENS_INLINE): New macro. Use it instead of 'static inline'.
* modules/utimens (Depends-on): Add extern-inline.
Paul Eggert [Sat, 28 Jul 2012 14:20:59 +0000 (07:20 -0700)]
u64: use extern-inline
* lib/u64.c: New file.
* lib/u64.h: Use _GL_INLINE_HEADER_BEGIN, _GL_INLINE_HEADER_END.
(_GL_U64_INLINE): New macro. Use it instead of 'static inline'.
* modules/u64 (Files): Add lib/u64.c.
(Depends-on): Add extern-inline.
(configure.ac): No need to require AC_C_INLINE, since extern-inline
does that now.
(lib_SOURCES): Add u64.c.
Paul Eggert [Sat, 28 Jul 2012 14:18:23 +0000 (07:18 -0700)]
timespec: use extern-inline
* lib/timespec.c: New file.
* lib/timespec.h: Use _GL_INLINE_HEADER_BEGIN, _GL_INLINE_HEADER_END.
(_GL_TIMESPEC_INLINE): New macro. Use it instead of 'static inline'.
* modules/timespec (Files): Add lib/timespec.c.
(Depends-on): Add extern-inline.
(lib_SOURCES): Add timespec.c.
Paul Eggert [Sat, 28 Jul 2012 14:15:59 +0000 (07:15 -0700)]
stat-time: use extern-inline
* lib/stat-time.c: New file.
* lib/stat-time.h: Use _GL_INLINE_HEADER_BEGIN, _GL_INLINE_HEADER_END.
(_GL_STAT_TIME_INLINE): New macro. Use it instead of 'static inline'.
* modules/stat-time (Files): Add lib/stat-time.c.
(Depends-on): Add extern-inline.
(lib_SOURCES): Add stat-time.c.
Paul Eggert [Sat, 28 Jul 2012 14:11:58 +0000 (07:11 -0700)]
extern-inline: new module
* modules/extern-inline, m4/extern-inline.m4: New files.
This is for better support of 'extern inline' a la ISO C99,
with a portable alternative on compilers that do not support
C99-style 'extern inline'. Using 'extern inline' shrinks the size
of the Emacs executable, when compiled with debugging disabled,
which is a typical way that Emacs is built while developing.
Akim Demaille [Wed, 1 Aug 2012 07:55:49 +0000 (09:55 +0200)]
maint.mk: a "release-commit" wrapper to do-release-commit-and-tag
* build-aux/do-release-commit-and-tag: Move variable definitions
together.
($branch): Instead of defaulting to "master", default to the current
branch (as gnu-web-doc-update does).
(help): Display the current values of the option arguments.
* top/maint.mk (release-commit): New.
* top/README-release: Simplify the corresponding step.