Bruno Haible [Fri, 26 Apr 2024 09:33:06 +0000 (11:33 +0200)]
gnulib-tool: Use the Python implementation by default.
* gnulib-tool: If GNULIB_TOOL_IMPL is not set: Use the Python
implementation if a suitable 'python3' program is found in $PATH;
otherwise print a warning and use the shell implementation.
gnulib-tool.py: Reduce code duplication in file name transformations.
* pygnulib/functions.py: New file for shared functions between modules.
Add a function based on functions removed from GLImport and GLTestDir.
Accepts a single file name instead of a list.
* pygnulib/GLImport.py (GLImport.prepare): Use the new function.
(GLImport.rewrite_new_files, GLImport.rewrite_old_files): Remove
functions.
* pygnulib/GLTestDir.py (GLTestDir.execute): Use the new function.
(GLTestDir.rewrite_files): Remove functions.
* pygnulib/main.py (main): Remove unused function import. Use the new
function.
* pygnulib/GLFileTable.py: New file. Define the GLFileTable class with
five attributes which can be individually typed.
* pygnulib/GLTestDir.py (GLTestDir.execute): Use the GLFileTable class.
* pygnulib/GLImport.py (GLImport.gnulib_comp, GLImport.prepare)
(GLImport.execute): Likewise. Update type hints and doc strings.
Paul Eggert [Wed, 24 Apr 2024 21:56:28 +0000 (14:56 -0700)]
largefile: port to C++
This patch is mostly taken from Autoconf master.
* m4/largefile.m4 (AC_SYS_YEAR2038_RECOMMENDED):
Undefine if unpatched Autoconf 2.72 or earlier, so that
later code will redefine it.
The remaining part of this patch is from Autoconf master.
(_AC_SYS_YEAR2038_PROBE, _AC_SYS_LARGEFILE_PROBE):
Put "$CCFLAGS" in diagnostics, not "$CC".
(_AC_SYS_LARGEFILE_OPTIONS): Omit -n32.
(AC_SYS_LARGEFILE_PROBE): Fiddle with CPPFLAGS, not CC.
Do not worry about -n32.
Paul Eggert [Wed, 24 Apr 2024 06:18:07 +0000 (23:18 -0700)]
manywarnings: update C warnings for GCC 14
Adjust for C programs compiled by GCC 14.
(A C++ expert still needs to look at manywarnings-c++.m4.)
* build-aux/gcc-warning.spec: Add warnings introduced in GCC 13.
* m4/manywarnings.m4 (gl_MANYWARN_ALL_GCC):
Add -Wflex-array-member-not-at-end, -Wmissing-variable-declarations.
* pygnulib/*.py: Import functions from constants.py directly instead of
assigning them to module-specific variable. Keep the module prefix for
standard library functions.
Bruno Haible [Tue, 23 Apr 2024 14:58:04 +0000 (16:58 +0200)]
Update HACKING.
* HACKING: Mention the linear git history, how to work with ChangeLog,
how to run a testdir, where to find the gnulib-tool tests, and where are
the continuous integrations.
Bruno Haible [Mon, 22 Apr 2024 11:11:05 +0000 (13:11 +0200)]
gnulib-tool.py: Fix trouble caused by Python's bytecode cache.
Reported by Paul Eggert in
<https://lists.gnu.org/archive/html/bug-gnulib/2024-04/msg00367.html>.
* gnulib-tool.py: Set PYTHONPYCACHEPREFIX, so as to avoid creating a
__pycache__ directory in the developer's gnulib checkout (only effective
with Python ≥ 3.8).
gnulib-tool.py: Don't fail when given a bad module name.
* pygnulib/GLTestDir.py (GLTestDir.execute): Don't include None in the
list of GLModule objects.
* pygnulib/GLModuleSystem.py (GLModuleSystem.find): Document the meaning
of the None return.
* pygnulib/GLImport.py (GLImport.execute): Update transformer type hint
to reflect change from sed expressions to re.sub() arguments.
(GLImport.prepare): Likewise. Don't reference sed or license
replacements in docstring.
Bruno Haible [Sat, 20 Apr 2024 23:58:39 +0000 (01:58 +0200)]
nan: Relicense under LGPLv2+.
Eric Blake's approval is in
<https://lists.gnu.org/archive/html/bug-gnulib/2024-04/msg00290.html>.
Paul Eggert's approval is in
<https://lists.gnu.org/archive/html/bug-gnulib/2024-04/msg00324.html>.
Daniel Richard G.'s approval was given in private email.
Bruno Haible [Sat, 20 Apr 2024 22:27:18 +0000 (00:27 +0200)]
gnulib-tool: In sh+py mode, don't fail because of dangling symlinks.
Reported by Paul Eggert in
<https://lists.gnu.org/archive/html/bug-gnulib/2024-04/msg00318.html>
and Pádraig Brady in
<https://lists.gnu.org/archive/html/bug-gnulib/2024-04/msg00321.html>.
* gnulib-tool: In sh+py mode, use diff option '--no-dereference' if
available.
* pygnulib/constants.py: Remove duplicate __authors__, __license__, and
__copyright__ definitions.
* pygnulib/GLInfo.py: Use the value of __authors__ and __copyright__
from __init__.py for output.
* pygnulib/*.py: Remove unused references to the constant.py
definitions.
Bruno Haible [Sat, 20 Apr 2024 21:45:59 +0000 (23:45 +0200)]
gnulib-tool.py: Fix a bug in removed / added files handling.
* pygnulib/GLImport.py (GLImport.execute): When looking for files that
are in both filetable['old'] and filetable['new'], consider only the
first element of each tuple, not the entire tuple.
gnulib-tool.py: Make use of GLModule's __hash__ method.
* pygnulib/GLModuleSystem.py (GLModuleTable.addUnconditional)
(GLModuleTable.isConditional): Use the GLModule object instead of the
module name directly.
(GLModuleTable.addConditional, GLModuleTable.getCondition): Likewise.
Use a tuple of two GLModule objects as a key for the conditionals
dictionary.
gnulib-tool.py: Simplify data structures for dependencies.
* pygnulib/GLModuleSystem.py (GLModuleTable.__init__): Use a defaultdict
for dependers to remove the base initialization case.
(GLModuleTable.addConditional): Use a set to disallow duplicates instead
of performing list lookups.
Bruno Haible [Fri, 19 Apr 2024 15:41:54 +0000 (17:41 +0200)]
gnulib-tool.py: Update authors list.
* pygnulib/constants.py (__author__): Add Collin Funk.
* pygnulib/__init__.py (__copyright__, __author__): Include years and
authors of the gnulib-tool shell script.
Bruno Haible [Fri, 19 Apr 2024 11:57:14 +0000 (13:57 +0200)]
signed-nan: Don't assume that '-' works as expected on NaN values.
* lib/signed-nan.h (minus_NaNf): New function.
(positive_NaNf, negative_NaNf): Use it.
(minus_NaNd): New function.
(positive_NaNd, negative_NaNd): Use it.
(minus_NaNl): New function.
(positive_NaNl, negative_NaNl): Use it.
* tests/test-totalorder.c (TOTALORDER_MINUS): New macro.
* tests/test-totalorderf.c (TOTALORDER_MINUS): New macro.
* tests/test-totalorderl.c (TOTALORDER_MINUS): New macro.
* tests/test-totalorder.h (negative_NaN_with_payload): Use it.
* tests/test-totalordermag.c (TOTALORDER_MINUS): New macro.
* tests/test-totalordermagf.c (TOTALORDER_MINUS): New macro.
* tests/test-totalordermagl.c (TOTALORDER_MINUS): New macro.
* tests/test-totalordermag.h (negative_NaN_with_payload): Use it.
Bruno Haible [Fri, 19 Apr 2024 00:22:21 +0000 (02:22 +0200)]
totalordermagl: Add tests.
* tests/test-totalordermagl.c: New file, based on
tests/test-totalorderl.c.
* modules/totalordermagl-tests: New file, based on
modules/totalorderl-tests.
Bruno Haible [Fri, 19 Apr 2024 00:22:16 +0000 (02:22 +0200)]
totalordermagl: New module.
* lib/math.in.h (totalordermagl): New declaration.
* lib/totalordermagl.c: New file, based on lib/totalorderl.c.
* m4/math_h.m4 (gl_MATH_H): Test whether totalordermagl is declared.
(gl_MATH_H_REQUIRE_DEFAULTS): Initialize GNULIB_TOTALORDERMAGL.
(gl_MATH_H_DEFAULTS): Initialize HAVE_TOTALORDERMAGL,
REPLACE_TOTALORDERMAGL.
* modules/math (Makefile.am): Substitute GNULIB_TOTALORDERMAGL,
HAVE_TOTALORDERMAGL, REPLACE_TOTALORDERMAGL.
* modules/totalordermagl: New file, based on modules/totalorderl.
* doc/posix-functions/totalordermagl.texi: Mention the new module.
Bruno Haible [Fri, 19 Apr 2024 00:22:01 +0000 (02:22 +0200)]
totalordermagf: Add tests.
* tests/test-totalordermagf.c: New file, based on
tests/test-totalorderf.c.
* modules/totalordermagf-tests: New file, based on
modules/totalorderf-tests.
Bruno Haible [Fri, 19 Apr 2024 00:21:56 +0000 (02:21 +0200)]
totalordermagf: New module.
* lib/math.in.h (totalordermagf): New declaration.
* lib/totalordermagf.c: New file, based on lib/totalorderf.c.
* m4/math_h.m4 (gl_MATH_H): Test whether totalordermagf is declared.
(gl_MATH_H_REQUIRE_DEFAULTS): Initialize GNULIB_TOTALORDERMAGF.
(gl_MATH_H_DEFAULTS): Initialize HAVE_TOTALORDERMAGF,
REPLACE_TOTALORDERMAGF.
* modules/math (Makefile.am): Substitute GNULIB_TOTALORDERMAGF,
HAVE_TOTALORDERMAGF, REPLACE_TOTALORDERMAGF.
* modules/totalordermagf: New file, based on modules/totalorderf.
* doc/posix-functions/totalordermagf.texi: Mention the new module.
Bruno Haible [Fri, 19 Apr 2024 00:21:34 +0000 (02:21 +0200)]
totalordermag: Add tests.
* tests/test-totalordermag.c: New file, based on
tests/test-totalorder.c.
* tests/test-totalordermag.h: New file, based on
tests/test-totalorder.h.
* modules/totalordermag-tests: New file, based on
modules/totalorder-tests.
Bruno Haible [Fri, 19 Apr 2024 00:21:21 +0000 (02:21 +0200)]
totalordermag: New module.
* lib/math.in.h (totalordermag): New declaration.
* lib/totalordermag.c: New file, based on lib/totalorder.c.
* m4/totalordermag.m4: New file, based on m4/totalorder.m4.
* m4/math_h.m4 (gl_MATH_H): Test whether totalordermag is declared.
(gl_MATH_H_REQUIRE_DEFAULTS): Initialize GNULIB_TOTALORDERMAG.
(gl_MATH_H_DEFAULTS): Initialize HAVE_TOTALORDERMAG,
REPLACE_TOTALORDERMAG.
* modules/math (Makefile.am): Substitute GNULIB_TOTALORDERMAG,
HAVE_TOTALORDERMAG, REPLACE_TOTALORDERMAG.
* modules/totalordermag: New file, based on modules/totalorder.
* doc/posix-functions/totalordermag.texi: Mention the new module.
Bruno Haible [Fri, 19 Apr 2024 00:14:45 +0000 (02:14 +0200)]
setpayloadsig*: Support newer MIPS CPUs.
* lib/setpayloadsig.c (setpayloadsig): On MIPS CPUs with MIPS_NAN2008_DOUBLE,
reject a zero payload.
* lib/setpayloadsigf.c (setpayloadsigf): On MIPS CPUs with MIPS_NAN2008_FLOAT,
reject a zero payload.
* lib/setpayloadsigl.c (setpayloadsigl): On MIPS CPUs with
MIPS_NAN2008_LONG_DOUBLE, reject a zero payload.
Bruno Haible [Fri, 19 Apr 2024 00:14:41 +0000 (02:14 +0200)]
setpayload*: Support newer MIPS CPUs.
* lib/setpayload.c (setpayload): On MIPS CPUs with MIPS_NAN2008_DOUBLE,
accept a zero payload.
* lib/setpayloadf.c (setpayloadf): On MIPS CPUs with MIPS_NAN2008_FLOAT,
accept a zero payload.
* lib/setpayloadl.c (setpayloadl): On MIPS CPUs with
MIPS_NAN2008_LONG_DOUBLE, accept a zero payload.
* m4/setpayload.m4 (gl_FUNC_SETPAYLOADF, gl_FUNC_SETPAYLOAD,
gl_FUNC_SETPAYLOADL): Invoke gl_NAN_MIPS.
* modules/setpayload (Files): Add m4/nan-mips.m4.
* modules/setpayloadf (Files): Likewise.
* modules/setpayloadl (Files): Likewise.
Bruno Haible [Fri, 19 Apr 2024 00:14:37 +0000 (02:14 +0200)]
totalorder*: Support newer MIPS CPUs.
* lib/totalorder.c (totalorder): On MIPS CPUs with MIPS_NAN2008_DOUBLE,
don't invert the most significant bit of the mantissa field.
* lib/totalorderf.c (totalorderf): On MIPS CPUs with MIPS_NAN2008_FLOAT,
don't invert the most significant bit of the mantissa field.
* lib/totalorderl.c (totalorderl): On MIPS CPUs with
MIPS_NAN2008_LONG_DOUBLE, don't invert the most significant bit of the
mantissa field.
* m4/totalorder.m4 (gl_FUNC_TOTALORDERF, gl_FUNC_TOTALORDER,
gl_FUNC_TOTALORDERL): Invoke gl_NAN_MIPS.
* modules/totalorder (Files): Add m4/nan-mips.m4.
* modules/totalorderf (Files): Likewise.
* modules/totalorderl (Files): Likewise.
Bruno Haible [Thu, 18 Apr 2024 14:29:28 +0000 (16:29 +0200)]
totalorderl: Simplify on MSVC.
* lib/totalorderl.c (totalorderl): If 'long double' is the same as
'double', just invoke totalorder. Otherwise, drop the optimized code
for small 'long double' since it does not occur on any platform.
* m4/totalorder.m4 (gl_FUNC_TOTALORDERL): Require
gl_LONG_DOUBLE_VS_DOUBLE. If 'long double' is the same as 'double', use
TOTALORDER_LIBM.
* modules/totalorderl (Depends-on): Add totalorder.
Bruno Haible [Wed, 17 Apr 2024 23:34:02 +0000 (01:34 +0200)]
totalorder* tests: Strengthen tests.
* tests/test-totalorder.h: Include <math.h>.
(positive_NaN_with_payload, negative_NaN_with_payload): New functions.
(main): Test quiet NaNs of each sign with different payload.
* tests/test-totalorder.c (TOTALORDER_POSITIVE_NAN,
TOTALORDER_NEGATIVE_NAN): Remove macros.
(TOTALORDER_SETPAYLOAD): New macro.
* tests/test-totalorderf.c (TOTALORDER_POSITIVE_NAN,
TOTALORDER_NEGATIVE_NAN): Remove macros.
(TOTALORDER_SETPAYLOAD): New macro.
* tests/test-totalorderl.c (TOTALORDER_POSITIVE_NAN,
TOTALORDER_NEGATIVE_NAN): Remove macros.
(TOTALORDER_SETPAYLOAD): New macro.
* modules/totalorder-tests (Depends-on): Add setpayload.
(Makefile.am): Link test-totalorder with $(SETPAYLOAD_LIBM).
* modules/totalorderf-tests (Depends-on): Add setpayloadf.
(Makefile.am): Link test-totalorderf with $(SETPAYLOADF_LIBM).
* modules/totalorderl-tests (Depends-on): Add setpayloadl.
(Makefile.am): Link test-totalorderl with $(SETPAYLOADL_LIBM).
Bruno Haible [Wed, 17 Apr 2024 09:08:40 +0000 (11:08 +0200)]
getpayloadl: New module.
* lib/math.in.h (getpayloadl): New declaration.
* lib/getpayloadl.c: New file.
* m4/math_h.m4 (gl_MATH_H): Test whether getpayloadl is declared.
(gl_MATH_H_REQUIRE_DEFAULTS): Initialize GNULIB_GETPAYLOADL.
(gl_MATH_H_DEFAULTS): Initialize HAVE_GETPAYLOADL, REPLACE_GETPAYLOADL.
* modules/math (Makefile.am): Substitute GNULIB_GETPAYLOADL,
HAVE_GETPAYLOADL, REPLACE_GETPAYLOADL.
* modules/getpayloadl: New file.
* doc/posix-functions/getpayloadl.texi: Mention the new module and the
glibc bug.
Bruno Haible [Wed, 17 Apr 2024 09:02:52 +0000 (11:02 +0200)]
getpayloadf: New module.
* lib/math.in.h (getpayloadf): New declaration.
* lib/getpayloadf.c: New file.
* m4/math_h.m4 (gl_MATH_H): Test whether getpayloadf is declared.
(gl_MATH_H_REQUIRE_DEFAULTS): Initialize GNULIB_GETPAYLOADF.
(gl_MATH_H_DEFAULTS): Initialize HAVE_GETPAYLOADF, REPLACE_GETPAYLOADF.
* modules/math (Makefile.am): Substitute GNULIB_GETPAYLOADF,
HAVE_GETPAYLOADF, REPLACE_GETPAYLOADF.
* modules/getpayloadf: New file.
* doc/posix-functions/getpayloadf.texi: Mention the new module and the
glibc bug.
Bruno Haible [Wed, 17 Apr 2024 08:57:05 +0000 (10:57 +0200)]
getpayload: New module.
* lib/math.in.h (getpayload): New declaration.
* lib/getpayload.c: New file.
* m4/getpayload.m4: New file.
* m4/math_h.m4 (gl_MATH_H): Test whether getpayload is declared.
(gl_MATH_H_REQUIRE_DEFAULTS): Initialize GNULIB_GETPAYLOAD.
(gl_MATH_H_DEFAULTS): Initialize HAVE_GETPAYLOAD, REPLACE_GETPAYLOAD.
* modules/math (Makefile.am): Substitute GNULIB_GETPAYLOAD,
HAVE_GETPAYLOAD, REPLACE_GETPAYLOAD.
* modules/getpayload: New file.
* doc/posix-functions/getpayload.texi: Mention the new module and the
glibc bug.
Bruno Haible [Tue, 16 Apr 2024 19:28:42 +0000 (21:28 +0200)]
setpayloadsigl: New module.
* lib/math.in.h (setpayloadsigl): New declaration.
* lib/setpayloadsigl.c: New file, based on lib/setpayloadl.c.
* m4/math_h.m4 (gl_MATH_H): Test whether setpayloadsigl is declared.
(gl_MATH_H_REQUIRE_DEFAULTS): Initialize GNULIB_SETPAYLOADSIGL.
(gl_MATH_H_DEFAULTS): Initialize HAVE_SETPAYLOADSIGL.
* modules/math (Makefile.am): Substitute GNULIB_SETPAYLOADSIGL,
HAVE_SETPAYLOADSIGL.
* modules/setpayloadsigl: New file.
* doc/posix-functions/setpayloadsigl.texi: Mention the new module.
Bruno Haible [Tue, 16 Apr 2024 19:15:16 +0000 (21:15 +0200)]
setpayloadsigf: Add tests.
* tests/test-setpayloadf.c (PAYLOAD_BITS): New macro.
(main): Use it.
* tests/test-setpayloadsigf.c: New file, based on
tests/test-setpayloadf.c.
* modules/setpayloadsigf-tests: New file.
Bruno Haible [Tue, 16 Apr 2024 19:12:39 +0000 (21:12 +0200)]
setpayloadsigf: New module.
* lib/math.in.h (setpayloadsigf): New declaration.
* lib/setpayloadsigf.c: New file, based on lib/setpayloadf.c.
* m4/math_h.m4 (gl_MATH_H): Test whether setpayloadsigf is declared.
(gl_MATH_H_REQUIRE_DEFAULTS): Initialize GNULIB_SETPAYLOADSIGF.
(gl_MATH_H_DEFAULTS): Initialize HAVE_SETPAYLOADSIGF.
* modules/math (Makefile.am): Substitute GNULIB_SETPAYLOADSIGF,
HAVE_SETPAYLOADSIGF.
* modules/setpayloadsigf: New file.
* doc/posix-functions/setpayloadsigf.texi: Mention the new module.
Bruno Haible [Tue, 16 Apr 2024 19:06:20 +0000 (21:06 +0200)]
setpayloadsig: Add tests.
* tests/test-setpayload.c (PAYLOAD_BITS): New macro.
(main): Use it.
* tests/test-setpayloadsig.c: New file, based on
tests/test-setpayload.c.
* modules/setpayloadsig-tests: New file.
Bruno Haible [Tue, 16 Apr 2024 19:01:17 +0000 (21:01 +0200)]
setpayloadsig: New module.
* lib/math.in.h (setpayloadsig): New declaration.
* lib/setpayloadsig.c: New file, based on lib/setpayload.c.
* m4/setpayloadsig.m4: New file, based on m4/setpayload.m4.
* m4/math_h.m4 (gl_MATH_H): Test whether setpayloadsig is declared.
(gl_MATH_H_REQUIRE_DEFAULTS): Initialize GNULIB_SETPAYLOADSIG.
(gl_MATH_H_DEFAULTS): Initialize HAVE_SETPAYLOADSIG.
* modules/math (Makefile.am): Substitute GNULIB_SETPAYLOADSIG,
HAVE_SETPAYLOADSIG.
* modules/setpayloadsig: New file.
* doc/posix-functions/setpayloadsig.texi: Mention the new module.
Bruno Haible [Tue, 16 Apr 2024 22:38:07 +0000 (00:38 +0200)]
setpayloadl: Fix platform-specific bugs.
* lib/setpayloadl.c (setpayloadl): On m68k, consider the actual memory
layout of a 'long double'. On platforms with quadruple-precision
'long double', store 111 bits of payload, not only 110 bits.
* pygnulib/GLModuleSystem.py (GLModuleTable.__init__): Use a set to
represent the unconditional modules instead of a dictionary. Remove
redundant comments.
(GLModuleTable.addUnconditional): Add the module to a set instead of
using it as a key to the dictionary.
gnulib-tool.py: Don't use mutable default arguments.
* pygnulib/GLFileSystem.py (GLFileAssistant.__init__): Set the default
argument for 'transformers' to None. If it is None then set it to an
empty dictionary in the body.
Bruno Haible [Sat, 13 Apr 2024 23:38:42 +0000 (01:38 +0200)]
bootstrap: Implement phase 1 as documented in the --help output.
Reported by Simon Josefsson as bug #1 in
<https://lists.gnu.org/archive/html/bug-gnulib/2024-04/msg00152.html>.
* top/bootstrap: Correct indentation.
* top/bootstrap-funclib.sh (prepare_GNULIB_SRCDIR): Implement as
documented:
If GNULIB_SRCDIR and GNULIB_REVISION are set and there is a 'gnulib'
submodule, checkout the revision GNULIB_REVISION.
If GNULIB_SRCDIR and GNULIB_REVISION are set and --no-git is specified,
don't checkout the revision GNULIB_REVISION.
Bruno Haible [Sat, 13 Apr 2024 22:08:50 +0000 (00:08 +0200)]
bootstrap: Simplify git submodule initialization.
* top/bootstrap-funclib.sh (prepare_GNULIB_SRCDIR): Err out if git is
older than version 1.6.4. Remove fallback code for older versions.
* build-aux/bootstrap: Regenerated.