bootloader: rebase onto upstream 1.0.0, sync firmware-loader version

Bootloader fork rebase:
- Base changed from 0.1.0 pre-patched archive to upstream 1.0.0 tag (c7eeb9f)
- Applied 0001-redbear-local-forks.patch (Cargo.toml crate path redirects)
- Applied fix-uefi-alloc-panic.patch equivalents (4 panic!() -> graceful
  error handling in src/main.rs)
- Applied P5-live-preload-cap-1gib.patch (1 GiB cap on live image preload)
- Skipped: P0 GPT partition scan (requires new module + integration),
  P1 timeout/default-resolution, P2 live preload guard (subsumed by
  panic fixes + cap), P3 live image safe read, P4 large ISO boot,
  redox.patch — to be applied in dedicated rebase session.

firmware-loader/Cargo.toml: version 0.1.0 -> 0.3.0 (sync with other
Red Bear custom crates which are at 0.3.0).

fork-upstream-map.toml: bootloader back from PENDING_REBASE to 1.0.0
since the partial rebase matches upstream 1.0.0 content.

fork-upstream-map.toml: base restored to 'main' tracked (was correctly
tracked by build-redbear.sh).
This commit is contained in:
2026-07-11 09:47:59 +03:00
parent 9bbc38fe60
commit 068a1ca63e
1609 changed files with 256532 additions and 299729 deletions
+1 -1
View File
@@ -35,7 +35,7 @@ redoxfs https://gitlab.redox-os.org/redox-os/redoxfs.git 0.9.1 sna
redox-scheme https://gitlab.redox-os.org/redox-os/redox-scheme.git 0.11.2 snapshot
relibc https://gitlab.redox-os.org/redox-os/relibc.git 0.6.0 snapshot
kernel https://gitlab.redox-os.org/redox-os/kernel.git 0.5.12 snapshot
bootloader https://gitlab.redox-os.org/redox-os/bootloader.git PENDING_REBASE snapshot # 2026-07-11: detected content divergence vs upstream 1.0.0. Local fork appears to be based on a pre-1.0.0 import ("89c68d0 Red Bear OS bootloader baseline from 0.1.0 pre-patched archive") plus Red Bear patches, NOT a true rebase onto upstream 1.0.0 tag. Rebase required: import upstream 1.0.0 source, re-apply 0001-redbear-local-forks.patch and fix-uefi-alloc-panic.patch on top, then update version label.
bootloader https://gitlab.redox-os.org/redox-os/bootloader.git 1.0.0 snapshot
installer https://gitlab.redox-os.org/redox-os/installer.git 0.2.42 snapshot
userutils https://gitlab.redox-os.org/redox-os/userutils.git 0.1.0 snapshot
base https://gitlab.redox-os.org/redox-os/base.git main tracked
@@ -1,6 +1,6 @@
[package]
name = "firmware-loader"
version = "0.1.0"
version = "0.3.0"
edition = "2021"
[dependencies]
+9 -6
View File
@@ -2,9 +2,6 @@
tar = "https://ftp.gnu.org/gnu/diffutils/diffutils-3.12.tar.xz"
blake3 = "363fb378c85505b43f91d6e7c7382d571f2f7b47e4d334c18d522baf55599d18"
patches = ["diffutils.patch"]
script = """
autoreconf
"""
[build]
template = "custom"
@@ -13,6 +10,8 @@ script = """
DYNAMIC_INIT
export HELP2MAN=true
export MAKEINFO=true
export CFLAGS="${CFLAGS} -fcommon"
export LDFLAGS="${LDFLAGS} -Wl,--allow-multiple-definition"
COOKBOOK_CONFIGURE_FLAGS+=(
gt_cv_locale_fr=false
gt_cv_locale_fr_utf8=false
@@ -28,12 +27,16 @@ COOKBOOK_CONFIGURE_FLAGS+=(
ac_cv_header_stdio_h=yes
ac_cv_path_HELP2MAN=true
ac_cv_path_MAKEINFO=true
gl_cv_func_strcasecmp_works=yes
gl_cv_func_strncasecmp_works=yes
)
cookbook_configure
"${COOKBOOK_MAKE}" -j "${COOKBOOK_MAKE_JOBS}" HELP2MAN=true MAKEINFO=true
"${COOKBOOK_MAKE}" install DESTDIR="${COOKBOOK_STAGE}" HELP2MAN=true MAKEINFO=true
printf '#!/bin/sh\\nexit 0\\n' > "${COOKBOOK_SOURCE}/man/help2man"
chmod +x "${COOKBOOK_SOURCE}/man/help2man"
"${COOKBOOK_MAKE}" -j "${COOKBOOK_MAKE_JOBS}"
"${COOKBOOK_MAKE}" install DESTDIR="${COOKBOOK_STAGE}"
rm -f "${COOKBOOK_STAGE}/usr/share/info/dir"
"""
[package]
description = "GNU diffutils 3.12 (gnulib bypass enabled)"
description = "GNU diffutils 3.12"
Binary file not shown.
@@ -1 +1 @@
3.6
3.12
+1 -1
View File
@@ -33,7 +33,7 @@ Patrick D'Cruze
Eli Zaretskii
Copyright (C) 2001, 2006, 2009-2013, 2015-2017 Free Software Foundation, Inc.
Copyright (C) 2001, 2006, 2009-2013, 2015-2025 Free Software Foundation, Inc.
This file is part of GNU diffutils.
File diff suppressed because it is too large Load Diff
@@ -4265,7 +4265,7 @@ Thu Nov 3 16:30:24 1988 Randall Smith (randy at gluteus.ai.mit.edu)
-----
Copyright (C) 1988-1994, 1997-2002, 2004, 2006, 2009-2013, 2015-2017
Copyright (C) 1988-1994, 1997-2002, 2004, 2006, 2009-2013, 2015-2025
Free Software Foundation, Inc.
Copying and distribution of this file, with or without
@@ -5,7 +5,7 @@
# It is necessary if you want to build targets usually of interest
# only to the maintainer.
# Copyright (C) 2001, 2003, 2006-2017 Free Software Foundation, Inc.
# Copyright (C) 2001, 2003, 2006-2025 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
@@ -18,7 +18,7 @@
# 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 <http://www.gnu.org/licenses/>.
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# If the user runs GNU make but has not yet run ./configure,
# give them a diagnostic.
@@ -26,7 +26,7 @@ _gl-Makefile := $(wildcard [M]akefile)
ifneq ($(_gl-Makefile),)
# Make tar archive easier to reproduce.
export TAR_OPTIONS = --owner=0 --group=0 --numeric-owner
export TAR_OPTIONS = --owner=0 --group=0 --numeric-owner --sort=name
# Allow the user to add to this in the Makefile.
ALL_RECURSIVE_TARGETS =
@@ -44,6 +44,9 @@ include $(srcdir)/maint.mk
# Ensure that $(VERSION) is up to date for dist-related targets, but not
# for others: rerunning autoreconf and recompiling everything isn't cheap.
# This is not part of the essential workflow with .tarball-version. Rather,
# it is meant to help the maintainer who has changed the current version
# but not done a "make distclean".
_have-git-version-gen := \
$(shell test -f $(srcdir)/$(_build-aux)/git-version-gen && echo yes)
ifeq ($(_have-git-version-gen)0,yes$(MAKELEVEL))
@@ -104,7 +107,7 @@ endif
abort-due-to-no-makefile:
@echo There seems to be no Makefile in this directory. 1>&2
@echo "You must run ./configure before running 'make'." 1>&2
@echo "You must run ./configure before running '$(MAKE)'." 1>&2
@exit 1
endif
+229 -229
View File
@@ -1,177 +1,180 @@
Installation Instructions
*************************
Copyright (C) 1994-1996, 1999-2002, 2004-2016 Free Software
Foundation, Inc.
Copying and distribution of this file, with or without modification,
are permitted in any medium without royalty provided the copyright
notice and this notice are preserved. This file is offered as-is,
without warranty of any kind.
Basic Installation
==================
Briefly, the shell command './configure && make && make install'
should configure, build, and install this package. The following
more-detailed instructions are generic; see the 'README' file for
instructions specific to this package. Some packages provide this
'INSTALL' file but do not implement all of the features documented
below. The lack of an optional feature in a given package is not
necessarily a bug. More recommendations for GNU packages can be found
in *note Makefile Conventions: (standards)Makefile Conventions.
The following shell commands:
The 'configure' shell script attempts to guess correct values for
various system-dependent variables used during compilation. It uses
those values to create a 'Makefile' in each directory of the package.
It may also create one or more '.h' files containing system-dependent
definitions. Finally, it creates a shell script 'config.status' that
you can run in the future to recreate the current configuration, and a
file 'config.log' containing compiler output (useful mainly for
debugging 'configure').
test -f configure || ./bootstrap
./configure
make
make install
It can also use an optional file (typically called 'config.cache' and
enabled with '--cache-file=config.cache' or simply '-C') that saves the
should configure, build, and install this package. The first line,
which bootstraps, is intended for developers; when building from
distribution tarballs it does nothing and can be skipped. A package
might name the bootstrapping script differently; if the name is
autogen.sh, for example, the first line should say ./autogen.sh
instead of ./bootstrap.
The following more-detailed instructions are generic; see the
README file for instructions specific to this package. Some packages
provide this INSTALL file but do not implement all of the features
documented below. The lack of an optional feature in a given package is
not necessarily a bug. More recommendations for GNU packages can be
found in the GNU Coding Standards.
Many packages have scripts meant for developers instead of ordinary
builders, as they may use developer tools that are less commonly
installed, or they may access the network, which has privacy
implications. These scripts attempt to bootstrap by building the
configure script and related files, possibly using developer tools or
the network. Because the output of bootstrapping is system-independent,
it is normally run by a package developer so that its output can be put
into the distribution tarball and ordinary builders and users need not
bootstrap. Some packages have commands like ./autopull.sh and
./autogen.sh that you can run instead of ./bootstrap, for more
fine-grained control over bootstrapping.
The configure script attempts to guess correct values for various
system-dependent variables used during compilation. It uses those
values to create a Makefile in each directory of the package. It may
also create one or more .h files containing system-dependent
definitions. Finally, it creates a script config.status that you can
run in the future to recreate the current configuration, and a file
config.log containing output useful for debugging configure.
It can also use an optional file (typically called config.cache and
enabled with --cache-file=config.cache or simply -C) that saves the
results of its tests to speed up reconfiguring. Caching is disabled by
default to prevent problems with accidental use of stale cache files.
If you need to do unusual things to compile the package, please try
to figure out how 'configure' could check whether to do them, and mail
diffs or instructions to the address given in the 'README' so they can
to figure out how configure could check whether to do them, and mail
diffs or instructions to the address given in the README so they can
be considered for the next release. If you are using the cache, and at
some point 'config.cache' contains results you don't want to keep, you
some point config.cache contains results you dont want to keep, you
may remove or edit it.
The file 'configure.ac' (or 'configure.in') is used to create
'configure' by a program called 'autoconf'. You need 'configure.ac' if
you want to change it or regenerate 'configure' using a newer version of
'autoconf'.
The autoconf program generates configure from the file
configure.ac. Normally you should edit configure.ac instead of
editing configure directly.
The simplest way to compile this package is:
1. 'cd' to the directory containing the package's source code and type
'./configure' to configure the package for your system.
1. cd to the directory containing the packages source code.
Running 'configure' might take a while. While running, it prints
some messages telling which features it is checking for.
2. If this is a developer checkout and file configure does not yet
exist, run the bootstrapping script (typically ./bootstrap or
./autogen.sh) to bootstrap and create the file. You may need
special developer tools and network access to bootstrap, and the
network access may have privacy implications.
2. Type 'make' to compile the package.
3. Type ./configure to configure the package for your system. This
might take a while. While running, configure prints messages
telling which features it is checking for.
3. Optionally, type 'make check' to run any self-tests that come with
4. Type make to compile the package.
5. Optionally, type make check to run any self-tests that come with
the package, generally using the just-built uninstalled binaries.
4. Type 'make install' to install the programs and any data files and
6. Type make install to install the programs and any data files and
documentation. When installing into a prefix owned by root, it is
recommended that the package be configured and built as a regular
user, and only the 'make install' phase executed with root
user, and only the make install phase executed with root
privileges.
5. Optionally, type 'make installcheck' to repeat any self-tests, but
7. Optionally, type make installcheck to repeat any self-tests, but
this time using the binaries in their final installed location.
This target does not install anything. Running this target as a
regular user, particularly if the prior 'make install' required
regular user, particularly if the prior make install required
root privileges, verifies that the installation completed
correctly.
6. You can remove the program binaries and object files from the
source code directory by typing 'make clean'. To also remove the
files that 'configure' created (so you can compile the package for
a different kind of computer), type 'make distclean'. There is
also a 'make maintainer-clean' target, but that is intended mainly
for the package's developers. If you use it, you may have to get
all sorts of other programs in order to regenerate files that came
with the distribution.
8. You can remove the program binaries and object files from the
source code directory by typing make clean. To also remove the
files that configure created (so you can compile the package for
a different kind of computer), type make distclean. There is
also a make maintainer-clean target, but that is intended mainly
for the packages developers. If you use it, you may have to
bootstrap again.
7. Often, you can also type 'make uninstall' to remove the installed
files again. In practice, not all packages have tested that
uninstallation works correctly, even though it is required by the
GNU Coding Standards.
8. Some packages, particularly those that use Automake, provide 'make
distcheck', which can by used by developers to test that all other
targets like 'make install' and 'make uninstall' work correctly.
This target is generally not run by end users.
9. If the package follows the GNU Coding Standards, you can type make
uninstall to remove the installed files.
Compilers and Options
=====================
Some systems require unusual options for compilation or linking that
the 'configure' script does not know about. Run './configure --help'
the configure script does not know about. Run ./configure --help
for details on some of the pertinent environment variables.
You can give 'configure' initial values for configuration parameters
You can give configure initial values for configuration parameters
by setting variables in the command line or in the environment. Here is
an example:
./configure CC=c99 CFLAGS=-g LIBS=-lposix
./configure CC=gcc CFLAGS=-g LIBS=-lposix
*Note Defining Variables::, for more details.
See Defining Variables for more details.
Compiling For Multiple Architectures
====================================
You can compile the package for more than one kind of computer at the
same time, by placing the object files for each architecture in their
own directory. To do this, you can use GNU 'make'. 'cd' to the
directory where you want the object files and executables to go and run
the 'configure' script. 'configure' automatically checks for the source
code in the directory that 'configure' is in and in '..'. This is known
as a "VPATH" build.
same time, by placing the object files for each system in their own
directory. To do this, you can use GNU make. cd to the directory
where you want the object files and executables to go and run the
configure script. configure automatically checks for the source
code in the directory that configure is in and in ... This is known
as a VPATH build.
With a non-GNU 'make', it is safer to compile the package for one
architecture at a time in the source code directory. After you have
installed the package for one architecture, use 'make distclean' before
reconfiguring for another architecture.
With a non-GNU make, it is safer to compile the package for one
system at a time in the source code directory. After you have installed
the package for one system, use make distclean before reconfiguring
for another system.
On MacOS X 10.5 and later systems, you can create libraries and
executables that work on multiple system types--known as "fat" or
"universal" binaries--by specifying multiple '-arch' options to the
compiler but only a single '-arch' option to the preprocessor. Like
this:
./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
CPP="gcc -E" CXXCPP="g++ -E"
This is not guaranteed to produce working output in all cases, you
may have to build one architecture at a time and combine the results
using the 'lipo' tool if you have problems.
Some platforms, notably macOS, support “fat” or “universal” binaries,
where a single binary can execute on different architectures. On these
platforms you can configure and compile just once, with options specific
to that platform.
Installation Names
==================
By default, 'make install' installs the package's commands under
'/usr/local/bin', include files under '/usr/local/include', etc. You
can specify an installation prefix other than '/usr/local' by giving
'configure' the option '--prefix=PREFIX', where PREFIX must be an
By default, make install installs the packages commands under
/usr/local/bin, include files under /usr/local/include, etc. You
can specify an installation prefix other than /usr/local by giving
configure the option --prefix=PREFIX, where PREFIX must be an
absolute file name.
You can specify separate installation prefixes for
architecture-specific files and architecture-independent files. If you
pass the option '--exec-prefix=PREFIX' to 'configure', the package uses
pass the option --exec-prefix=PREFIX to configure, the package uses
PREFIX as the prefix for installing programs and libraries.
Documentation and other data files still use the regular prefix.
In addition, if you use an unusual directory layout you can give
options like '--bindir=DIR' to specify different values for particular
kinds of files. Run 'configure --help' for a list of the directories
options like --bindir=DIR to specify different values for particular
kinds of files. Run configure --help for a list of the directories
you can set and what kinds of files go in them. In general, the default
for these options is expressed in terms of '${prefix}', so that
specifying just '--prefix' will affect all of the other directory
for these options is expressed in terms of ${prefix}, so that
specifying just --prefix will affect all of the other directory
specifications that were not explicitly provided.
The most portable way to affect installation locations is to pass the
correct locations to 'configure'; however, many packages provide one or
correct locations to configure; however, many packages provide one or
both of the following shortcuts of passing variable assignments to the
'make install' command line to change installation locations without
make install command line to change installation locations without
having to reconfigure or recompile.
The first method involves providing an override variable for each
affected directory. For example, 'make install
prefix=/alternate/directory' will choose an alternate location for all
affected directory. For example, make install
prefix=/alternate/directory will choose an alternate location for all
directory configuration variables that were expressed in terms of
'${prefix}'. Any directories that were specified during 'configure',
but not in terms of '${prefix}', must each be overridden at install time
${prefix}. Any directories that were specified during configure,
but not in terms of ${prefix}, must each be overridden at install time
for the entire installation to be relocated. The approach of makefile
variable overrides for each directory variable is required by the GNU
Coding Standards, and ideally causes no recompilation. However, some
@@ -179,190 +182,187 @@ platforms have known limitations with the semantics of shared libraries
that end up requiring recompilation when using this method, particularly
noticeable in packages that use GNU Libtool.
The second method involves providing the 'DESTDIR' variable. For
example, 'make install DESTDIR=/alternate/directory' will prepend
'/alternate/directory' before all installation names. The approach of
'DESTDIR' overrides is not required by the GNU Coding Standards, and
The second method involves providing the DESTDIR variable. For
example, make install DESTDIR=/alternate/directory will prepend
/alternate/directory before all installation names. The approach of
DESTDIR overrides is not required by the GNU Coding Standards, and
does not work on platforms that have drive letters. On the other hand,
it does better at avoiding recompilation issues, and works well even
when some directory options were not specified in terms of '${prefix}'
at 'configure' time.
when some directory options were not specified in terms of ${prefix}
at configure time.
Optional Features
=================
If the package supports it, you can cause programs to be installed
with an extra prefix or suffix on their names by giving 'configure' the
option '--program-prefix=PREFIX' or '--program-suffix=SUFFIX'.
with an extra prefix or suffix on their names by giving configure the
option --program-prefix=PREFIX or --program-suffix=SUFFIX.
Some packages pay attention to '--enable-FEATURE' options to
'configure', where FEATURE indicates an optional part of the package.
They may also pay attention to '--with-PACKAGE' options, where PACKAGE
is something like 'gnu-as' or 'x' (for the X Window System). The
'README' should mention any '--enable-' and '--with-' options that the
package recognizes.
For packages that use the X Window System, 'configure' can usually
find the X include and library files automatically, but if it doesn't,
you can use the 'configure' options '--x-includes=DIR' and
'--x-libraries=DIR' to specify their locations.
Some packages pay attention to --enable-FEATURE and
--disable-FEATURE options to configure, where FEATURE indicates an
optional part of the package. They may also pay attention to
--with-PACKAGE and --without-PACKAGE options, where PACKAGE is
something like gnu-ld. ./configure --help should mention the
--enable-... and --with-... options that the package recognizes.
Some packages offer the ability to configure how verbose the
execution of 'make' will be. For these packages, running './configure
--enable-silent-rules' sets the default to minimal output, which can be
overridden with 'make V=1'; while running './configure
--disable-silent-rules' sets the default to verbose, which can be
overridden with 'make V=0'.
execution of make will be. For these packages, running ./configure
--enable-silent-rules sets the default to minimal output, which can be
overridden with make V=1; while running ./configure
--disable-silent-rules sets the default to verbose, which can be
overridden with make V=0.
Particular systems
==================
Specifying a System Type
========================
On HP-UX, the default C compiler is not ANSI C compatible. If GNU CC
is not installed, it is recommended to use the following options in
order to use an ANSI C compiler:
By default configure builds for the current system. To create
binaries that can run on a different system type, specify a
--host=TYPE option along with compiler variables that specify how to
generate object code for TYPE. For example, to create binaries intended
to run on a 64-bit ARM processor:
./configure CC="cc -Ae -D_XOPEN_SOURCE=500"
./configure --host=aarch64-linux-gnu \
CC=aarch64-linux-gnu-gcc \
CXX=aarch64-linux-gnu-g++
and if that doesn't work, install pre-built binaries of GCC for HP-UX.
If done on a machine that can execute these binaries (e.g., via
qemu-aarch64, $QEMU_LD_PREFIX, and Linuxs binfmt_misc
capability), the build behaves like a native build. Otherwise it is a
cross-build: configure will make cross-compilation guesses instead of
running test programs, and make check will not work.
HP-UX 'make' updates targets which have the same time stamps as their
prerequisites, which makes it generally unusable when shipped generated
files such as 'configure' are involved. Use GNU 'make' instead.
A system type can either be a short name like mingw64, or a
canonical name like x86_64-pc-linux-gnu. Canonical names have the
form CPU-COMPANY-SYSTEM where SYSTEM is either OS or KERNEL-OS. To
canonicalize and validate a system type, you can run the command
config.sub, which is often squirreled away in a subdirectory like
build-aux. For example:
On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot
parse its '<wchar.h>' header file. The option '-nodtk' can be used as a
workaround. If GNU CC is not installed, it is therefore recommended to
try
$ build-aux/config.sub arm64-linux
aarch64-unknown-linux-gnu
$ build-aux/config.sub riscv-lnx
Invalid configuration 'riscv-lnx': OS 'lnx' not recognized
./configure CC="cc"
You can look at the config.sub file to see which types are recognized.
If the file is absent, this package does not need the system type.
and if that doesn't work, try
If configure fails with the diagnostic “cannot guess build type”.
config.sub did not recognize your systems type. In this case, first
fetch the newest versions of these files from the GNU config package
(https://savannah.gnu.org/projects/config). If that fixes things,
please report it to the maintainers of the package containing
configure. Otherwise, you can try the configure option --build=TYPE
where TYPE comes close to your system type; also, please report the
problem to <config-patches@gnu.org>.
./configure CC="cc -nodtk"
On Solaris, don't put '/usr/ucb' early in your 'PATH'. This
directory contains several dysfunctional programs; working variants of
these programs are available in '/usr/bin'. So, if you need '/usr/ucb'
in your 'PATH', put it _after_ '/usr/bin'.
On Haiku, software installed for all users goes in '/boot/common',
not '/usr/local'. It is recommended to use the following options:
./configure --prefix=/boot/common
Specifying the System Type
==========================
There may be some features 'configure' cannot figure out
automatically, but needs to determine by the type of machine the package
will run on. Usually, assuming the package is built to be run on the
_same_ architectures, 'configure' can figure that out, but if it prints
a message saying it cannot guess the machine type, give it the
'--build=TYPE' option. TYPE can either be a short name for the system
type, such as 'sun4', or a canonical name which has the form:
CPU-COMPANY-SYSTEM
where SYSTEM can have one of these forms:
OS
KERNEL-OS
See the file 'config.sub' for the possible values of each field. If
'config.sub' isn't included in this package, then this package doesn't
need to know the machine type.
If you are _building_ compiler tools for cross-compiling, you should
use the option '--target=TYPE' to select the type of system they will
produce code for.
If you want to _use_ a cross compiler, that generates code for a
platform different from the build platform, you should specify the
"host" platform (i.e., that on which the generated programs will
eventually be run) with '--host=TYPE'.
For more details about configuring system types, see the Autoconf
documentation.
Sharing Defaults
================
If you want to set default values for 'configure' scripts to share,
you can create a site shell script called 'config.site' that gives
default values for variables like 'CC', 'cache_file', and 'prefix'.
'configure' looks for 'PREFIX/share/config.site' if it exists, then
'PREFIX/etc/config.site' if it exists. Or, you can set the
'CONFIG_SITE' environment variable to the location of the site script.
A warning: not all 'configure' scripts look for a site script.
If you want to set default values for configure scripts to share,
you can create a site shell script called config.site that gives
default values for variables like CC, cache_file, and prefix.
configure looks for PREFIX/share/config.site if it exists, then
PREFIX/etc/config.site if it exists. Or, you can set the
CONFIG_SITE environment variable to the location of the site script.
A warning: not all configure scripts look for a site script.
Defining Variables
==================
Variables not defined in a site shell script can be set in the
environment passed to 'configure'. However, some packages may run
environment passed to configure. However, some packages may run
configure again during the build, and the customized values of these
variables may be lost. In order to avoid this problem, you should set
them in the 'configure' command line, using 'VAR=value'. For example:
them in the configure command line, using VAR=value. For example:
./configure CC=/usr/local2/bin/gcc
causes the specified 'gcc' to be used as the C compiler (unless it is
causes the specified gcc to be used as the C compiler (unless it is
overridden in the site shell script).
Unfortunately, this technique does not work for 'CONFIG_SHELL' due to an
Unfortunately, this technique does not work for CONFIG_SHELL due to an
Autoconf limitation. Until the limitation is lifted, you can use this
workaround:
CONFIG_SHELL=/bin/bash ./configure CONFIG_SHELL=/bin/bash
'configure' Invocation
configure Invocation
======================
'configure' recognizes the following options to control how it
configure recognizes the following options to control how it
operates.
'--help'
'-h'
Print a summary of all of the options to 'configure', and exit.
--help
-h
Print a summary of all of the options to configure, and exit.
'--help=short'
'--help=recursive'
Print a summary of the options unique to this package's
'configure', and exit. The 'short' variant lists options used only
in the top level, while the 'recursive' variant lists options also
--help=short
--help=recursive
Print a summary of the options unique to this packages
configure, and exit. The short variant lists options used only
in the top level, while the recursive variant lists options also
present in any nested packages.
'--version'
'-V'
Print the version of Autoconf used to generate the 'configure'
--version
-V
Print the version of Autoconf used to generate the configure
script, and exit.
'--cache-file=FILE'
--cache-file=FILE
Enable the cache: use and save the results of the tests in FILE,
traditionally 'config.cache'. FILE defaults to '/dev/null' to
traditionally config.cache. FILE defaults to /dev/null to
disable caching.
'--config-cache'
'-C'
Alias for '--cache-file=config.cache'.
--config-cache
-C
Alias for --cache-file=config.cache.
'--quiet'
'--silent'
'-q'
Do not print messages saying which checks are being made. To
suppress all normal output, redirect it to '/dev/null' (any error
messages will still be shown).
--srcdir=DIR
Look for the packages source code in directory DIR. Usually
configure can determine that directory automatically.
'--srcdir=DIR'
Look for the package's source code in directory DIR. Usually
'configure' can determine that directory automatically.
'--prefix=DIR'
Use DIR as the installation prefix. *note Installation Names:: for
--prefix=DIR
Use DIR as the installation prefix. See “Installation Names” for
more details, including other options available for fine-tuning the
installation locations.
'--no-create'
'-n'
--host=TYPE
Build binaries for system TYPE. See “Specifying a System Type”.
--enable-FEATURE
--disable-FEATURE
Enable or disable the optional FEATURE. See “Optional Features”.
--with-PACKAGE
--without-PACKAGE
Use or omit PACKAGE when building. See “Optional Features”.
--quiet
--silent
-q
Do not print messages saying which checks are being made. To
suppress all normal output, redirect it to /dev/null (any error
messages will still be shown).
--no-create
-n
Run the configure checks, but stop before creating any output
files.
'configure' also accepts some other, not widely useful, options. Run
'configure --help' for more details.
configure also recognizes several environment variables, and accepts
some other, less widely useful, options. Run configure --help for
more details.
Copyright notice
================
Copyright © 19941996, 19992002, 20042017, 20202024 Free Software
Foundation, Inc.
Copying and distribution of this file, with or without modification,
are permitted in any medium without royalty provided the copyright
notice and this notice are preserved. This file is offered as-is,
without warranty of any kind.
@@ -1,6 +1,6 @@
# Main Automakefile for GNU diffutils.
# Copyright (C) 2001-2002, 2004, 2006, 2009-2013, 2015-2017 Free Software
# Copyright (C) 2001-2002, 2004, 2006, 2009-2013, 2015-2025 Free Software
# Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
File diff suppressed because it is too large Load Diff
+148 -7
View File
@@ -1,5 +1,146 @@
GNU diffutils NEWS -*- outline -*-
* Noteworthy changes in release 3.12 (2025-04-08) [stable]
** Bug fixes
diff -r no longer merely summarizes when comparing an empty regular
file to a nonempty regular file.
[bug#76452 introduced in 3.11]
diff -y no longer crashes when given nontrivial differences.
[bug#76613 introduced in 3.11]
* Noteworthy changes in release 3.11 (2025-02-02) [stable]
** Improvements
Programs now quote file names more consistently in diagnostics.
For example; "cmp 'none of' /etc/passwd" now might output
"cmp: EOF on none of which is empty" instead of outputting
"cmp: EOF on none of which is empty". In diagnostic messages
that traditionally omit quotes and where backward compatibility
seems to be important, programs continue to omit quotes unless
a file name contains shell metacharacters, in which case programs
use shell quoting. For example, although diff continues to output
"Only in a: b" as before for most file names, it now outputs
"Only in 'a: b': 'c: d'" instead of "Only in a: b: c: d" because the
file names 'a: b' and 'c: d' contain spaces. For compatibility
with previous practice, diff -c and -u headers continue to quote for
C rather than for the shell.
diff now outputs more information when symbolic links differ, e.g.,
"Symbolic links d/f -> a and e/f -> b differ", not just
"Symbolic links d/f and e/f differ". Special files too, e.g.,
"Character special files d/f (1, 3) and e/f (5, 0) differ", not
"File d/f is a character special file while file e/f is a character
special file".
diff's --ignore-case (-i) and --ignore-file-name-case options now
support multi-byte characters. For example, they treat Greek
capital Δ like small δ when input uses UTF-8.
diff now supports multi-byte characters when treating white space.
In options like --expand-tabs (-t), --ignore-space-change (-b) and
--ignore-tab-expansion (-E), diff now recognizes non-ASCII space
characters and counts columns for non-ASCII characters.
** Bug fixes
cmp -bl no longer omits "M-" from bytes with the high bit set in
single-byte locales like en_US.iso8859-1. This fix causes the
behavior to be locale independent, and to be the same as the
longstanding behavior in the C locale and in locales using UTF-8.
[bug introduced in 2.9]
cmp -i N and -n N no longer fail merely because N is enormous.
[bug present since "the beginning"]
cmp -s no longer mishandles /proc files, for which the Linux kernel
reports a zero size even when nonempty. For example, the following
shell command now outputs nothing, as it should:
cp /proc/cmdline t; cmp -s /proc/cmdline t || echo files differ
[bug present since "the beginning"]
diff -E no longer mishandles some input lines containing '\a', '\b',
'\f', '\r', '\v', or '\0'.
[bug present since 2.8]
diff -ly no longer mishandles non-ASCII input.
[bug#64461 introduced in 2.9]
diff - A/B now works correctly when standard input is a directory,
by reading a file named B in that directory.
[bug present since "the beginning"]
diff no longer suffers from race conditions in some cases
when comparing files in a mutating file system.
[bug present since "the beginning"]
** Release
distribute gzip-compressed tarballs once again
* Noteworthy changes in release 3.10 (2023-05-21) [stable]
** Bug fixes
cmp/diff can again work with file dates past Y2K38
[bug introduced in 3.9]
diff -D no longer fails to output #ifndef lines.
[bug#61193 introduced in 3.9]
* Noteworthy changes in release 3.9 (2023-01-15) [stable]
** Bug fixes
diff -c and -u no longer output incorrect timezones in headers
on platforms like Solaris where struct tm lacks tm_gmtoff.
[bug#51228 introduced in 3.4]
* Noteworthy changes in release 3.8 (2021-08-01) [stable]
** Incompatible changes
diff no longer treats a closed stdin as representing an absent file
in usage like 'diff --new-file - foo <&-'. This feature was rarely
if ever used and was not portable to POSIX platforms that reopen
stdin on exec, such as SELinux if the process underwent an AT_SECURE
transition, or HP-UX even if not setuid.
[bug#33965 introduced in 2.8]
** Bug fixes
diff and related programs no longer get confused if stdin, stdout,
or stderr are closed. Previously, they sometimes opened files into
file descriptors 0, 1, or 2 and then mistakenly did I/O with them
that was intended for stdin, stdout, or stderr.
[bug#33965 present since "the beginning"]
cmp, diff and sdiff no longer treat negative command-line
option-arguments as if they were large positive numbers.
[bug#35256 introduced in 2.8]
* Noteworthy changes in release 3.7 (2018-12-31) [stable]
** Bug fixes
diff --strip-trailing-cr with a single CR byte in one input file
would provoke an uninitialized memory read, e.g.,
diff -a --strip-trailing-cr <(printf '\r') <(echo a)
[bug introduced in 2.8 with addition of the --strip-trailing-cr option]
** Improvements
diff --color now produces output compatible with less -R.
* Noteworthy changes in release 3.6 (2017-05-21) [stable]
** New features
@@ -309,12 +450,12 @@ User-visible changes in version 2.4:
printed according to the printf specification.
E.g. '%5df' prints the number of the first line in the
group in the old file using the "%5d" format.
e: line number just before the group in old file; equals f - 1
f: first line number in group in the old file
l: last line number in group in the old file
m: line number just after the group in old file; equals l + 1
n: number of lines in group in the old file; equals l - f + 1
E, F, L, M, N: likewise, for lines in the new file
e: line number just before the group in old file; equals f - 1
f: first line number in group in the old file
l: last line number in group in the old file
m: line number just after the group in old file; equals l + 1
n: number of lines in group in the old file; equals l - f + 1
E, F, L, M, N: likewise, for lines in the new file
%(A=B?T:E)
If A equals B then T else E. A and B are each either a decimal
constant or a single letter interpreted as above. T and E are
@@ -404,7 +545,7 @@ User-visible changes in version 2.0:
Copyright (C) 1993-1994, 1998, 2001-2002, 2004, 2006, 2009-2013, 2015-2017 Free
Copyright (C) 1993-1994, 1998, 2001-2002, 2004, 2006, 2009-2013, 2015-2025 Free
Software Foundation, Inc.
This file is part of GNU Diffutils.
+1 -1
View File
@@ -51,7 +51,7 @@ Please report bugs to <bug-diffutils@gnu.org>.
-----
Copyright (C) 1992, 1998, 2001-2002, 2004, 2009-2013, 2015-2017 Free Software
Copyright (C) 1992, 1998, 2001-2002, 2004, 2009-2013, 2015-2025 Free Software
Foundation, Inc.
This file is part of GNU Diffutils.
+9 -1
View File
@@ -1,7 +1,15 @@
Add --git option to generate output compatible with 'git diff -p'.
This would behave like 'diff -p', except that it would also generate
the extended headers 'old mode', 'new mode', 'deleted file mode', and
'new file mode', and it would quote file names with unusual characters.
GNU patch already parses this format.
Add --include option (opposite of --exclude).
Add SEEK_DATA/SEEK_HOLE sparse file optimization to cmp, diff -q, etc.
Look into sdiff improvement here:
http://www.pkix.net/~chuck/sdiff2.diff
https://web.archive.org/web/20090106164131/http://www.pkix.net/~chuck/sdiff2.diff
Propagate stderr from subprocess so that diff3 does
a better job of explaining _why_:
+165 -36
View File
@@ -1,4 +1,4 @@
# generated automatically by aclocal 1.18.1 -*- Autoconf -*-
# generated automatically by aclocal 1.17.0.91 -*- Autoconf -*-
# Copyright (C) 1996-2025 Free Software Foundation, Inc.
@@ -14,8 +14,8 @@
m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
m4_ifndef([AC_AUTOCONF_VERSION],
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.72],,
[m4_warning([this file was generated for autoconf 2.72.
m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.72.76-2f64],,
[m4_warning([this file was generated for autoconf 2.72.76-2f64.
You have another version of autoconf. It may work, but is not guaranteed to.
If you have problems, you may need to regenerate the build system entirely.
To do so, use the procedure documented by the package, typically 'autoreconf'.])])
@@ -32,10 +32,10 @@ To do so, use the procedure documented by the package, typically 'autoreconf'.])
# generated from the m4 files accompanying Automake X.Y.
# (This private macro should not be called outside this file.)
AC_DEFUN([AM_AUTOMAKE_VERSION],
[am__api_version='1.18'
[am__api_version='1.17'
dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
dnl require some minimum version. Point them to the right macro.
m4_if([$1], [1.18.1], [],
m4_if([$1], [1.17.0.91], [],
[AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
])
@@ -51,7 +51,7 @@ m4_define([_AM_AUTOCONF_VERSION], [])
# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
[AM_AUTOMAKE_VERSION([1.18.1])dnl
[AM_AUTOMAKE_VERSION([1.17.0.91])dnl
m4_ifndef([AC_AUTOCONF_VERSION],
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
@@ -108,6 +108,43 @@ AC_DEFUN([AM_AUX_DIR_EXPAND],
am_aux_dir=`cd "$ac_aux_dir" && pwd`
])
# AM_COND_IF -*- Autoconf -*-
# Copyright (C) 2008-2025 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# _AM_COND_IF
# _AM_COND_ELSE
# _AM_COND_ENDIF
# --------------
# These macros are only used for tracing.
m4_define([_AM_COND_IF])
m4_define([_AM_COND_ELSE])
m4_define([_AM_COND_ENDIF])
# AM_COND_IF(COND, [IF-TRUE], [IF-FALSE])
# ---------------------------------------
# If the shell condition COND is true, execute IF-TRUE, otherwise execute
# IF-FALSE. Allow automake to learn about conditional instantiating macros
# (the AC_CONFIG_FOOS).
AC_DEFUN([AM_COND_IF],
[m4_ifndef([_AM_COND_VALUE_$1],
[m4_fatal([$0: no such condition "$1"])])dnl
_AM_COND_IF([$1])dnl
if test -z "$$1_TRUE"; then :
m4_n([$2])[]dnl
m4_ifval([$3],
[_AM_COND_ELSE([$1])dnl
else
$3
])dnl
_AM_COND_ENDIF([$1])dnl
fi[]dnl
])
# AM_CONDITIONAL -*- Autoconf -*-
# Copyright (C) 1997-2025 Free Software Foundation, Inc.
@@ -500,9 +537,8 @@ AC_REQUIRE([AC_PROG_AWK])dnl
AC_REQUIRE([AC_PROG_MAKE_SET])dnl
AC_REQUIRE([AM_SET_LEADING_DOT])dnl
_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
[_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
[_AM_IF_OPTION([tar-v7], [_AM_PROG_TAR([v7])],
[_AM_PROG_TAR([ustar])])])])
[_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
[_AM_PROG_TAR([v7])])])
_AM_IF_OPTION([no-dependencies],,
[AC_PROVIDE_IFELSE([AC_PROG_CC],
[_AM_DEPENDENCIES([CC])],
@@ -1316,70 +1352,101 @@ AC_SUBST(am__xargs_n)
])
m4_include([m4/00gnulib.m4])
m4_include([m4/__inline.m4])
m4_include([m4/absolute-header.m4])
m4_include([m4/alloca.m4])
m4_include([m4/arpa_inet_h.m4])
m4_include([m4/asm-underscore.m4])
m4_include([m4/assert_h.m4])
m4_include([m4/atoll.m4])
m4_include([m4/btowc.m4])
m4_include([m4/build-to-host.m4])
m4_include([m4/builtin-expect.m4])
m4_include([m4/c-bool.m4])
m4_include([m4/c-stack.m4])
m4_include([m4/c32rtomb.m4])
m4_include([m4/calloc.m4])
m4_include([m4/chdir-long.m4])
m4_include([m4/clock_time.m4])
m4_include([m4/close.m4])
m4_include([m4/closedir.m4])
m4_include([m4/codeset.m4])
m4_include([m4/config-h.m4])
m4_include([m4/configmake.m4])
m4_include([m4/ctype.m4])
m4_include([m4/dirname.m4])
m4_include([m4/ctype_h.m4])
m4_include([m4/d-type.m4])
m4_include([m4/dirent_h.m4])
m4_include([m4/dirfd.m4])
m4_include([m4/double-slash-root.m4])
m4_include([m4/dup.m4])
m4_include([m4/dup2.m4])
m4_include([m4/eealloc.m4])
m4_include([m4/environ.m4])
m4_include([m4/errno_h.m4])
m4_include([m4/error.m4])
m4_include([m4/error_h.m4])
m4_include([m4/exponentd.m4])
m4_include([m4/exponentf.m4])
m4_include([m4/exponentl.m4])
m4_include([m4/extensions-aix.m4])
m4_include([m4/extensions.m4])
m4_include([m4/extern-inline.m4])
m4_include([m4/fchdir.m4])
m4_include([m4/fclose.m4])
m4_include([m4/fcntl-o.m4])
m4_include([m4/fcntl.m4])
m4_include([m4/fcntl_h.m4])
m4_include([m4/fdopen.m4])
m4_include([m4/fdopendir.m4])
m4_include([m4/fflush.m4])
m4_include([m4/fileblocks.m4])
m4_include([m4/filenamecat.m4])
m4_include([m4/flexmember.m4])
m4_include([m4/float_h.m4])
m4_include([m4/fnmatch.m4])
m4_include([m4/fnmatch_h.m4])
m4_include([m4/fopen.m4])
m4_include([m4/fpieee.m4])
m4_include([m4/free.m4])
m4_include([m4/freopen.m4])
m4_include([m4/fstat.m4])
m4_include([m4/fstatat.m4])
m4_include([m4/ftruncate.m4])
m4_include([m4/getcwd.m4])
m4_include([m4/getdtablesize.m4])
m4_include([m4/getopt.m4])
m4_include([m4/getpagesize.m4])
m4_include([m4/getprogname.m4])
m4_include([m4/getrandom.m4])
m4_include([m4/gettext.m4])
m4_include([m4/gettime.m4])
m4_include([m4/gettimeofday.m4])
m4_include([m4/glibc21.m4])
m4_include([m4/gnu-make.m4])
m4_include([m4/gnulib-common.m4])
m4_include([m4/gnulib-comp.m4])
m4_include([m4/hard-locale.m4])
m4_include([m4/gnulib-i18n.m4])
m4_include([m4/host-cpu-c-abi.m4])
m4_include([m4/iconv.m4])
m4_include([m4/iconv_h.m4])
m4_include([m4/iconv_open.m4])
m4_include([m4/include_next.m4])
m4_include([m4/inet_pton.m4])
m4_include([m4/inline.m4])
m4_include([m4/intl-thread-locale.m4])
m4_include([m4/intlmacosx.m4])
m4_include([m4/intmax_t.m4])
m4_include([m4/inttostr.m4])
m4_include([m4/inttypes-pri.m4])
m4_include([m4/inttypes.m4])
m4_include([m4/inttypes_h.m4])
m4_include([m4/ioctl.m4])
m4_include([m4/isblank.m4])
m4_include([m4/isnand.m4])
m4_include([m4/isnanf.m4])
m4_include([m4/isnanl.m4])
m4_include([m4/iswblank.m4])
m4_include([m4/iswctype.m4])
m4_include([m4/iswdigit.m4])
m4_include([m4/iswpunct.m4])
m4_include([m4/iswxdigit.m4])
m4_include([m4/langinfo_h.m4])
m4_include([m4/largefile.m4])
m4_include([m4/lcmessage.m4])
m4_include([m4/lib-ld.m4])
m4_include([m4/lib-link.m4])
m4_include([m4/lib-prefix.m4])
@@ -1387,28 +1454,31 @@ m4_include([m4/libsigsegv.m4])
m4_include([m4/libunistring-base.m4])
m4_include([m4/limits-h.m4])
m4_include([m4/localcharset.m4])
m4_include([m4/locale-en.m4])
m4_include([m4/locale-fr.m4])
m4_include([m4/locale-ja.m4])
m4_include([m4/locale-tr.m4])
m4_include([m4/locale-zh.m4])
m4_include([m4/locale_h.m4])
m4_include([m4/localeconv.m4])
m4_include([m4/localtime-buffer.m4])
m4_include([m4/longlong.m4])
m4_include([m4/localename.m4])
m4_include([m4/lock.m4])
m4_include([m4/lstat.m4])
m4_include([m4/malloc.m4])
m4_include([m4/malloca.m4])
m4_include([m4/manywarnings.m4])
m4_include([m4/mbchar.m4])
m4_include([m4/mbiter.m4])
m4_include([m4/math_h.m4])
m4_include([m4/mbrtoc32.m4])
m4_include([m4/mbrtowc.m4])
m4_include([m4/mbsinit.m4])
m4_include([m4/mbslen.m4])
m4_include([m4/mbsrtowcs.m4])
m4_include([m4/mbstate_t.m4])
m4_include([m4/mbtowc.m4])
m4_include([m4/memchr.m4])
m4_include([m4/mempcpy.m4])
m4_include([m4/memrchr.m4])
m4_include([m4/minmax.m4])
m4_include([m4/mkdir.m4])
m4_include([m4/mkstemp.m4])
m4_include([m4/mktime.m4])
m4_include([m4/mmap-anon.m4])
@@ -1416,64 +1486,109 @@ m4_include([m4/mode_t.m4])
m4_include([m4/msvc-inval.m4])
m4_include([m4/msvc-nothrow.m4])
m4_include([m4/multiarch.m4])
m4_include([m4/musl.m4])
m4_include([m4/nan-mips.m4])
m4_include([m4/nanosleep.m4])
m4_include([m4/netinet_in_h.m4])
m4_include([m4/nl_langinfo.m4])
m4_include([m4/nls.m4])
m4_include([m4/nocrash.m4])
m4_include([m4/nstrftime.m4])
m4_include([m4/nullptr.m4])
m4_include([m4/off64_t.m4])
m4_include([m4/off_t.m4])
m4_include([m4/once.m4])
m4_include([m4/open-cloexec.m4])
m4_include([m4/open-slash.m4])
m4_include([m4/open.m4])
m4_include([m4/openat.m4])
m4_include([m4/opendir.m4])
m4_include([m4/pathmax.m4])
m4_include([m4/pclose.m4])
m4_include([m4/perl.m4])
m4_include([m4/perror.m4])
m4_include([m4/pipe.m4])
m4_include([m4/po.m4])
m4_include([m4/popen.m4])
m4_include([m4/printf.m4])
m4_include([m4/priv-set.m4])
m4_include([m4/progtest.m4])
m4_include([m4/pselect.m4])
m4_include([m4/pthread-cond.m4])
m4_include([m4/pthread-mutex.m4])
m4_include([m4/pthread-once.m4])
m4_include([m4/pthread-rwlock.m4])
m4_include([m4/pthread-spin.m4])
m4_include([m4/pthread-thread.m4])
m4_include([m4/pthread_h.m4])
m4_include([m4/pthread_mutex_timedlock.m4])
m4_include([m4/pthread_rwlock_rdlock.m4])
m4_include([m4/pthread_sigmask.m4])
m4_include([m4/putenv.m4])
m4_include([m4/quote.m4])
m4_include([m4/quotearg.m4])
m4_include([m4/raise.m4])
m4_include([m4/random.m4])
m4_include([m4/random_r.m4])
m4_include([m4/rawmemchr.m4])
m4_include([m4/readdir.m4])
m4_include([m4/readlink.m4])
m4_include([m4/readlinkat.m4])
m4_include([m4/realloc.m4])
m4_include([m4/reallocarray.m4])
m4_include([m4/regex.m4])
m4_include([m4/secure_getenv.m4])
m4_include([m4/rmdir.m4])
m4_include([m4/save-cwd.m4])
m4_include([m4/sched_h.m4])
m4_include([m4/sched_yield.m4])
m4_include([m4/select.m4])
m4_include([m4/semaphore.m4])
m4_include([m4/setenv.m4])
m4_include([m4/setlocale.m4])
m4_include([m4/setlocale_null.m4])
m4_include([m4/sigaction.m4])
m4_include([m4/sigaltstack.m4])
m4_include([m4/signal_h.m4])
m4_include([m4/signalblocking.m4])
m4_include([m4/signbit.m4])
m4_include([m4/sigsegv.m4])
m4_include([m4/size_max.m4])
m4_include([m4/sleep.m4])
m4_include([m4/snan.m4])
m4_include([m4/snprintf.m4])
m4_include([m4/socketlib.m4])
m4_include([m4/sockets.m4])
m4_include([m4/socklen.m4])
m4_include([m4/sockpfaf.m4])
m4_include([m4/ssize_t.m4])
m4_include([m4/stack-direction.m4])
m4_include([m4/stat-size.m4])
m4_include([m4/stat-time.m4])
m4_include([m4/stat.m4])
m4_include([m4/stdalign.m4])
m4_include([m4/stdarg.m4])
m4_include([m4/stdbool.m4])
m4_include([m4/stdbit_h.m4])
m4_include([m4/stddef_h.m4])
m4_include([m4/stdint.m4])
m4_include([m4/stdint_h.m4])
m4_include([m4/stdio_h.m4])
m4_include([m4/stdlib_h.m4])
m4_include([m4/strcase.m4])
m4_include([m4/stpcpy.m4])
m4_include([m4/strcasecmp.m4])
m4_include([m4/strdup.m4])
m4_include([m4/strerror.m4])
m4_include([m4/strerror_r.m4])
m4_include([m4/strftime.m4])
m4_include([m4/string_h.m4])
m4_include([m4/strings_h.m4])
m4_include([m4/strndup.m4])
m4_include([m4/strncasecmp.m4])
m4_include([m4/strnlen.m4])
m4_include([m4/strptime.m4])
m4_include([m4/strtoull.m4])
m4_include([m4/strtoumax.m4])
m4_include([m4/strtoimax.m4])
m4_include([m4/strtoll.m4])
m4_include([m4/symlink.m4])
m4_include([m4/symlinkat.m4])
m4_include([m4/sys_cdefs_h.m4])
m4_include([m4/sys_ioctl_h.m4])
m4_include([m4/sys_random_h.m4])
m4_include([m4/sys_select_h.m4])
m4_include([m4/sys_socket_h.m4])
m4_include([m4/sys_stat_h.m4])
@@ -1482,31 +1597,45 @@ m4_include([m4/sys_types_h.m4])
m4_include([m4/sys_uio_h.m4])
m4_include([m4/sys_wait_h.m4])
m4_include([m4/tempname.m4])
m4_include([m4/thread.m4])
m4_include([m4/threadlib.m4])
m4_include([m4/time.m4])
m4_include([m4/time_h.m4])
m4_include([m4/time_r.m4])
m4_include([m4/time_rz.m4])
m4_include([m4/timegm.m4])
m4_include([m4/timespec.m4])
m4_include([m4/timespec_get.m4])
m4_include([m4/tm_gmtoff.m4])
m4_include([m4/tzset.m4])
m4_include([m4/uchar_h.m4])
m4_include([m4/unicase_h.m4])
m4_include([m4/unictype_h.m4])
m4_include([m4/uninorm_h.m4])
m4_include([m4/unistd_h.m4])
m4_include([m4/unlink.m4])
m4_include([m4/unlinkat.m4])
m4_include([m4/unlinkdir.m4])
m4_include([m4/unlocked-io.m4])
m4_include([m4/vararrays.m4])
m4_include([m4/vasnprintf.m4])
m4_include([m4/vasprintf.m4])
m4_include([m4/version-etc.m4])
m4_include([m4/visibility.m4])
m4_include([m4/warn-on-use.m4])
m4_include([m4/warnings.m4])
m4_include([m4/wchar_h.m4])
m4_include([m4/wchar_t.m4])
m4_include([m4/wcrtomb.m4])
m4_include([m4/wctob.m4])
m4_include([m4/wctomb.m4])
m4_include([m4/wctype.m4])
m4_include([m4/wctype_h.m4])
m4_include([m4/wcwidth.m4])
m4_include([m4/windows-rc.m4])
m4_include([m4/wint_t.m4])
m4_include([m4/wmemchr.m4])
m4_include([m4/wmempcpy.m4])
m4_include([m4/xalloc.m4])
m4_include([m4/xgetcwd.m4])
m4_include([m4/xsize.m4])
m4_include([m4/xstrndup.m4])
m4_include([m4/xstrtol.m4])
m4_include([m4/xvasprintf.m4])
m4_include([m4/yield.m4])
m4_include([m4/zzgnulib.m4])
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -1,918 +0,0 @@
# This file was generated by Autom4te 2.72.
# It contains the lists of macros which have been traced.
# It can be safely removed.
@request = (
bless( [
'0',
1,
[
'/usr/share/autoconf'
],
[
'/usr/share/autoconf/autoconf/autoconf.m4f',
'/usr/share/aclocal-1.18/internal/ac-config-macro-dirs.m4',
'/usr/share/aclocal-1.18/amversion.m4',
'/usr/share/aclocal-1.18/auxdir.m4',
'/usr/share/aclocal-1.18/cond.m4',
'/usr/share/aclocal-1.18/depend.m4',
'/usr/share/aclocal-1.18/depout.m4',
'/usr/share/aclocal-1.18/init.m4',
'/usr/share/aclocal-1.18/install-sh.m4',
'/usr/share/aclocal-1.18/lead-dot.m4',
'/usr/share/aclocal-1.18/make.m4',
'/usr/share/aclocal-1.18/missing.m4',
'/usr/share/aclocal-1.18/mkdirp.m4',
'/usr/share/aclocal-1.18/options.m4',
'/usr/share/aclocal-1.18/prog-cc-c-o.m4',
'/usr/share/aclocal-1.18/rmf.m4',
'/usr/share/aclocal-1.18/runlog.m4',
'/usr/share/aclocal-1.18/sanity.m4',
'/usr/share/aclocal-1.18/silent.m4',
'/usr/share/aclocal-1.18/strip.m4',
'/usr/share/aclocal-1.18/substnot.m4',
'/usr/share/aclocal-1.18/tar.m4',
'/usr/share/aclocal-1.18/xargsn.m4',
'm4/00gnulib.m4',
'm4/absolute-header.m4',
'm4/alloca.m4',
'm4/arpa_inet_h.m4',
'm4/btowc.m4',
'm4/builtin-expect.m4',
'm4/c-stack.m4',
'm4/clock_time.m4',
'm4/close.m4',
'm4/codeset.m4',
'm4/config-h.m4',
'm4/configmake.m4',
'm4/ctype.m4',
'm4/dirname.m4',
'm4/double-slash-root.m4',
'm4/dup2.m4',
'm4/eealloc.m4',
'm4/environ.m4',
'm4/errno_h.m4',
'm4/error.m4',
'm4/exponentd.m4',
'm4/extensions.m4',
'm4/extern-inline.m4',
'm4/fcntl-o.m4',
'm4/fcntl.m4',
'm4/fcntl_h.m4',
'm4/fdopen.m4',
'm4/filenamecat.m4',
'm4/flexmember.m4',
'm4/float_h.m4',
'm4/fnmatch.m4',
'm4/fpieee.m4',
'm4/freopen.m4',
'm4/fstat.m4',
'm4/ftruncate.m4',
'm4/getcwd.m4',
'm4/getdtablesize.m4',
'm4/getopt.m4',
'm4/getpagesize.m4',
'm4/getprogname.m4',
'm4/gettext.m4',
'm4/gettime.m4',
'm4/gettimeofday.m4',
'm4/glibc21.m4',
'm4/gnu-make.m4',
'm4/gnulib-common.m4',
'm4/gnulib-comp.m4',
'm4/hard-locale.m4',
'm4/iconv.m4',
'm4/iconv_h.m4',
'm4/iconv_open.m4',
'm4/include_next.m4',
'm4/inet_pton.m4',
'm4/inline.m4',
'm4/intlmacosx.m4',
'm4/intmax_t.m4',
'm4/inttostr.m4',
'm4/inttypes-pri.m4',
'm4/inttypes.m4',
'm4/inttypes_h.m4',
'm4/ioctl.m4',
'm4/isblank.m4',
'm4/iswblank.m4',
'm4/langinfo_h.m4',
'm4/largefile.m4',
'm4/lib-ld.m4',
'm4/lib-link.m4',
'm4/lib-prefix.m4',
'm4/libsigsegv.m4',
'm4/libunistring-base.m4',
'm4/limits-h.m4',
'm4/localcharset.m4',
'm4/locale-fr.m4',
'm4/locale-ja.m4',
'm4/locale-tr.m4',
'm4/locale-zh.m4',
'm4/locale_h.m4',
'm4/localeconv.m4',
'm4/localtime-buffer.m4',
'm4/longlong.m4',
'm4/lstat.m4',
'm4/malloc.m4',
'm4/malloca.m4',
'm4/manywarnings.m4',
'm4/mbchar.m4',
'm4/mbiter.m4',
'm4/mbrtowc.m4',
'm4/mbsinit.m4',
'm4/mbslen.m4',
'm4/mbsrtowcs.m4',
'm4/mbstate_t.m4',
'm4/mbtowc.m4',
'm4/memchr.m4',
'm4/minmax.m4',
'm4/mkstemp.m4',
'm4/mktime.m4',
'm4/mmap-anon.m4',
'm4/mode_t.m4',
'm4/msvc-inval.m4',
'm4/msvc-nothrow.m4',
'm4/multiarch.m4',
'm4/nanosleep.m4',
'm4/netinet_in_h.m4',
'm4/nl_langinfo.m4',
'm4/nls.m4',
'm4/nocrash.m4',
'm4/off_t.m4',
'm4/open.m4',
'm4/pathmax.m4',
'm4/perror.m4',
'm4/pipe.m4',
'm4/po.m4',
'm4/printf.m4',
'm4/progtest.m4',
'm4/putenv.m4',
'm4/quote.m4',
'm4/quotearg.m4',
'm4/raise.m4',
'm4/rawmemchr.m4',
'm4/readlink.m4',
'm4/regex.m4',
'm4/secure_getenv.m4',
'm4/select.m4',
'm4/setenv.m4',
'm4/setlocale.m4',
'm4/sigaction.m4',
'm4/signal_h.m4',
'm4/signalblocking.m4',
'm4/size_max.m4',
'm4/sleep.m4',
'm4/snprintf.m4',
'm4/socketlib.m4',
'm4/sockets.m4',
'm4/socklen.m4',
'm4/sockpfaf.m4',
'm4/ssize_t.m4',
'm4/stat-time.m4',
'm4/stat.m4',
'm4/stdalign.m4',
'm4/stdarg.m4',
'm4/stdbool.m4',
'm4/stddef_h.m4',
'm4/stdint.m4',
'm4/stdint_h.m4',
'm4/stdio_h.m4',
'm4/stdlib_h.m4',
'm4/strcase.m4',
'm4/strerror.m4',
'm4/strerror_r.m4',
'm4/strftime.m4',
'm4/string_h.m4',
'm4/strings_h.m4',
'm4/strndup.m4',
'm4/strnlen.m4',
'm4/strptime.m4',
'm4/strtoull.m4',
'm4/strtoumax.m4',
'm4/symlink.m4',
'm4/sys_ioctl_h.m4',
'm4/sys_select_h.m4',
'm4/sys_socket_h.m4',
'm4/sys_stat_h.m4',
'm4/sys_time_h.m4',
'm4/sys_types_h.m4',
'm4/sys_uio_h.m4',
'm4/sys_wait_h.m4',
'm4/tempname.m4',
'm4/time_h.m4',
'm4/time_r.m4',
'm4/time_rz.m4',
'm4/timegm.m4',
'm4/timespec.m4',
'm4/tm_gmtoff.m4',
'm4/tzset.m4',
'm4/unistd_h.m4',
'm4/unlocked-io.m4',
'm4/vararrays.m4',
'm4/vasnprintf.m4',
'm4/vasprintf.m4',
'm4/version-etc.m4',
'm4/warn-on-use.m4',
'm4/warnings.m4',
'm4/wchar_h.m4',
'm4/wchar_t.m4',
'm4/wcrtomb.m4',
'm4/wctob.m4',
'm4/wctomb.m4',
'm4/wctype_h.m4',
'm4/wcwidth.m4',
'm4/wint_t.m4',
'm4/xalloc.m4',
'm4/xsize.m4',
'm4/xstrndup.m4',
'm4/xstrtol.m4',
'm4/xvasprintf.m4',
'configure.ac'
],
{
'AC_' => 1,
'AC_CHECK_HEADER_STDBOOL' => 1,
'AC_COMPUTE_INT' => 1,
'AC_CONFIG_MACRO_DIR' => 1,
'AC_CONFIG_MACRO_DIR_TRACE' => 1,
'AC_C_FLEXIBLE_ARRAY_MEMBER' => 1,
'AC_C_RESTRICT' => 1,
'AC_C_VARARRAYS' => 1,
'AC_DEFUN' => 1,
'AC_DEFUN_ONCE' => 1,
'AC_FUNC_MBRTOWC' => 1,
'AC_HEADER_MAJOR' => 1,
'AC_LIB_APPENDTOVAR' => 1,
'AC_LIB_ARG_WITH' => 1,
'AC_LIB_FROMPACKAGE' => 1,
'AC_LIB_HAVE_LINKFLAGS' => 1,
'AC_LIB_LINKFLAGS' => 1,
'AC_LIB_LINKFLAGS_BODY' => 1,
'AC_LIB_LINKFLAGS_FROM_LIBS' => 1,
'AC_LIB_PREFIX' => 1,
'AC_LIB_PREPARE_MULTILIB' => 1,
'AC_LIB_PREPARE_PREFIX' => 1,
'AC_LIB_PROG_LD' => 1,
'AC_LIB_PROG_LD_GNU' => 1,
'AC_LIB_RPATH' => 1,
'AC_LIB_WITH_FINAL_PREFIX' => 1,
'AC_PROG_MKDIR_P' => 1,
'AC_PROG_SED' => 1,
'AC_SYS_LARGEFILE' => 1,
'AC_SYS_XSI_STACK_OVERFLOW_HEURISTIC' => 1,
'AC_TYPE_LONG_LONG_INT' => 1,
'AC_TYPE_MBSTATE_T' => 1,
'AC_TYPE_UNSIGNED_LONG_LONG_INT' => 1,
'AC_USE_SYSTEM_EXTENSIONS' => 1,
'AM_AUTOMAKE_VERSION' => 1,
'AM_AUX_DIR_EXPAND' => 1,
'AM_CONDITIONAL' => 1,
'AM_DEP_TRACK' => 1,
'AM_GNU_GETTEXT' => 1,
'AM_GNU_GETTEXT_NEED' => 1,
'AM_GNU_GETTEXT_VERSION' => 1,
'AM_ICONV' => 1,
'AM_ICONV_LINK' => 1,
'AM_ICONV_LINKFLAGS_BODY' => 1,
'AM_INIT_AUTOMAKE' => 1,
'AM_LANGINFO_CODESET' => 1,
'AM_MAKE_INCLUDE' => 1,
'AM_MISSING_HAS_RUN' => 1,
'AM_MISSING_PROG' => 1,
'AM_NLS' => 1,
'AM_OUTPUT_DEPENDENCY_COMMANDS' => 1,
'AM_PATH_PROG_WITH_TEST' => 1,
'AM_POSTPROCESS_PO_MAKEFILE' => 1,
'AM_PO_SUBDIRS' => 1,
'AM_PROG_CC_C_O' => 1,
'AM_PROG_INSTALL_SH' => 1,
'AM_PROG_INSTALL_STRIP' => 1,
'AM_PROG_MKDIR_P' => 1,
'AM_RUN_LOG' => 1,
'AM_SANITY_CHECK' => 1,
'AM_SET_CURRENT_AUTOMAKE_VERSION' => 1,
'AM_SET_DEPDIR' => 1,
'AM_SET_LEADING_DOT' => 1,
'AM_SILENT_RULES' => 1,
'AM_STDBOOL_H' => 1,
'AM_SUBST_NOTMAKE' => 1,
'AM_XGETTEXT_OPTION' => 1,
'AM_XGETTEXT_OPTION_INIT' => 1,
'AU_DEFUN' => 1,
'GL_NOCRASH' => 1,
'_AC_AM_CONFIG_HEADER_HOOK' => 1,
'_AC_FUNC_MALLOC_IF' => 1,
'_AC_TYPE_LONG_LONG_SNIPPET' => 1,
'_AM_AUTOCONF_VERSION' => 1,
'_AM_CONFIG_MACRO_DIRS' => 1,
'_AM_DEPENDENCIES' => 1,
'_AM_FILESYSTEM_TIMESTAMP_RESOLUTION' => 1,
'_AM_IF_OPTION' => 1,
'_AM_MANGLE_OPTION' => 1,
'_AM_OUTPUT_DEPENDENCY_COMMANDS' => 1,
'_AM_PROG_CC_C_O' => 1,
'_AM_PROG_RM_F' => 1,
'_AM_PROG_TAR' => 1,
'_AM_PROG_XARGS_N' => 1,
'_AM_SET_OPTION' => 1,
'_AM_SET_OPTIONS' => 1,
'_AM_SILENT_RULES' => 1,
'_AM_SLEEP_FRACTIONAL_SECONDS' => 1,
'_AM_SUBST_NOTMAKE' => 1,
'_m4_warn' => 1,
'gl_00GNULIB' => 1,
'gl_ABSOLUTE_HEADER' => 1,
'gl_ABSOLUTE_HEADER_ONE' => 1,
'gl_AC_HEADER_INTTYPES_H' => 1,
'gl_AC_HEADER_STDINT_H' => 1,
'gl_AC_TYPE_INTMAX_T' => 1,
'gl_ARPA_INET_H_DEFAULTS' => 1,
'gl_ARPA_INET_MODULE_INDICATOR' => 1,
'gl_ASSERT_NO_GNULIB_POSIXCHECK' => 1,
'gl_ASSERT_NO_GNULIB_TESTS' => 1,
'gl_BIGENDIAN' => 1,
'gl_CACHE_VAL_SILENT' => 1,
'gl_CHECK_MALLOC_POSIX' => 1,
'gl_CHECK_NEXT_HEADERS' => 1,
'gl_CHECK_SOCKET_HEADERS' => 1,
'gl_CHECK_TYPES_SIGNED' => 1,
'gl_CHECK_TYPE_SIGSET_T' => 1,
'gl_CHECK_TYPE_STRUCT_TIMESPEC' => 1,
'gl_CLOCK_TIME' => 1,
'gl_COMMON' => 1,
'gl_COMMON_BODY' => 1,
'gl_COMPILER_OPTION_IF' => 1,
'gl_CONFIGMAKE_PREP' => 1,
'gl_CONFIG_H' => 1,
'gl_CTYPE_H' => 1,
'gl_CTYPE_H_DEFAULTS' => 1,
'gl_CTYPE_MODULE_INDICATOR' => 1,
'gl_C_STACK' => 1,
'gl_DIRNAME' => 1,
'gl_DIRNAME_LGPL' => 1,
'gl_DOUBLE_EXPONENT_LOCATION' => 1,
'gl_DOUBLE_SLASH_ROOT' => 1,
'gl_EARLY' => 1,
'gl_EEALLOC' => 1,
'gl_EEMALLOC' => 1,
'gl_EEREALLOC' => 1,
'gl_ENVIRON' => 1,
'gl_ERROR' => 1,
'gl_EXTERN_INLINE' => 1,
'gl_FCNTL_H' => 1,
'gl_FCNTL_H_DEFAULTS' => 1,
'gl_FCNTL_MODULE_INDICATOR' => 1,
'gl_FCNTL_O_FLAGS' => 1,
'gl_FEATURES_H' => 1,
'gl_FILE_LIST' => 1,
'gl_FILE_NAME_CONCAT' => 1,
'gl_FILE_NAME_CONCAT_LGPL' => 1,
'gl_FLOAT_H' => 1,
'gl_FP_IEEE' => 1,
'gl_FUNC_ALLOCA' => 1,
'gl_FUNC_BTOWC' => 1,
'gl_FUNC_CLOSE' => 1,
'gl_FUNC_DUP2' => 1,
'gl_FUNC_FCNTL' => 1,
'gl_FUNC_FDOPEN' => 1,
'gl_FUNC_FNMATCH_GNU' => 1,
'gl_FUNC_FNMATCH_POSIX' => 1,
'gl_FUNC_FREOPEN' => 1,
'gl_FUNC_FSTAT' => 1,
'gl_FUNC_FTRUNCATE' => 1,
'gl_FUNC_GEN_TEMPNAME' => 1,
'gl_FUNC_GETCWD' => 1,
'gl_FUNC_GETCWD_LGPL' => 1,
'gl_FUNC_GETCWD_NULL' => 1,
'gl_FUNC_GETCWD_SIGNATURE' => 1,
'gl_FUNC_GETDTABLESIZE' => 1,
'gl_FUNC_GETOPT_GNU' => 1,
'gl_FUNC_GETOPT_POSIX' => 1,
'gl_FUNC_GETPAGESIZE' => 1,
'gl_FUNC_GETPROGNAME' => 1,
'gl_FUNC_GETTIMEOFDAY' => 1,
'gl_FUNC_GETTIMEOFDAY_CLOBBER' => 1,
'gl_FUNC_GLIBC_UNLOCKED_IO' => 1,
'gl_FUNC_GNU_STRFTIME' => 1,
'gl_FUNC_ICONV_OPEN' => 1,
'gl_FUNC_INET_PTON' => 1,
'gl_FUNC_IOCTL' => 1,
'gl_FUNC_ISBLANK' => 1,
'gl_FUNC_ISWBLANK' => 1,
'gl_FUNC_LOCALECONV' => 1,
'gl_FUNC_LSTAT' => 1,
'gl_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK' => 1,
'gl_FUNC_MALLOC_GNU' => 1,
'gl_FUNC_MALLOC_POSIX' => 1,
'gl_FUNC_MBRTOWC' => 1,
'gl_FUNC_MBSINIT' => 1,
'gl_FUNC_MBSLEN' => 1,
'gl_FUNC_MBSRTOWCS' => 1,
'gl_FUNC_MBTOWC' => 1,
'gl_FUNC_MEMCHR' => 1,
'gl_FUNC_MKSTEMP' => 1,
'gl_FUNC_MKTIME' => 1,
'gl_FUNC_MKTIME_INTERNAL' => 1,
'gl_FUNC_MKTIME_WORKS' => 1,
'gl_FUNC_MMAP_ANON' => 1,
'gl_FUNC_NANOSLEEP' => 1,
'gl_FUNC_NL_LANGINFO' => 1,
'gl_FUNC_OPEN' => 1,
'gl_FUNC_PERROR' => 1,
'gl_FUNC_PIPE' => 1,
'gl_FUNC_PUTENV' => 1,
'gl_FUNC_RAISE' => 1,
'gl_FUNC_RAWMEMCHR' => 1,
'gl_FUNC_READLINK' => 1,
'gl_FUNC_READLINK_SEPARATE' => 1,
'gl_FUNC_SECURE_GETENV' => 1,
'gl_FUNC_SELECT' => 1,
'gl_FUNC_SETENV' => 1,
'gl_FUNC_SETENV_SEPARATE' => 1,
'gl_FUNC_SETLOCALE' => 1,
'gl_FUNC_SLEEP' => 1,
'gl_FUNC_SNPRINTF' => 1,
'gl_FUNC_STAT' => 1,
'gl_FUNC_STRCASECMP' => 1,
'gl_FUNC_STRERROR' => 1,
'gl_FUNC_STRERROR_0' => 1,
'gl_FUNC_STRERROR_R' => 1,
'gl_FUNC_STRERROR_R_WORKS' => 1,
'gl_FUNC_STRNCASECMP' => 1,
'gl_FUNC_STRNDUP' => 1,
'gl_FUNC_STRNLEN' => 1,
'gl_FUNC_STRPTIME' => 1,
'gl_FUNC_STRTOULL' => 1,
'gl_FUNC_STRTOUMAX' => 1,
'gl_FUNC_SYMLINK' => 1,
'gl_FUNC_TIMEGM' => 1,
'gl_FUNC_TZSET' => 1,
'gl_FUNC_TZSET_CLOBBER' => 1,
'gl_FUNC_UNSETENV' => 1,
'gl_FUNC_VASNPRINTF' => 1,
'gl_FUNC_VASPRINTF' => 1,
'gl_FUNC_WCRTOMB' => 1,
'gl_FUNC_WCTOB' => 1,
'gl_FUNC_WCTOMB' => 1,
'gl_FUNC_WCWIDTH' => 1,
'gl_GETOPT_CHECK_HEADERS' => 1,
'gl_GETOPT_SUBSTITUTE_HEADER' => 1,
'gl_GETTIME' => 1,
'gl_GLIBC21' => 1,
'gl_GNU_MAKE' => 1,
'gl_HARD_LOCALE' => 1,
'gl_HEADER_ARPA_INET' => 1,
'gl_HEADER_ERRNO_H' => 1,
'gl_HEADER_NETINET_IN' => 1,
'gl_HEADER_STRINGS_H' => 1,
'gl_HEADER_STRINGS_H_BODY' => 1,
'gl_HEADER_STRINGS_H_DEFAULTS' => 1,
'gl_HEADER_STRING_H' => 1,
'gl_HEADER_STRING_H_BODY' => 1,
'gl_HEADER_STRING_H_DEFAULTS' => 1,
'gl_HEADER_SYS_SELECT' => 1,
'gl_HEADER_SYS_SOCKET' => 1,
'gl_HEADER_SYS_STAT_H' => 1,
'gl_HEADER_SYS_TIME_H' => 1,
'gl_HEADER_SYS_TIME_H_BODY' => 1,
'gl_HEADER_SYS_TIME_H_DEFAULTS' => 1,
'gl_HEADER_SYS_UIO' => 1,
'gl_HEADER_TIME_H' => 1,
'gl_HEADER_TIME_H_BODY' => 1,
'gl_HEADER_TIME_H_DEFAULTS' => 1,
'gl_ICONV_H' => 1,
'gl_ICONV_H_DEFAULTS' => 1,
'gl_ICONV_MODULE_INDICATOR' => 1,
'gl_INCLUDE_NEXT' => 1,
'gl_INIT' => 1,
'gl_INLINE' => 1,
'gl_INTEGER_TYPE_SUFFIX' => 1,
'gl_INTTOSTR' => 1,
'gl_INTTYPES_CHECK_LONG_LONG_INT_CONDITION' => 1,
'gl_INTTYPES_H' => 1,
'gl_INTTYPES_H_DEFAULTS' => 1,
'gl_INTTYPES_INCOMPLETE' => 1,
'gl_INTTYPES_MODULE_INDICATOR' => 1,
'gl_INTTYPES_PRI_SCN' => 1,
'gl_LANGINFO_H' => 1,
'gl_LANGINFO_H_DEFAULTS' => 1,
'gl_LANGINFO_MODULE_INDICATOR' => 1,
'gl_LARGEFILE' => 1,
'gl_LIBOBJ' => 1,
'gl_LIBSIGSEGV' => 1,
'gl_LIBSOURCES' => 1,
'gl_LIBUNISTRING_LIBHEADER' => 1,
'gl_LIBUNISTRING_LIB_PREPARE' => 1,
'gl_LIBUNISTRING_MODULE' => 1,
'gl_LIBUNISTRING_VERSION_CMP' => 1,
'gl_LIMITS_H' => 1,
'gl_LOCALCHARSET' => 1,
'gl_LOCALE_H' => 1,
'gl_LOCALE_H_DEFAULTS' => 1,
'gl_LOCALE_MODULE_INDICATOR' => 1,
'gl_LOCALTIME_BUFFER_DEFAULTS' => 1,
'gl_LOCALTIME_BUFFER_NEEDED' => 1,
'gl_MALLOCA' => 1,
'gl_MANYWARN_ALL_GCC' => 1,
'gl_MANYWARN_COMPLEMENT' => 1,
'gl_MBCHAR' => 1,
'gl_MBITER' => 1,
'gl_MBRTOWC_C_LOCALE' => 1,
'gl_MBRTOWC_EMPTY_INPUT' => 1,
'gl_MBRTOWC_INCOMPLETE_STATE' => 1,
'gl_MBRTOWC_NULL_ARG1' => 1,
'gl_MBRTOWC_NULL_ARG2' => 1,
'gl_MBRTOWC_NUL_RETVAL' => 1,
'gl_MBRTOWC_RETVAL' => 1,
'gl_MBRTOWC_SANITYCHECK' => 1,
'gl_MBSRTOWCS_WORKS' => 1,
'gl_MBSTATE_T_BROKEN' => 1,
'gl_MINMAX' => 1,
'gl_MINMAX_IN_HEADER' => 1,
'gl_MODULE_INDICATOR' => 1,
'gl_MODULE_INDICATOR_FOR_TESTS' => 1,
'gl_MODULE_INDICATOR_SET_VARIABLE' => 1,
'gl_MODULE_INDICATOR_SET_VARIABLE_AUX' => 1,
'gl_MODULE_INDICATOR_SET_VARIABLE_AUX_OR' => 1,
'gl_MSVC_INVAL' => 1,
'gl_MSVC_NOTHROW' => 1,
'gl_MULTIARCH' => 1,
'gl_NEXT_HEADERS' => 1,
'gl_NEXT_HEADERS_INTERNAL' => 1,
'gl_PATHMAX' => 1,
'gl_PATHMAX_SNIPPET' => 1,
'gl_PATHMAX_SNIPPET_PREREQ' => 1,
'gl_PREREQ_ALLOCA' => 1,
'gl_PREREQ_ASNPRINTF' => 1,
'gl_PREREQ_ASPRINTF' => 1,
'gl_PREREQ_BTOWC' => 1,
'gl_PREREQ_C_STACK' => 1,
'gl_PREREQ_DUP2' => 1,
'gl_PREREQ_ERROR' => 1,
'gl_PREREQ_FDOPEN' => 1,
'gl_PREREQ_FNMATCH' => 1,
'gl_PREREQ_FREOPEN' => 1,
'gl_PREREQ_FSTAT' => 1,
'gl_PREREQ_FTRUNCATE' => 1,
'gl_PREREQ_GETCWD' => 1,
'gl_PREREQ_GETDTABLESIZE' => 1,
'gl_PREREQ_GETTIMEOFDAY' => 1,
'gl_PREREQ_IMAXTOSTR' => 1,
'gl_PREREQ_INET_PTON' => 1,
'gl_PREREQ_INTTOSTR' => 1,
'gl_PREREQ_LOCALECONV' => 1,
'gl_PREREQ_LSTAT' => 1,
'gl_PREREQ_MBRTOWC' => 1,
'gl_PREREQ_MBSINIT' => 1,
'gl_PREREQ_MBSRTOWCS' => 1,
'gl_PREREQ_MBTOWC' => 1,
'gl_PREREQ_MEMCHR' => 1,
'gl_PREREQ_MINMAX' => 1,
'gl_PREREQ_MKSTEMP' => 1,
'gl_PREREQ_MKTIME' => 1,
'gl_PREREQ_NANOSLEEP' => 1,
'gl_PREREQ_OFFTOSTR' => 1,
'gl_PREREQ_OPEN' => 1,
'gl_PREREQ_PRINTF_ARGS' => 1,
'gl_PREREQ_PRINTF_PARSE' => 1,
'gl_PREREQ_PUTENV' => 1,
'gl_PREREQ_RAISE' => 1,
'gl_PREREQ_RAWMEMCHR' => 1,
'gl_PREREQ_READLINK' => 1,
'gl_PREREQ_REGEX' => 1,
'gl_PREREQ_SECURE_GETENV' => 1,
'gl_PREREQ_SETENV' => 1,
'gl_PREREQ_SETLOCALE' => 1,
'gl_PREREQ_SIGACTION' => 1,
'gl_PREREQ_SIGPROCMASK' => 1,
'gl_PREREQ_SIG_HANDLER_H' => 1,
'gl_PREREQ_SNPRINTF' => 1,
'gl_PREREQ_SOCKETS' => 1,
'gl_PREREQ_STAT' => 1,
'gl_PREREQ_STRCASECMP' => 1,
'gl_PREREQ_STRERROR_R' => 1,
'gl_PREREQ_STRNCASECMP' => 1,
'gl_PREREQ_STRNLEN' => 1,
'gl_PREREQ_STRPTIME' => 1,
'gl_PREREQ_STRTOULL' => 1,
'gl_PREREQ_STRTOUMAX' => 1,
'gl_PREREQ_SYS_H_SOCKET' => 1,
'gl_PREREQ_SYS_H_WINSOCK2' => 1,
'gl_PREREQ_TEMPNAME' => 1,
'gl_PREREQ_TIMEGM' => 1,
'gl_PREREQ_TIME_R' => 1,
'gl_PREREQ_UINTTOSTR' => 1,
'gl_PREREQ_UMAXTOSTR' => 1,
'gl_PREREQ_UNSETENV' => 1,
'gl_PREREQ_VASNPRINTF' => 1,
'gl_PREREQ_VASNPRINTF_DIRECTIVE_A' => 1,
'gl_PREREQ_VASNPRINTF_DIRECTIVE_F' => 1,
'gl_PREREQ_VASNPRINTF_DIRECTIVE_LS' => 1,
'gl_PREREQ_VASNPRINTF_ENOMEM' => 1,
'gl_PREREQ_VASNPRINTF_FLAG_GROUPING' => 1,
'gl_PREREQ_VASNPRINTF_FLAG_LEFTADJUST' => 1,
'gl_PREREQ_VASNPRINTF_FLAG_ZERO' => 1,
'gl_PREREQ_VASNPRINTF_INFINITE_DOUBLE' => 1,
'gl_PREREQ_VASNPRINTF_INFINITE_LONG_DOUBLE' => 1,
'gl_PREREQ_VASNPRINTF_LONG_DOUBLE' => 1,
'gl_PREREQ_VASNPRINTF_PRECISION' => 1,
'gl_PREREQ_VASNPRINTF_WITH_EXTRAS' => 1,
'gl_PREREQ_VASPRINTF' => 1,
'gl_PREREQ_VASPRINTF_H' => 1,
'gl_PREREQ_WCRTOMB' => 1,
'gl_PREREQ_WCTOB' => 1,
'gl_PREREQ_WCTOMB' => 1,
'gl_PREREQ_XSTRNDUP' => 1,
'gl_PRINTF_DIRECTIVE_A' => 1,
'gl_PRINTF_DIRECTIVE_F' => 1,
'gl_PRINTF_DIRECTIVE_LS' => 1,
'gl_PRINTF_DIRECTIVE_N' => 1,
'gl_PRINTF_ENOMEM' => 1,
'gl_PRINTF_FLAG_GROUPING' => 1,
'gl_PRINTF_FLAG_LEFTADJUST' => 1,
'gl_PRINTF_FLAG_ZERO' => 1,
'gl_PRINTF_INFINITE' => 1,
'gl_PRINTF_INFINITE_LONG_DOUBLE' => 1,
'gl_PRINTF_LONG_DOUBLE' => 1,
'gl_PRINTF_POSITIONS' => 1,
'gl_PRINTF_PRECISION' => 1,
'gl_PRINTF_SIZES_C99' => 1,
'gl_PROG_AR_RANLIB' => 1,
'gl_PROG_CC_C99' => 1,
'gl_PROMOTED_TYPE_MODE_T' => 1,
'gl_QUOTE' => 1,
'gl_QUOTEARG' => 1,
'gl_REGEX' => 1,
'gl_REPLACE_ERRNO_VALUE' => 1,
'gl_REPLACE_FCNTL' => 1,
'gl_REPLACE_FUNCS' => 1,
'gl_REPLACE_ICONV_H' => 1,
'gl_REPLACE_ICONV_OPEN' => 1,
'gl_REPLACE_SNPRINTF' => 1,
'gl_REPLACE_VASNPRINTF' => 1,
'gl_REPLACE_VASPRINTF' => 1,
'gl_SIGACTION' => 1,
'gl_SIGNALBLOCKING' => 1,
'gl_SIGNAL_H' => 1,
'gl_SIGNAL_H_DEFAULTS' => 1,
'gl_SIGNAL_MODULE_INDICATOR' => 1,
'gl_SIZE_MAX' => 1,
'gl_SNPRINTF_DIRECTIVE_N' => 1,
'gl_SNPRINTF_PRESENCE' => 1,
'gl_SNPRINTF_RETVAL_C99' => 1,
'gl_SNPRINTF_SIZE1' => 1,
'gl_SNPRINTF_TRUNCATION_C99' => 1,
'gl_SOCKETLIB' => 1,
'gl_SOCKETS' => 1,
'gl_SOCKET_FAMILIES' => 1,
'gl_SOCKET_FAMILY_UNIX' => 1,
'gl_SOCKET_HEADERS' => 1,
'gl_STAT_BIRTHTIME' => 1,
'gl_STAT_TIME' => 1,
'gl_STDALIGN_H' => 1,
'gl_STDARG_H' => 1,
'gl_STDBOOL_H' => 1,
'gl_STDDEF_H' => 1,
'gl_STDDEF_H_DEFAULTS' => 1,
'gl_STDDEF_MODULE_INDICATOR' => 1,
'gl_STDINT_BITSIZEOF' => 1,
'gl_STDINT_H' => 1,
'gl_STDINT_INCLUDES' => 1,
'gl_STDINT_TYPE_PROPERTIES' => 1,
'gl_STDIO_H' => 1,
'gl_STDIO_H_DEFAULTS' => 1,
'gl_STDIO_MODULE_INDICATOR' => 1,
'gl_STDLIB_H' => 1,
'gl_STDLIB_H_DEFAULTS' => 1,
'gl_STDLIB_MODULE_INDICATOR' => 1,
'gl_STRCASE' => 1,
'gl_STRINGS_MODULE_INDICATOR' => 1,
'gl_STRING_MODULE_INDICATOR' => 1,
'gl_SYS_IOCTL_H' => 1,
'gl_SYS_IOCTL_H_DEFAULTS' => 1,
'gl_SYS_IOCTL_MODULE_INDICATOR' => 1,
'gl_SYS_SELECT_H_DEFAULTS' => 1,
'gl_SYS_SELECT_MODULE_INDICATOR' => 1,
'gl_SYS_SOCKET_H_DEFAULTS' => 1,
'gl_SYS_SOCKET_MODULE_INDICATOR' => 1,
'gl_SYS_STAT_H_DEFAULTS' => 1,
'gl_SYS_STAT_MODULE_INDICATOR' => 1,
'gl_SYS_TIME_MODULE_INDICATOR' => 1,
'gl_SYS_TYPES_H' => 1,
'gl_SYS_TYPES_H_DEFAULTS' => 1,
'gl_SYS_UIO_H_DEFAULTS' => 1,
'gl_SYS_UIO_MODULE_INDICATOR' => 1,
'gl_SYS_WAIT_H' => 1,
'gl_SYS_WAIT_H_DEFAULTS' => 1,
'gl_SYS_WAIT_MODULE_INDICATOR' => 1,
'gl_TIMESPEC' => 1,
'gl_TIME_MODULE_INDICATOR' => 1,
'gl_TIME_R' => 1,
'gl_TIME_RZ' => 1,
'gl_TIME_T_IS_SIGNED' => 1,
'gl_TM_GMTOFF' => 1,
'gl_TYPE_OFF_T' => 1,
'gl_TYPE_SOCKLEN_T' => 1,
'gl_TYPE_WINT_T_PREREQ' => 1,
'gl_UNISTD_H' => 1,
'gl_UNISTD_H_DEFAULTS' => 1,
'gl_UNISTD_MODULE_INDICATOR' => 1,
'gl_UNKNOWN_WARNINGS_ARE_ERRORS' => 1,
'gl_USE_SYSTEM_EXTENSIONS' => 1,
'gl_VERSION_ETC' => 1,
'gl_VSNPRINTF_ZEROSIZE_C99' => 1,
'gl_W' => 1,
'gl_WARN_ADD' => 1,
'gl_WARN_ON_USE_PREPARE' => 1,
'gl_WCHAR_H' => 1,
'gl_WCHAR_H_DEFAULTS' => 1,
'gl_WCHAR_H_INLINE_OK' => 1,
'gl_WCHAR_MODULE_INDICATOR' => 1,
'gl_WCTYPE_H' => 1,
'gl_WCTYPE_H_DEFAULTS' => 1,
'gl_WCTYPE_MODULE_INDICATOR' => 1,
'gl_XALLOC' => 1,
'gl_XSIZE' => 1,
'gl_XSTRNDUP' => 1,
'gl_XSTRTOL' => 1,
'gl_XVASPRINTF' => 1,
'gl___BUILTIN_EXPECT' => 1,
'gltests_LIBOBJ' => 1,
'gltests_LIBSOURCES' => 1,
'gltests_REPLACE_FUNCS' => 1,
'gt_AC_TYPE_INTMAX_T' => 1,
'gt_CHECK_VAR_DECL' => 1,
'gt_INTL_MACOSX' => 1,
'gt_INTTYPES_PRI' => 1,
'gt_LOCALE_FR' => 1,
'gt_LOCALE_FR_UTF8' => 1,
'gt_LOCALE_JA' => 1,
'gt_LOCALE_TR_UTF8' => 1,
'gt_LOCALE_ZH_CN' => 1,
'gt_TYPE_SSIZE_T' => 1,
'gt_TYPE_WCHAR_T' => 1,
'gt_TYPE_WINT_T' => 1,
'include' => 1,
'm4_include' => 1,
'm4_pattern_allow' => 1,
'm4_pattern_forbid' => 1
}
], 'Autom4te::Request' ),
bless( [
'1',
1,
[
'/usr/share/autoconf'
],
[
'/usr/share/autoconf/autoconf/autoconf.m4f',
'aclocal.m4',
'configure.ac'
],
{
'AC_CANONICAL_BUILD' => 1,
'AC_CANONICAL_HOST' => 1,
'AC_CANONICAL_SYSTEM' => 1,
'AC_CANONICAL_TARGET' => 1,
'AC_CONFIG_AUX_DIR' => 1,
'AC_CONFIG_FILES' => 1,
'AC_CONFIG_HEADERS' => 1,
'AC_CONFIG_LIBOBJ_DIR' => 1,
'AC_CONFIG_LINKS' => 1,
'AC_CONFIG_MACRO_DIR_TRACE' => 1,
'AC_CONFIG_SUBDIRS' => 1,
'AC_DEFINE_TRACE_LITERAL' => 1,
'AC_FC_FREEFORM' => 1,
'AC_FC_PP_DEFINE' => 1,
'AC_FC_PP_SRCEXT' => 1,
'AC_FC_SRCEXT' => 1,
'AC_INIT' => 1,
'AC_LIBSOURCE' => 1,
'AC_PROG_LIBTOOL' => 1,
'AC_REQUIRE_AUX_FILE' => 1,
'AC_SUBST' => 1,
'AC_SUBST_TRACE' => 1,
'AH_OUTPUT' => 1,
'AM_AUTOMAKE_VERSION' => 1,
'AM_CONDITIONAL' => 1,
'AM_ENABLE_MULTILIB' => 1,
'AM_EXTRA_RECURSIVE_TARGETS' => 1,
'AM_GNU_GETTEXT' => 1,
'AM_GNU_GETTEXT_INTL_SUBDIR' => 1,
'AM_INIT_AUTOMAKE' => 1,
'AM_MAINTAINER_MODE' => 1,
'AM_MAKEFILE_INCLUDE' => 1,
'AM_NLS' => 1,
'AM_PATH_GUILE' => 1,
'AM_POT_TOOLS' => 1,
'AM_PROG_AR' => 1,
'AM_PROG_CC_C_O' => 1,
'AM_PROG_CXX_C_O' => 1,
'AM_PROG_F77_C_O' => 1,
'AM_PROG_FC_C_O' => 1,
'AM_PROG_LIBTOOL' => 1,
'AM_PROG_MKDIR_P' => 1,
'AM_PROG_MOC' => 1,
'AM_SILENT_RULES' => 1,
'AM_XGETTEXT_OPTION' => 1,
'GTK_DOC_CHECK' => 1,
'IT_PROG_INTLTOOL' => 1,
'LT_CONFIG_LTDL_DIR' => 1,
'LT_INIT' => 1,
'LT_SUPPORTED_TAG' => 1,
'_AM_COND_ELSE' => 1,
'_AM_COND_ENDIF' => 1,
'_AM_COND_IF' => 1,
'_AM_MAKEFILE_INCLUDE' => 1,
'_AM_SUBST_NOTMAKE' => 1,
'_LT_AC_TAGCONFIG' => 1,
'_m4_warn' => 1,
'include' => 1,
'm4_include' => 1,
'm4_pattern_allow' => 1,
'm4_pattern_forbid' => 1,
'm4_sinclude' => 1,
'sinclude' => 1
}
], 'Autom4te::Request' ),
bless( [
'2',
1,
[
'/usr/share/autoconf'
],
[
'/usr/share/autoconf/autoconf/autoconf.m4f',
'aclocal.m4',
'/usr/share/autoconf/autoconf/trailer.m4',
'configure.ac'
],
{
'AC_CANONICAL_BUILD' => 1,
'AC_CANONICAL_HOST' => 1,
'AC_CANONICAL_SYSTEM' => 1,
'AC_CANONICAL_TARGET' => 1,
'AC_CONFIG_AUX_DIR' => 1,
'AC_CONFIG_FILES' => 1,
'AC_CONFIG_HEADERS' => 1,
'AC_CONFIG_LIBOBJ_DIR' => 1,
'AC_CONFIG_LINKS' => 1,
'AC_CONFIG_MACRO_DIR_TRACE' => 1,
'AC_CONFIG_SUBDIRS' => 1,
'AC_DEFINE_TRACE_LITERAL' => 1,
'AC_FC_FREEFORM' => 1,
'AC_FC_PP_DEFINE' => 1,
'AC_FC_PP_SRCEXT' => 1,
'AC_FC_SRCEXT' => 1,
'AC_INIT' => 1,
'AC_LIBSOURCE' => 1,
'AC_PROG_LIBTOOL' => 1,
'AC_REQUIRE_AUX_FILE' => 1,
'AC_SUBST' => 1,
'AC_SUBST_TRACE' => 1,
'AH_OUTPUT' => 1,
'AM_AUTOMAKE_VERSION' => 1,
'AM_CONDITIONAL' => 1,
'AM_ENABLE_MULTILIB' => 1,
'AM_EXTRA_RECURSIVE_TARGETS' => 1,
'AM_GNU_GETTEXT' => 1,
'AM_GNU_GETTEXT_INTL_SUBDIR' => 1,
'AM_INIT_AUTOMAKE' => 1,
'AM_MAINTAINER_MODE' => 1,
'AM_MAKEFILE_INCLUDE' => 1,
'AM_NLS' => 1,
'AM_PATH_GUILE' => 1,
'AM_POT_TOOLS' => 1,
'AM_PROG_AR' => 1,
'AM_PROG_CC_C_O' => 1,
'AM_PROG_CXX_C_O' => 1,
'AM_PROG_F77_C_O' => 1,
'AM_PROG_FC_C_O' => 1,
'AM_PROG_LIBTOOL' => 1,
'AM_PROG_MKDIR_P' => 1,
'AM_PROG_MOC' => 1,
'AM_SILENT_RULES' => 1,
'AM_XGETTEXT_OPTION' => 1,
'GTK_DOC_CHECK' => 1,
'IT_PROG_INTLTOOL' => 1,
'LT_CONFIG_LTDL_DIR' => 1,
'LT_INIT' => 1,
'LT_SUPPORTED_TAG' => 1,
'_AM_COND_ELSE' => 1,
'_AM_COND_ENDIF' => 1,
'_AM_COND_IF' => 1,
'_AM_MAKEFILE_INCLUDE' => 1,
'_AM_SUBST_NOTMAKE' => 1,
'_LT_AC_TAGCONFIG' => 1,
'_m4_warn' => 1,
'include' => 1,
'm4_include' => 1,
'm4_pattern_allow' => 1,
'm4_pattern_forbid' => 1,
'm4_sinclude' => 1,
'sinclude' => 1
}
], 'Autom4te::Request' )
);
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -1,46 +1,56 @@
eval '(exit $?0)' && eval 'exec perl -wS "$0" "$@"'
& eval 'exec perl -wS "$0" $argv:q'
if 0;
#!/bin/sh
#! -*-perl-*-
# Generate a release announcement message.
my $VERSION = '2016-01-12 23:09'; # UTC
# Copyright (C) 2002-2025 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 <https://www.gnu.org/licenses/>.
#
# Written by Jim Meyering
# This is a prologue that allows to run a perl script as an executable
# on systems that are compliant to a POSIX version before POSIX:2017.
# On such systems, the usual invocation of an executable through execlp()
# or execvp() fails with ENOEXEC if it is a script that does not start
# with a #! line. The script interpreter mentioned in the #! line has
# to be /bin/sh, because on GuixSD systems that is the only program that
# has a fixed file name. The second line is essential for perl and is
# also useful for editing this file in Emacs. The next two lines below
# are valid code in both sh and perl. When executed by sh, they re-execute
# the script through the perl program found in $PATH. The '-x' option
# is essential as well; without it, perl would re-execute the script
# through /bin/sh. When executed by perl, the next two lines are a no-op.
eval 'exec perl -wSx "$0" "$@"'
if 0;
my $VERSION = '2025-01-31 23:21'; # 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
# do its job. Otherwise, update this string manually.
# Copyright (C) 2002-2017 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 <http://www.gnu.org/licenses/>.
# Written by Jim Meyering
(my $copyright_year = $VERSION) =~ s/^(\d*)-.*$/$1/;
use strict;
use Getopt::Long;
use POSIX qw(strftime);
(my $ME = $0) =~ s|.*/||;
my %valid_release_types = map {$_ => 1} qw (alpha beta stable);
my @archive_suffixes = ('tar.gz', 'tar.bz2', 'tar.lzma', 'tar.xz');
my %digest_classes =
(
'md5' => (eval { require Digest::MD5; } and 'Digest::MD5'),
'sha1' => ((eval { require Digest::SHA; } and 'Digest::SHA')
or (eval { require Digest::SHA1; } and 'Digest::SHA1'))
);
my @archive_suffixes = qw (tar.gz tar.bz2 tar.lz tar.lzma tar.xz);
my $srcdir = '.';
sub usage ($)
@@ -80,7 +90,13 @@ The following are optional:
VERSION is the result of running git describe
in the gnulib source directory.
required if gnulib is in TOOL_LIST.
--no-print-checksums do not emit MD5 or SHA1 checksums
--gpg-key-email=EMAIL The email address of the key used to
sign the tarballs
--gpg-keyring-url=URL URL pointing to keyring containing the key used
to sign the tarballs
--no-print-checksums do not emit SHA1 or SHA256 checksums
--cksum-checksums emit SHA256 checksums in a form that requires
cksum from coreutils or OpenBSD
--archive-suffix=SUF add SUF to the list of archive suffixes
--mail-headers=HEADERS a space-separated list of mail headers, e.g.,
To: x\@example.com Cc: y-announce\@example.com,...
@@ -88,6 +104,7 @@ The following are optional:
--help display this help and exit
--version output version information and exit
Send patches and bug reports to <bug-gnulib\@gnu.org>.
EOF
}
exit $exit_code;
@@ -109,7 +126,7 @@ sub sizes (@)
my %res;
foreach my $f (@file)
{
my $cmd = "du -h $f";
my $cmd = "du -h -L $f";
my $t = `$cmd`;
# FIXME-someday: give a better diagnostic, a la $PROCESS_STATUS
$@
@@ -147,31 +164,53 @@ sub print_locations ($\@\%@)
=item C<print_checksums (@file)
Print the MD5 and SHA1 signature section for each C<@file>.
Print the SHA1 and SHA256 signature section for each C<@file>.
=cut
sub print_checksums (@)
# This digest function omits the "=" padding that is required by cksum,
# so add the 0..2 bytes of padding required for each of Digest's algorithms.
# To verify such a digest, users need
# - a particular command ('cksum -a sha256 --check')
# - and particular tools (coreutils >= 9.2 or OpenBSD's cksum since 2007).
sub digest_file_base64_wrap ($$)
{
my (@file) = @_;
my ($file, $alg) = @_;
my $h = digest_file_base64($file, $alg);
$alg =~ tr{-}{}d;
my %pad = (MD5 => 2, SHA1 => 1, SHA256 => 1, SHA384 => 0, SHA512 => 2);
return $h . '=' x $pad{$alg};
}
print "Here are the MD5 and SHA1 checksums:\n";
sub print_checksums ($@)
{
my ($prefer_cksum, @file) = @_;
print "Here are the SHA1 and SHA256 checksums:\n";
print "\n";
foreach my $meth (qw (md5 sha1))
use Digest::file qw(digest_file_hex digest_file_base64);
if ($prefer_cksum)
{
my $class = $digest_classes{$meth} or next;
foreach my $f (@file)
{
open IN, '<', $f
or die "$ME: $f: cannot open for reading: $!\n";
binmode IN;
my $dig = $class->new->addfile(*IN)->hexdigest;
close IN;
print "$dig $f\n";
print ' ', digest_file_hex ($f, "SHA-1"), " $f\n";
print ' ', digest_file_base64_wrap ($f, "SHA-256"), " $f\n";
}
print "\nVerify the base64 SHA256 checksum with cksum -a sha256 --check\n";
print "from coreutils-9.2 or OpenBSD's cksum since 2007.\n\n";
}
else
{
foreach my $f (@file)
{
print " File: $f\n";
print ' SHA1 sum: ', digest_file_hex ($f, "SHA-1"), "\n";
print ' SHA256 sum: ', digest_file_hex ($f, "SHA-256"), "\n";
print "\n";
}
}
print "\n";
}
=item C<print_news_deltas ($news_file, $prev_version, $curr_version)
@@ -336,16 +375,16 @@ sub get_tool_versions ($$)
# 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.-]+)$/)
if ($first_line =~ /.* ([a-f\d][\w.-]+)$/)
{
$t = ucfirst $t;
push @tool_version_pair, "$t $1";
}
else
{
warn "$t: unexpected --version output:\n$first_line";
defined $first_line
and $first_line = '';
warn "$t: unexpected --version output\n:$first_line";
$fail = 1;
}
}
@@ -356,9 +395,41 @@ sub get_tool_versions ($$)
return @tool_version_pair;
}
# Print a more human-friendly representation of $SEC seconds.
sub readable_interval0($)
{
# Neutralize the locale, so that, for instance, "du" does not
# issue "1,2" instead of "1.2", what confuses our regexps.
my $sec = shift;
$sec < 60 and return "$sec seconds";
my $min = int($sec / 60); $sec %= 60;
30 < $sec and $min++;
$min < 60 and return "$min minutes";
my $hr = int($min / 60); $min %= 60;
30 < $min and $hr++;
$hr < 24 and return "$hr hours";
my $day = int($hr / 24); $hr %= 24;
12 < $hr and $day++;
$day < 50 and return "$day days";
my $wk = int($day / 7); $day %= 7;
4 < $day and $wk++;
return "$wk weeks";
}
# Convert e.g., "1 weeks", to "1 week".
sub readable_interval($)
{
my $interval_str = shift;
my $i = readable_interval0 $interval_str;
$i =~ m{^1 \w+s$} and chop $i;
return $i;
}
{
# Use the C locale so that, for instance, "du" does not
# print "1,2" instead of "1.2", which would confuse our regexps.
$ENV{LC_ALL} = "C";
my $mail_headers;
@@ -372,6 +443,9 @@ sub get_tool_versions ($$)
my $bootstrap_tools;
my $gnulib_version;
my $print_checksums_p = 1;
my $cksum_checksums_p;
my $gpg_key_email;
my $gpg_keyring_url;
# Reformat the warnings before displaying them.
local $SIG{__WARN__} = sub
@@ -390,16 +464,31 @@ sub get_tool_versions ($$)
'previous-version=s' => \$prev_version,
'current-version=s' => \$curr_version,
'gpg-key-id=s' => \$gpg_key_id,
'gpg-key-email=s' => \$gpg_key_email,
'gpg-keyring-url=s' => \$gpg_keyring_url,
'url-directory=s' => \@url_dir_list,
'news=s' => \@news_file,
'srcdir=s' => \$srcdir,
'bootstrap-tools=s' => \$bootstrap_tools,
'gnulib-version=s' => \$gnulib_version,
'print-checksums!' => \$print_checksums_p,
'cksum-checksums' => \$cksum_checksums_p,
'archive-suffix=s' => \@archive_suffixes,
help => sub { usage 0 },
version => sub { print "$ME version $VERSION\n"; exit },
version =>
sub
{
print "$ME version $VERSION\n";
print "Copyright (C) $copyright_year Free Software Foundation, Inc.\n";
print "License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.\n"
. "This is free software: you are free to change and redistribute it.\n"
. "There is NO WARRANTY, to the extent permitted by law.\n";
print "\n";
my $author = "Jim Meyering";
print "Written by $author.\n";
exit
},
) or usage 1;
my $fail = 0;
@@ -420,11 +509,15 @@ sub get_tool_versions ($$)
my @tool_list = split ',', $bootstrap_tools
if $bootstrap_tools;
grep (/^gnulib$/, @tool_list) ^ defined $gnulib_version
grep (/^gnulib$/, @tool_list) && ! defined $gnulib_version
and (warn "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;
! grep (/^gnulib$/, @tool_list) && defined $gnulib_version
and (warn "with --gnulib-version=V you must use --bootstrap-tools=...\n"
. "including gnulib in that list"), $fail = 1;
!$release_type || exists $valid_release_types{$release_type}
or (warn "'$release_type': invalid release type\n"), $fail = 1;
@@ -464,16 +557,51 @@ sub get_tool_versions ($$)
${headers}Subject: $my_distdir released [$release_type]
<\#secure method=pgpmime mode=sign>
This is to announce $package_name-$curr_version, a $release_type release.
FIXME: put comments here
EOF
my $v0 = $prev_version;
my $v1 = $curr_version;
(my $first_name = `git -C "$srcdir" config user.name|cut -d' ' -f1`)
=~ m{\S} or die "no name? set user.name in ~/.gitconfig\n";
chomp (my $n_ci = `git -C "$srcdir" rev-list "v$v0..v$v1" | wc -l`);
chomp (my $n_p = `git -C "$srcdir" shortlog "v$v0..v$v1" | grep -c '^[^ ]'`);
my $this_commit_hash = `git -C "$srcdir" log --pretty=%H -1 "v$v1"`;
chop $this_commit_hash;
my $prev_release_date = `git -C "$srcdir" log --pretty=%ct -1 "v$v0"`;
my $this_release_date = `git -C "$srcdir" log --pretty=%ct -1 "v$v1"`;
my $n_seconds = $this_release_date - $prev_release_date;
my $time_since_prev = readable_interval $n_seconds;
my $names = `git -C "$srcdir" shortlog "v$v0..v$v1"|perl -lne '/^(\\w.*):/ and print " ".\$1'`;
print <<EOF;
There have been $n_ci commits by $n_p people in the $time_since_prev since $v0.
See the NEWS below for a brief summary.
Thanks to everyone who has contributed!
The following people contributed changes to this release:
$names
$first_name [on behalf of the $package_name maintainers]
==================================================================
Here is the GNU $package_name home page:
https://gnu.org/s/$package_name/
EOF
if (@url_dir_list == 1 && @tarballs == 1)
{
# When there's only one tarball and one URL, use a more concise form.
my $m = "$url_dir_list[0]/$tarballs[0]";
print "Here are the compressed sources and a GPG detached signature[*]:\n"
print "Here are the compressed sources and a GPG detached signature:\n"
. " $m\n"
. " $m.sig\n\n";
}
@@ -485,43 +613,96 @@ EOF
. "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,
print_locations ("GPG detached signatures", @url_dir_list, %size,
@sig_files);
}
if ($url_dir_list[0] =~ "gnu\.org")
{
print "Use a mirror for higher download bandwidth:\n";
if (@tarballs == 1 && $url_dir_list[0] =~ m!http://ftp\.gnu\.org/gnu/!)
if (@tarballs == 1 && $url_dir_list[0] =~ m!https://ftp\.gnu\.org/gnu/!)
{
(my $m = "$url_dir_list[0]/$tarballs[0]")
=~ s!http://ftp\.gnu\.org/gnu/!http://ftpmirror\.gnu\.org/!;
=~ s!https://ftp\.gnu\.org/gnu/!https://ftpmirror\.gnu\.org/!;
print " $m\n"
. " $m.sig\n\n";
}
else
{
print " http://www.gnu.org/order/ftp.html\n\n";
print " https://www.gnu.org/order/ftp.html\n\n";
}
}
$print_checksums_p
and print_checksums (@sizable);
and print_checksums ($cksum_checksums_p, @sizable);
print <<EOF;
[*] Use a .sig file to verify that the corresponding file (without the
Use a .sig file to verify that the corresponding file (without the
.sig suffix) is intact. First, be sure to download both the .sig file
and the corresponding tarball. Then, run a command like this:
gpg --verify $tarballs[0].sig
EOF
my $gpg_fingerprint = `LC_ALL=C gpg --fingerprint $gpg_key_id | grep -v ^sub`;
if ($gpg_fingerprint =~ /^pub/)
{
chop $gpg_fingerprint;
$gpg_fingerprint =~ s/ \[expires:.*//mg;
$gpg_fingerprint =~ s/^uid \[ultimate\]/uid /mg;
$gpg_fingerprint =~ s/^/ /mg;
print<<EOF
The signature should match the fingerprint of the following key:
$gpg_fingerprint
EOF
}
print <<EOF;
If that command fails because you don't have the required public key,
then run this command to import it:
or that public key has expired, try the following commands to retrieve
or refresh it, and then rerun the 'gpg --verify' command.
EOF
if ($gpg_key_email) {
print <<EOF;
gpg --keyserver keys.gnupg.net --recv-keys $gpg_key_id
gpg --locate-external-key $gpg_key_email
EOF
}
print <<EOF;
and rerun the 'gpg --verify' command.
gpg --recv-keys $gpg_key_id
EOF
if ($gpg_keyring_url) {
print <<EOF;
wget -q -O- '$gpg_keyring_url' | gpg --import -
EOF
}
print <<EOF;
As a last resort to find the key, you can try the official GNU
keyring:
wget -q https://ftp.gnu.org/gnu/gnu-keyring.gpg
gpg --keyring gnu-keyring.gpg --verify $tarballs[0].sig
EOF
print <<EOF;
This release is based on the $package_name git repository, available as
git clone https://git.savannah.gnu.org/git/$package_name.git
with commit $this_commit_hash tagged as v$v1.
For a summary of changes and contributors, see:
https://git.sv.gnu.org/gitweb/?p=$package_name.git;a=shortlog;h=v$v1
or run this command from a git-cloned $package_name directory:
git shortlog v$v0..v$v1
EOF
my @tool_versions = get_tool_versions (\@tool_list, $gnulib_version);
@@ -549,7 +730,8 @@ EOF
## perl-label-offset: -2
## perl-extra-newline-before-brace: t
## perl-merge-trailing-else: nil
## eval: (add-hook 'write-file-hooks 'time-stamp)
## eval: (add-hook 'before-save-hook 'time-stamp nil t)
## time-stamp-line-limit: 50
## time-stamp-start: "my $VERSION = '"
## time-stamp-format: "%:y-%02m-%02d %02H:%02M"
## time-stamp-time-zone: "UTC0"
@@ -1,270 +0,0 @@
#! /bin/sh
# Wrapper for Microsoft lib.exe
me=ar-lib
scriptversion=2012-03-01.08; # UTC
# Copyright (C) 2010-2015 Free Software Foundation, Inc.
# Written by Peter Rosin <peda@lysator.liu.se>.
#
# 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, see <http://www.gnu.org/licenses/>.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
# This file is maintained in Automake, please report
# bugs to <bug-automake@gnu.org> or send patches to
# <automake-patches@gnu.org>.
# func_error message
func_error ()
{
echo "$me: $1" 1>&2
exit 1
}
file_conv=
# func_file_conv build_file
# Convert a $build file to $host form and store it in $file
# Currently only supports Windows hosts.
func_file_conv ()
{
file=$1
case $file in
/ | /[!/]*) # absolute file, and not a UNC file
if test -z "$file_conv"; then
# lazily determine how to convert abs files
case `uname -s` in
MINGW*)
file_conv=mingw
;;
CYGWIN*)
file_conv=cygwin
;;
*)
file_conv=wine
;;
esac
fi
case $file_conv in
mingw)
file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'`
;;
cygwin)
file=`cygpath -m "$file" || echo "$file"`
;;
wine)
file=`winepath -w "$file" || echo "$file"`
;;
esac
;;
esac
}
# func_at_file at_file operation archive
# Iterate over all members in AT_FILE performing OPERATION on ARCHIVE
# for each of them.
# When interpreting the content of the @FILE, do NOT use func_file_conv,
# since the user would need to supply preconverted file names to
# binutils ar, at least for MinGW.
func_at_file ()
{
operation=$2
archive=$3
at_file_contents=`cat "$1"`
eval set x "$at_file_contents"
shift
for member
do
$AR -NOLOGO $operation:"$member" "$archive" || exit $?
done
}
case $1 in
'')
func_error "no command. Try '$0 --help' for more information."
;;
-h | --h*)
cat <<EOF
Usage: $me [--help] [--version] PROGRAM ACTION ARCHIVE [MEMBER...]
Members may be specified in a file named with @FILE.
EOF
exit $?
;;
-v | --v*)
echo "$me, version $scriptversion"
exit $?
;;
esac
if test $# -lt 3; then
func_error "you must specify a program, an action and an archive"
fi
AR=$1
shift
while :
do
if test $# -lt 2; then
func_error "you must specify a program, an action and an archive"
fi
case $1 in
-lib | -LIB \
| -ltcg | -LTCG \
| -machine* | -MACHINE* \
| -subsystem* | -SUBSYSTEM* \
| -verbose | -VERBOSE \
| -wx* | -WX* )
AR="$AR $1"
shift
;;
*)
action=$1
shift
break
;;
esac
done
orig_archive=$1
shift
func_file_conv "$orig_archive"
archive=$file
# strip leading dash in $action
action=${action#-}
delete=
extract=
list=
quick=
replace=
index=
create=
while test -n "$action"
do
case $action in
d*) delete=yes ;;
x*) extract=yes ;;
t*) list=yes ;;
q*) quick=yes ;;
r*) replace=yes ;;
s*) index=yes ;;
S*) ;; # the index is always updated implicitly
c*) create=yes ;;
u*) ;; # TODO: don't ignore the update modifier
v*) ;; # TODO: don't ignore the verbose modifier
*)
func_error "unknown action specified"
;;
esac
action=${action#?}
done
case $delete$extract$list$quick$replace,$index in
yes,* | ,yes)
;;
yesyes*)
func_error "more than one action specified"
;;
*)
func_error "no action specified"
;;
esac
if test -n "$delete"; then
if test ! -f "$orig_archive"; then
func_error "archive not found"
fi
for member
do
case $1 in
@*)
func_at_file "${1#@}" -REMOVE "$archive"
;;
*)
func_file_conv "$1"
$AR -NOLOGO -REMOVE:"$file" "$archive" || exit $?
;;
esac
done
elif test -n "$extract"; then
if test ! -f "$orig_archive"; then
func_error "archive not found"
fi
if test $# -gt 0; then
for member
do
case $1 in
@*)
func_at_file "${1#@}" -EXTRACT "$archive"
;;
*)
func_file_conv "$1"
$AR -NOLOGO -EXTRACT:"$file" "$archive" || exit $?
;;
esac
done
else
$AR -NOLOGO -LIST "$archive" | sed -e 's/\\/\\\\/g' | while read member
do
$AR -NOLOGO -EXTRACT:"$member" "$archive" || exit $?
done
fi
elif test -n "$quick$replace"; then
if test ! -f "$orig_archive"; then
if test -z "$create"; then
echo "$me: creating $orig_archive"
fi
orig_archive=
else
orig_archive=$archive
fi
for member
do
case $1 in
@*)
func_file_conv "${1#@}"
set x "$@" "@$file"
;;
*)
func_file_conv "$1"
set x "$@" "$file"
;;
esac
shift
shift
done
if test -n "$orig_archive"; then
$AR -NOLOGO -OUT:"$archive" "$orig_archive" "$@" || exit $?
else
$AR -NOLOGO -OUT:"$archive" "$@" || exit $?
fi
elif test -n "$list"; then
if test ! -f "$orig_archive"; then
func_error "archive not found"
fi
$AR -NOLOGO -LIST "$archive" || exit $?
fi
@@ -1,9 +1,9 @@
#! /bin/sh
# Wrapper for compilers which do not understand '-c -o'.
scriptversion=2016-01-11.22; # UTC
scriptversion=2025-02-03.05; # UTC
# Copyright (C) 1999-2015 Free Software Foundation, Inc.
# Copyright (C) 1999-2025 Free Software Foundation, Inc.
# Written by Tom Tromey <tromey@cygnus.com>.
#
# This program is free software; you can redistribute it and/or modify
@@ -17,7 +17,7 @@ scriptversion=2016-01-11.22; # UTC
# 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 <http://www.gnu.org/licenses/>.
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
@@ -37,11 +37,11 @@ IFS=" "" $nl"
file_conv=
# func_file_conv build_file lazy
# func_file_conv build_file unneeded_conversions
# Convert a $build file to $host form and store it in $file
# Currently only supports Windows hosts. If the determined conversion
# type is listed in (the comma separated) LAZY, no conversion will
# take place.
# type is listed in (the comma separated) UNNEEDED_CONVERSIONS, no
# conversion will take place.
func_file_conv ()
{
file=$1
@@ -51,9 +51,20 @@ func_file_conv ()
# lazily determine how to convert abs files
case `uname -s` in
MINGW*)
file_conv=mingw
if test -n "$MSYSTEM" && (cygpath --version) >/dev/null 2>&1; then
# MSYS2 environment.
file_conv=cygwin
else
# Original MinGW environment.
file_conv=mingw
fi
;;
MSYS*)
# Old MSYS environment, or MSYS2 with 32-bit MSYS2 shell.
file_conv=cygwin
;;
CYGWIN*)
# Cygwin environment.
file_conv=cygwin
;;
*)
@@ -63,12 +74,14 @@ func_file_conv ()
fi
case $file_conv/,$2, in
*,$file_conv,*)
# This is the optimization mentioned above:
# If UNNEEDED_CONVERSIONS contains $file_conv, don't convert.
;;
mingw/*)
file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'`
;;
cygwin/*)
file=`cygpath -m "$file" || echo "$file"`
file=`cygpath -w "$file" || echo "$file"`
;;
wine/*)
file=`winepath -w "$file" || echo "$file"`
@@ -143,7 +156,7 @@ func_cl_wrapper ()
# configure might choose to run compile as 'compile cc -o foo foo.c'.
eat=1
case $2 in
*.o | *.[oO][bB][jJ])
*.o | *.lo | *.[oO][bB][jJ])
func_file_conv "$2"
set x "$@" -Fo"$file"
shift
@@ -248,14 +261,17 @@ If you are trying to build a whole package this is not the
right script to run: please start by reading the file 'INSTALL'.
Report bugs to <bug-automake@gnu.org>.
GNU Automake home page: <https://www.gnu.org/software/automake/>.
General help using GNU software: <https://www.gnu.org/gethelp/>.
EOF
exit $?
;;
-v | --v*)
echo "compile $scriptversion"
echo "compile (GNU Automake) $scriptversion"
exit $?
;;
cl | *[/\\]cl | cl.exe | *[/\\]cl.exe | \
clang-cl | *[/\\]clang-cl | clang-cl.exe | *[/\\]clang-cl.exe | \
icl | *[/\\]icl | icl.exe | *[/\\]icl.exe )
func_cl_wrapper "$@" # Doesn't return...
;;
@@ -340,7 +356,7 @@ exit $ret
# Local Variables:
# mode: shell-script
# sh-indentation: 2
# eval: (add-hook 'write-file-hooks 'time-stamp)
# eval: (add-hook 'before-save-hook 'time-stamp nil t)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC0"
File diff suppressed because it is too large Load Diff
@@ -1,23 +1,15 @@
#! /bin/sh
# Output a system dependent set of variables, describing how to set the
# run time search path of shared libraries in an executable.
# run time search path of shared libraries in a binary (executable or
# shared library).
#
# Copyright 1996-2017 Free Software Foundation, Inc.
# Copyright 1996-2025 Free Software Foundation, Inc.
# Taken from GNU libtool, 2001
# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
#
# This file is free software; the Free Software Foundation gives
# unlimited permission to copy and/or distribute it, with or without
# modifications, as long as this notice is preserved.
#
# The first argument passed to this file is the canonical host specification,
# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
# or
# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
# The environment variables CC, GCC, LDFLAGS, LD, with_gnu_ld
# should be set by the caller.
#
# The set of defined variables is at the end of this script.
# Known limitations:
# - On IRIX 6.5 with CC="cc", the run time search patch must not be longer
@@ -25,6 +17,81 @@
# known workaround is to choose shorter directory names for the build
# directory and/or the installation directory.
# func_usage
# outputs to stdout the --help usage message.
func_usage ()
{
echo "\
Usage: config.rpath [OPTION] HOST
Prints shell variable assignments that describe how to hardcode a directory
for the lookup of shared libraries into a binary (executable or shared library).
The first argument passed to this file is the canonical host specification,
CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
or
CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
The environment variables CC, GCC, LDFLAGS, LD, with_gnu_ld
should be set by the caller.
The set of defined variables is at the end of this script.
Options:
--help print this help and exit
--version print version information and exit
Send patches and bug reports to <bug-gnulib@gnu.org>."
}
# func_version
# outputs to stdout the --version message.
func_version ()
{
echo "config.rpath (GNU gnulib, module havelib)"
echo "Copyright (C) 2025 Free Software Foundation, Inc.
License: All-Permissive.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law."
echo
printf 'Written by %s.\n' "Bruno Haible"
}
# func_fatal_error message
# outputs to stderr a fatal error message, and terminates the program.
func_fatal_error ()
{
echo "config.rpath: *** $1" 1>&2
echo "config.rpath: *** Stop." 1>&2
exit 1
}
# Command-line option processing.
while test $# -gt 0; do
case "$1" in
--help | --hel | --he | --h )
func_usage
exit 0 ;;
--version | --versio | --versi | --vers | --ver | --ve | --v )
func_version
exit 0 ;;
-- ) # Stop option processing
shift; break ;;
-* )
func_fatal_error "unrecognized option: $1"
;;
* )
break ;;
esac
done
if test $# -gt 1; then
func_fatal_error "too many arguments"
fi
if test $# -lt 1; then
func_fatal_error "too few arguments"
fi
# All known linkers require a '.a' archive for static linking (except MSVC,
# which needs '.lib').
libext=a
@@ -371,7 +438,7 @@ else
hardcode_direct=yes
hardcode_minus_L=yes
;;
freebsd* | dragonfly*)
freebsd* | dragonfly* | midnightbsd*)
hardcode_libdir_flag_spec='-R$libdir'
hardcode_direct=yes
;;
@@ -547,7 +614,7 @@ case "$host_os" in
freebsd[23].*)
library_names_spec='$libname$shrext$versuffix'
;;
freebsd* | dragonfly*)
freebsd* | dragonfly* | midnightbsd*)
library_names_spec='$libname$shrext'
;;
gnu*)
File diff suppressed because it is too large Load Diff
@@ -1,9 +1,9 @@
#! /bin/sh
# depcomp - compile a program generating dependencies as side-effects
scriptversion=2016-01-11.22; # UTC
scriptversion=2024-12-03.03; # UTC
# Copyright (C) 1999-2017 Free Software Foundation, Inc.
# Copyright (C) 1999-2025 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
@@ -16,7 +16,7 @@ scriptversion=2016-01-11.22; # UTC
# 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 <http://www.gnu.org/licenses/>.
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
@@ -47,11 +47,13 @@ Environment variables:
libtool Whether libtool is used (yes/no).
Report bugs to <bug-automake@gnu.org>.
GNU Automake home page: <https://www.gnu.org/software/automake/>.
General help using GNU software: <https://www.gnu.org/gethelp/>.
EOF
exit $?
;;
-v | --v*)
echo "depcomp $scriptversion"
echo "depcomp (GNU Automake) $scriptversion"
exit $?
;;
esac
@@ -113,7 +115,6 @@ nl='
# These definitions help.
upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ
lower=abcdefghijklmnopqrstuvwxyz
digits=0123456789
alpha=${upper}${lower}
if test -z "$depmode" || test -z "$source" || test -z "$object"; then
@@ -128,7 +129,7 @@ tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
rm -f "$tmpdepfile"
# Avoid interferences from the environment.
# Avoid interference from the environment.
gccflag= dashmflag=
# Some modes work just like other modes, but use different flags. We
@@ -198,8 +199,8 @@ gcc3)
;;
gcc)
## Note that this doesn't just cater to obsosete pre-3.x GCC compilers.
## but also to in-use compilers like IMB xlc/xlC and the HP C compiler.
## Note that this doesn't just cater to obsolete pre-3.x GCC compilers.
## but also to in-use compilers like IBM xlc/xlC and the HP C compiler.
## (see the conditional assignment to $gccflag above).
## There are various ways to get dependency output from gcc. Here's
## why we pick this rather obscure method:
@@ -251,6 +252,41 @@ hp)
exit 1
;;
sgi)
if test "$libtool" = yes; then
"$@" "-Wp,-MDupdate,$tmpdepfile"
else
"$@" -MDupdate "$tmpdepfile"
fi
stat=$?
if test $stat -ne 0; then
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files
echo "$object : \\" > "$depfile"
# Clip off the initial element (the dependent). Don't try to be
# clever and replace this with sed code, as IRIX sed won't handle
# lines with more than a fixed number of characters (4096 in
# IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines;
# the IRIX cc adds comments like '#:fec' to the end of the
# dependency line.
tr ' ' "$nl" < "$tmpdepfile" \
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \
| tr "$nl" ' ' >> "$depfile"
echo >> "$depfile"
# The second pass generates a dummy entry for each header file.
tr ' ' "$nl" < "$tmpdepfile" \
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
>> "$depfile"
else
make_dummy_depfile
fi
rm -f "$tmpdepfile"
;;
xlc)
# This case exists only to let depend.m4 do its work. It works by
# looking at the text of this script. This case will never be run,
@@ -748,7 +784,7 @@ exit 0
# Local Variables:
# mode: shell-script
# sh-indentation: 2
# eval: (add-hook 'write-file-hooks 'time-stamp)
# eval: (add-hook 'before-save-hook 'time-stamp nil t)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC0"
@@ -3,11 +3,11 @@
# 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=2016-12-31.14 # UTC
VERSION=2024-07-04.10 # UTC
# Note: this is a bash script (could be zsh or dash)
# Copyright (C) 2009-2017 Free Software Foundation, Inc.
# Copyright (C) 2009-2025 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
@@ -20,7 +20,7 @@ VERSION=2016-12-31.14 # UTC
# 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 <http://www.gnu.org/licenses/>.
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# Written by Jim Meyering
@@ -67,7 +67,7 @@ version()
cat <<EOF
$ME $VERSION
Copyright (C) $year Free Software Foundation, Inc,
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
EOF
@@ -125,7 +125,7 @@ prev_ver=$(cat .prev-version) \
|| die 'failed to determine previous version number from .prev-version'
# Verify that $ver is sensible (> .prev-version).
case $(printf "$prev_ver\n$ver\n"|sort -V -u|tr '\n' ':') in
case $(printf "%s\n%s\n" "$prev_ver" "$ver"|sort -V -u|tr '\n' ':') in
"$prev_ver:$ver:") ;;
*) die "invalid version: $ver (<= $prev_ver)";;
esac
@@ -165,13 +165,13 @@ perl -MPOSIX -ni -e 'my $today = strftime "%F", localtime time;' \
-e 'print $.==3 ? "$pfx $ver ($today) [$type]\n" : $_' \
NEWS || die 'failed to update NEWS'
printf "version $ver\n\n* NEWS: Record release date.\n" \
printf "version %s\n\n* NEWS: Record release date.\n" "$ver" \
| git commit -F - -a || die 'git commit failed'
git tag -s -m "$pkg $ver" v$ver HEAD || die 'git tag failed'
# Local variables:
# indent-tabs-mode: nil
# eval: (add-hook 'write-file-hooks 'time-stamp)
# eval: (add-hook 'before-save-hook 'time-stamp nil t)
# time-stamp-start: "VERSION="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC0"
@@ -2,13 +2,13 @@
# gendocs.sh -- generate a GNU manual in many formats. This script is
# mentioned in maintain.texi. See the help message below for usage details.
scriptversion=2016-12-31.18
scriptversion=2025-01-01.00
# Copyright 2003-2017 Free Software Foundation, Inc.
# Copyright 2003-2025 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
# 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,
@@ -17,7 +17,7 @@ scriptversion=2016-12-31.18
# 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 <http://www.gnu.org/licenses/>.
# along with this program. If not, see <https://www.gnu.org/licenses/>.
#
# Original author: Mohit Agarwal.
# Send bug reports and any other correspondence to bug-gnulib@gnu.org.
@@ -25,8 +25,8 @@ scriptversion=2016-12-31.18
# The latest version of this script, and the companion template, is
# available from the Gnulib repository:
#
# http://git.savannah.gnu.org/cgit/gnulib.git/tree/build-aux/gendocs.sh
# http://git.savannah.gnu.org/cgit/gnulib.git/tree/doc/gendocs_template
# https://git.savannah.gnu.org/cgit/gnulib.git/tree/build-aux/gendocs.sh
# https://git.savannah.gnu.org/cgit/gnulib.git/tree/doc/gendocs_template
# TODO:
# - image importing was only implemented for HTML generated by
@@ -37,42 +37,43 @@ scriptversion=2016-12-31.18
prog=`basename "$0"`
srcdir=`pwd`
scripturl="http://git.savannah.gnu.org/cgit/gnulib.git/plain/build-aux/gendocs.sh"
templateurl="http://git.savannah.gnu.org/cgit/gnulib.git/plain/doc/gendocs_template"
scripturl="https://git.savannah.gnu.org/cgit/gnulib.git/plain/build-aux/gendocs.sh"
templateurl="https://git.savannah.gnu.org/cgit/gnulib.git/plain/doc/gendocs_template"
: ${SETLANG="env LANG= LC_MESSAGES= LC_ALL= LANGUAGE="}
: ${MAKEINFO="makeinfo"}
: ${TEXI2DVI="texi2dvi"}
: ${DOCBOOK2HTML="docbook2html"}
: ${DOCBOOK2PDF="docbook2pdf"}
: ${DOCBOOK2TXT="docbook2txt"}
: ${GENDOCS_TEMPLATE_DIR="."}
: ${PERL='perl'}
: ${TEXI2HTML="texi2html"}
: "${SETLANG="env LANG= LC_TIME= LC_MESSAGES= LC_ALL= LANGUAGE="}"
: "${MAKEINFO="makeinfo"}"
: "${TEXI2DVI="texi2dvi"}"
: "${DOCBOOK2HTML="docbook2html"}"
: "${DOCBOOK2PDF="docbook2pdf"}"
: "${DOCBOOK2TXT="docbook2txt"}"
: "${GENDOCS_TEMPLATE_DIR="."}"
: "${PERL="perl"}"
: "${TEXI2HTML="texi2html"}"
unset CDPATH
unset use_texi2html
MANUAL_TITLE=
PACKAGE=
EMAIL=webmasters@gnu.org # please override with --email
commonarg= # passed to all makeinfo/texi2html invcations.
commonarg= # passed to all makeinfo/texi2html invocations.
dirargs= # passed to all tools (-I dir).
dirs= # -I directories.
htmlarg="--css-ref=/software/gnulib/manual.css -c TOP_NODE_UP_URL=/manual"
htmlarg="--css-ref=https://www.gnu.org/software/gnulib/manual.css -c TOP_NODE_UP_URL=/manual"
default_htmlarg=true
infoarg=--no-split
generate_ascii=true
generate_html=true
generate_info=true
generate_tex=true
outdir=manual
source_extra=
unset source_extra
split=node
srcfile=
texarg="-t @finalout"
version="gendocs.sh $scriptversion
Copyright 2017 Free Software Foundation, Inc.
Copyright 2025-2025 Free Software Foundation, Inc.
There is NO warranty. You may redistribute this software
under the terms of the GNU General Public License.
For more information about these matters, see the files named COPYING."
@@ -82,7 +83,7 @@ usage="Usage: $prog [OPTION]... PACKAGE MANUAL-TITLE
Generate output in various formats from PACKAGE.texinfo (or .texi or
.txi) source. See the GNU Maintainers document for a more extensive
discussion:
http://www.gnu.org/prep/maintain_toc.html
https://www.gnu.org/prep/maintain_toc.html
Options:
--email ADR use ADR as contact in generated web pages; always give this.
@@ -163,10 +164,10 @@ while test $# -gt 0; do
--common) shift; commonarg=$1;;
--docbook) docbook=yes;;
--email) shift; EMAIL=$1;;
--html) shift; htmlarg=$1;;
--html) shift; default_htmlarg=false; htmlarg=$1;;
--info) shift; infoarg=$1;;
--no-ascii) generate_ascii=false;;
--no-html) generate_ascii=false;;
--no-html) generate_html=false;;
--no-info) generate_info=false;;
--no-tex) generate_tex=false;;
--source) shift; source_extra=$1;;
@@ -199,6 +200,11 @@ commonarg=" $dirargs $commonarg"
# For most of the following, the base name is just $PACKAGE
base=$PACKAGE
if $default_htmlarg && test -n "$use_texi2html"; then
# The legacy texi2html doesn't support TOP_NODE_UP_URL
htmlarg="--css-ref=https://www.gnu.org/software/gnulib/manual.css"
fi
if test -n "$srcfile"; then
# but here, we use the basename of $srcfile
base=`basename "$srcfile"`
@@ -250,8 +256,8 @@ BEGIN {
/<img src="(.*?)"/g && ++$need{$1};
END {
#print "$me: @{[keys %need]}\n"; # for debugging, show images found.
FILE: for my $f (keys %need) {
#print "$me: @{[sort keys %need]}\n"; # for debugging, show images found.
FILE: for my $f (sort keys %need) {
for my $d (@dirs) {
if (-f "$d/$f") {
use File::Basename;
@@ -298,7 +304,7 @@ fi # end info
#
if $generate_tex; then
cmd="$SETLANG $TEXI2DVI $dirargs $texarg \"$srcfile\""
printf "\nGenerating dvi... ($cmd)\n"
printf "\nGenerating dvi... (%s)\n" "$cmd"
eval "$cmd"
# compress/finish dvi:
gzip -f -9 $PACKAGE.dvi
@@ -307,7 +313,7 @@ if $generate_tex; then
ls -l "$outdir/$PACKAGE.dvi.gz"
cmd="$SETLANG $TEXI2DVI --pdf $dirargs $texarg \"$srcfile\""
printf "\nGenerating pdf... ($cmd)\n"
printf "\nGenerating pdf... (%s)\n" "$cmd"
eval "$cmd"
pdf_size=`calcsize $PACKAGE.pdf`
mv $PACKAGE.pdf "$outdir/"
@@ -318,7 +324,7 @@ fi # end tex (dvi + pdf)
if $generate_ascii; then
opt="-o $PACKAGE.txt --no-split --no-headers $commonarg"
cmd="$SETLANG $MAKEINFO $opt \"$srcfile\""
printf "\nGenerating ascii... ($cmd)\n"
printf "\nGenerating ascii... (%s)\n" "$cmd"
eval "$cmd"
ascii_size=`calcsize $PACKAGE.txt`
gzip -f -9 -c $PACKAGE.txt >"$outdir/$PACKAGE.txt.gz"
@@ -335,7 +341,7 @@ html_split()
{
opt="--split=$1 --node-files $commonarg $htmlarg"
cmd="$SETLANG $TEXI2HTML --output $PACKAGE.html $opt \"$srcfile\""
printf "\nGenerating html by $1... ($cmd)\n"
printf "\nGenerating html by %s... (%s)\n" "$1" "$cmd"
eval "$cmd"
split_html_dir=$PACKAGE.html
(
@@ -353,7 +359,7 @@ html_split()
if test -z "$use_texi2html"; then
opt="--no-split --html -o $PACKAGE.html $commonarg $htmlarg"
cmd="$SETLANG $MAKEINFO $opt \"$srcfile\""
printf "\nGenerating monolithic html... ($cmd)\n"
printf "\nGenerating monolithic html... (%s)\n" "$cmd"
rm -rf $PACKAGE.html # in case a directory is left over
eval "$cmd"
html_mono_size=`calcsize $PACKAGE.html`
@@ -374,7 +380,7 @@ if test -z "$use_texi2html"; then
#
opt="--html -o $PACKAGE.html $split_arg $commonarg $htmlarg"
cmd="$SETLANG $MAKEINFO $opt \"$srcfile\""
printf "\nGenerating html by $split... ($cmd)\n"
printf "\nGenerating html by %s... (%s)\n" "$split" "$cmd"
eval "$cmd"
split_html_dir=$PACKAGE.html
copy_images $split_html_dir/ $split_html_dir/*.html
@@ -392,7 +398,7 @@ if test -z "$use_texi2html"; then
else # use texi2html:
opt="--output $PACKAGE.html $commonarg $htmlarg"
cmd="$SETLANG $TEXI2HTML $opt \"$srcfile\""
printf "\nGenerating monolithic html with texi2html... ($cmd)\n"
printf "\nGenerating monolithic html with texi2html... (%s)\n" "$cmd"
rm -rf $PACKAGE.html # in case a directory is left over
eval "$cmd"
html_mono_size=`calcsize $PACKAGE.html`
@@ -410,11 +416,49 @@ fi # end html
printf "\nMaking .tar.gz for sources...\n"
d=`dirname $srcfile`
(
cd "$d"
srcfiles=`ls -d *.texinfo *.texi *.txi *.eps $source_extra 2>/dev/null` || true
tar czfh "$abs_outdir/$PACKAGE.texi.tar.gz" $srcfiles
ls -l "$abs_outdir/$PACKAGE.texi.tar.gz"
)
cd "$d" || exit
# Set PATS to a list of globbing patterns that expand to
# file names to be put into the .tar.gz for sources.
# Omit patterns that do not expand to file names.
pats=
if case `$MAKEINFO --version | sed -e 's/^[^0-9]*//' -e 1q` in \
[1-6]* | 7.[01]*) false;; \
*) true;; \
esac \
; then
for pat in '*.eps'; do
for file in $pat; do
test "$file" = "$pat" && test ! -e "$file" || pats="$pats $pat"
break
done
done
# if $MAKEINFO is recent enough, use --trace-includes on the
# $srcfile to get the included files of the targeted manual only
base=`basename "$srcfile"`
cmd="$SETLANG $MAKEINFO $commonarg --trace-includes \"$base\""
eval "$cmd" \
| tar -czhf "$abs_outdir/$PACKAGE.texi.tar.gz" \
--verbatim-files-from -T- -- "$base" $pats \
${source_extra+"$source_extra"} \
&& ls -l "$abs_outdir/$PACKAGE.texi.tar.gz"
else
for pat in '*.texinfo' '*.texi' '*.txi' '*.eps'; do
for file in $pat; do
test "$file" = "$pat" && test ! -e "$file" || pats="$pats $pat"
break
done
done
tar -czhf "$abs_outdir/$PACKAGE.texi.tar.gz" \
-- $pats ${source_extra+"$source_extra"} \
&& ls -l "$abs_outdir/$PACKAGE.texi.tar.gz"
fi
) || exit
texi_tgz_size=`calcsize "$outdir/$PACKAGE.texi.tar.gz"`
#
@@ -422,7 +466,7 @@ texi_tgz_size=`calcsize "$outdir/$PACKAGE.texi.tar.gz"`
if test -n "$docbook"; then
opt="-o - --docbook $commonarg"
cmd="$SETLANG $MAKEINFO $opt \"$srcfile\" >${srcdir}/$PACKAGE-db.xml"
printf "\nGenerating docbook XML... ($cmd)\n"
printf "\nGenerating docbook XML... (%s)\n" "$cmd"
eval "$cmd"
docbook_xml_size=`calcsize $PACKAGE-db.xml`
gzip -f -9 -c $PACKAGE-db.xml >"$outdir/$PACKAGE-db.xml.gz"
@@ -432,7 +476,7 @@ if test -n "$docbook"; then
split_html_db_dir=html_node_db
opt="$commonarg -o $split_html_db_dir"
cmd="$DOCBOOK2HTML $opt \"${outdir}/$PACKAGE-db.xml\""
printf "\nGenerating docbook HTML... ($cmd)\n"
printf "\nGenerating docbook HTML... (%s)\n" "$cmd"
eval "$cmd"
(
cd ${split_html_db_dir} || exit 1
@@ -445,26 +489,40 @@ if test -n "$docbook"; then
rmdir ${split_html_db_dir}
cmd="$DOCBOOK2TXT \"${outdir}/$PACKAGE-db.xml\""
printf "\nGenerating docbook ASCII... ($cmd)\n"
printf "\nGenerating docbook ASCII... (%s)\n" "$cmd"
eval "$cmd"
docbook_ascii_size=`calcsize $PACKAGE-db.txt`
mv $PACKAGE-db.txt "$outdir/"
cmd="$DOCBOOK2PDF \"${outdir}/$PACKAGE-db.xml\""
printf "\nGenerating docbook PDF... ($cmd)\n"
printf "\nGenerating docbook PDF... (%s)\n" "$cmd"
eval "$cmd"
docbook_pdf_size=`calcsize $PACKAGE-db.pdf`
mv $PACKAGE-db.pdf "$outdir/"
fi
#
printf "\nMaking index.html for $PACKAGE...\n"
printf "\nMaking index.html for %s...\n" "$PACKAGE"
if test -z "$use_texi2html"; then
CONDS="/%%IF *HTML_SECTION%%/,/%%ENDIF *HTML_SECTION%%/d;\
/%%IF *HTML_CHAPTER%%/,/%%ENDIF *HTML_CHAPTER%%/d"
if test x$split = xnode; then
CONDS="/%%IF *HTML_NODE%%/d;/%%ENDIF *HTML_NODE%%/d;\
/%%IF *HTML_CHAPTER%%/,/%%ENDIF *HTML_CHAPTER%%/d;\
/%%IF *HTML_SECTION%%/,/%%ENDIF *HTML_SECTION%%/d;"
elif test x$split = xchapter; then
CONDS="/%%IF *HTML_CHAPTER%%/d;/%%ENDIF *HTML_CHAPTER%%/d;\
/%%IF *HTML_SECTION%%/,/%%ENDIF *HTML_SECTION%%/d;\
/%%IF *HTML_NODE%%/,/%%ENDIF *HTML_NODE%%/d;"
elif test x$split = xsection; then
CONDS="/%%IF *HTML_SECTION%%/d;/%%ENDIF *HTML_SECTION%%/d;\
/%%IF *HTML_CHAPTER%%/,/%%ENDIF *HTML_CHAPTER%%/d;\
/%%IF *HTML_NODE%%/,/%%ENDIF *HTML_NODE%%/d;"
else
CONDS="/%%IF.*%%/d;/%%ENDIF.*%%/d;" # invalid split argument
fi
else
# should take account of --split here.
CONDS="/%%ENDIF.*%%/d;/%%IF *HTML_SECTION%%/d;/%%IF *HTML_CHAPTER%%/d"
# for texi2html, we do not take account of --split and simply output
# all variants
CONDS="/%%IF.*%%/d;/%%ENDIF.*%%/d;"
fi
curdate=`$SETLANG date '+%B %d, %Y'`
@@ -497,7 +555,7 @@ $GENDOCS_TEMPLATE_DIR/gendocs_template >"$outdir/index.html"
echo "Done, see $outdir/ subdirectory for new files."
# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
# eval: (add-hook 'before-save-hook 'time-stamp nil t)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-end: "$"
@@ -1,12 +1,12 @@
#!/bin/sh
# Print a version string.
scriptversion=2017-01-09.19; # UTC
scriptversion=2025-01-28.09; # UTC
# Copyright (C) 2007-2017 Free Software Foundation, Inc.
# Copyright (C) 2007-2025 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
# 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,
@@ -15,69 +15,78 @@ scriptversion=2017-01-09.19; # UTC
# 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 <http://www.gnu.org/licenses/>.
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# This script is derived from GIT-VERSION-GEN from GIT: http://git.or.cz/.
# It may be run two ways:
# This script is derived from GIT-VERSION-GEN from GIT: https://git-scm.com/.
# It may be run in the following ways, presuming the script is invoked
# like "./git-version-gen .tarball-version":
#
# - from a git repository in which the "git describe" command below
# produces useful output (thus requiring at least one signed tag)
# - from a non-git-repo directory containing a .tarball-version file, which
# presumes this script is invoked like "./git-version-gen .tarball-version".
#
# - from a "make dist" non-git-repo directory containing a
# .tarball-version file
#
# - from a "git archive" non-git-repo directory containing a
# .tarball-version-git file
# In order to use intra-version strings in your project, you will need two
# In order to use intra-version strings in your project, you will need some
# separate generated version string files:
#
# .tarball-version - present only in a distribution tarball, and not in
# a checked-out repository. Created with contents that were learned at
# the last time autoconf was run, and used by git-version-gen. Must not
# be present in either $(srcdir) or $(builddir) for git-version-gen to
# give accurate answers during normal development with a checked out tree,
# but must be present in a tarball when there is no version control system.
# Therefore, it cannot be used in any dependencies. GNUmakefile has
# hooks to force a reconfigure at distribution time to get the value
# correct, without penalizing normal development with extra reconfigures.
# .tarball-version - contains the version number assigned by the maintainer.
# Present or missing in a checked-out repository, at the discretion of the
# maintainer/contributor. Present in a distribution tarball, because the
# tarball does not include the version control history.
# Used by git-version-gen as an override.
# Cannot be used in any dependencies (since it may be absent).
# GNUmakefile has hooks to force a reconfigure at "make dist" time to get
# the value correct, without penalizing normal development with extra
# reconfigures.
#
# .version - present in a checked-out repository and in a distribution
# tarball. Usable in dependencies, particularly for files that don't
# want to depend on config.h but do want to track version changes.
# Delete this file prior to any autoconf run where you want to rebuild
# files to pick up a version string change; and leave it stale to
# minimize rebuild time after unrelated changes to configure sources.
# .tarball-version-git - a file committed to git containing a single
# line with the string $Format:%(describe)$ and that the file is
# marked in .gitattributes with ".tarball-version-git export-subst".
# If the file doesn't exist or the export-subst keyword wasn't
# effective, the file is ignored.
#
# As with any generated file in a VC'd directory, you should add
# /.version to .gitignore, so that you don't accidentally commit it.
# .tarball-version is never generated in a VC'd directory, so needn't
# be listed there.
#
# Use the following line in your configure.ac, so that $(VERSION) will
# Use the following snippet in your configure.ac, so that $(VERSION) will
# automatically be up-to-date each time configure is run (and note that
# since configure.ac no longer includes a version string, Makefile rules
# should not depend on configure.ac for version updates).
#
# AC_INIT([GNU project],
# m4_esyscmd([build-aux/git-version-gen .tarball-version]),
# [bug-project@example])
# AC_INIT([@var{package}], [package])
# AC_CONFIG_SRCDIR([@var{unique-file-in-source-dir}])
# AC_CONFIG_AUX_DIR([build-aux])
# VERSION_NUMBER=`cd $srcdir \
# && build-aux/git-version-gen .tarball-version`
# gl_INIT_PACKAGE_VERSION([$VERSION_NUMBER])
# AM_INIT_AUTOMAKE([@var{options}])
#
# Then use the following lines in your Makefile.am, so that .version
# will be present for dependencies, and so that .version and
# Then use the following lines in your Makefile.am, so that
# .tarball-version will exist in distribution tarballs.
#
# EXTRA_DIST = $(top_srcdir)/.version
# BUILT_SOURCES = $(top_srcdir)/.version
# $(top_srcdir)/.version:
# echo $(VERSION) > $@-t && mv $@-t $@
# dist-hook:
# echo $(VERSION) > $(distdir)/.tarball-version
# dist-hook: dist-tarball-version
# .PHONY: dist-tarball-version
# dist-tarball-version:
# echo '$(VERSION)' > $(distdir)/.tarball-version
#
# To setup support for "git archive" tarballs, use the following:
#
# echo '$Format:%(describe)$' > .tarball-version-git
# echo '.tarball-version-git export-subst' >> .gitattributes
# git add .tarball-version-git .gitattributes
# git commit -m "Add .tarball-version-git for git-version-gen."
me=$0
year=`expr "$scriptversion" : '\([^-]*\)'`
version="git-version-gen $scriptversion
Copyright 2011 Free Software Foundation, Inc.
There is NO warranty. You may redistribute this software
under the terms of the GNU General Public License.
For more information about these matters, see the files named COPYING."
Copyright (C) ${year} Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law."
usage="\
Usage: $me [OPTION]... \$srcdir/.tarball-version [TAG-NORMALIZATION-SED-SCRIPT]
@@ -92,7 +101,7 @@ Options:
--help display this help and exit
--version output version information and exit
Running without arguments will suffice in most cases."
Send patches and bug reports to <bug-gnulib@gnu.org>."
prefix=v
fallback=
@@ -136,16 +145,14 @@ v_from_git=
# First see if there is a tarball-only version file.
# then try "git describe", then default.
if test -f $tarball_version_file
if test -f "$tarball_version_file"
then
v=`cat $tarball_version_file` || v=
v=`cat "$tarball_version_file"` || v=
case $v in
*$nl*) v= ;; # reject multi-line output
[0-9]*) ;;
*) v= ;;
esac
test "x$v" = x \
&& echo "$0: WARNING: $tarball_version_file is missing or damaged" 1>&2
&& echo "$0: WARNING: $tarball_version_file is damaged" 1>&2
fi
if test "x$v" != x
@@ -167,9 +174,10 @@ then
# tag or the previous older version that did not?
# Newer: v6.10-77-g0f8faeb
# Older: v6.10-g0f8faeb
case $v in
*-*-*) : git describe is okay three part flavor ;;
*-*)
vprefix=`expr "X$v" : 'X\(.*\)-g[^-]*$'` || vprefix=$v
case $vprefix in
*-*) : git describe is probably okay three part flavor ;;
*)
: git describe is older two part flavor
# Recreate the number of commits and rewrite such that the
# result is the same as if we were using the newer version
@@ -183,10 +191,6 @@ then
test "$commit_list" = failed && v=UNKNOWN
;;
esac
# Change the first '-' to a '.', so version-comparing tools work properly.
# Remove the "g" in git describe's output string, to save a byte.
v=`echo "$v" | sed 's/-/./;s/\(.*\)-g/\1-/'`;
v_from_git=1
elif test "x$fallback" = x || git --version >/dev/null 2>&1; then
v=UNKNOWN
@@ -194,22 +198,43 @@ else
v=$fallback
fi
if test "x$v" = xUNKNOWN \
&& test -f "$tarball_version_file"-git \
&& v=$(head -1 "$tarball_version_file"-git); then
case $v in
*Format*) v=UNKNOWN ;;
esac
fi
# Change the penultimate "-" to ".", for version-comparing tools.
# Remove the "g" to save a byte.
v=`echo "$v" | sed 's/-\([^-]*\)-g\([^-]*\)$/.\1-\2/'`;
v=`echo "$v" |sed "s/^$prefix//"`
# Test whether to append the "-dirty" suffix only if the version
# The "-modified" suffix was previously called "-dirty". While this term
# was invented by the git people to designate a checkout that is not "clean",
# it has a negative connotation that is not in line with the fact that
# a Free Software developer routinely works with modified source code.
# In fact, modifying source code is the *essence* of Free Software.
# What we need here is a term that is suitable for naming tarballs, without
# shaming the developer. Giving a name to a tarball is something else than
# describing the state of a git checkout.
#
# Test whether to append the "-modified" suffix only if the version
# string we're using came from git. I.e., skip the test if it's "UNKNOWN"
# or if it came from .tarball-version.
if test "x$v_from_git" != x; then
# Don't declare a version "dirty" merely because a timestamp has changed.
# Don't declare a version "modified" merely because a timestamp has changed.
git update-index --refresh > /dev/null 2>&1
dirty=`exec 2>/dev/null;git diff-index --name-only HEAD` || dirty=
case "$dirty" in
modified=`exec 2>/dev/null;git diff-index --name-only HEAD` || modified=
case "$modified" in
'') ;;
*) # Append the suffix only if there isn't one already.
case $v in
*-dirty) ;;
*) v="$v-dirty" ;;
*-dirty | *-modified) ;;
*) v="$v-modified" ;;
esac ;;
esac
fi
@@ -218,7 +243,7 @@ fi
printf %s "$v"
# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
# eval: (add-hook 'before-save-hook 'time-stamp nil t)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC0"
@@ -1,30 +1,47 @@
eval '(exit $?0)' && eval 'exec perl -wS "$0" "$@"'
& eval 'exec perl -wS "$0" $argv:q'
if 0;
#!/bin/sh
#! -*-perl-*-
# Convert git log output to ChangeLog format.
my $VERSION = '2016-03-22 21:49'; # UTC
# Copyright (C) 2008-2025 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 <https://www.gnu.org/licenses/>.
#
# Written by Jim Meyering
# This is a prologue that allows running a perl script as an executable
# on systems that are compliant to a POSIX version before POSIX:2017.
# On such systems, the usual invocation of an executable through execlp()
# or execvp() fails with ENOEXEC if it is a script that does not start
# with a #! line. The script interpreter mentioned in the #! line has
# to be /bin/sh, because on GuixSD systems that is the only program that
# has a fixed file name. The second line is essential for perl and is
# also useful for editing this file in Emacs. The next two lines below
# are valid code in both sh and perl. When executed by sh, they re-execute
# the script through the perl program found in $PATH. The '-x' option
# is essential as well; without it, perl would re-execute the script
# through /bin/sh. When executed by perl, the next two lines are a no-op.
eval 'exec perl -wSx "$0" "$@"'
if 0;
my $VERSION = '2024-07-17 02:20'; # 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
# do its job. Otherwise, update this string manually.
# Copyright (C) 2008-2017 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 <http://www.gnu.org/licenses/>.
# Written by Jim Meyering
(my $copyright_year = $VERSION) =~ s/^(\d*)-.*$/$1/;
use strict;
use warnings;
@@ -33,7 +50,7 @@ use POSIX qw(strftime);
(my $ME = $0) =~ s|.*/||;
# use File::Coda; # http://meyering.net/code/Coda/
# use File::Coda; # https://meyering.net/code/Coda/
END {
defined fileno STDOUT or return;
close STDOUT and return;
@@ -82,6 +99,7 @@ OPTIONS:
--strip-cherry-pick remove data inserted by "git cherry-pick";
this includes the "cherry picked from commit ..." line,
and the possible final "Conflicts:" paragraph.
--commit-timezone use dates respecting the timezone commits were made in.
--help display this help and exit
--version output version information and exit
@@ -122,11 +140,24 @@ s/all tile types/all file types/
# Change the author to be Paul. Note the escaped "@":
s,Jim .*>,Paul Eggert <eggert\\\@cs.ucla.edu>,
Send patches and bug reports to <bug-gnulib\@gnu.org>.
EOF
}
exit $exit_code;
}
sub print_version ()
{
print "$ME version $VERSION\n";
print "Copyright (C) $copyright_year Free Software Foundation, Inc.\n";
print "License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>\n"
. "This is free software: you are free to change and redistribute it.\n"
. "There is NO WARRANTY, to the extent permitted by law.\n";
print "\n";
my $author = "Jim Meyering";
print "Written by $author.\n";
}
# If the string $S is a well-behaved file name, simply return it.
# If it contains white space, quotes, etc., quote it, and return the new string.
sub shell_quote($)
@@ -174,7 +205,7 @@ sub parse_amend_file($)
if (!$in_code)
{
$line =~ /^([0-9a-fA-F]{40})$/
$line =~ /^([[:xdigit:]]{40})$/
or (warn "$ME: $f:$.: invalid line; expected an SHA1\n"),
$fail = 1, next;
$sha = lc $1;
@@ -232,11 +263,12 @@ sub git_dir_option($)
my $ignore_line;
my $strip_tab = 0;
my $strip_cherry_pick = 0;
my $commit_timezone = 0;
my $srcdir;
GetOptions
(
help => sub { usage 0 },
version => sub { print "$ME version $VERSION\n"; exit },
version => sub { print_version; exit },
'since=s' => \$since_date,
'until=s' => \$until_date,
'format=s' => \$format_string,
@@ -247,6 +279,7 @@ sub git_dir_option($)
'ignore-line=s' => \$ignore_line,
'strip-tab' => \$strip_tab,
'strip-cherry-pick' => \$strip_cherry_pick,
'commit-timezone' => \$commit_timezone,
'srcdir=s' => \$srcdir,
) or usage 1;
@@ -259,10 +292,12 @@ sub git_dir_option($)
# that makes a correction in the log or attribution of that commit.
my $amend_code = defined $amend_file ? parse_amend_file $amend_file : {};
my $commit_time_format = $commit_timezone ? '%cI' : '%ct';
my @cmd = ('git',
git_dir_option $srcdir,
qw(log --log-size),
'--pretty=format:%H:%ct %an <%ae>%n%n'.$format_string, @ARGV);
("--pretty=format:%H:$commit_time_format"
. ' %an <%ae>%n%n'.$format_string, @ARGV));
open PIPE, '-|', @cmd
or die ("$ME: failed to run '". quoted_cmd (@cmd) ."': $!\n"
. "(Is your Git too old? Version 1.5.1 or later is required.)\n");
@@ -288,7 +323,7 @@ sub git_dir_option($)
my ($sha, $rest) = split ':', $log, 2;
defined $sha
or die "$ME:$.: malformed log entry\n";
$sha =~ /^[0-9a-fA-F]{40}$/
$sha =~ /^[[:xdigit:]]{40}$/
or die "$ME:$.: invalid SHA1: $sha\n";
my $skipflag = 0;
@@ -335,17 +370,31 @@ sub git_dir_option($)
my $author_line = shift @line;
defined $author_line
or die "$ME:$.: unexpected EOF\n";
$author_line =~ /^(\d+) (.*>)$/
$author_line =~ /^(\S+) (.*>)$/
or die "$ME:$.: Invalid line "
. "(expected date/author/email):\n$author_line\n";
# Author <email>
my $author = $2;
my $commit_date = $1;
if (! $commit_timezone)
{
# Seconds since the Epoch.
$commit_date = strftime "%Y-%m-%d", localtime ($commit_date);
}
else
{
# ISO 8601 date.
$commit_date =~ s/T.*$//;
}
# Format 'Copyright-paperwork-exempt: Yes' as a standard ChangeLog
# `(tiny change)' annotation.
# '(tiny change)' annotation.
my $tiny = (grep (/^(?:Copyright-paperwork-exempt|Tiny-change):\s+[Yy]es$/, @line)
? ' (tiny change)' : '');
my $date_line = sprintf "%s %s$tiny\n",
strftime ("%Y-%m-%d", localtime ($1)), $2;
my $date_line = "$commit_date $author$tiny\n";
my @coauthors = grep /^Co-authored-by:.*$/, @line;
# Omit meta-data lines we've already interpreted.
@@ -376,7 +425,7 @@ sub git_dir_option($)
@skipshas = ();
next;
}
if ($found && $_ =~ /^([0-9a-fA-F]{7,}) [^ ]/)
if ($found && $_ =~ /^([[:xdigit:]]{7,}) [^ ]/)
{
push ( @skipshas, $1 );
}
@@ -440,7 +489,8 @@ sub git_dir_option($)
# If there were any lines
if (@line == 0)
{
warn "$ME: warning: empty commit message:\n $date_line\n";
warn "$ME: warning: empty commit message:\n"
. " commit $sha\n $date_line\n";
}
else
{
@@ -479,7 +529,7 @@ sub git_dir_option($)
# Complain about any unused entry in the --amend=F specified file.
my $fail = 0;
foreach my $sha (keys %$amend_code)
foreach my $sha (sort keys %$amend_code)
{
warn "$ME:$amend_file: unused entry: $sha\n";
$fail = 1;
@@ -491,7 +541,8 @@ sub git_dir_option($)
# Local Variables:
# mode: perl
# indent-tabs-mode: nil
# eval: (add-hook 'write-file-hooks 'time-stamp)
# eval: (add-hook 'before-save-hook 'time-stamp nil t)
# time-stamp-line-limit: 50
# time-stamp-start: "my $VERSION = '"
# time-stamp-format: "%:y-%02m-%02d %02H:%02M"
# time-stamp-time-zone: "UTC0"
@@ -1,10 +1,10 @@
#!/bin/sh
# Run this after each non-alpha release, to update the web documentation at
# http://www.gnu.org/software/$pkg/manual/
# https://www.gnu.org/software/$pkg/manual/
VERSION=2016-01-12.23; # UTC
VERSION=2024-07-04.10; # UTC
# Copyright (C) 2009-2017 Free Software Foundation, Inc.
# Copyright (C) 2009-2025 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
@@ -17,7 +17,7 @@ VERSION=2016-01-12.23; # UTC
# 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 <http://www.gnu.org/licenses/>.
# along with this program. If not, see <https://www.gnu.org/licenses/>.
ME=$(basename "$0")
warn() { printf '%s: %s\n' "$ME" "$*" >&2; }
@@ -30,7 +30,7 @@ Usage: $ME
Run this script from top_srcdir (no arguments) after each non-alpha
release, to update the web documentation at
http://www.gnu.org/software/\$pkg/manual/
https://www.gnu.org/software/\$pkg/manual/
This script assumes you're using git for revision control, and
requires a .prev-version file as well as a Makefile, from which it
@@ -41,6 +41,7 @@ Options:
-C, --builddir=DIR location of (configured) Makefile (default: .)
-n, --dry-run don't actually commit anything
-m, --mirror remove out of date files from document server
-u, --user the name of the CVS user on Savannah
--help print this help, then exit
--version print version number, then exit
@@ -55,7 +56,7 @@ version()
cat <<EOF
$ME $VERSION
Copyright (C) $year Free Software Foundation, Inc,
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
EOF
@@ -109,6 +110,7 @@ find_tool XARGS gxargs xargs
builddir=.
dryrun=
rm_stale='echo'
cvs_user="$USER"
while test $# != 0
do
# Handle --option=value by splitting apart and putting back on argv.
@@ -126,6 +128,7 @@ do
-C|--builddir) shift; builddir=$1; shift ;;
-n|--dry-run) dryrun=echo; shift;;
-m|--mirror) rm_stale=''; shift;;
-u|--user) shift; cvs_user=$1; shift ;;
--*) die "unrecognized option: $1";;
*) break;;
esac
@@ -150,8 +153,8 @@ cleanup()
$GIT branch -d $tmp_branch
exit $__st
}
trap cleanup 0
trap 'exit $?' 1 2 13 15
trap cleanup EXIT
trap 'exit $?' HUP INT PIPE TERM
# We must build using sources for which --version reports the
# just-released version number, not some string like 7.6.18-20761.
@@ -172,11 +175,14 @@ set +e
tmp=$(mktemp -d web-doc-update.XXXXXX) || exit 1
( cd $tmp \
&& $CVS -d $USER@cvs.sv.gnu.org:/webcvs/$pkg co $pkg )
&& $CVS -d $cvs_user@cvs.savannah.gnu.org:/webcvs/$pkg co $pkg )
$RSYNC -avP "$builddir"/doc/manual/ $tmp/$pkg/manual
(
cd $tmp/$pkg/manual
cd $tmp/$pkg
test -d manual/CVS || $dryrun $CVS add -ko manual
cd manual
# Add all the files. This is simpler than trying to add only the
# new ones because of new directories
@@ -202,7 +208,7 @@ $RSYNC -avP "$builddir"/doc/manual/ $tmp/$pkg/manual
)
# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
# eval: (add-hook 'before-save-hook 'time-stamp nil t)
# time-stamp-start: "VERSION="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC0"
@@ -1,13 +1,13 @@
#!/bin/sh
# Sign files and upload them.
scriptversion=2016-01-11.22; # UTC
scriptversion=2024-12-09.08; # UTC
# Copyright (C) 2004-2017 Free Software Foundation, Inc.
# Copyright (C) 2004-2025 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)
# 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,
@@ -16,7 +16,7 @@ scriptversion=2016-01-11.22; # UTC
# 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 <http://www.gnu.org/licenses/>.
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# Originally written by Alexandre Duret-Lutz <adl@gnu.org>.
# The master copy of this file is maintained in the gnulib Git repository.
@@ -24,7 +24,30 @@ scriptversion=2016-01-11.22; # UTC
set -e
GPG='gpg --batch --no-tty'
GPG=gpg
# Choose the proper version of gpg, so as to avoid a
# "gpg-agent is not available in this session" error
# when gpg-agent is version 2 but gpg is still version 1.
# FIXME-2020: remove, once all major distros ship gpg version 2 as /usr/bin/gpg
gpg_agent_version=`(gpg-agent --version) 2>/dev/null | sed -e '2,$d' -e 's/^[^0-9]*//'`
case "$gpg_agent_version" in
2.*)
gpg_version=`(gpg --version) 2>/dev/null | sed -e '2,$d' -e 's/^[^0-9]*//'`
case "$gpg_version" in
1.*)
if (type gpg2) >/dev/null 2>/dev/null; then
# gpg2 is present.
GPG=gpg2
else
# gpg2 is missing. Ubuntu users should install the package 'gnupg2'.
echo "WARNING: Using 'gpg', which is too old. You should install 'gpg2'." 1>&2
fi
;;
esac
;;
esac
GPG="${GPG} --batch --no-tty"
conffile=.gnuploadrc
to=
dry_run=false
@@ -54,10 +77,10 @@ Options:
--user NAME sign with key NAME
--replace allow replacements of existing files
--symlink-regex[=EXPR] use sed script EXPR to compute symbolic link names
--dry-run do nothing, show what would have been done
-n, --dry-run do nothing, show what would have been done
(including the constructed directive file)
--version output version information and exit
--help print this help text and exit
-h, --help print this help text and exit
If --symlink-regex is given without EXPR, then the link target name
is created by replacing the version information with '-latest', e.g.:
@@ -78,7 +101,10 @@ in the current working directory, its contents are prepended to the
actual command line options. Use this to keep your defaults. Comments
(#) and empty lines in $conffile are allowed.
<http://www.gnu.org/prep/maintain/html_node/Automated-FTP-Uploads.html>
You may need to set GPG_TTY=\$(tty) in your environment. See the
gpg-agent man page.
<https://www.gnu.org/prep/maintain/html_node/Automated-FTP-Uploads.html>
gives some further background.
Examples:
@@ -93,12 +119,22 @@ Examples:
--symlink-regex \\
foobar-1.0.tar.gz foobar-1.0.tar.xz
4. Upload foobar-0.9.90.tar.gz to two sites:
4. Create a symbolic link foobar-latest.tar.gz -> foobar-1.0.tar.gz
and likewise for the corresponding .sig file:
gnupload --to ftp.gnu.org:foobar \\
--symlink foobar-1.0.tar.gz foobar-latest.tar.gz \\
foobar-1.0.tar.gz.sig foobar-latest.tar.gz.sig
or (equivalent):
gnupload --to ftp.gnu.org:foobar \\
--symlink foobar-1.0.tar.gz foobar-latest.tar.gz \\
--symlink foobar-1.0.tar.gz.sig foobar-latest.tar.gz.sig
5. Upload foobar-0.9.90.tar.gz to two sites:
gnupload --to alpha.gnu.org:foobar \\
--to sources.redhat.com:~ftp/pub/foobar \\
foobar-0.9.90.tar.gz
5. Delete oopsbar-0.9.91.tar.gz and upload foobar-0.9.91.tar.gz
6. Delete oopsbar-0.9.91.tar.gz and upload foobar-0.9.91.tar.gz
(the -- terminates the list of files to delete):
gnupload --to alpha.gnu.org:foobar \\
--to sources.redhat.com:~ftp/pub/foobar \\
@@ -108,10 +144,16 @@ Examples:
gnupload executes a program ncftpput to do the transfers; if you don't
happen to have an ncftp package installed, the ncftpput-ftp script in
the build-aux/ directory of the gnulib package
(http://savannah.gnu.org/projects/gnulib) may serve as a replacement.
(https://savannah.gnu.org/projects/gnulib) may serve as a replacement.
Send patches and bug reports to <bug-gnulib@gnu.org>."
copyright_year=`echo "$scriptversion" | sed -e 's/[^0-9].*//'`
copyright="Copyright (C) ${copyright_year} Free Software Foundation, Inc.
License GPLv2+: GNU GPL version 2 or later <https://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law."
# Read local configuration file
if test -r "$conffile"; then
echo "$0: Reading configuration file $conffile"
@@ -125,7 +167,7 @@ while test -n "$1"; do
-*)
collect_var=
case $1 in
--help)
-h | --help)
echo "$usage"
exit $?
;;
@@ -171,12 +213,13 @@ while test -n "$1"; do
--symlink)
collect_var=symlink_files
;;
--dry-run|-n)
-n | --dry-run)
dry_run=:
;;
--version)
echo "gnupload $scriptversion"
exit $?
echo "$copyright"
exit 0
;;
--)
shift
@@ -358,7 +401,7 @@ upload ()
for f in $files $base.directive.asc
do
echo put $f
done | $dbg sftp -b - puszcza.gnu.org.ua:/incoming/$destdir_topdir
done | $dbg sftp -b - download.gnu.org.ua:/incoming/$destdir_topdir
;;
/*)
dest_host=`echo "$dest" | sed 's,:.*,,'`
@@ -432,7 +475,7 @@ done
exit 0
# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
# eval: (add-hook 'before-save-hook 'time-stamp nil t)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC0"
@@ -1,7 +1,7 @@
#!/bin/sh
# install - install a program, script, or datafile
scriptversion=2016-01-11.22; # UTC
scriptversion=2024-12-03.03; # UTC
# This originates from X11R5 (mit/util/scripts/install.sh), which was
# later released in X11R6 (xc/config/util/install.sh) with the
@@ -69,6 +69,11 @@ posix_mkdir=
# Desired mode of installed file.
mode=0755
# Create dirs (including intermediate dirs) using mode 755.
# This is like GNU 'install' as of coreutils 8.32 (2020).
mkdir_umask=22
backupsuffix=
chgrpcmd=
chmodcmd=$chmodprog
chowncmd=
@@ -99,19 +104,29 @@ Options:
--version display version info and exit.
-c (ignored)
-C install only if different (preserve the last data modification time)
-C install only if different (preserve data modification time)
-d create directories instead of installing files.
-g GROUP $chgrpprog installed files to GROUP.
-m MODE $chmodprog installed files to MODE.
-o USER $chownprog installed files to USER.
-p pass -p to $cpprog.
-s $stripprog installed files.
-S SUFFIX attempt to back up existing files, with suffix SUFFIX.
-t DIRECTORY install into DIRECTORY.
-T report an error if DSTFILE is a directory.
Environment variables override the default commands:
CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
RMPROG STRIPPROG
"
By default, rm is invoked with -f; when overridden with RMPROG,
it's up to you to specify -f if you want it.
If -S is not specified, no backups are attempted.
Report bugs to <bug-automake@gnu.org>.
GNU Automake home page: <https://www.gnu.org/software/automake/>.
General help using GNU software: <https://www.gnu.org/gethelp/>."
while test $# -ne 0; do
case $1 in
@@ -137,8 +152,13 @@ while test $# -ne 0; do
-o) chowncmd="$chownprog $2"
shift;;
-p) cpprog="$cpprog -p";;
-s) stripcmd=$stripprog;;
-S) backupsuffix="$2"
shift;;
-t)
is_target_a_directory=always
dst_arg=$2
@@ -150,7 +170,7 @@ while test $# -ne 0; do
-T) is_target_a_directory=never;;
--version) echo "$0 $scriptversion"; exit $?;;
--version) echo "$0 (GNU Automake) $scriptversion"; exit $?;;
--) shift
break;;
@@ -255,6 +275,10 @@ do
dstdir=$dst
test -d "$dstdir"
dstdir_status=$?
# Don't chown directories that already exist.
if test $dstdir_status = 0; then
chowncmd=""
fi
else
# Waiting for this to be detected by the "$cpprog $src $dsttmp" command
@@ -271,15 +295,18 @@ do
fi
dst=$dst_arg
# If destination is a directory, append the input filename; won't work
# if double slashes aren't ignored.
# If destination is a directory, append the input filename.
if test -d "$dst"; then
if test "$is_target_a_directory" = never; then
echo "$0: $dst_arg: Is a directory" >&2
exit 1
fi
dstdir=$dst
dst=$dstdir/`basename "$src"`
dstbase=`basename "$src"`
case $dst in
*/) dst=$dst$dstbase;;
*) dst=$dst/$dstbase;;
esac
dstdir_status=0
else
dstdir=`dirname "$dst"`
@@ -288,27 +315,16 @@ do
fi
fi
case $dstdir in
*/) dstdirslash=$dstdir;;
*) dstdirslash=$dstdir/;;
esac
obsolete_mkdir_used=false
if test $dstdir_status != 0; then
case $posix_mkdir in
'')
# Create intermediate dirs using mode 755 as modified by the umask.
# This is like FreeBSD 'install' as of 1997-10-28.
umask=`umask`
case $stripcmd.$umask in
# Optimize common cases.
*[2367][2367]) mkdir_umask=$umask;;
.*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
*[0-7])
mkdir_umask=`expr $umask + 22 \
- $umask % 100 % 40 + $umask % 20 \
- $umask % 10 % 4 + $umask % 2
`;;
*) mkdir_umask=$umask,go-w;;
esac
# With -d, create the new directory with the user-specified mode.
# Otherwise, rely on $mkdir_umask.
if test -n "$dir_arg"; then
@@ -318,43 +334,49 @@ do
fi
posix_mkdir=false
case $umask in
*[123567][0-7][0-7])
# POSIX mkdir -p sets u+wx bits regardless of umask, which
# is incompatible with FreeBSD 'install' when (umask & 300) != 0.
;;
*)
tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
# The $RANDOM variable is not portable (e.g., dash). Use it
# here however when possible just to lower collision chance.
tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
if (umask $mkdir_umask &&
exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
then
if test -z "$dir_arg" || {
# Check for POSIX incompatibilities with -m.
# HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
# other-writable bit of parent directory when it shouldn't.
# FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
ls_ld_tmpdir=`ls -ld "$tmpdir"`
case $ls_ld_tmpdir in
d????-?r-*) different_mode=700;;
d????-?--*) different_mode=755;;
*) false;;
esac &&
$mkdirprog -m$different_mode -p -- "$tmpdir" && {
ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
}
}
then posix_mkdir=:
fi
rmdir "$tmpdir/d" "$tmpdir"
else
# Remove any dirs left behind by ancient mkdir implementations.
rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
fi
trap '' 0;;
esac;;
trap '
ret=$?
rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null
exit $ret
' 0
# Because "mkdir -p" follows existing symlinks and we likely work
# directly in world-writable /tmp, make sure that the '$tmpdir'
# directory is successfully created first before we actually test
# 'mkdir -p'.
if (umask $mkdir_umask &&
$mkdirprog $mkdir_mode "$tmpdir" &&
exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1
then
if test -z "$dir_arg" || {
# Check for POSIX incompatibility with -m.
# HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
# other-writable bit of parent directory when it shouldn't.
# FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
test_tmpdir="$tmpdir/a"
ls_ld_tmpdir=`ls -ld "$test_tmpdir"`
case $ls_ld_tmpdir in
d????-?r-*) different_mode=700;;
d????-?--*) different_mode=755;;
*) false;;
esac &&
$mkdirprog -m$different_mode -p -- "$test_tmpdir" && {
ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"`
test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
}
}
then posix_mkdir=:
fi
rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir"
else
# Remove any dirs left behind by ancient mkdir implementations.
rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null
fi
trap '' 0;;
esac
if
@@ -365,7 +387,7 @@ do
then :
else
# The umask is ridiculous, or mkdir does not conform to POSIX,
# mkdir does not conform to POSIX,
# or it failed possibly due to a race condition. Create the
# directory the slow way, step by step, checking for races as we go.
@@ -394,7 +416,7 @@ do
prefixes=
else
if $posix_mkdir; then
(umask=$mkdir_umask &&
(umask $mkdir_umask &&
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
# Don't fail if two instances are running concurrently.
test -d "$prefix" || exit 1
@@ -427,14 +449,25 @@ do
else
# Make a couple of temp file names in the proper directory.
dsttmp=$dstdir/_inst.$$_
rmtmp=$dstdir/_rm.$$_
dsttmp=${dstdirslash}_inst.$$_
rmtmp=${dstdirslash}_rm.$$_
# Trap to clean up those temp files at exit.
trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
# Copy the file name to the temp name.
(umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
(umask $cp_umask &&
{ test -z "$stripcmd" || {
# Create $dsttmp read-write so that cp doesn't create it read-only,
# which would cause strip to fail.
if test -z "$doit"; then
: >"$dsttmp" # No need to fork-exec 'touch'.
else
$doit touch "$dsttmp"
fi
}
} &&
$doit_exec $cpprog "$src" "$dsttmp") &&
# and set any options; do chmod last to preserve setuid bits.
#
@@ -460,6 +493,13 @@ do
then
rm -f "$dsttmp"
else
# If $backupsuffix is set, and the file being installed
# already exists, attempt a backup. Don't worry if it fails,
# e.g., if mv doesn't support -f.
if test -n "$backupsuffix" && test -f "$dst"; then
$doit $mvcmd -f "$dst" "$dst$backupsuffix" 2>/dev/null
fi
# Rename the file to the real destination.
$doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
@@ -474,9 +514,9 @@ do
# file should still install successfully.
{
test ! -f "$dst" ||
$doit $rmcmd -f "$dst" 2>/dev/null ||
$doit $rmcmd "$dst" 2>/dev/null ||
{ $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
{ $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
{ $doit $rmcmd "$rmtmp" 2>/dev/null; :; }
} ||
{ echo "$0: cannot unlink or rename $dst" >&2
(exit 1); exit 1
@@ -493,7 +533,7 @@ do
done
# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
# eval: (add-hook 'before-save-hook 'time-stamp nil t)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC0"
@@ -1,9 +1,9 @@
#!/bin/sh
# Get modification time of a file or directory and pretty-print it.
scriptversion=2016-01-11.22; # UTC
scriptversion=2024-12-03.03; # UTC
# Copyright (C) 1995-2017 Free Software Foundation, Inc.
# Copyright (C) 1995-2025 Free Software Foundation, Inc.
# written by Ulrich Drepper <drepper@gnu.ai.mit.edu>, June 1995
#
# This program is free software; you can redistribute it and/or modify
@@ -17,7 +17,7 @@ scriptversion=2016-01-11.22; # UTC
# 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 <http://www.gnu.org/licenses/>.
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
@@ -50,11 +50,13 @@ Pretty-print the modification day of FILE, in the format:
1 January 1970
Report bugs to <bug-automake@gnu.org>.
GNU Automake home page: <https://www.gnu.org/software/automake/>.
General help using GNU software: <https://www.gnu.org/gethelp/>.
EOF
exit $?
;;
-v | --v*)
echo "mdate-sh $scriptversion"
echo "mdate-sh (GNU Automake) $scriptversion"
exit $?
;;
esac
@@ -74,6 +76,10 @@ export LC_ALL
LC_TIME=C
export LC_TIME
# Use UTC to get reproducible result.
TZ=UTC0
export TZ
# GNU ls changes its time format in response to the TIME_STYLE
# variable. Since we cannot assume 'unset' works, revert this
# variable to its documented default.
@@ -216,7 +222,7 @@ echo $day $month $year
# Local Variables:
# mode: shell-script
# sh-indentation: 2
# eval: (add-hook 'write-file-hooks 'time-stamp)
# eval: (add-hook 'before-save-hook 'time-stamp nil t)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC0"
@@ -1,9 +1,11 @@
#! /bin/sh
# Common wrapper for a few potentially missing GNU programs.
# Common wrapper for a few potentially missing GNU and other programs.
scriptversion=2016-01-11.22; # UTC
scriptversion=2024-12-03.03; # UTC
# Copyright (C) 1996-2015 Free Software Foundation, Inc.
# shellcheck disable=SC2006,SC2268 # we must support pre-POSIX shells
# Copyright (C) 1996-2025 Free Software Foundation, Inc.
# Originally written by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
# This program is free software; you can redistribute it and/or modify
@@ -17,7 +19,7 @@ scriptversion=2016-01-11.22; # UTC
# 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 <http://www.gnu.org/licenses/>.
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
@@ -54,18 +56,20 @@ Options:
-v, --version output version information and exit
Supported PROGRAM values:
aclocal autoconf autoheader autom4te automake makeinfo
bison yacc flex lex help2man
aclocal autoconf autogen autoheader autom4te automake autoreconf
bison flex help2man lex makeinfo perl yacc
Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and
'g' are ignored when checking the name.
Send bug reports to <bug-automake@gnu.org>."
Report bugs to <bug-automake@gnu.org>.
GNU Automake home page: <https://www.gnu.org/software/automake/>.
General help using GNU software: <https://www.gnu.org/gethelp/>."
exit $?
;;
-v|--v|--ve|--ver|--vers|--versi|--versio|--version)
echo "missing $scriptversion (GNU Automake)"
echo "missing (GNU Automake) $scriptversion"
exit $?
;;
@@ -101,14 +105,14 @@ else
exit $st
fi
perl_URL=http://www.perl.org/
flex_URL=http://flex.sourceforge.net/
gnu_software_URL=http://www.gnu.org/software
perl_URL=https://www.perl.org/
flex_URL=https://github.com/westes/flex
gnu_software_URL=https://www.gnu.org/software
program_details ()
{
case $1 in
aclocal|automake)
aclocal|automake|autoreconf)
echo "The '$1' program is part of the GNU Automake package:"
echo "<$gnu_software_URL/automake>"
echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:"
@@ -123,6 +127,9 @@ program_details ()
echo "<$gnu_software_URL/m4/>"
echo "<$perl_URL>"
;;
*)
:
;;
esac
}
@@ -137,48 +144,55 @@ give_advice ()
printf '%s\n' "'$1' is $msg."
configure_deps="'configure.ac' or m4 files included by 'configure.ac'"
autoheader_deps="'acconfig.h'"
automake_deps="'Makefile.am'"
aclocal_deps="'acinclude.m4'"
case $normalized_program in
aclocal*)
echo "You should only need it if you modified $aclocal_deps or"
echo "$configure_deps."
;;
autoconf*)
echo "You should only need it if you modified 'configure.ac',"
echo "or m4 files included by it."
program_details 'autoconf'
echo "You should only need it if you modified $configure_deps."
;;
autogen*)
echo "You should only need it if you modified a '.def' or '.tpl' file."
echo "You may want to install the GNU AutoGen package:"
echo "<$gnu_software_URL/autogen/>"
;;
autoheader*)
echo "You should only need it if you modified 'acconfig.h' or"
echo "You should only need it if you modified $autoheader_deps or"
echo "$configure_deps."
program_details 'autoheader'
;;
automake*)
echo "You should only need it if you modified 'Makefile.am' or"
echo "You should only need it if you modified $automake_deps or"
echo "$configure_deps."
program_details 'automake'
;;
aclocal*)
echo "You should only need it if you modified 'acinclude.m4' or"
echo "$configure_deps."
program_details 'aclocal'
;;
autom4te*)
autom4te*)
echo "You might have modified some maintainer files that require"
echo "the 'autom4te' program to be rebuilt."
program_details 'autom4te'
;;
autoreconf*)
echo "You should only need it if you modified $aclocal_deps or"
echo "$automake_deps or $autoheader_deps or $automake_deps or"
echo "$configure_deps."
;;
bison*|yacc*)
echo "You should only need it if you modified a '.y' file."
echo "You may want to install the GNU Bison package:"
echo "<$gnu_software_URL/bison/>"
;;
lex*|flex*)
echo "You should only need it if you modified a '.l' file."
echo "You may want to install the Fast Lexical Analyzer package:"
echo "<$flex_URL>"
;;
help2man*)
echo "You should only need it if you modified a dependency" \
"of a man page."
echo "You may want to install the GNU Help2man package:"
echo "<$gnu_software_URL/help2man/>"
;;
lex*|flex*)
echo "You should only need it if you modified a '.l' file."
echo "You may want to install the Fast Lexical Analyzer package:"
echo "<$flex_URL>"
;;
makeinfo*)
echo "You should only need it if you modified a '.texi' file, or"
echo "any other file indirectly affecting the aspect of the manual."
@@ -189,6 +203,12 @@ give_advice ()
echo "want to install GNU make:"
echo "<$gnu_software_URL/make/>"
;;
perl*)
echo "You should only need it to run GNU Autoconf, GNU Automake, "
echo " assorted other tools, or if you modified a Perl source file."
echo "You may want to install the Perl 5 language interpreter:"
echo "<$perl_URL>"
;;
*)
echo "You might have modified some files without having the proper"
echo "tools for further handling them. Check the 'README' file, it"
@@ -197,6 +217,7 @@ give_advice ()
echo "case some other package contains this missing '$1' program."
;;
esac
program_details "$normalized_program"
}
give_advice "$1" | sed -e '1s/^/WARNING: /' \
@@ -207,7 +228,7 @@ give_advice "$1" | sed -e '1s/^/WARNING: /' \
exit $st
# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
# eval: (add-hook 'before-save-hook 'time-stamp nil t)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC0"
@@ -1,9 +1,9 @@
#! /bin/sh
# test-driver - basic testsuite driver script.
scriptversion=2016-01-11.22; # UTC
scriptversion=2024-12-03.03; # UTC
# Copyright (C) 2011-2015 Free Software Foundation, Inc.
# Copyright (C) 2011-2025 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
@@ -16,7 +16,7 @@ scriptversion=2016-01-11.22; # UTC
# 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 <http://www.gnu.org/licenses/>.
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
@@ -42,11 +42,18 @@ print_usage ()
{
cat <<END
Usage:
test-driver --test-name=NAME --log-file=PATH --trs-file=PATH
[--expect-failure={yes|no}] [--color-tests={yes|no}]
[--enable-hard-errors={yes|no}] [--]
test-driver --test-name NAME --log-file PATH --trs-file PATH
[--expect-failure {yes|no}] [--color-tests {yes|no}]
[--collect-skipped-logs {yes|no}]
[--enable-hard-errors {yes|no}] [--]
TEST-SCRIPT [TEST-SCRIPT-ARGUMENTS]
The '--test-name', '--log-file' and '--trs-file' options are mandatory.
See the GNU Automake documentation for information.
Report bugs to <bug-automake@gnu.org>.
GNU Automake home page: <https://www.gnu.org/software/automake/>.
General help using GNU software: <https://www.gnu.org/gethelp/>.
END
}
@@ -55,15 +62,17 @@ log_file= # Where to save the output of the test script.
trs_file= # Where to save the metadata of the test run.
expect_failure=no
color_tests=no
collect_skipped_logs=yes
enable_hard_errors=yes
while test $# -gt 0; do
case $1 in
--help) print_usage; exit $?;;
--version) echo "test-driver $scriptversion"; exit $?;;
--version) echo "test-driver (GNU Automake) $scriptversion"; exit $?;;
--test-name) test_name=$2; shift;;
--log-file) log_file=$2; shift;;
--trs-file) trs_file=$2; shift;;
--color-tests) color_tests=$2; shift;;
--collect-skipped-logs) collect_skipped_logs=$2; shift;;
--expect-failure) expect_failure=$2; shift;;
--enable-hard-errors) enable_hard_errors=$2; shift;;
--) shift; break;;
@@ -103,8 +112,11 @@ trap "st=130; $do_exit" 2
trap "st=141; $do_exit" 13
trap "st=143; $do_exit" 15
# Test script is run here.
"$@" >$log_file 2>&1
# Test script is run here. We create the file first, then append to it,
# to ameliorate tests themselves also writing to the log file. Our tests
# don't, but others can (automake bug#35762).
: >"$log_file"
"$@" >>"$log_file" 2>&1
estatus=$?
if test $enable_hard_errors = no && test $estatus -eq 99; then
@@ -116,7 +128,7 @@ fi
case $tweaked_estatus:$expect_failure in
0:yes) col=$red res=XPASS recheck=yes gcopy=yes;;
0:*) col=$grn res=PASS recheck=no gcopy=no;;
77:*) col=$blu res=SKIP recheck=no gcopy=yes;;
77:*) col=$blu res=SKIP recheck=no gcopy=$collect_skipped_logs;;
99:*) col=$mgn res=ERROR recheck=yes gcopy=yes;;
*:yes) col=$lgn res=XFAIL recheck=no gcopy=yes;;
*:*) col=$red res=FAIL recheck=yes gcopy=yes;;
@@ -126,7 +138,7 @@ esac
# know whether the test passed or failed simply by looking at the '.log'
# file, without the need of also peaking into the corresponding '.trs'
# file (automake bug#11814).
echo "$res $test_name (exit status: $estatus)" >>$log_file
echo "$res $test_name (exit status: $estatus)" >>"$log_file"
# Report outcome to console.
echo "${col}${res}${std}: $test_name"
@@ -140,7 +152,7 @@ echo ":copy-in-global-log: $gcopy" >> $trs_file
# Local Variables:
# mode: shell-script
# sh-indentation: 2
# eval: (add-hook 'write-file-hooks 'time-stamp)
# eval: (add-hook 'before-save-hook 'time-stamp nil t)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC0"
File diff suppressed because it is too large Load Diff
@@ -1,15 +1,13 @@
eval '(exit $?0)' && eval 'exec perl -wS -0777 -pi "$0" "$@"'
& eval 'exec perl -wS -0777 -pi "$0" $argv:q'
if 0;
#!/bin/sh
#! -*-perl-*-
# Update an FSF copyright year list to include the current year.
my $VERSION = '2016-01-12.23:13'; # UTC
# Copyright (C) 2009-2017 Free Software Foundation, Inc.
# Copyright (C) 2009-2025 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)
# 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,
@@ -18,10 +16,13 @@ my $VERSION = '2016-01-12.23:13'; # UTC
# 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 <http://www.gnu.org/licenses/>.
# along with this program. If not, see <https://www.gnu.org/licenses/>.
#
# Written by Jim Meyering and Joel E. Denny
# This script updates an FSF copyright year list to include the current year.
# Usage: update-copyright [FILE...]
#
# The arguments to this script should be names of files that contain
# copyright statements to be updated. The copyright holder's name
# defaults to "Free Software Foundation, Inc." but may be changed to
@@ -46,8 +47,8 @@ my $VERSION = '2016-01-12.23:13'; # UTC
# Each file's copyright statement must be formatted correctly in
# order to be recognized. For example, each of these is fine:
#
# Copyright @copyright{} 1990-2005, 2007-2009 Free Software
# Foundation, Inc.
# Copyright @copyright{} 1990-2005, 2007-2009, 2025 Free Software Foundation,
# Inc.
#
# # Copyright (C) 1990-2005, 2007-2009 Free Software
# # Foundation, Inc.
@@ -81,6 +82,7 @@ my $VERSION = '2016-01-12.23:13'; # UTC
# B. (c)
# C. @copyright{}
# D. &copy;
# E. ©
#
# 4. The "Copyright" appears at the beginning of a line, except that it
# may be prefixed by any sequence (e.g., a comment) of no more than
@@ -96,7 +98,8 @@ my $VERSION = '2016-01-12.23:13'; # UTC
# 6. Blank lines, even if preceded by the prefix, do not appear
# within the FSF copyright statement.
# 7. Each copyright year is 2 or 4 digits, and years are separated by
# commas or dashes. Whitespace may appear after commas.
# commas, "-", "--", or "\(en" (for troff). Whitespace may appear
# after commas.
#
# Environment variables:
#
@@ -120,11 +123,34 @@ my $VERSION = '2016-01-12.23:13'; # UTC
# 5. Set UPDATE_COPYRIGHT_HOLDER if the copyright holder is other
# than "Free Software Foundation, Inc.".
# This is a prologue that allows running a perl script as an executable
# on systems that are compliant to a POSIX version before POSIX:2017.
# On such systems, the usual invocation of an executable through execlp()
# or execvp() fails with ENOEXEC if it is a script that does not start
# with a #! line. The script interpreter mentioned in the #! line has
# to be /bin/sh, because on GuixSD systems that is the only program that
# has a fixed file name. The second line is essential for perl and is
# also useful for editing this file in Emacs. The next two lines below
# are valid code in both sh and perl. When executed by sh, they re-execute
# the script through the perl program found in $PATH. The '-x' option
# is essential as well; without it, perl would re-execute the script
# through /bin/sh. When executed by perl, the next two lines are a no-op.
eval 'exec perl -wSx -0777 -pi "$0" "$@"'
if 0;
my $VERSION = '2025-01-01.07:36'; # 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
# do its job. Otherwise, update this string manually.
use strict;
use warnings;
use re 'eval';
my $copyright_re = 'Copyright';
my $circle_c_re = '(?:\([cC]\)|@copyright\{}|\\\\\(co|&copy;)';
my $circle_c_re = '(?:\([cC]\)|@copyright\{}|\\\\\(co|&copy;)';
my $ndash_re = '(?:--?|\\\\\(en)';
my $holder = $ENV{UPDATE_COPYRIGHT_HOLDER};
$holder ||= 'Free Software Foundation, Inc.';
my $prefix_max = 5;
@@ -144,14 +170,13 @@ if (!$this_year || $this_year !~ m/^\d{4}$/)
# Unless the file consistently uses "\r\n" as the EOL, use "\n" instead.
my $eol = /(?:^|[^\r])\n/ ? "\n" : "\r\n";
my $leading;
my $prefix;
my $ws_re;
my $stmt_re;
while (/(^|\n)(.{0,$prefix_max})$copyright_re/g)
my $found;
while (/(^|\n)(.{0,$prefix_max})$copyright_re/cg)
{
$leading = "$1$2";
$prefix = $2;
my $pos=pos();
my $leading = "$1$2";
my $prefix = $2;
if ($prefix =~ /^(\s*\/)\*(\s*)$/)
{
$prefix =~ s,/, ,;
@@ -162,111 +187,119 @@ while (/(^|\n)(.{0,$prefix_max})$copyright_re/g)
$prefix = $prefix_ws;
}
}
$ws_re = '[ \t\r\f]'; # \s without \n
my $ws_re = '[ \t\r\f]'; # \s without \n
$ws_re =
"(?:$ws_re*(?:$ws_re|\\n" . quotemeta($prefix) . ")$ws_re*)";
my $holder_re = $holder;
$holder_re =~ s/\s/$ws_re/g;
my $stmt_remainder_re =
"(?:$ws_re$circle_c_re)?"
. "$ws_re(?:(?:\\d\\d)?\\d\\d(?:,$ws_re?|-))*"
. "$ws_re(?:(?:\\d\\d)?\\d\\d(?:,$ws_re?|$ndash_re))*"
. "((?:\\d\\d)?\\d\\d)$ws_re$holder_re";
if (/\G$stmt_remainder_re/)
{
$found = 1;
$stmt_re =
quotemeta($leading) . "($copyright_re$stmt_remainder_re)";
last;
}
}
if (defined $stmt_re)
{
/$stmt_re/ or die; # Should never die.
my $stmt = $1;
my $final_year_orig = $2;
# Handle two-digit year numbers like "98" and "99".
my $final_year = $final_year_orig;
$final_year <= 99
and $final_year += 1900;
/$stmt_re/ or die; # Should never die.
my $stmt = $1;
my $final_year_orig = $2;
if ($final_year != $this_year)
{
# Update the year.
$stmt =~ s/\b$final_year_orig\b/$final_year, $this_year/;
}
if ($final_year != $this_year || $ENV{'UPDATE_COPYRIGHT_FORCE'})
{
# Normalize all whitespace including newline-prefix sequences.
$stmt =~ s/$ws_re/ /g;
# Handle two-digit year numbers like "98" and "99".
my $final_year = $final_year_orig;
$final_year <= 99
and $final_year += 1900;
# Put spaces after commas.
$stmt =~ s/, ?/, /g;
# Convert 2-digit to 4-digit years.
$stmt =~ s/(\b\d\d\b)/19$1/g;
# Make the use of intervals consistent.
if (!$ENV{UPDATE_COPYRIGHT_USE_INTERVALS})
if ($final_year != $this_year)
{
$stmt =~ s/(\d{4})-(\d{4})/join(', ', $1..$2)/eg;
# Update the year.
$stmt =~ s/(^|[^\d])$final_year_orig\b/$1$final_year, $this_year/;
}
else
if ($final_year != $this_year || $ENV{'UPDATE_COPYRIGHT_FORCE'})
{
$stmt =~
s/
(\d{4})
(?:
(,\ |-)
((??{
if ($2 eq '-') { '\d{4}'; }
elsif (!$3) { $1 + 1; }
else { $3 + 1; }
}))
)+
/$1-$3/gx;
# Normalize all whitespace including newline-prefix sequences.
$stmt =~ s/$ws_re/ /g;
# When it's 2, emit a single range encompassing all year numbers.
$ENV{UPDATE_COPYRIGHT_USE_INTERVALS} == 2
and $stmt =~ s/\b(\d{4})\b.*\b(\d{4})\b/$1-$2/;
}
# Put spaces after commas.
$stmt =~ s/, ?/, /g;
# Format within margin.
my $stmt_wrapped;
my $text_margin = $margin - length($prefix);
if ($prefix =~ /^(\t+)/)
{
$text_margin -= length($1) * ($tab_width - 1);
}
while (length $stmt)
{
if (($stmt =~ s/^(.{1,$text_margin})(?: |$)//)
|| ($stmt =~ s/^([\S]+)(?: |$)//))
# Convert 2-digit to 4-digit years.
$stmt =~ s/(\b\d\d\b)/19$1/g;
# Make the use of intervals consistent.
if (!$ENV{UPDATE_COPYRIGHT_USE_INTERVALS})
{
my $line = $1;
$stmt_wrapped .= $stmt_wrapped ? "$eol$prefix" : $leading;
$stmt_wrapped .= $line;
$stmt =~ s/(\d{4})$ndash_re(\d{4})/join(', ', $1..$2)/eg;
}
else
{
# Should be unreachable, but we don't want an infinite
# loop if it can be reached.
die;
}
}
my $ndash = ($ARGV =~ /\.tex(i(nfo)?)?$/ ? "--"
: $ARGV =~ /\.(\d[a-z]*|man)(\.in)?$/ && $ARGV !~ /ChangeLog\./ ? "\\(en"
: "-");
# Replace the old copyright statement.
s/$stmt_re/$stmt_wrapped/;
$stmt =~
s/
(\d{4})
(?:
(,\ |$ndash_re)
((??{
if ($2 ne ', ') { '\d{4}'; }
elsif (!$3) { $1 + 1; }
else { $3 + 1; }
}))
)+
/$1$ndash$3/gx;
# When it's 2, emit a single range encompassing all year numbers.
$ENV{UPDATE_COPYRIGHT_USE_INTERVALS} == 2
and $stmt =~ s/(^|[^\d])(\d{4})\b.*(?:[^\d])(\d{4})\b/$1$2$ndash$3/;
}
# Format within margin.
my $stmt_wrapped;
my $text_margin = $margin - length($prefix);
if ($prefix =~ /^(\t+)/)
{
$text_margin -= length($1) * ($tab_width - 1);
}
while (length $stmt)
{
if (($stmt =~ s/^(.{1,$text_margin})(?: |$)//)
|| ($stmt =~ s/^([\S]+)(?: |$)//))
{
my $line = $1;
$stmt_wrapped .= $stmt_wrapped ? "$eol$prefix" : $leading;
$stmt_wrapped .= $line;
}
else
{
# Should be unreachable, but we don't want an infinite
# loop if it can be reached.
die;
}
}
# Replace the old copyright statement.
my $p = pos();
s/$stmt_re/$stmt_wrapped/g;
pos() = $p;
}
}
}
else
if (!$found)
{
print STDERR "$ARGV: warning: copyright statement not found\n";
}
# Hey Emacs!
# Local variables:
# coding: utf-8
# mode: perl
# indent-tabs-mode: nil
# eval: (add-hook 'write-file-hooks 'time-stamp)
# eval: (add-hook 'before-save-hook 'time-stamp nil t)
# time-stamp-line-limit: 200
# time-stamp-start: "my $VERSION = '"
# time-stamp-format: "%:y-%02m-%02d.%02H:%02M"
# time-stamp-time-zone: "UTC0"
@@ -1,31 +1,48 @@
eval '(exit $?0)' && eval 'exec perl -wST "$0" "$@"'
& eval 'exec perl -wST "$0" $argv:q'
if 0;
#!/bin/sh
#! -*-perl-*-
# Detect instances of "if (p) free (p);".
# Likewise "if (p != 0)", "if (0 != p)", or with NULL; and with braces.
my $VERSION = '2016-08-01 17:47'; # UTC
# Copyright (C) 2008-2025 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 <https://www.gnu.org/licenses/>.
#
# Written by Jim Meyering
# This is a prologue that allows to run a perl script as an executable
# on systems that are compliant to a POSIX version before POSIX:2017.
# On such systems, the usual invocation of an executable through execlp()
# or execvp() fails with ENOEXEC if it is a script that does not start
# with a #! line. The script interpreter mentioned in the #! line has
# to be /bin/sh, because on GuixSD systems that is the only program that
# has a fixed file name. The second line is essential for perl and is
# also useful for editing this file in Emacs. The next two lines below
# are valid code in both sh and perl. When executed by sh, they re-execute
# the script through the perl program found in $PATH. The '-x' option
# is essential as well; without it, perl would re-execute the script
# through /bin/sh. When executed by perl, the next two lines are a no-op.
eval 'exec perl -wSx "$0" "$@"'
if 0;
my $VERSION = '2024-07-17 02:10'; # 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
# do its job. Otherwise, update this string manually.
# Copyright (C) 2008-2017 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 <http://www.gnu.org/licenses/>.
# Written by Jim Meyering
(my $copyright_year = $VERSION) =~ s/^(\d*)-.*$/$1/;
use strict;
use warnings;
@@ -33,7 +50,7 @@ use Getopt::Long;
(my $ME = $0) =~ s|.*/||;
# use File::Coda; # http://meyering.net/code/Coda/
# use File::Coda; # https://meyering.net/code/Coda/
END {
defined fileno STDOUT or return;
close STDOUT and return;
@@ -81,6 +98,7 @@ and "kfree" calls in the linux kernel sources:
git ls-files -z |xargs -0 $ME --name=kfree
Send patches and bug reports to <bug-gnulib\@gnu.org>.
EOF
}
exit $exit_code;
@@ -89,7 +107,7 @@ EOF
sub is_NULL ($)
{
my ($expr) = @_;
return ($expr eq 'NULL' || $expr eq '0');
return ($expr eq 'NULL' || $expr eq 'nullptr' || $expr eq '0');
}
{
@@ -103,7 +121,19 @@ sub is_NULL ($)
GetOptions
(
help => sub { usage 0 },
version => sub { print "$ME version $VERSION\n"; exit },
version =>
sub
{
print "$ME version $VERSION\n";
print "Copyright (C) $copyright_year Free Software Foundation, Inc.\n";
print "License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.\n"
. "This is free software: you are free to change and redistribute it.\n"
. "There is NO WARRANTY, to the extent permitted by law.\n";
print "\n";
my $author = "Jim Meyering";
print "Written by $author.\n";
exit
},
list => \$list,
'name=s@' => \@name,
) or usage 1;
@@ -182,7 +212,7 @@ free=xfree
git grep -l -z "$free *(" \
| xargs -0 useless-if-before-free -l --name="$free" \
| xargs -0 perl -0x3b -pi -e \
's/\bif\s*\(\s*(\S+?)(?:\s*!=\s*(?:0|NULL))?\s*\)\s+('"$free"'\s*\((?:\s*\([^)]+\))?\s*\1\s*\)\s*;)/$2/s'
's/\bif\s*\(\s*(\S+?)(?:\s*!=\s*(?:0|NULL|nullptr))?\s*\)\s+('"$free"'\s*\((?:\s*\([^)]+\))?\s*\1\s*\)\s*;)/$2/s'
# Use the following to remove redundant uses of kfree inside braces.
# Note that -0777 puts perl in slurp-whole-file mode;
@@ -191,7 +221,7 @@ free=kfree
git grep -l -z "$free *(" \
| xargs -0 useless-if-before-free -l --name="$free" \
| xargs -0 perl -0777 -pi -e \
's/\bif\s*\(\s*(\S+?)(?:\s*!=\s*(?:0|NULL))?\s*\)\s*\{\s*('"$free"'\s*\((?:\s*\([^)]+\))?\s*\1\s*\);)\s*\}[^\n]*$/$2/gms'
's/\bif\s*\(\s*(\S+?)(?:\s*!=\s*(?:0|NULL|nullptr))?\s*\)\s*\{\s*('"$free"'\s*\((?:\s*\([^)]+\))?\s*\1\s*\);)\s*\}[^\n]*$/$2/gms'
Be careful that the result of the above transformation is valid.
If the matched string is followed by "else", then obviously, it won't be.
@@ -202,7 +232,8 @@ EOF
## Local Variables:
## mode: perl
## indent-tabs-mode: nil
## eval: (add-hook 'write-file-hooks 'time-stamp)
## eval: (add-hook 'before-save-hook 'time-stamp nil t)
## time-stamp-line-limit: 50
## time-stamp-start: "my $VERSION = '"
## time-stamp-format: "%:y-%02m-%02d %02H:%02M"
## time-stamp-time-zone: "UTC0"
@@ -2,9 +2,9 @@
# List version-controlled file names.
# Print a version string.
scriptversion=2016-01-11.22; # UTC
scriptversion=2024-07-04.10; # UTC
# Copyright (C) 2006-2017 Free Software Foundation, Inc.
# Copyright (C) 2006-2025 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
@@ -17,7 +17,7 @@ scriptversion=2016-01-11.22; # UTC
# 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 <http://www.gnu.org/licenses/>.
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# List the specified version-controlled files.
@@ -25,7 +25,7 @@ scriptversion=2016-01-11.22; # UTC
# list the version-controlled files in that directory.
# If there's an argument, it must be a single, "."-relative directory name.
# cvsu is part of the cvsutils package: http://www.red-bean.com/cvsutils/
# cvsu is part of the cvsutils package: https://www.red-bean.com/cvsutils/
postprocess=
case $1 in
@@ -49,7 +49,7 @@ EOF
cat <<EOF
vc-list-files $scriptversion
Copyright (C) $year Free Software Foundation, Inc,
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
EOF
@@ -65,7 +65,7 @@ test $# = 0 && set .
for dir
do
if test -d .git; then
if test -d .git || test -f .git; then
test "x$dir" = x. \
&& dir= sed_esc= \
|| { dir="$dir/"; sed_esc=`echo "$dir"|env sed 's,\([\\/]\),\\\\\1,g'`; }
@@ -105,7 +105,7 @@ do
done
# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
# eval: (add-hook 'before-save-hook 'time-stamp nil t)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC0"
+24 -7
View File
@@ -1,5 +1,5 @@
# Customize maint.mk -*- makefile -*-
# Copyright (C) 2003-2013, 2015-2017 Free Software Foundation, Inc.
# Copyright (C) 2003-2013, 2015-2025 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
@@ -16,7 +16,7 @@
# Use the direct link. This is guaranteed to work immediately, while
# it can take a while for the faster mirror links to become usable.
url_dir_list = http://ftp.gnu.org/gnu/$(PACKAGE)
url_dir_list = https://ftp.gnu.org/gnu/$(PACKAGE)
# Used in maint.mk's web-manual rule
manual_title = Comparing and Merging Files
@@ -24,20 +24,30 @@ manual_title = Comparing and Merging Files
# Tests not to run as part of "make distcheck".
local-checks-to-skip = \
sc_error_message_period \
sc_error_message_uppercase
sc_error_message_uppercase \
sc_indent
# Tools used to bootstrap this package, used for "announcement".
bootstrap-tools = autoconf,automake,gnulib
# Override the default Cc: used in generating an announcement.
announcement_Cc_ = $(translation_project_), $(PACKAGE)-devel@gnu.org
# Now that we have better tests, make this the default.
export VERBOSE = yes
old_NEWS_hash = 0216ec3bf3e3322f33afd4e949a9a29b
old_NEWS_hash = eefa9b0b34af4272f659040508d9acd0
# Tell maint.mk's syntax-check rules that diff gets config.h directly or
# via diff.h or system.h.
config_h_header = (<config\.h>|"(diff|system)\.h")
# Write base64-encoded (not hex) checksums into the announcement.
announce_gen_args = --cksum-checksums
# Add an exemption for sc_makefile_at_at_check.
_makefile_at_at_check_exceptions = ' && !/MAKEINFO/'
update-copyright-env = \
UPDATE_COPYRIGHT_USE_INTERVALS=1 \
UPDATE_COPYRIGHT_MAX_LINE_LENGTH=79
@@ -66,7 +76,14 @@ config-save:
ln -nsf $(_date_time) $(_cf_state_dir)/latest
cp lib/config.h config.status $(_cf_state_dir)/latest
exclude_file_name_regexp--sc_space_tab = ^gl/lib/.*\.c\.diff$$
exclude_file_name_regexp--sc_GPL_version = ^gl/lib/
exclude_file_name_regexp--sc_bindtextdomain = ^gl/tests/
exclude_file_name_regexp--sc_doubled_words = ^gl/lib/mcel\.h$$
exclude_file_name_regexp--sc_prohibit_doubled_word = ^(gl/lib/mcel\.h|tests/y2038-vs-32bit)$$
exclude_file_name_regexp--sc_prohibit_strcmp = ^gl/lib/
# Tell gnulib's tight_scope rule that we mark externs with XTERN
export _gl_TS_extern = extern|XTERN
# Tell gnulib's tight_scope rule that we mark extern inlines with
# DIFF_INLINE and SYSTEM_INLINE.
export _gl_TS_extern = extern|DIFF_INLINE|SYSTEM_INLINE
codespell_ignore_words_list = FO,ND,debbugs
+39030 -18534
View File
File diff suppressed because it is too large Load Diff
+118 -87
View File
@@ -1,6 +1,6 @@
# Configure template for GNU Diffutils.
# Copyright (C) 1994-1995, 1998, 2001-2002, 2004, 2006, 2009-2013, 2015-2017
# Copyright (C) 1994-1995, 1998, 2001-2002, 2004, 2006, 2009-2013, 2015-2025
# Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
@@ -16,141 +16,172 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
AC_PREREQ(2.61)
AC_PREREQ([2.64])
AC_INIT([GNU diffutils],
m4_esyscmd([build-aux/git-version-gen .tarball-version]),
[bug-diffutils@gnu.org])
[bug-diffutils@gnu.org],
[diffutils],
[https://www.gnu.org/software/diffutils/])
AC_CONFIG_SRCDIR([src/diff.c])
AC_CONFIG_AUX_DIR([build-aux])
AC_CONFIG_MACRO_DIR([m4])
AM_INIT_AUTOMAKE([1.11 dist-xz no-dist-gzip subdir-objects
color-tests parallel-tests])
AM_INIT_AUTOMAKE([1.11 dist-xz subdir-objects color-tests parallel-tests])
AM_SILENT_RULES([yes]) # make --enable-silent-rules the default.
AC_CONFIG_HEADER([lib/config.h:lib/config.hin])
AC_CONFIG_HEADERS([lib/config.h:lib/config.hin])
AC_PROG_AWK
AC_PROG_CC
AM_PROG_CC_C_O
AM_MISSING_PROG([HELP2MAN], [help2man])
AC_PROG_RANLIB
gl_EARLY
gl_USE_SYSTEM_EXTENSIONS
gl_INIT
# Ensure VLAs are not used.
# Note -Wvla is implicitly added by gl_MANYWARN_ALL_GCC
AC_DEFINE([GNULIB_NO_VLA], [1], [Define to 1 to disable use of VLAs])
# diffutils is single-threaded; optimize for this.
AC_DEFINE([GNULIB_EXCLUDE_SINGLE_THREAD], [1],
['exclude' code is called only from 1 thread.])
AC_DEFINE([GNULIB_MBRTOWC_SINGLE_THREAD], [1],
['mbrtowc', 'mbrtoc32', 'regex' code is called only from 1 thread.])
AC_DEFINE([GNULIB_REGEX_SINGLE_THREAD], [1],
['regex' code is called only from 1 thread.])
AC_DEFINE([GNULIB_WCHAR_SINGLE_LOCALE], [1],
[Locale-sensitive functions are called only after locale is set.])
AC_DEFINE([GNULIB_MBRTOC32_REGULAR], [1],
[Do not worry about rare encodings like CP864, EBCDIC, Johab, and Shift JIS
that glibc does not support.])
AC_C_INLINE
AC_CHECK_MEMBERS([struct stat.st_rdev])
AC_HEADER_DIRENT
AC_HEADER_SYS_WAIT
AC_TYPE_PID_T
AC_CHECK_FUNCS_ONCE([sigaction sigprocmask])
if test $ac_cv_func_sigprocmask = no; then
AC_CHECK_FUNCS([sigblock])
fi
AC_FUNC_FORK
dnl O_PATH exists since Linux 2.6.39, but is supported with fstat() only since
dnl Linux 3.6. Use a configure test rather than testing `uname -sr`.
AC_CACHE_CHECK([whether O_PATH supports fstat],
[du_cv_O_PATH_fstat],
[AC_RUN_IFELSE(
[AC_LANG_PROGRAM([[
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
]], [[
struct stat statbuf;
int fd = openat (AT_FDCWD, "conftest.c", O_RDONLY|O_PATH);
return !(fd >= 0 && fstat (fd, &statbuf) == 0);
]])
],
[du_cv_O_PATH_fstat=yes],
[du_cv_O_PATH_fstat=no],
[du_cv_O_PATH_fstat="guessing no"])
])
case "$du_cv_O_PATH_fstat" in
yes)
AC_DEFINE([O_PATH_SUPPORTS_FSTAT], [1],
[Define to 1 if <fcntl.h> defines O_PATH and file descriptors
created with this flag are supported by fstat().])
;;
esac
# gl_GCC_VERSION_IFELSE([major], [minor], [run-if-found], [run-if-not-found])
# ------------------------------------------------
# If $CPP is gcc-MAJOR.MINOR or newer, then run RUN-IF-FOUND.
# Otherwise, run RUN-IF-NOT-FOUND.
AC_DEFUN([gl_GCC_VERSION_IFELSE],
[AC_PREPROC_IFELSE(
[AC_LANG_PROGRAM(
[[
#if ($1) < __GNUC__ || (($1) == __GNUC__ && ($2) <= __GNUC_MINOR__)
/* ok */
#else
# error "your version of gcc is older than $1.$2"
#endif
]]),
], [$3], [$4])
]
)
AC_ARG_ENABLE([gcc-warnings],
[AS_HELP_STRING([--enable-gcc-warnings],
[turn on lots of GCC warnings (for developers)])],
[AS_HELP_STRING([[--enable-gcc-warnings[=TYPE]]],
[control generation of GCC warnings. The TYPE 'no' disables
warnings (default for non-developer builds); 'yes' generates
cheap warnings if available (default for developer builds);
'expensive' in addition generates expensive-to-compute warnings
if available.])],
[case $enableval in
yes|no) ;;
no|yes|expensive) ;;
*) AC_MSG_ERROR([bad value $enableval for gcc-warnings option]) ;;
esac
gl_gcc_warnings=$enableval],
[if test -d "$srcdir"/.git; then
gl_gcc_warnings=yes
else
gl_gcc_warnings=no
fi]
[
# GCC provides fine-grained control over diagnostics which
# is used in gnulib for example to suppress warnings from
# certain sections of code. So if this is available and
# we're running from a git repo, then auto enable the warnings.
gl_gcc_warnings=no
gl_GCC_VERSION_IFELSE([4], [6],
[test -d "$srcdir"/.git \
&& ! test -f "$srcdir"/.tarball-version \
&& gl_gcc_warnings=yes])]
)
if test "$gl_gcc_warnings" = yes; then
if test $gl_gcc_warnings != no; then
gl_WARN_ADD([-Werror], [WERROR_CFLAGS])
AC_SUBST([WERROR_CFLAGS])
nw=
ew=
AS_IF([test $gl_gcc_warnings != expensive],
[# -fanalyzer and related options slow GCC considerably.
ew="$ew -fanalyzer -Wno-analyzer-malloc-leak"])
# This, $nw, is the list of warnings we disable.
nw="$nw -Wdeclaration-after-statement" # too useful to forbid
nw="$nw -Waggregate-return" # anachronistic
nw="$nw -Wlong-long" # C90 is anachronistic (lib/gethrxtime.h)
nw="$nw -Wc++-compat" # We don't care about C++ compilers
nw="$nw -Wundef" # Warns on '#if GNULIB_FOO' etc in gnulib
nw="$nw -Wtraditional" # Warns on #elif which we use often
nw="$nw -Wcast-qual" # Too many warnings for now
nw="$nw -Wconversion" # Too many warnings for now
nw="$nw -Wsystem-headers" # Don't let system headers trigger warnings
nw="$nw -Wsign-conversion" # Too many warnings for now
nw="$nw -Wtraditional-conversion" # Too many warnings for now
nw="$nw -Wunreachable-code" # Too many warnings for now
nw="$nw -Wpadded" # Our structs are not padded
nw="$nw -Wredundant-decls" # openat.h declares e.g., mkdirat
nw="$nw -Wlogical-op" # any use of fwrite provokes this
nw="$nw -Wformat-nonliteral" # who.c and pinky.c strftime uses
nw="$nw -Wvla" # warnings in gettext.h
nw="$nw -Wnested-externs" # use of XARGMATCH/verify_function__
nw="$nw -Wswitch-enum" # Too many warnings for now
nw="$nw -Wswitch-default" # Too many warnings for now
nw="$nw -Wstack-protector" # not worth working around
# things I might fix soon:
nw="$nw -Wfloat-equal" # sort.c, seq.c
nw="$nw -Wmissing-format-attribute" # copy.c
nw="$nw -Wunsafe-loop-optimizations" # a few src/*.c
nw="$nw -Winline" # system.h's readdir_ignoring_dot_and_dotdot
nw="$nw -Wstrict-overflow" # expr.c, pr.c, tr.c, factor.c
nw="$nw -Wformat-extra-args" # sdiff.c
# ?? -Wstrict-overflow
nw=$ew
nw="$nw -Winline" # not a correctness warning
nw="$nw -Wstack-protector" # not a correctness warning
gl_MANYWARN_ALL_GCC([ws])
gl_MANYWARN_COMPLEMENT([ws], [$ws], [$nw])
for w in $ws; do
gl_WARN_ADD([$w])
done
gl_WARN_ADD([-Wno-missing-field-initializers]) # We need this one
gl_WARN_ADD([-Wno-sign-compare]) # Too many warnings for now
gl_WARN_ADD([-Wno-pointer-sign]) # Too many warnings for now
gl_WARN_ADD([-Wno-unused-parameter]) # Too many warnings for now
gl_WARN_ADD([-Wno-sign-compare]) # Too many false positives
gl_WARN_ADD([-Wno-format-nonliteral])
# In spite of excluding -Wlogical-op above, it is enabled, as of
# gcc 4.5.0 20090517, and it provokes warnings in cat.c, dd.c, truncate.c
gl_WARN_ADD([-Wno-logical-op])
gl_WARN_ADD([-fdiagnostics-show-option])
gl_WARN_ADD([-funit-at-a-time])
gl_WARN_ADD([-fno-common])
AC_SUBST([WARN_CFLAGS])
AC_DEFINE([lint], [1], [Define to 1 if the compiler is checking for lint.])
AC_DEFINE([_FORTIFY_SOURCE], [2],
[enable compile-time and run-time bounds-checking, and some warnings])
AH_VERBATIM([FORTIFY_SOURCE],
[/* Enable compile-time and run-time bounds-checking, and some warnings,
without upsetting glibc 2.15+. */
#if !defined _FORTIFY_SOURCE && defined __OPTIMIZE__ && __OPTIMIZE__ \
&& !defined __MINGW32__
# define _FORTIFY_SOURCE 2
#endif
])
AC_DEFINE([GNULIB_PORTCHECK], [1], [enable some gnulib portability checks])
# We use a slightly smaller set of warning options for lib/.
# Remove the following and save the result in GNULIB_WARN_CFLAGS.
nw=
nw="$nw -Wunused-macros"
nw="$nw -Wmissing-prototypes"
nw="$nw -Wold-style-definition"
nw="$nw -Wsuggest-attribute=pure"
gl_MANYWARN_COMPLEMENT([GNULIB_WARN_CFLAGS], [$WARN_CFLAGS], [$nw])
AC_SUBST([GNULIB_WARN_CFLAGS])
fi
AC_C_INLINE
AC_C_VARARRAYS
AC_DEFINE([DEFAULT_EDITOR_PROGRAM], ["ed"],
[Name of editor program, unless overridden.])
AC_PATH_PROG([PR_PROGRAM], [pr], [""])
AC_DEFINE_UNQUOTED([PR_PROGRAM], ["$PR_PROGRAM"], [Name of "pr" program.])
AC_CHECK_MEMBERS([struct stat.st_blksize])
AC_CHECK_MEMBERS([struct stat.st_rdev])
AC_HEADER_DIRENT
AC_HEADER_SYS_WAIT
AC_TYPE_PID_T
AC_CHECK_FUNCS_ONCE([sigaction sigprocmask strcasecoll stricoll])
if test $ac_cv_func_sigprocmask = no; then
AC_CHECK_FUNCS([sigblock])
fi
AC_FUNC_CLOSEDIR_VOID
AC_FUNC_FORK
# When .tarball-version exists, we're building from a tarball
# and must not make man/*.1 files depend on the generated src/version.c,
# because that would induce a requirement to run the help2man perl script.
File diff suppressed because it is too large Load Diff
@@ -1,6 +1,6 @@
# Makefile for GNU diffutils documentation.
# Copyright (C) 2001-2002, 2009-2013, 2015-2017 Free Software Foundation, Inc.
# Copyright (C) 2001-2002, 2009-2013, 2015-2025 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
@@ -15,6 +15,11 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# The customization variable CHECK_NORMAL_MENU_STRUCTURE is necessary with
# makeinfo versions ≥ 6.8.
MAKEINFO = @MAKEINFO@ -c CHECK_NORMAL_MENU_STRUCTURE=1
AM_MAKEINFOFLAGS = --no-split
info_TEXINFOS = diffutils.texi
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -3,6 +3,9 @@
@setfilename diffutils.info
@include version.texi
@settitle Comparing and Merging Files
@documentencoding UTF-8
@set txicodequoteundirected
@set txicodequotebacktick
@syncodeindex vr cp
@setchapternewpage odd
@comment %**end of header
@@ -14,8 +17,8 @@ and documents the GNU @command{diff}, @command{diff3},
differences between files and the GNU @command{patch} command for
using their output to update files.
Copyright @copyright{} 1992-1994, 1998, 2001-2002, 2004, 2006, 2009-2017 Free
Software Foundation, Inc.
Copyright @copyright{} 1992--1994, 1998, 2001--2002, 2004, 2006, 2009--2025
Free Software Foundation, Inc.
@quotation
Permission is granted to copy, distribute and/or modify this document
@@ -235,6 +238,7 @@ need not read them to do its job.
* Case Folding:: Suppressing differences in alphabetic case.
* Brief:: Summarizing which files are different.
* Binary:: Comparing binary files or forcing text comparisons.
* Mutating Files:: Comparing files that are changing while being read.
@end menu
@node Hunks
@@ -388,12 +392,42 @@ line against each regular expression.
@section Suppressing Case Differences
@cindex case difference suppression
GNU @command{diff} can treat lower case letters as
equivalent to their upper case counterparts, so that, for example, it
GNU @command{diff} can treat capital letters as
equivalent to their small counterparts, so that, for example, it
considers @samp{Funky Stuff}, @samp{funky STUFF}, and @samp{fUNKy
stuFf} to all be the same. To request this, use the @option{-i} or
@option{--ignore-case} option.
When ignoring case @command{diff} downcases each character before comparing it.
For example, @samp{diff -i} downcases Greek capital ``Δ'' to small
``δ'' before comparison. Although this works for many cases, it may
have problems in some. For example:
@itemize @bullet
@item
The German word ``Straße'' is not treated like ``STRASSE'' as
many Germans might expect, because the two words downcase to
``straße'' and ``strasse'' respectively.
@item
The Greek name ``Κως'' is not treated like ``ΚΩΣ''
even though they both end in sigma,
because the latter's trailing ``Σ'' (U+03A3 GREEK CAPITAL LETTER SIGMA)
downcases to ``σ'' (U+03C3 GREEK SMALL LETTER SIGMA) instead
of to ``ς'' (U+03C2 GREEK SMALL LETTER FINAL SIGMA).
@c pdftex cannot handle combining characters, alas.
@ifnottex
@item
The ancient Greek phrase ``Πάντα ῥεῖ'' is not treated like ``ΠΆΝΤΑ ῬΕΙ͂'',
as the former's trailing ``ῖ'' is the single character U+1FD6 (GREEK
SMALL LETTER IOTA WITH PERISPOMENI) whereas the latter's trailing
``Ι͂'' has two characters, U+0399 (GREEK CAPITAL LETTER IOTA) and
U+0342 (COMBINING GREEK PERISPOMENI).
@end ifnottex
@end itemize
@node Brief
@section Summarizing Which Files Differ
@cindex summarizing which files differ
@@ -497,6 +531,28 @@ text files, you can force @command{diff3} to consider all files to be text
files and compare them line by line by using the @option{-a} or
@option{--text} option.
@node Mutating Files
@section Comparing Files While They Are Changing
@cindex mutating files
Commands like @command{diff} read files and directories by using a
series of system calls, as operating systems typically do not give a
program a way to snapshot all its input before processing it.
If input files change while being read, @command{diff} and related
commands can generate output that does not correspond to any state of
the input file system.
For example, if some other process truncates a file to zero size when
@command{diff} has read just half the file, @command{diff} will use
the half that it read as its input data. As another example, if a
recursive @command{diff} determines that a file is a directory, and
then some other process replaces the directory with a regular file,
and then @command{diff} attempts to descend into the directory,
@command{diff} will issue a diagnostic and fail.
In these situations the output of @command{diff} and related programs
should be interpreted with some care.
@node Output Formats
@chapter @command{diff} Output Formats
@cindex output formats
@@ -766,8 +822,8 @@ or @option{-u} option.
The argument @var{lines} is the number of lines of context to show.
When it is not given, it defaults to three.
At present, only GNU @command{diff} can produce this format and
only GNU @command{patch} can automatically apply diffs in this
In the early 1990s, only GNU @command{diff} could produce this format and
only GNU @command{patch} could automatically apply diffs in this
format. For proper operation, @command{patch} typically needs at
least three lines of context.
@@ -1737,7 +1793,7 @@ output formats (@pxref{Output Formats}) @command{diff} cannot
represent an incomplete line, so it pretends there was a newline and
reports an error.
For example, suppose @file{F} and @file{G} are one-byte files that
For example, suppose @file{F} and @file{G} are one-character files that
contain just @samp{f} and @samp{g}, respectively. Then @samp{diff F G}
outputs
@@ -1796,8 +1852,7 @@ second position.) To do this, use the @option{--new-file}
(@option{-N}) option. This option affects command-line arguments as
well as files found via directory traversal; for example, @samp{diff
-N a b} treats @file{a} as empty if @file{a} does not exist but
@file{b} does, and similarly @samp{diff -N - b} treats standard input
as empty if it is closed but @file{b} exists.
@file{b} does.
If the older directory contains large files that are not in
the newer directory, you can make the patch smaller by using the
@@ -1872,6 +1927,10 @@ These adjustments can be applied to any output format.
@cindex tab stop alignment
@cindex aligning tab stops
The tab character moves the cursor to the next tab stop.
Tab stops are normally every 8 display columns;
this can be altered by the @option{--tabsize=@var{columns}} option.
The lines of text in some of the @command{diff} output formats are
preceded by one or two characters that indicate whether the text is
inserted, deleted, or changed. The addition of those characters can
@@ -1884,9 +1943,7 @@ number of spaces before outputting them; select this method with the
@option{--expand-tabs} (@option{-t}) option. To use this form of output with
@command{patch}, you must give @command{patch} the @option{-l} or
@option{--ignore-white-space} option (@pxref{Changed White Space}, for more
information). @command{diff} normally assumes that tab stops are set
every 8 print columns, but this can be altered by the
@option{--tabsize=@var{columns}} option.
information).
The other method for making tabs line up correctly is to add a tab
character instead of a space after the indicator character at the
@@ -1899,6 +1956,15 @@ output format, which does not have a space character after the change
type indicator character. Select this method with the @option{-T} or
@option{--initial-tab} option.
GNU @command{diff} currently assumes that the output device respects tab stops,
displays each character with column width as given by the operating system,
and displays each encoding error byte in a single column.
Unfortunately these assumptions are often incorrect
for encoding errors and non-ASCII characters,
so complex input data may not line up properly on output,
and analysis based on the @option{--ignore-tab-expansion} (@option{-E}) option
may differ from the display device's behavior.
@node Trailing Blanks
@section Omitting trailing blanks
@cindex trailing blanks
@@ -3544,9 +3610,12 @@ line word: @option{-bl} is equivalent to @option{-b -l}.
@table @option
@item -b
@itemx --print-bytes
Print the differing bytes. Display control bytes as a
@samp{^} followed by a letter of the alphabet and precede bytes
that have the high bit set with @samp{M-} (which stands for ``meta'').
Print the differing bytes. Display each control byte as a @samp{^}
followed by an ASCII letter, @samp{@@}, @samp{[}, @samp{\}, @samp{]},
@samp{^} or @samp{_}. Precede each byte with the high bit set with
@samp{M-}, which stands for ``meta''. A control byte is any byte
with the high bit clear that does not represent a printable ASCII
character including space.
@item --help
Output a summary of usage and then exit.
@@ -3588,20 +3657,16 @@ In the above table, operands that are byte counts are normally
decimal, but may be preceded by @samp{0} for octal and @samp{0x} for
hexadecimal.
A byte count can be followed by a suffix to specify a multiple of that
count; in this case an omitted integer is understood to be 1. A bare
size letter, or one followed by @samp{iB}, specifies a multiple using
powers of 1024. A size letter followed by @samp{B} specifies powers
of 1000 instead. For example, @option{-n 4M} and @option{-n 4MiB} are
equivalent to @option{-n 4194304}, whereas @option{-n 4MB} is
equivalent to @option{-n 4000000}. This notation is upward compatible
with the @uref{http://www.bipm.fr/enus/3_SI/si-prefixes.html, SI
prefixes} for decimal multiples and with the
@uref{http://physics.nist.gov/cuu/Units/binary.html, IEC 60027-2
prefixes for binary multiples}.
A byte count can be followed by a suffix to specify a
multiple of the count. A bare letter,
or one followed by @samp{iB}, specifies
a multiple using powers of 1024. A letter followed by @samp{B}
specifies powers of 1000 instead. For example, @samp{-n 1M} and
@samp{-n 1MiB} are equivalent to @samp{-n 1048576}, whereas @samp{-n 1MB} is
equivalent to @samp{-n 1000000}.
The following suffixes are defined. Large sizes like @code{1Y} may be
rejected by your computer due to limitations of its arithmetic.
The following suffixes are defined. Large sizes like @code{1Q}
may be rejected by your computer due to limitations of its arithmetic.
@table @samp
@item kB
@@ -3611,8 +3676,8 @@ kilobyte: @math{10^3 = 1000}.
@itemx K
@itemx KiB
@cindex kibibyte, definition of
kibibyte: @math{2^10 = 1024}. @samp{K} is special: the SI prefix is
@samp{k} and the IEC 60027-2 prefix is @samp{Ki}, but tradition and
kibibyte: @math{2^{10} = 1024}. @samp{K} is special: the SI prefix is
@samp{k} and the ISO/IEC 80000-13 prefix is @samp{Ki}, but tradition and
POSIX use @samp{k} to mean @samp{KiB}.
@item MB
@cindex megabyte, definition of
@@ -3620,49 +3685,59 @@ megabyte: @math{10^6 = 1,000,000}.
@item M
@itemx MiB
@cindex mebibyte, definition of
mebibyte: @math{2^20 = 1,048,576}.
mebibyte: @math{2^{20} = 1,048,576}.
@item GB
@cindex gigabyte, definition of
gigabyte: @math{10^9 = 1,000,000,000}.
@item G
@itemx GiB
@cindex gibibyte, definition of
gibibyte: @math{2^30 = 1,073,741,824}.
gibibyte: @math{2^{30} = 1,073,741,824}.
@item TB
@cindex terabyte, definition of
terabyte: @math{10^12 = 1,000,000,000,000}.
terabyte: @math{10^{12} = 1,000,000,000,000}.
@item T
@itemx TiB
@cindex tebibyte, definition of
tebibyte: @math{2^40 = 1,099,511,627,776}.
tebibyte: @math{2^{40} = 1,099,511,627,776}.
@item PB
@cindex petabyte, definition of
petabyte: @math{10^15 = 1,000,000,000,000,000}.
petabyte: @math{10^{15} = 1,000,000,000,000,000}.
@item P
@itemx PiB
@cindex pebibyte, definition of
pebibyte: @math{2^50 = 1,125,899,906,842,624}.
pebibyte: @math{2^{50} = 1,125,899,906,842,624}.
@item EB
@cindex exabyte, definition of
exabyte: @math{10^18 = 1,000,000,000,000,000,000}.
exabyte: @math{10^{18} = 1,000,000,000,000,000,000}.
@item E
@itemx EiB
@cindex exbibyte, definition of
exbibyte: @math{2^60 = 1,152,921,504,606,846,976}.
exbibyte: @math{2^{60} = 1,152,921,504,606,846,976}.
@item ZB
@cindex zettabyte, definition of
zettabyte: @math{10^21 = 1,000,000,000,000,000,000,000}
zettabyte: @math{10^{21} = 1,000,000,000,000,000,000,000}
@item Z
@itemx ZiB
@math{2^70 = 1,180,591,620,717,411,303,424}.
(@samp{Zi} is a GNU extension to IEC 60027-2.)
zebibyte: @math{2^{70} = 1,180,591,620,717,411,303,424}.
@item YB
@cindex yottabyte, definition of
yottabyte: @math{10^24 = 1,000,000,000,000,000,000,000,000}.
yottabyte: @math{10^{24} = 1,000,000,000,000,000,000,000,000}.
@item Y
@itemx YiB
@math{2^80 = 1,208,925,819,614,629,174,706,176}.
(@samp{Yi} is a GNU extension to IEC 60027-2.)
yobibyte: @math{2^{80} = 1,208,925,819,614,629,174,706,176}.
@item RB
@cindex ronnabyte, definition of
ronnabyte: @math{10^{27} = 1,000,000,000,000,000,000,000,000,000}.
@item R
@itemx RiB
robibyte: @math{2^{90} = 1,237,940,039,285,380,274,899,124,224}.
@item QB
@cindex quettabyte, definition of
quettabyte: @math{10^{30} = 1,000,000,000,000,000,000,000,000,000,000}.
@item Q
@itemx QiB
quebibyte: @math{2^{100} = 1,267,650,600,228,229,401,496,703,205,376}.
@end table
@node Invoking diff
@@ -4595,39 +4670,37 @@ handle some of the existing formats. These shortcomings motivate the
following suggested projects.
@menu
* Internationalization:: Handling multibyte and varying-width characters.
* Internationalization:: Handling multi-byte and varying-width characters.
* Changing Structure:: Handling changes to the directory structure.
* Special Files:: Handling symbolic links, device special files, etc.
* Unusual File Names:: Handling file names that contain unusual characters.
* Timestamp Order:: Outputting diffs in timestamp order.
* Timestamp Order:: Outputting diffs in timestamp order.
* Ignoring Changes:: Ignoring certain changes while showing others.
* Speedups:: Improving performance.
@end menu
@node Internationalization
@subsection Handling Multibyte and Varying-Width Characters
@cindex multibyte characters
@subsection Handling Multi-byte and Varying-Width Characters
@cindex multi-byte characters
@cindex varying-width characters
@command{diff}, @command{diff3} and @command{sdiff} treat each line of
input as a string of unibyte characters. This can mishandle multibyte
characters in some cases. For example, when asked to ignore spaces,
@command{diff} does not properly ignore a multibyte space character.
input as a string of characters and encoding errors, where an
@dfn{encoding error} is an input byte that is not part of any
character. Single-byte and multi-byte characters are supported, along
with common character encoding systems like UTF-8. The operating
system's locale specifies the character encoding, and can be specified
with the @env{LC_ALL} environment variable. You can find which
locales are supported on your system by running the shell command
@samp{locale -a}.
Also, @command{diff} currently assumes that each byte is one column
wide, and this assumption is incorrect in some locales, e.g., locales
that use UTF-8 encoding. This causes problems with the @option{-y} or
@option{--side-by-side} option of @command{diff}.
When counting columns for options like @option{--expand-tabs} (@option{-t}),
@command{diff} consults the locale for the column width of each character,
and assumes that each encoding error occupies a single column.
These problems need to be fixed without unduly affecting the
performance of the utilities in unibyte environments.
The IBM GNU/Linux Technology Center Internationalization Team has
proposed
@uref{http://oss.software.ibm.com/developer/opensource/linux/patches/i18n/diffutils-2.7.2-i18n-0.1.patch.gz,patches
to support internationalized @command{diff}}.
Unfortunately, these patches are incomplete and are to an older
version of @command{diff}, so more work needs to be done in this area.
When ignoring case for @option{--ignore-case} (@option{-i}),
@command{diff} downcases each character before comparing it,
regardless of whether it is multi-byte. @xref{Case Folding}.
@node Changing Structure
@subsection Handling Changes to the Directory Structure
@@ -4677,13 +4750,14 @@ and @command{patch} should be extended to understand these extensions.
@subsection File Names that Contain Unusual Characters
@cindex file names with unusual characters
When a file name contains an unusual character like a newline or
white space, @samp{diff -r} generates a patch that @command{patch} cannot
parse. The problem is with format of @command{diff} output, not just with
@command{patch}, because with odd enough file names one can cause
@command{diff} to generate a patch that is syntactically correct but
patches the wrong files. The format of @command{diff} output should be
extended to handle all possible file names.
Since diffutils-3.3, file names have been encoded to eliminate the ambiguity
of unusual characters like newline and TAB.
However, since any file name containing a newline may easily cause trouble,
in so many contexts (not just diff and patch), a future version of
diff may well reject attempts to operate on such names.
@c FIXME-in-2026 consider rejecting NL-afflicted file names
@c keep an eye on POSIX, e.g.,
@c https://pubs.opengroup.org/onlinepubs/9799919799/utilities/diff.html
@node Timestamp Order
@subsection Outputting Diffs in Timestamp Order
@@ -5,8 +5,9 @@
@c hence no sectioning command or @node.
@display
Copyright @copyright{} 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc.
@uref{http://fsf.org/}
Copyright @copyright{} 2000--2002, 2007--2008, 2022--2025 Free Software
Foundation, Inc.
@uref{https://fsf.org/}
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
@@ -414,7 +415,7 @@ The Free Software Foundation may publish new, revised versions
of the GNU Free Documentation License from time to time. Such new
versions will be similar in spirit to the present version, but may
differ in detail to address new problems or concerns. See
@uref{http://www.gnu.org/copyleft/}.
@uref{https://www.gnu.org/licenses/}.
Each version of the License is given a distinguishing version number.
If the Document specifies that a particular numbered version of this
@@ -1,4 +1,4 @@
@set UPDATED 6 May 2017
@set UPDATED-MONTH May 2017
@set EDITION 3.6
@set VERSION 3.6
@set UPDATED 12 January 2025
@set UPDATED-MONTH January 2025
@set EDITION 3.12
@set VERSION 3.12
@@ -1,4 +1,4 @@
@set UPDATED 6 May 2017
@set UPDATED-MONTH May 2017
@set EDITION 3.6
@set VERSION 3.6
@set UPDATED 12 January 2025
@set UPDATED-MONTH January 2025
@set EDITION 3.12
@set VERSION 3.12
@@ -1,7 +1,7 @@
#! /bin/sh
# Wrapper around gettext for programs using the msgid convention.
# Copyright (C) 1998, 2001, 2004, 2009-2013, 2015-2017 Free Software
# Copyright (C) 1998, 2001, 2004, 2009-2013, 2015-2025 Free Software
# Foundation, Inc.
# Written by Paul Eggert <eggert@twinsun.com>.
@@ -97,7 +97,7 @@ generate_emsgids='
line = substr(line, percent_index + 2)
bracket_index = index(line, "}")
if (bracket_index == 0) {
continue
continue
}
msgid = substr(line, 1, bracket_index - 1)
if (index(msgid, "%") != 0) {
File diff suppressed because it is too large Load Diff
@@ -1,8 +1,48 @@
#if !defined _Noreturn && __STDC_VERSION__ < 201112
# if (3 <= __GNUC__ || (__GNUC__ == 2 && 8 <= __GNUC_MINOR__) \
|| 0x5110 <= __SUNPRO_C)
/* A C macro for declaring that a function does not return.
Copyright (C) 2011-2025 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 2 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 <https://www.gnu.org/licenses/>. */
#ifndef _Noreturn
# if (defined __cplusplus \
&& ((201103 <= __cplusplus && !(__GNUC__ == 4 && __GNUC_MINOR__ == 7)) \
|| (defined _MSC_VER && 1900 <= _MSC_VER)) \
&& 0)
/* [[noreturn]] is not practically usable, because with it the syntax
extern _Noreturn void func (...);
would not be valid; such a declaration would only be valid with 'extern'
and '_Noreturn' swapped, or without the 'extern' keyword. However, some
AIX system header files and several gnulib header files use precisely
this syntax with 'extern'. */
# define _Noreturn [[noreturn]]
# elif (defined __clang__ && __clang_major__ < 16 \
&& defined _GL_WORK_AROUND_LLVM_BUG_59792)
/* Compile with -D_GL_WORK_AROUND_LLVM_BUG_59792 to work around
that rare LLVM bug, though you may get many false-alarm warnings. */
# define _Noreturn
# elif ((!defined __cplusplus || defined __clang__) \
&& (201112 <= (defined __STDC_VERSION__ ? __STDC_VERSION__ : 0) \
|| (!defined __STRICT_ANSI__ \
&& (4 < __GNUC__ + (7 <= __GNUC_MINOR__) && !defined __clang__ \
|| (defined __apple_build_version__ \
? 6000000 <= __apple_build_version__ \
: 3 < __clang_major__ + (5 <= __clang_minor__))))))
/* _Noreturn works as-is. */
# elif (2 < __GNUC__ + (8 <= __GNUC_MINOR__) || defined __clang__ \
|| 0x5110 <= __SUNPRO_C)
# define _Noreturn __attribute__ ((__noreturn__))
# elif 1200 <= _MSC_VER
# elif 1200 <= (defined _MSC_VER ? _MSC_VER : 0)
# define _Noreturn __declspec (noreturn)
# else
# define _Noreturn
@@ -1,19 +1,19 @@
/* accept.c --- wrappers for Windows accept function
Copyright (C) 2008-2017 Free Software Foundation, Inc.
Copyright (C) 2008-2025 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 file 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 2.1 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
This file 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.
GNU Lesser 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 <http://www.gnu.org/licenses/>. */
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* Written by Paolo Bonzini */
@@ -0,0 +1,167 @@
/* alloca.c -- allocate automatically reclaimed memory
This file is in the public domain. */
/* (Mostly) portable implementation -- D A Gwyn
This implementation of the PWB library alloca function,
which is used to allocate space off the run-time stack so
that it is automatically reclaimed upon procedure exit,
was inspired by discussions with J. Q. Johnson of Cornell.
J.Otto Tennant <jot@cray.com> contributed the Cray support.
There are some preprocessor constants that can
be defined when compiling for your specific system, for
improved efficiency; however, the defaults should be okay.
The general concept of this implementation is to keep
track of all alloca-allocated blocks, and reclaim any
that are found to be deeper in the stack than the current
invocation. This heuristic does not reclaim storage as
soon as it becomes invalid, but it will do so eventually.
As a special case, alloca(0) reclaims storage without
allocating any. It is a good idea to use alloca(0) in
your main control loop, etc. to force garbage collection. */
#include <config.h>
#include <alloca.h>
#include <string.h>
#include <stdlib.h>
/* If compiling with GCC or clang, this file is not needed. */
#if !(defined __GNUC__ || defined __clang__)
/* If someone has defined alloca as a macro,
there must be some other way alloca is supposed to work. */
# ifndef alloca
/* Define STACK_DIRECTION if you know the direction of stack
growth for your system; otherwise it will be automatically
deduced at run-time.
STACK_DIRECTION > 0 => grows toward higher addresses
STACK_DIRECTION < 0 => grows toward lower addresses
STACK_DIRECTION = 0 => direction of growth unknown */
# ifndef STACK_DIRECTION
# define STACK_DIRECTION 0 /* Direction unknown. */
# endif
# if STACK_DIRECTION != 0
# define STACK_DIR STACK_DIRECTION /* Known at compile-time. */
# else /* STACK_DIRECTION == 0; need run-time code. */
static int stack_dir; /* 1 or -1 once known. */
# define STACK_DIR stack_dir
static int
find_stack_direction (int *addr, int depth)
{
int dir, dummy = 0;
if (! addr)
addr = &dummy;
*addr = addr < &dummy ? 1 : addr == &dummy ? 0 : -1;
dir = depth ? find_stack_direction (addr, depth - 1) : 0;
return dir + dummy;
}
# endif /* STACK_DIRECTION == 0 */
/* An "alloca header" is used to:
(a) chain together all alloca'ed blocks;
(b) keep track of stack depth.
It is very important that sizeof(header) agree with malloc
alignment chunk size. The following default should work okay. */
# ifndef ALIGN_SIZE
# define ALIGN_SIZE sizeof(double)
# endif
typedef union hdr
{
char align[ALIGN_SIZE]; /* To force sizeof(header). */
struct
{
union hdr *next; /* For chaining headers. */
char *deep; /* For stack depth measure. */
} h;
} header;
static header *last_alloca_header = NULL; /* -> last alloca header. */
/* Return a pointer to at least SIZE bytes of storage,
which will be automatically reclaimed upon exit from
the procedure that called alloca. Originally, this space
was supposed to be taken from the current stack frame of the
caller, but that method cannot be made to work for some
implementations of C, for example under Gould's UTX/32. */
void *
alloca (size_t size)
{
auto char probe; /* Probes stack depth: */
register char *depth = &probe;
# if STACK_DIRECTION == 0
if (STACK_DIR == 0) /* Unknown growth direction. */
STACK_DIR = find_stack_direction (NULL, (size & 1) + 20);
# endif
/* Reclaim garbage, defined as all alloca'd storage that
was allocated from deeper in the stack than currently. */
{
register header *hp; /* Traverses linked list. */
for (hp = last_alloca_header; hp != NULL;)
if ((STACK_DIR > 0 && hp->h.deep > depth)
|| (STACK_DIR < 0 && hp->h.deep < depth))
{
register header *np = hp->h.next;
free (hp); /* Collect garbage. */
hp = np; /* -> next header. */
}
else
break; /* Rest are not deeper. */
last_alloca_header = hp; /* -> last valid storage. */
}
if (size == 0)
return NULL; /* No allocation required. */
/* Allocate combined header + user data storage. */
{
/* Address of header. */
register header *new;
size_t combined_size = sizeof (header) + size;
if (combined_size < sizeof (header))
memory_full ();
new = malloc (combined_size);
if (! new)
memory_full ();
new->h.next = last_alloca_header;
new->h.deep = depth;
last_alloca_header = new;
/* User storage begins just after header. */
return (void *) (new + 1);
}
}
# endif /* no alloca */
#endif /* not GCC || clang */
@@ -0,0 +1,66 @@
/* Some auxiliary stuff for defining an alternate stack.
Copyright (C) 2010-2025 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 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 <https://www.gnu.org/licenses/>. */
/* Written by Eric Blake and Bruno Haible. */
#include <stdint.h> /* uintptr_t */
#include <string.h> /* for memset */
#define MYSTACK_SIZE (1 << 24)
/* glibc says: Users should use SIGSTKSZ as the size of user-supplied
buffers. We want to detect stack overflow of the alternate stack
in a nicer manner than just crashing, so we overallocate in
comparison to what we hand libsigsegv. Also, we intentionally hand
an unaligned pointer, to ensure the alternate stack still ends up
aligned. */
#define MYSTACK_CRUMPLE_ZONE 8192
static char mystack_storage[MYSTACK_SIZE + 2 * MYSTACK_CRUMPLE_ZONE + 31];
static char *mystack; /* MYSTACK_SIZE bytes in the middle of storage. */
static void
prepare_alternate_stack (void)
{
#ifdef SIGSTKSZ
if (MYSTACK_SIZE < SIGSTKSZ)
{
size_t size = SIGSTKSZ;
printf ("SIGSTKSZ=%zu exceeds MYSTACK_SIZE=%d\n", size, MYSTACK_SIZE);
exit (1);
}
#endif
memset (mystack_storage, 's', sizeof mystack_storage);
mystack = (char *) ((uintptr_t) (mystack_storage + MYSTACK_CRUMPLE_ZONE) | 31);
}
static void
check_alternate_stack_no_overflow (void)
{
unsigned int i;
for (i = MYSTACK_CRUMPLE_ZONE; i > 0; i--)
if (*(mystack - i) != 's')
{
printf ("Alternate stack was exceeded by %u bytes!!\n", i);
exit (1);
}
for (i = MYSTACK_CRUMPLE_ZONE; i > 0; i--)
if (*(mystack + MYSTACK_SIZE - 1 + i) != 's')
{
printf ("Alternate stack was exceeded by %u bytes!!\n", i);
exit (1);
}
}
@@ -0,0 +1,50 @@
/* anytostr.c -- convert integers to printable strings
Copyright (C) 2001, 2006, 2008-2025 Free Software Foundation, Inc.
This file 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 2.1 of the
License, or (at your option) any later version.
This file 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 <https://www.gnu.org/licenses/>. */
/* Written by Paul Eggert */
#include <config.h>
#include "inttostr.h"
/* Convert I to a printable string in BUF, which must be at least
INT_BUFSIZE_BOUND (INTTYPE) bytes long. Return the address of the
printable string, which need not start at BUF. */
_GL_ATTRIBUTE_NODISCARD char *
anytostr (inttype i, char *buf)
{
char *p = buf + INT_STRLEN_BOUND (inttype);
*p = 0;
if (i < 0)
{
do
*--p = '0' - i % 10;
while ((i /= 10) != 0);
*--p = '-';
}
else
{
do
*--p = '0' + i % 10;
while ((i /= 10) != 0);
}
return p;
}
@@ -1,24 +1,24 @@
/* A C macro for declaring that specific arguments must not be NULL.
Copyright (C) 2009-2017 Free Software Foundation, Inc.
Copyright (C) 2009-2025 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
under the terms of the GNU Lesser General Public License as published
by the Free Software Foundation; either version 2 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.
Lesser 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 <http://www.gnu.org/licenses/>. */
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* _GL_ARG_NONNULL((n,...,m)) tells the compiler and static analyzer tools
that the values passed as arguments n, ..., m must be non-NULL pointers.
n = 1 stands for the first argument, n = 2 for the second argument etc. */
#ifndef _GL_ARG_NONNULL
# if (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) || __GNUC__ > 3
# if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) || defined __clang__
# define _GL_ARG_NONNULL(params) __attribute__ ((__nonnull__ params))
# else
# define _GL_ARG_NONNULL(params)
@@ -0,0 +1,21 @@
/* Inline functions for <arpa/inet.h>.
Copyright (C) 2024-2025 Free Software Foundation, Inc.
This file 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 2.1 of the
License, or (at your option) any later version.
This file 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 <https://www.gnu.org/licenses/>. */
#include <config.h>
#define _GL_ARPA_INET_INLINE _GL_EXTERN_INLINE
#include <arpa/inet.h>
@@ -1,19 +1,19 @@
/* A GNU-like <arpa/inet.h>.
Copyright (C) 2005-2006, 2008-2017 Free Software Foundation, Inc.
Copyright (C) 2005-2006, 2008-2025 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 file 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 2.1 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
This file 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.
GNU Lesser 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 <http://www.gnu.org/licenses/>. */
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>. */
#ifndef _@GUARD_PREFIX@_ARPA_INET_H
@@ -49,6 +49,64 @@
#ifndef _@GUARD_PREFIX@_ARPA_INET_H
#define _@GUARD_PREFIX@_ARPA_INET_H
/* This file uses GNULIB_POSIXCHECK, HAVE_RAW_DECL_*. */
#if !_GL_CONFIG_H_INCLUDED
#error "Please include config.h first."
#endif
/* Get all possible declarations of inet_ntop() and inet_pton(). */
#if (@GNULIB_INET_NTOP@ || @GNULIB_INET_PTON@ || defined GNULIB_POSIXCHECK) \
&& @HAVE_WS2TCPIP_H@
# include <ws2tcpip.h>
#endif
#if !(@HAVE_DECL_HTONL@ || @HAVE_DECL_HTONS@ || @HAVE_DECL_NTOHL@ || @HAVE_DECL_NTOHS@)
# include <endian.h>
#endif
_GL_INLINE_HEADER_BEGIN
#ifndef _GL_ARPA_INET_INLINE
# define _GL_ARPA_INET_INLINE _GL_INLINE
#endif
/* Host to network byte order. */
#if !@HAVE_DECL_HTONS@
_GL_ARPA_INET_INLINE uint16_t
htons (uint16_t value)
{
return htobe16 (value);
}
#endif
#if !@HAVE_DECL_HTONL@
_GL_ARPA_INET_INLINE uint32_t
htonl (uint32_t value)
{
return htobe32 (value);
}
#endif
/* Network to host byte order. */
#if !@HAVE_DECL_NTOHS@
_GL_ARPA_INET_INLINE uint16_t
ntohs (uint16_t value)
{
return htobe16 (value);
}
#endif
#if !@HAVE_DECL_NTOHL@
_GL_ARPA_INET_INLINE uint32_t
ntohl (uint32_t value)
{
return htobe32 (value);
}
#endif
/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
/* The definition of _GL_ARG_NONNULL is copied here. */
@@ -70,8 +128,8 @@
the return value is NULL and errno is set to ENOSPC. A good value
for CNT is 46.
For more details, see the POSIX:2001 specification
<http://www.opengroup.org/susv3xsh/inet_ntop.html>. */
For more details, see the POSIX:2008 specification
<https://pubs.opengroup.org/onlinepubs/9699919799/functions/inet_ntop.html>. */
# if @REPLACE_INET_NTOP@
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# undef inet_ntop
@@ -79,7 +137,7 @@
# endif
_GL_FUNCDECL_RPL (inet_ntop, const char *,
(int af, const void *restrict src,
char *restrict dst, socklen_t cnt)
char *restrict dst, socklen_t cnt),
_GL_ARG_NONNULL ((2, 3)));
_GL_CXXALIAS_RPL (inet_ntop, const char *,
(int af, const void *restrict src,
@@ -88,7 +146,7 @@ _GL_CXXALIAS_RPL (inet_ntop, const char *,
# if !@HAVE_DECL_INET_NTOP@
_GL_FUNCDECL_SYS (inet_ntop, const char *,
(int af, const void *restrict src,
char *restrict dst, socklen_t cnt)
char *restrict dst, socklen_t cnt),
_GL_ARG_NONNULL ((2, 3)));
# endif
/* Need to cast, because on NonStop Kernel, the fourth parameter is
@@ -97,7 +155,9 @@ _GL_CXXALIAS_SYS_CAST (inet_ntop, const char *,
(int af, const void *restrict src,
char *restrict dst, socklen_t cnt));
# endif
# if __GLIBC__ >= 2
_GL_CXXALIASWARN (inet_ntop);
# endif
#elif defined GNULIB_POSIXCHECK
# undef inet_ntop
# if HAVE_RAW_DECL_INET_NTOP
@@ -113,20 +173,22 @@ _GL_WARN_ON_USE (inet_ntop, "inet_ntop is unportable - "
# define inet_pton rpl_inet_pton
# endif
_GL_FUNCDECL_RPL (inet_pton, int,
(int af, const char *restrict src, void *restrict dst)
(int af, const char *restrict src, void *restrict dst),
_GL_ARG_NONNULL ((2, 3)));
_GL_CXXALIAS_RPL (inet_pton, int,
(int af, const char *restrict src, void *restrict dst));
# else
# if !@HAVE_DECL_INET_PTON@
_GL_FUNCDECL_SYS (inet_pton, int,
(int af, const char *restrict src, void *restrict dst)
(int af, const char *restrict src, void *restrict dst),
_GL_ARG_NONNULL ((2, 3)));
# endif
_GL_CXXALIAS_SYS (inet_pton, int,
(int af, const char *restrict src, void *restrict dst));
# endif
# if __GLIBC__ >= 2
_GL_CXXALIASWARN (inet_pton);
# endif
#elif defined GNULIB_POSIXCHECK
# undef inet_pton
# if HAVE_RAW_DECL_INET_PTON
@@ -135,6 +197,7 @@ _GL_WARN_ON_USE (inet_pton, "inet_pton is unportable - "
# endif
#endif
_GL_INLINE_HEADER_END
#endif /* _@GUARD_PREFIX@_ARPA_INET_H */
#endif /* _@GUARD_PREFIX@_ARPA_INET_H */
@@ -0,0 +1,34 @@
/* Formatted output to strings.
Copyright (C) 1999, 2002, 2006, 2009-2025 Free Software Foundation, Inc.
This file 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 2.1 of the
License, or (at your option) any later version.
This file 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 <https://www.gnu.org/licenses/>. */
#include <config.h>
/* Specification. */
#include "vasnprintf.h"
#include <stdarg.h>
char *
asnprintf (char *resultbuf, size_t *lengthp, const char *format, ...)
{
va_list args;
char *result;
va_start (args, format);
result = vasnprintf (resultbuf, lengthp, format, args);
va_end (args);
return result;
}
@@ -0,0 +1,146 @@
/* Define at-style functions like fstatat, unlinkat, fchownat, etc.
Copyright (C) 2006, 2009-2025 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 <https://www.gnu.org/licenses/>. */
/* written by Jim Meyering */
#include "filename.h" /* solely for definition of IS_ABSOLUTE_FILE_NAME */
#ifdef GNULIB_SUPPORT_ONLY_AT_FDCWD
# include <errno.h>
# ifndef ENOTSUP
# define ENOTSUP EINVAL
# endif
#else
# include "openat.h"
# include "openat-priv.h"
# include "save-cwd.h"
#endif
#ifdef AT_FUNC_USE_F1_COND
# define CALL_FUNC(F) \
(flag == AT_FUNC_USE_F1_COND \
? AT_FUNC_F1 (F AT_FUNC_POST_FILE_ARGS) \
: AT_FUNC_F2 (F AT_FUNC_POST_FILE_ARGS))
# define VALIDATE_FLAG(F) \
if (flag & ~AT_FUNC_USE_F1_COND) \
{ \
errno = EINVAL; \
return FUNC_FAIL; \
}
#else
# define CALL_FUNC(F) (AT_FUNC_F1 (F AT_FUNC_POST_FILE_ARGS))
# define VALIDATE_FLAG(F) /* empty */
#endif
#ifdef AT_FUNC_RESULT
# define FUNC_RESULT AT_FUNC_RESULT
#else
# define FUNC_RESULT int
#endif
#ifdef AT_FUNC_FAIL
# define FUNC_FAIL AT_FUNC_FAIL
#else
# define FUNC_FAIL -1
#endif
/* Call AT_FUNC_F1 to operate on FILE, which is in the directory
open on descriptor FD. If AT_FUNC_USE_F1_COND is defined to a value,
AT_FUNC_POST_FILE_PARAM_DECLS must include a parameter named flag;
call AT_FUNC_F2 if FLAG is 0 or fail if FLAG contains more bits than
AT_FUNC_USE_F1_COND. Return int and fail with -1 unless AT_FUNC_RESULT
or AT_FUNC_FAIL are defined. If possible, do it without changing the
working directory. Otherwise, resort to using save_cwd/fchdir,
then AT_FUNC_F?/restore_cwd. If either the save_cwd or the restore_cwd
fails, then give a diagnostic and exit nonzero. */
FUNC_RESULT
AT_FUNC_NAME (int fd, char const *file AT_FUNC_POST_FILE_PARAM_DECLS)
{
VALIDATE_FLAG (flag);
if (fd == AT_FDCWD || IS_ABSOLUTE_FILE_NAME (file))
return CALL_FUNC (file);
#ifdef GNULIB_SUPPORT_ONLY_AT_FDCWD
errno = ENOTSUP;
return FUNC_FAIL;
#else
{
/* Be careful to choose names unlikely to conflict with
AT_FUNC_POST_FILE_PARAM_DECLS. */
struct saved_cwd saved_cwd;
int saved_errno;
FUNC_RESULT err;
{
char proc_buf[OPENAT_BUFFER_SIZE];
char *proc_file = openat_proc_name (proc_buf, fd, file);
if (proc_file)
{
FUNC_RESULT proc_result = CALL_FUNC (proc_file);
int proc_errno = errno;
if (proc_file != proc_buf)
free (proc_file);
/* If the syscall succeeds, or if it fails with an unexpected
errno value, then return right away. Otherwise, fall through
and resort to using save_cwd/restore_cwd. */
if (FUNC_FAIL != proc_result)
return proc_result;
if (! EXPECTED_ERRNO (proc_errno))
{
errno = proc_errno;
return proc_result;
}
}
}
if (save_cwd (&saved_cwd) != 0)
openat_save_fail (errno);
if (0 <= fd && fd == saved_cwd.desc)
{
/* If saving the working directory collides with the user's
requested fd, then the user's fd must have been closed to
begin with. */
free_cwd (&saved_cwd);
errno = EBADF;
return FUNC_FAIL;
}
if (fchdir (fd) != 0)
{
saved_errno = errno;
free_cwd (&saved_cwd);
errno = saved_errno;
return FUNC_FAIL;
}
err = CALL_FUNC (file);
saved_errno = (err == FUNC_FAIL ? errno : 0);
if (restore_cwd (&saved_cwd) != 0)
openat_restore_fail (errno);
free_cwd (&saved_cwd);
if (saved_errno)
errno = saved_errno;
return err;
}
#endif
}
#undef CALL_FUNC
#undef FUNC_RESULT
#undef FUNC_FAIL
@@ -0,0 +1,34 @@
/* Copyright (C) 1991, 1997-1998, 2008-2025 Free Software Foundation, Inc.
This file is part of the GNU C Library.
This file 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 file 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 <https://www.gnu.org/licenses/>. */
#if !_LIBC
# include <config.h>
#endif
/* Specification. */
#include <stdlib.h>
#if _LIBC
# undef atoll
#endif
/* Convert a string to a long long int. */
long long int
atoll (const char *nptr)
{
return strtoll (nptr, (char **) NULL, 10);
}
@@ -0,0 +1,179 @@
/* Atomic integers. Useful for testing multithreaded locking primitives.
Copyright (C) 2005, 2008-2025 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 <https://www.gnu.org/licenses/>. */
/* Whether to use 'volatile' on some variables that communicate information
between threads. If set to 0, a semaphore or a lock is used to protect
these variables. If set to 1, 'volatile' is used; this is theoretically
equivalent but can lead to much slower execution (e.g. 30x slower total
run time on a 40-core machine), because 'volatile' does not imply any
synchronization/communication between different CPUs. */
#define USE_VOLATILE 0
#if USE_POSIX_THREADS && HAVE_SEMAPHORE_H
/* Whether to use a semaphore to communicate information between threads.
If set to 0, a lock is used. If set to 1, a semaphore is used.
Uncomment this to reduce the dependencies of this test. */
# define USE_SEMAPHORE 1
/* Mac OS X provides only named semaphores (sem_open); its facility for
unnamed semaphores (sem_init) does not work. */
# if defined __APPLE__ && defined __MACH__
# define USE_NAMED_SEMAPHORE 1
# else
# define USE_UNNAMED_SEMAPHORE 1
# endif
#endif
#if USE_SEMAPHORE
# include <errno.h>
# include <fcntl.h>
# include <semaphore.h>
# include <unistd.h>
#endif
#if USE_VOLATILE
struct atomic_int {
volatile int value;
};
static void
init_atomic_int (struct atomic_int *ai)
{
}
static int
get_atomic_int_value (struct atomic_int *ai)
{
return ai->value;
}
static void
set_atomic_int_value (struct atomic_int *ai, int new_value)
{
ai->value = new_value;
}
#elif USE_SEMAPHORE
/* This atomic_int implementation can only support the values 0 and 1.
It is initially 0 and can be set to 1 only once. */
# if USE_UNNAMED_SEMAPHORE
struct atomic_int {
sem_t semaphore;
};
#define atomic_int_semaphore(ai) (&(ai)->semaphore)
static void
init_atomic_int (struct atomic_int *ai)
{
sem_init (&ai->semaphore, 0, 0);
}
# endif
# if USE_NAMED_SEMAPHORE
struct atomic_int {
sem_t *semaphore;
};
#define atomic_int_semaphore(ai) ((ai)->semaphore)
static void
init_atomic_int (struct atomic_int *ai)
{
sem_t *s;
unsigned int count;
for (count = 0; ; count++)
{
char name[80];
/* Use getpid() in the name, so that different processes running at the
same time will not interfere. Use ai in the name, so that different
atomic_int in the same process will not interfere. Use a count in
the name, so that even in the (unlikely) case that a semaphore with
the specified name already exists, we can try a different name. */
sprintf (name, "test-lock-%lu-%p-%u",
(unsigned long) getpid (), ai, count);
s = sem_open (name, O_CREAT | O_EXCL, 0600, 0);
if (s == SEM_FAILED)
{
if (errno == EEXIST)
/* Retry with a different name. */
continue;
else
{
perror ("sem_open failed");
fflush (stderr);
abort ();
}
}
else
{
/* Try not to leave a semaphore hanging around on the file system
eternally, if we can avoid it. */
sem_unlink (name);
break;
}
}
ai->semaphore = s;
}
# endif
static int
get_atomic_int_value (struct atomic_int *ai)
{
if (sem_trywait (atomic_int_semaphore (ai)) == 0)
{
if (sem_post (atomic_int_semaphore (ai)))
abort ();
return 1;
}
else if (errno == EAGAIN)
return 0;
else
abort ();
}
static void
set_atomic_int_value (struct atomic_int *ai, int new_value)
{
if (new_value == 0)
/* It's already initialized with 0. */
return;
/* To set the value 1: */
if (sem_post (atomic_int_semaphore (ai)))
abort ();
}
#else
struct atomic_int {
pthread_mutex_t lock;
int value;
};
static void
init_atomic_int (struct atomic_int *ai)
{
pthread_mutexattr_t attr;
ASSERT (pthread_mutexattr_init (&attr) == 0);
ASSERT (pthread_mutexattr_settype (&attr, PTHREAD_MUTEX_NORMAL) == 0);
ASSERT (pthread_mutex_init (&ai->lock, &attr) == 0);
ASSERT (pthread_mutexattr_destroy (&attr) == 0);
}
static int
get_atomic_int_value (struct atomic_int *ai)
{
ASSERT (pthread_mutex_lock (&ai->lock) == 0);
int ret = ai->value;
ASSERT (pthread_mutex_unlock (&ai->lock) == 0);
return ret;
}
static void
set_atomic_int_value (struct atomic_int *ai, int new_value)
{
ASSERT (pthread_mutex_lock (&ai->lock) == 0);
ai->value = new_value;
ASSERT (pthread_mutex_unlock (&ai->lock) == 0);
}
#endif
@@ -1,19 +1,19 @@
/* bind.c --- wrappers for Windows bind function
Copyright (C) 2008-2017 Free Software Foundation, Inc.
Copyright (C) 2008-2025 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 file 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 2.1 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
This file 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.
GNU Lesser 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 <http://www.gnu.org/licenses/>. */
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* Written by Paolo Bonzini */
@@ -1,18 +1,18 @@
/* C++ compatible function declaration macros.
Copyright (C) 2010-2017 Free Software Foundation, Inc.
Copyright (C) 2010-2025 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
under the terms of the GNU Lesser General Public License as published
by the Free Software Foundation; either version 2 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.
Lesser 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 <http://www.gnu.org/licenses/>. */
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>. */
#ifndef _GL_CXXDEFS_H
#define _GL_CXXDEFS_H
@@ -93,27 +93,53 @@
# define _GL_EXTERN_C extern
#endif
/* _GL_FUNCDECL_RPL (func, rettype, parameters_and_attributes);
/* _GL_EXTERN_C_FUNC declaration;
performs the declaration of a function with C linkage. */
#if defined __cplusplus
# define _GL_EXTERN_C_FUNC extern "C"
#else
/* In C mode, omit the 'extern' keyword, because attributes in bracket syntax
are not allowed between 'extern' and the return type (see gnulib-common.m4).
*/
# define _GL_EXTERN_C_FUNC
#endif
/* _GL_FUNCDECL_RPL (func, rettype, parameters, [attributes]);
declares a replacement function, named rpl_func, with the given prototype,
consisting of return type, parameters, and attributes.
Example:
_GL_FUNCDECL_RPL (open, int, (const char *filename, int flags, ...)
Although attributes are optional, the comma before them is required
for portability to C17 and earlier. The attribute _GL_ATTRIBUTE_NOTHROW,
if needed, must be placed after the _GL_FUNCDECL_RPL invocation,
at the end of the declaration.
Examples:
_GL_FUNCDECL_RPL (free, void, (void *ptr), ) _GL_ATTRIBUTE_NOTHROW;
_GL_FUNCDECL_RPL (open, int, (const char *filename, int flags, ...),
_GL_ARG_NONNULL ((1)));
*/
#define _GL_FUNCDECL_RPL(func,rettype,parameters_and_attributes) \
_GL_FUNCDECL_RPL_1 (rpl_##func, rettype, parameters_and_attributes)
#define _GL_FUNCDECL_RPL_1(rpl_func,rettype,parameters_and_attributes) \
_GL_EXTERN_C rettype rpl_func parameters_and_attributes
/* _GL_FUNCDECL_SYS (func, rettype, parameters_and_attributes);
Note: Attributes, such as _GL_ATTRIBUTE_DEPRECATED, are supported in front
of a _GL_FUNCDECL_RPL invocation only in C mode, not in C++ mode. (That's
because
[[...]] extern "C" <declaration>;
is invalid syntax in C++.)
*/
#define _GL_FUNCDECL_RPL(func,rettype,parameters,...) \
_GL_FUNCDECL_RPL_1 (rpl_##func, rettype, parameters, __VA_ARGS__)
#define _GL_FUNCDECL_RPL_1(rpl_func,rettype,parameters,...) \
_GL_EXTERN_C_FUNC __VA_ARGS__ rettype rpl_func parameters
/* _GL_FUNCDECL_SYS (func, rettype, parameters, [attributes]);
declares the system function, named func, with the given prototype,
consisting of return type, parameters, and attributes.
Example:
_GL_FUNCDECL_SYS (open, int, (const char *filename, int flags, ...)
_GL_ARG_NONNULL ((1)));
Although attributes are optional, the comma before them is required
for portability to C17 and earlier. The attribute _GL_ATTRIBUTE_NOTHROW,
if needed, must be placed after the _GL_FUNCDECL_RPL invocation,
at the end of the declaration.
Examples:
_GL_FUNCDECL_SYS (getumask, mode_t, (void), ) _GL_ATTRIBUTE_NOTHROW;
_GL_FUNCDECL_SYS (posix_openpt, int, (int flags), _GL_ATTRIBUTE_NODISCARD);
*/
#define _GL_FUNCDECL_SYS(func,rettype,parameters_and_attributes) \
_GL_EXTERN_C rettype func parameters_and_attributes
#define _GL_FUNCDECL_SYS(func,rettype,parameters,...) \
_GL_EXTERN_C_FUNC __VA_ARGS__ rettype func parameters
/* _GL_CXXALIAS_RPL (func, rettype, parameters);
declares a C++ alias called GNULIB_NAMESPACE::func
@@ -146,6 +172,16 @@
_GL_EXTERN_C int _gl_cxxalias_dummy
#endif
/* _GL_CXXALIAS_MDA (func, rettype, parameters);
is to be used when func is a Microsoft deprecated alias, on native Windows.
It declares a C++ alias called GNULIB_NAMESPACE::func
that redirects to _func, if GNULIB_NAMESPACE is defined.
Example:
_GL_CXXALIAS_MDA (open, int, (const char *filename, int flags, ...));
*/
#define _GL_CXXALIAS_MDA(func,rettype,parameters) \
_GL_CXXALIAS_RPL_1 (func, _##func, rettype, parameters)
/* _GL_CXXALIAS_RPL_CAST_1 (func, rpl_func, rettype, parameters);
is like _GL_CXXALIAS_RPL_1 (func, rpl_func, rettype, parameters);
except that the C function rpl_func may have a slightly different
@@ -171,6 +207,14 @@
_GL_EXTERN_C int _gl_cxxalias_dummy
#endif
/* _GL_CXXALIAS_MDA_CAST (func, rettype, parameters);
is like _GL_CXXALIAS_MDA (func, rettype, parameters);
except that the C function func may have a slightly different declaration.
A cast is used to silence the "invalid conversion" error that would
otherwise occur. */
#define _GL_CXXALIAS_MDA_CAST(func,rettype,parameters) \
_GL_CXXALIAS_RPL_CAST_1 (func, _##func, rettype, parameters)
/* _GL_CXXALIAS_SYS (func, rettype, parameters);
declares a C++ alias called GNULIB_NAMESPACE::func
that redirects to the system provided function func, if GNULIB_NAMESPACE
@@ -266,14 +310,14 @@
_GL_CXXALIASWARN_1 (func, GNULIB_NAMESPACE)
# define _GL_CXXALIASWARN_1(func,namespace) \
_GL_CXXALIASWARN_2 (func, namespace)
/* To work around GCC bug <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43881>,
/* To work around GCC bug <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=43881>,
we enable the warning only when not optimizing. */
# if !__OPTIMIZE__
# if !(defined __GNUC__ && !defined __clang__ && __OPTIMIZE__)
# define _GL_CXXALIASWARN_2(func,namespace) \
_GL_WARN_ON_USE (func, \
"The symbol ::" #func " refers to the system function. " \
"Use " #namespace "::" #func " instead.")
# elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
# elif (__GNUC__ >= 3 || defined __clang__) && GNULIB_STRICT_CHECKING
# define _GL_CXXALIASWARN_2(func,namespace) \
extern __typeof__ (func) func
# else
@@ -294,16 +338,13 @@
GNULIB_NAMESPACE)
# define _GL_CXXALIASWARN1_1(func,rettype,parameters_and_attributes,namespace) \
_GL_CXXALIASWARN1_2 (func, rettype, parameters_and_attributes, namespace)
/* To work around GCC bug <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43881>,
/* To work around GCC bug <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=43881>,
we enable the warning only when not optimizing. */
# if !__OPTIMIZE__
# if !(defined __GNUC__ && !defined __clang__ && __OPTIMIZE__)
# define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \
_GL_WARN_ON_USE_CXX (func, rettype, parameters_and_attributes, \
_GL_WARN_ON_USE_CXX (func, rettype, rettype, parameters_and_attributes, \
"The symbol ::" #func " refers to the system function. " \
"Use " #namespace "::" #func " instead.")
# elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
# define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \
extern __typeof__ (func) func
# else
# define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \
_GL_EXTERN_C int _gl_cxxalias_dummy
@@ -0,0 +1,61 @@
/* Case-insensitive string comparison functions in C locale.
Copyright (C) 1995-1996, 2001, 2003, 2005, 2009-2025 Free Software
Foundation, Inc.
This file 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 2.1 of the
License, or (at your option) any later version.
This file 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 <https://www.gnu.org/licenses/>. */
#ifndef C_STRCASE_H
#define C_STRCASE_H
/* This file uses _GL_ATTRIBUTE_PURE. */
#if !_GL_CONFIG_H_INCLUDED
#error "Please include config.h first."
#endif
#include <stddef.h>
/* The functions defined in this file assume the "C" locale and a character
set without diacritics (ASCII-US or EBCDIC-US or something like that).
Even if the "C" locale on a particular system is an extension of the ASCII
character set (like on BeOS, where it is UTF-8, or on AmigaOS, where it
is ISO-8859-1), the functions in this file recognize only the ASCII
characters. More precisely, one of the string arguments must be an ASCII
string; the other one can also contain non-ASCII characters (but then
the comparison result will be nonzero). */
#ifdef __cplusplus
extern "C" {
#endif
/* Compare strings S1 and S2, ignoring case, returning less than, equal to or
greater than zero if S1 is lexicographically less than, equal to or greater
than S2. */
extern int c_strcasecmp (const char *s1, const char *s2) _GL_ATTRIBUTE_PURE;
/* Compare no more than N characters of strings S1 and S2, ignoring case,
returning less than, equal to or greater than zero if S1 is
lexicographically less than, equal to or greater than S2. */
extern int c_strncasecmp (const char *s1, const char *s2, size_t n)
_GL_ATTRIBUTE_PURE;
#ifdef __cplusplus
}
#endif
#endif /* C_STRCASE_H */
@@ -0,0 +1,76 @@
/* c-strcasestr.c -- case insensitive substring search in C locale
Copyright (C) 2005-2025 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2005.
This file 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 2.1 of the
License, or (at your option) any later version.
This file 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 <https://www.gnu.org/licenses/>. */
#include <config.h>
/* Specification. */
#include "c-strcasestr.h"
#include <string.h>
#include "c-ctype.h"
#include "c-strcase.h"
/* Two-Way algorithm. */
#define RETURN_TYPE char *
#define AVAILABLE(h, h_l, j, n_l) \
(!memchr ((h) + (h_l), '\0', (j) + (n_l) - (h_l)) \
&& ((h_l) = (j) + (n_l)))
#define CANON_ELEMENT c_tolower
#define CMP_FUNC(p1, p2, l) \
c_strncasecmp ((const char *) (p1), (const char *) (p2), l)
#include "str-two-way.h"
/* Find the first occurrence of NEEDLE in HAYSTACK, using case-insensitive
comparison from the C locale, regardless of the current locale. */
char *
c_strcasestr (const char *haystack_start, const char *needle_start)
{
const char *haystack = haystack_start;
const char *needle = needle_start;
size_t needle_len; /* Length of NEEDLE. */
size_t haystack_len; /* Known minimum length of HAYSTACK. */
bool ok = true; /* True if NEEDLE is prefix of HAYSTACK. */
/* Determine length of NEEDLE, and in the process, make sure
HAYSTACK is at least as long (no point processing all of a long
NEEDLE if HAYSTACK is too short). */
while (*haystack && *needle)
ok &= (c_tolower ((unsigned char) *haystack++)
== c_tolower ((unsigned char) *needle++));
if (*needle)
return NULL;
if (ok)
return (char *) haystack_start;
needle_len = needle - needle_start;
haystack = haystack_start + 1;
haystack_len = needle_len - 1;
/* Perform the search. Abstract memory is considered to be an array
of 'unsigned char' values, not an array of 'char' values. See
ISO C 99 section 6.2.6.1. */
if (needle_len < LONG_NEEDLE_THRESHOLD)
return two_way_short_needle ((const unsigned char *) haystack,
haystack_len,
(const unsigned char *) needle_start,
needle_len);
return two_way_long_needle ((const unsigned char *) haystack, haystack_len,
(const unsigned char *) needle_start,
needle_len);
}
#undef LONG_NEEDLE_THRESHOLD
@@ -0,0 +1,36 @@
/* Case-insensitive searching in a string in C locale.
Copyright (C) 2005, 2009-2025 Free Software Foundation, Inc.
This file 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 2.1 of the
License, or (at your option) any later version.
This file 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 <https://www.gnu.org/licenses/>. */
#ifndef C_STRCASESTR_H
#define C_STRCASESTR_H
#ifdef __cplusplus
extern "C" {
#endif
/* Find the first occurrence of NEEDLE in HAYSTACK, using case-insensitive
comparison. */
extern char *c_strcasestr (const char *haystack, const char *needle);
#ifdef __cplusplus
}
#endif
#endif /* C_STRCASESTR_H */
@@ -1,18 +1,18 @@
/* c-strncasecmp.c -- case insensitive string comparator in C locale
Copyright (C) 1998-1999, 2005-2006, 2009-2017 Free Software Foundation, Inc.
Copyright (C) 1998-1999, 2005-2006, 2009-2025 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 file 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 2.1 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
This file 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.
GNU Lesser 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 <http://www.gnu.org/licenses/>. */
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>. */
#include <config.h>
@@ -52,5 +52,5 @@ c_strncasecmp (const char *s1, const char *s2, size_t n)
/* On machines where 'char' and 'int' are types of the same size, the
difference of two 'unsigned char' values - including the sign bit -
doesn't fit in an 'int'. */
return (c1 > c2 ? 1 : c1 < c2 ? -1 : 0);
return _GL_CMP (c1, c2);
}
@@ -0,0 +1,132 @@
/* Convert 32-bit wide character to multibyte character.
Copyright (C) 2020-2025 Free Software Foundation, Inc.
This file 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 2.1 of the
License, or (at your option) any later version.
This file 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 <https://www.gnu.org/licenses/>. */
/* Written by Bruno Haible <bruno@clisp.org>, 2020. */
#include <config.h>
/* Specification. */
#include <uchar.h>
#include <errno.h>
#include <wchar.h>
#include "attribute.h" /* FALLTHROUGH */
#include "localcharset.h"
#include "streq.h"
#if GL_CHAR32_T_IS_UNICODE
# include "lc-charset-unicode.h"
#endif
size_t
c32rtomb (char *s, char32_t wc, mbstate_t *ps)
#undef c32rtomb
{
#if HAVE_WORKING_MBRTOC32 && HAVE_WORKING_C32RTOMB
# if C32RTOMB_RETVAL_BUG
if (s == NULL)
/* We know the NUL wide character corresponds to the NUL character. */
return 1;
# endif
return c32rtomb (s, wc, ps);
#elif _GL_SMALL_WCHAR_T
if (s == NULL)
return wcrtomb (NULL, 0, ps);
else
{
/* Special-case all encodings that may produce wide character values
> WCHAR_MAX. */
const char *encoding = locale_charset ();
if (STREQ_OPT (encoding, "UTF-8", 'U', 'T', 'F', '-', '8', 0, 0, 0, 0))
{
/* Special-case the UTF-8 encoding. Assume that the wide-character
encoding in a UTF-8 locale is UCS-2 or, equivalently, UTF-16. */
if (wc < 0x80)
{
s[0] = (unsigned char) wc;
return 1;
}
else
{
int count;
if (wc < 0x800)
count = 2;
else if (wc < 0x10000)
{
if (wc < 0xd800 || wc >= 0xe000)
count = 3;
else
{
errno = EILSEQ;
return (size_t)(-1);
}
}
else if (wc < 0x110000)
count = 4;
else
{
errno = EILSEQ;
return (size_t)(-1);
}
switch (count) /* note: code falls through cases! */
{
case 4: s[3] = 0x80 | (wc & 0x3f); wc = wc >> 6; wc |= 0x10000;
FALLTHROUGH;
case 3: s[2] = 0x80 | (wc & 0x3f); wc = wc >> 6; wc |= 0x800;
FALLTHROUGH;
case 2: s[1] = 0x80 | (wc & 0x3f); wc = wc >> 6; wc |= 0xc0;
/*case 1:*/ s[0] = wc;
}
return count;
}
}
else
{
if ((wchar_t) wc == wc)
return wcrtomb (s, (wchar_t) wc, ps);
else
{
errno = EILSEQ;
return (size_t)(-1);
}
}
}
#else
/* char32_t and wchar_t are equivalent. */
# if GL_CHAR32_T_IS_UNICODE && GL_CHAR32_T_VS_WCHAR_T_NEEDS_CONVERSION
if (wc != 0)
{
wc = unicode_to_locale_encoding (wc);
if (wc == 0)
{
errno = EILSEQ;
return (size_t)(-1);
}
}
# endif
return wcrtomb (s, (wchar_t) wc, ps);
#endif
}
@@ -0,0 +1,70 @@
/* Convert 32-bit wide character to unibyte character.
Copyright (C) 2020-2025 Free Software Foundation, Inc.
This file 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 file 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 <https://www.gnu.org/licenses/>. */
/* Written by Bruno Haible <bruno@clisp.org>, 2020. */
#include <config.h>
#define IN_C32TOB
/* Specification. */
#include <uchar.h>
#include <stdio.h>
#include <string.h>
#include <wchar.h>
#if GL_CHAR32_T_IS_UNICODE
# include "lc-charset-unicode.h"
#endif
#if _GL_WCHAR_T_IS_UCS4
_GL_EXTERN_INLINE
#endif
int
c32tob (wint_t wc)
{
#if HAVE_WORKING_MBRTOC32 && HAVE_WORKING_C32RTOMB && !_GL_WCHAR_T_IS_UCS4
/* The char32_t encoding of a multibyte character may be different than its
wchar_t encoding. */
if (wc != WEOF)
{
mbstate_t state;
char buf[8];
mbszero (&state);
if (c32rtomb (buf, wc, &state) == 1)
return (unsigned char) buf[0];
}
return EOF;
#elif _GL_SMALL_WCHAR_T
/* In all known encodings, unibyte characters correspond only to
characters in the BMP. */
if (wc != WEOF && (wchar_t) wc == wc)
return wctob ((wchar_t) wc);
else
return EOF;
#else
# if GL_CHAR32_T_IS_UNICODE && GL_CHAR32_T_VS_WCHAR_T_NEEDS_CONVERSION
if (wc != 0)
{
wc = unicode_to_locale_encoding (wc);
if (wc == 0)
return EOF;
}
# endif
return wctob (wc);
#endif
}
@@ -0,0 +1,73 @@
/* Construct a full filename from a directory and a relative filename.
Copyright (C) 2001-2004, 2006-2025 Free Software Foundation, Inc.
This file 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 2.1 of the
License, or (at your option) any later version.
This file 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 <https://www.gnu.org/licenses/>. */
/* Written by Bruno Haible <haible@clisp.cons.org>. */
#include <config.h>
/* Specification. */
#include "concat-filename.h"
#include <errno.h>
#include <stdlib.h>
#include <string.h>
#include "filename.h"
/* Concatenate a directory filename, a relative filename and an optional
suffix. The directory may end with the directory separator. The second
argument may not start with the directory separator (it is relative).
Return a freshly allocated filename. Return NULL and set errno
upon memory allocation failure. */
char *
concatenated_filename (const char *directory, const char *filename,
const char *suffix)
{
char *result;
char *p;
if (strcmp (directory, ".") == 0)
{
/* No need to prepend the directory. */
result = (char *) malloc (strlen (filename)
+ (suffix != NULL ? strlen (suffix) : 0)
+ 1);
if (result == NULL)
return NULL; /* errno is set here */
p = result;
}
else
{
size_t directory_len = strlen (directory);
int need_slash =
(directory_len > FILE_SYSTEM_PREFIX_LEN (directory)
&& !ISSLASH (directory[directory_len - 1]));
result = (char *) malloc (directory_len + need_slash
+ strlen (filename)
+ (suffix != NULL ? strlen (suffix) : 0)
+ 1);
if (result == NULL)
return NULL; /* errno is set here */
memcpy (result, directory, directory_len);
p = result + directory_len;
if (need_slash)
*p++ = '/';
}
p = stpcpy (p, filename);
if (suffix != NULL)
stpcpy (p, suffix);
return result;
}
@@ -0,0 +1,51 @@
/* Construct a full filename from a directory and a relative filename.
Copyright (C) 2001-2004, 2007-2025 Free Software Foundation, Inc.
This file 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 2.1 of the
License, or (at your option) any later version.
This file 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 <https://www.gnu.org/licenses/>. */
#ifndef _CONCAT_FILENAME_H
#define _CONCAT_FILENAME_H
/* This file uses _GL_ATTRIBUTE_MALLOC, _GL_ATTRIBUTE_RETURNS_NONNULL. */
#if !_GL_CONFIG_H_INCLUDED
#error "Please include config.h first."
#endif
#include <stdlib.h>
#ifdef __cplusplus
extern "C" {
#endif
/* Concatenate a directory filename, a relative filename and an optional
suffix. Return a freshly allocated filename. Return NULL and set errno
upon memory allocation failure. */
extern char *concatenated_filename (const char *directory,
const char *filename, const char *suffix)
_GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE;
/* Concatenate a directory filename, a relative filename and an optional
suffix. Return a freshly allocated filename. */
extern char *xconcatenated_filename (const char *directory,
const char *filename, const char *suffix)
_GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE
_GL_ATTRIBUTE_RETURNS_NONNULL;
#ifdef __cplusplus
}
#endif
#endif /* _CONCAT_FILENAME_H */
@@ -1,19 +1,19 @@
/* connect.c --- wrappers for Windows connect function
Copyright (C) 2008-2017 Free Software Foundation, Inc.
Copyright (C) 2008-2025 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 file 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 2.1 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
This file 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.
GNU Lesser 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 <http://www.gnu.org/licenses/>. */
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* Written by Paolo Bonzini */
@@ -1,10 +1,10 @@
/* Convert double to timespec.
Copyright (C) 2011-2017 Free Software Foundation, Inc.
Copyright (C) 2011-2025 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
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,
@@ -13,7 +13,7 @@
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 <http://www.gnu.org/licenses/>. */
along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* written by Paul Eggert */
@@ -32,20 +32,20 @@ dtotimespec (double sec)
if (! (TYPE_MINIMUM (time_t) < sec))
return make_timespec (TYPE_MINIMUM (time_t), 0);
else if (! (sec < 1.0 + TYPE_MAXIMUM (time_t)))
return make_timespec (TYPE_MAXIMUM (time_t), TIMESPEC_RESOLUTION - 1);
return make_timespec (TYPE_MAXIMUM (time_t), TIMESPEC_HZ - 1);
else
{
time_t s = sec;
double frac = TIMESPEC_RESOLUTION * (sec - s);
double frac = TIMESPEC_HZ * (sec - s);
long ns = frac;
ns += ns < frac;
s += ns / TIMESPEC_RESOLUTION;
ns %= TIMESPEC_RESOLUTION;
s += ns / TIMESPEC_HZ;
ns %= TIMESPEC_HZ;
if (ns < 0)
{
s--;
ns += TIMESPEC_RESOLUTION;
ns += TIMESPEC_HZ;
}
return make_timespec (s, ns);
@@ -1,18 +1,18 @@
/* Open a stream with a given file descriptor.
Copyright (C) 2011-2017 Free Software Foundation, Inc.
Copyright (C) 2011-2025 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 file 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 2.1 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
This file 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.
GNU Lesser 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 <http://www.gnu.org/licenses/>. */
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>. */
#include <config.h>
@@ -27,7 +27,8 @@
#undef fdopen
#if HAVE_MSVC_INVALID_PARAMETER_HANDLER
#if defined _WIN32 && !defined __CYGWIN__
# if HAVE_MSVC_INVALID_PARAMETER_HANDLER
static FILE *
fdopen_nothrow (int fd, const char *mode)
{
@@ -35,7 +36,7 @@ fdopen_nothrow (int fd, const char *mode)
TRY_MSVC_INVAL
{
result = fdopen (fd, mode);
result = _fdopen (fd, mode);
}
CATCH_MSVC_INVAL
{
@@ -45,6 +46,9 @@ fdopen_nothrow (int fd, const char *mode)
return result;
}
# else
# define fdopen_nothrow _fdopen
# endif
#else
# define fdopen_nothrow fdopen
#endif
@@ -1,19 +1,19 @@
/* Supplemental information about the floating-point formats.
Copyright (C) 2007, 2009-2017 Free Software Foundation, Inc.
Copyright (C) 2007, 2009-2025 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2007.
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 file 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 2.1 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
This file 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.
GNU Lesser 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 <http://www.gnu.org/licenses/>. */
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>. */
#ifndef _FLOATPLUS_H
#define _FLOATPLUS_H
@@ -0,0 +1,120 @@
/* Auxiliary definitions for <float.h>.
Copyright (C) 2011-2025 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2011.
This file 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 2.1 of the
License, or (at your option) any later version.
This file 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 <https://www.gnu.org/licenses/>. */
#include <config.h>
/* Specification. */
#include <float.h>
#if GNULIB_defined_long_double_union
# if (defined _ARCH_PPC || defined _POWER) && (defined _AIX || defined __linux__) && (LDBL_MANT_DIG == 106) && defined __GNUC__
const union gl_long_double_union gl_LDBL_MAX =
{ { DBL_MAX, DBL_MAX / (double)134217728UL / (double)134217728UL } };
# elif defined __i386__
const union gl_long_double_union gl_LDBL_MAX =
{ { 0xFFFFFFFF, 0xFFFFFFFF, 32766 } };
# endif
# if defined __i386__ && (defined __FreeBSD__ || defined __DragonFly__)
/* We can't even simply evaluate the formula (LDBL_MIN / 9223372036854775808.0L)
at run time, because it would require BEGIN_LONG_DOUBLE_ROUNDING /
END_LONG_DOUBLE_ROUNDING invocations. It simpler to just write down the
representation of LDBL_TRUE_MIN, based on
<https://en.wikipedia.org/wiki/Extended_precision#x86_extended_precision_format>. */
const union gl_long_double_union gl_LDBL_TRUE_MIN =
{ { 0x00000001, 0x00000000, 0 } };
# endif
#endif
#if GNULIB_defined_FLT_SNAN
/* Define like memory_positive_SNaNf(), see signed-snan.h and snan.h,
or like setpayloadsigf() with an arbitrary payload. */
gl_FLT_SNAN_t gl_FLT_SNAN =
# if FLT_MANT_DIG == 24
# if defined __hppa || (defined __mips__ && !MIPS_NAN2008_FLOAT) || defined __sh__
/* sign bit: 0, 8 exponent bits: all 1, next bit: 1, payload: 0b10...0 */
{ { 0x7FE00000U } }
# else
/* sign bit: 0, 8 exponent bits: all 1, next bit: 0, payload: 0b10...0 */
{ { 0x7FA00000U } }
# endif
# endif
;
#endif
#if GNULIB_defined_DBL_SNAN
/* Define like memory_positive_SNaNd(), see signed-snan.h and snan.h,
or like setpayloadsig() with an arbitrary payload. */
gl_DBL_SNAN_t gl_DBL_SNAN =
# if DBL_MANT_DIG == 53
# if defined __hppa || (defined __mips__ && !MIPS_NAN2008_FLOAT) || defined __sh__
/* sign bit: 0, 11 exponent bits: all 1, next bit: 1, payload: 0b10...0 */
{ { 0x7FFC000000000000ULL } }
# else
/* sign bit: 0, 11 exponent bits: all 1, next bit: 0, payload: 0b10...0 */
{ { 0x7FF4000000000000ULL } }
# endif
# endif
;
#endif
#if GNULIB_defined_LDBL_SNAN
# ifdef WORDS_BIGENDIAN
# define TWO(hi,lo) { hi, lo }
# else
# define TWO(hi,lo) { lo, hi }
# endif
/* Define like memory_positive_SNaNl(), see signed-snan.h and snan.h,
or like setpayloadsigl() with an arbitrary payload. */
gl_LDBL_SNAN_t gl_LDBL_SNAN =
# if LDBL_MANT_DIG == 53 /* on arm, hppa, mips, sh, but also MSVC */
# if defined __hppa || (defined __mips__ && !MIPS_NAN2008_FLOAT) || defined __sh__
/* sign bit: 0, 11 exponent bits: all 1, next bit: 1, payload: 0b10...0 */
{ { 0x7FFC000000000000ULL } }
# else
/* sign bit: 0, 11 exponent bits: all 1, next bit: 0, payload: 0b10...0 */
{ { 0x7FF4000000000000ULL } }
# endif
# elif LDBL_MANT_DIG == 64 /* on i386, x86_64, ia64, m68k */
# if defined __m68k__
/* sign bit: 0, 15 exponent bits: all 1, 16 gap bits: all 0,
always=1 bit: 1, next bit: 0, payload: 0b10...0 */
{ { 0x7FFF0000ULL, 0xA0000000ULL, 0x00000000ULL } }
# else
/* sign bit: 0, 15 exponent bits: all 1, always=1 bit: 1, next bit: 0, payload: 0b10...0
(see <https://en.wikipedia.org/wiki/Extended_precision#x86_extended_precision_format>) */
{ TWO (0x00007FFFULL, 0xA000000000000000ULL) }
# endif
# elif LDBL_MANT_DIG == 106 /* on powerpc, powerpc64, powerpc64le */
/* most-significant double:
sign bit: 0, 11 exponent bits: all 1, next bit: 0, payload: 0b10...0,
least-significant double: 0.0 */
{ { 0x7FF4000000000000ULL, 0ULL } }
# elif LDBL_MANT_DIG == 113 /* on alpha, arm64, loongarch64, mips64, riscv64, s390x, sparc64 */
# if (defined __mips__ && !MIPS_NAN2008_FLOAT)
/* sign bit: 0, 15 exponent bits: all 1, next bit: 1, payload: 0b10...0 */
{ TWO (0x7FFFC00000000000ULL, 0ULL) }
# else
/* sign bit: 0, 15 exponent bits: all 1, next bit: 0, payload: 0b10...0 */
{ TWO (0x7FFF400000000000ULL, 0ULL) }
# endif
# endif
;
#endif
/* This declaration is solely to ensure that after preprocessing
this file is never empty. */
typedef int dummy;
@@ -1,19 +1,19 @@
/* A correct <float.h>.
Copyright (C) 2007-2017 Free Software Foundation, Inc.
Copyright (C) 2007-2025 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 file 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 2.1 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
This file 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.
GNU Lesser 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 <http://www.gnu.org/licenses/>. */
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>. */
#ifndef _@GUARD_PREFIX@_FLOAT_H
@@ -28,6 +28,8 @@
#ifndef _@GUARD_PREFIX@_FLOAT_H
#define _@GUARD_PREFIX@_FLOAT_H
/* ============================ ISO C99 support ============================ */
/* 'long double' properties. */
#if defined __i386__ && (defined __BEOS__ || defined __OpenBSD__)
@@ -62,8 +64,8 @@
/* On FreeBSD/x86 6.4, the 'long double' type really has only 53 bits of
precision in the compiler but 64 bits of precision at runtime. See
<http://lists.gnu.org/archive/html/bug-gnulib/2008-07/msg00063.html>. */
#if defined __i386__ && defined __FreeBSD__
<https://lists.gnu.org/r/bug-gnulib/2008-07/msg00063.html>. */
#if defined __i386__ && (defined __FreeBSD__ || defined __DragonFly__)
/* Number of mantissa units, in base FLT_RADIX. */
# undef LDBL_MANT_DIG
# define LDBL_MANT_DIG 64
@@ -81,7 +83,7 @@
# define LDBL_MAX_EXP 16384
/* Minimum positive normalized number. */
# undef LDBL_MIN
# define LDBL_MIN 3.3621031431120935E-4932L /* = 0x1p-16382L */
# define LDBL_MIN 3.362103143112093506262677817321752E-4932L /* = 0x1p-16382L */
/* Maximum representable finite number. */
# undef LDBL_MAX
/* LDBL_MAX is represented as { 0xFFFFFFFF, 0xFFFFFFFF, 32766 }.
@@ -93,11 +95,14 @@
extern const long double LDBL_MAX;
Unfortunately, this is not a constant expression. */
# if !GNULIB_defined_long_double_union
union gl_long_double_union
{
struct { unsigned int lo; unsigned int hi; unsigned int exponent; } xd;
long double ld;
};
# define GNULIB_defined_long_double_union 1
# endif
extern const union gl_long_double_union gl_LDBL_MAX;
# define LDBL_MAX (gl_LDBL_MAX.ld)
/* Minimum e such that 10^e is in the range of normalized numbers. */
@@ -146,11 +151,14 @@ extern const union gl_long_double_union gl_LDBL_MAX;
Unfortunately, this is not a constant expression, and the latter expression
does not work well when GCC is optimizing.. */
# if !GNULIB_defined_long_double_union
union gl_long_double_union
{
struct { double hi; double lo; } dd;
long double ld;
};
# define GNULIB_defined_long_double_union 1
# endif
extern const union gl_long_double_union gl_LDBL_MAX;
# define LDBL_MAX (gl_LDBL_MAX.ld)
#endif
@@ -173,6 +181,156 @@ extern const union gl_long_double_union gl_LDBL_MAX;
# endif
#endif
/* ============================ ISO C11 support ============================ */
/* 'float' properties */
#ifndef FLT_HAS_SUBNORM
# define FLT_HAS_SUBNORM 1
#endif
#ifndef FLT_DECIMAL_DIG
/* FLT_MANT_DIG = 24 => FLT_DECIMAL_DIG = 9 */
# define FLT_DECIMAL_DIG ((int)(FLT_MANT_DIG * 0.3010299956639812 + 2))
#endif
#if defined _AIX && !defined __GNUC__
/* On AIX, the value of FLT_TRUE_MIN in /usr/include/float.h is a 'double',
not a 'float'. */
# undef FLT_TRUE_MIN
#endif
#ifndef FLT_TRUE_MIN
/* FLT_MIN / 2^(FLT_MANT_DIG-1) */
# define FLT_TRUE_MIN (FLT_MIN / 8388608.0f)
#endif
/* 'double' properties */
#ifndef DBL_HAS_SUBNORM
# define DBL_HAS_SUBNORM 1
#endif
#ifndef DBL_DECIMAL_DIG
/* DBL_MANT_DIG = 53 => DBL_DECIMAL_DIG = 17 */
# define DBL_DECIMAL_DIG ((int)(DBL_MANT_DIG * 0.3010299956639812 + 2))
#endif
#ifndef DBL_TRUE_MIN
/* DBL_MIN / 2^(DBL_MANT_DIG-1) */
# define DBL_TRUE_MIN (DBL_MIN / 4503599627370496.0)
#endif
/* 'long double' properties */
#ifndef LDBL_HAS_SUBNORM
# define LDBL_HAS_SUBNORM 1
#endif
#ifndef LDBL_DECIMAL_DIG
/* LDBL_MANT_DIG = 53 => LDBL_DECIMAL_DIG = 17 */
/* LDBL_MANT_DIG = 64 => LDBL_DECIMAL_DIG = 21 */
/* LDBL_MANT_DIG = 106 => LDBL_DECIMAL_DIG = 33 */
/* LDBL_MANT_DIG = 113 => LDBL_DECIMAL_DIG = 36 */
# define LDBL_DECIMAL_DIG ((int)(LDBL_MANT_DIG * 0.3010299956639812 + 2))
#endif
#ifndef LDBL_TRUE_MIN
/* LDBL_MIN / 2^(LDBL_MANT_DIG-1) */
# if LDBL_MANT_DIG == 53
# define LDBL_TRUE_MIN (LDBL_MIN / 4503599627370496.0L)
# elif LDBL_MANT_DIG == 64
# if defined __i386__ && (defined __FreeBSD__ || defined __DragonFly__)
/* Work around FreeBSD/x86 problem mentioned above. */
extern const union gl_long_double_union gl_LDBL_TRUE_MIN;
# define LDBL_TRUE_MIN (gl_LDBL_TRUE_MIN.ld)
# else
# define LDBL_TRUE_MIN (LDBL_MIN / 9223372036854775808.0L)
# endif
# elif LDBL_MANT_DIG == 106
# define LDBL_TRUE_MIN (LDBL_MIN / 40564819207303340847894502572032.0L)
# elif LDBL_MANT_DIG == 113
# define LDBL_TRUE_MIN (LDBL_MIN / 5192296858534827628530496329220096.0L)
# endif
#endif
/* ============================ ISO C23 support ============================ */
/* 'float' properties */
#ifndef FLT_IS_IEC_60559
# if defined __m68k__
# define FLT_IS_IEC_60559 0
# else
# define FLT_IS_IEC_60559 1
# endif
#endif
#ifndef FLT_NORM_MAX
# define FLT_NORM_MAX FLT_MAX
#endif
#ifndef FLT_SNAN
/* For sh, beware of <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111814>. */
# if ((__GNUC__ + (__GNUC_MINOR__ >= 3) > 3) || defined __clang__) && !defined __sh__
# define FLT_SNAN __builtin_nansf ("")
# else
typedef union { unsigned int word[1]; float value; } gl_FLT_SNAN_t;
extern gl_FLT_SNAN_t gl_FLT_SNAN;
# define FLT_SNAN (gl_FLT_SNAN.value)
# define GNULIB_defined_FLT_SNAN 1
# endif
#endif
/* 'double' properties */
#ifndef DBL_IS_IEC_60559
# if defined __m68k__
# define DBL_IS_IEC_60559 0
# else
# define DBL_IS_IEC_60559 1
# endif
#endif
#ifndef DBL_NORM_MAX
# define DBL_NORM_MAX DBL_MAX
#endif
#ifndef DBL_SNAN
/* For sh, beware of <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111814>. */
# if ((__GNUC__ + (__GNUC_MINOR__ >= 3) > 3) || defined __clang__) && !defined __sh__
# define DBL_SNAN __builtin_nans ("")
# else
typedef union { unsigned long long word[1]; double value; } gl_DBL_SNAN_t;
extern gl_DBL_SNAN_t gl_DBL_SNAN;
# define DBL_SNAN (gl_DBL_SNAN.value)
# define GNULIB_defined_DBL_SNAN 1
# endif
#endif
/* 'long double' properties */
#ifndef LDBL_IS_IEC_60559
# if defined __m68k__
# define LDBL_IS_IEC_60559 0
# elif LDBL_MANT_DIG == 53 || LDBL_MANT_DIG == 113
# define LDBL_IS_IEC_60559 1
# else
# define LDBL_IS_IEC_60559 0
# endif
#endif
#ifndef LDBL_NORM_MAX
# define LDBL_NORM_MAX LDBL_MAX
#endif
#ifndef LDBL_SNAN
/* For sh, beware of <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111814>. */
# if ((__GNUC__ + (__GNUC_MINOR__ >= 3) > 3) || defined __clang__) && !defined __sh__
# define LDBL_SNAN __builtin_nansl ("")
# else
# if LDBL_MANT_DIG == 53
typedef union { unsigned long long word[1]; long double value; } gl_LDBL_SNAN_t;
# elif defined __m68k__
typedef union { unsigned int word[3]; long double value; } gl_LDBL_SNAN_t;
# else
typedef union { unsigned long long word[2]; long double value; } gl_LDBL_SNAN_t;
# endif
extern gl_LDBL_SNAN_t gl_LDBL_SNAN;
# define LDBL_SNAN (gl_LDBL_SNAN.value)
# define GNULIB_defined_LDBL_SNAN 1
# endif
#endif
/* ================================= Other ================================= */
#if @REPLACE_ITOLD@
/* Pull in a function that fixes the 'int' to 'long double' conversion
of glibc 2.7. */
@@ -1,19 +1,19 @@
/* Manipulating the FPU control word. -*- coding: utf-8 -*-
Copyright (C) 2007-2017 Free Software Foundation, Inc.
Copyright (C) 2007-2025 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2007.
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 file 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 2.1 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
This file 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.
GNU Lesser 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 <http://www.gnu.org/licenses/>. */
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>. */
#ifndef _FPUCW_H
#define _FPUCW_H
@@ -35,15 +35,15 @@
The FPU control word is under control of the application, i.e. it is
not required to be set either way by the ABI. (In fact, the i386 ABI
http://refspecs.freestandards.org/elf/abi386-4.pdf page 3-12 = page 38
https://www.linux-mips.org/pub/linux/mips/doc/ABI/abi386-4.pdf page 3-12 = page 38
is not clear about it. But in any case, gcc treats the control word
like a "preserved" register: it emits code that assumes that the control
word is preserved across calls, and it restores the control word at the
end of functions that modify it.)
See Vincent Lefèvre's page http://www.vinc17.org/research/extended.en.html
See Vincent Lefèvre's page https://www.vinc17.net/research/extended.en.html
for a good explanation.
See http://www.uwsg.iu.edu/hypermail/linux/kernel/0103.0/0453.html for
See https://web.archive.org/web/20060905133417/http://www.uwsg.iu.edu/hypermail/linux/kernel/0103.0/0453.html
some argumentation which setting should be the default. */
/* This header file provides the following facilities:
@@ -61,8 +61,13 @@
'long double' safe operation precision
*/
/* Inline assembler like this works only with GNU C. */
#if (defined __i386__ || defined __x86_64__) && defined __GNUC__
#ifdef __cplusplus
extern "C" {
#endif
/* Inline assembler like this works only with GNU C and clang. */
#if (defined __i386__ || defined __x86_64__) && (defined __GNUC__ || defined __clang__)
typedef unsigned short fpucw_t; /* glibc calls this fpu_control_t */
@@ -70,12 +75,12 @@ typedef unsigned short fpucw_t; /* glibc calls this fpu_control_t */
# define FPU_PC_DOUBLE 0x200 /* glibc calls this _FPU_DOUBLE */
# define FPU_PC_EXTENDED 0x300 /* glibc calls this _FPU_EXTENDED */
# define GET_FPUCW() \
# define GET_FPUCW() __extension__ \
({ fpucw_t _cw; \
__asm__ __volatile__ ("fnstcw %0" : "=m" (*&_cw)); \
_cw; \
})
# define SET_FPUCW(word) \
# define SET_FPUCW(word) __extension__ \
(void)({ fpucw_t _ncw = (word); \
__asm__ __volatile__ ("fldcw %0" : : "m" (*&_ncw)); \
})
@@ -105,4 +110,9 @@ typedef unsigned int fpucw_t;
#endif
#ifdef __cplusplus
}
#endif
#endif /* _FPUCW_H */
@@ -0,0 +1,5 @@
int
main (void)
{
return do_test ();
}
@@ -0,0 +1,225 @@
/* Common test support for <stdbit.h> tests.
Copyright (C) 2024-2025 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library 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 2.1 of the License, or (at your option) any later version.
The GNU C Library 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 the GNU C Library; if not, see
<https://www.gnu.org/licenses/>. */
#ifndef _TST_STDBIT_H
#define _TST_STDBIT_H
#if GNULIB_TEST_STDBIT
# include <libc-config.h>
#endif
#include <stdbit.h>
#include <stdbool.h>
#if !GNULIB_TEST_STDBIT
# include <array_length.h>
# include <support/check.h>
#else
# include <stdint.h>
# include <macros.h>
# define array_length(a) (sizeof (a) / sizeof *(a))
# define TEST_COMPARE(a, b) ASSERT ((a) == (b))
#endif
struct stdbit_test
{
/* The test input. */
uint64_t x;
/* Expected results if that test input is converted to 8, 16, 32 or
64 bits and then passed to the function under test for that
width. */
uint64_t res_8, res_16, res_32, res_64;
};
#if !GNULIB_TEST_STDBIT
# define TEST_TYPE(EXPR, TYPE) \
_Static_assert (_Generic ((EXPR), TYPE: 1, default: 0), "bad type")
#elif ((defined __GNUC__ && 2 <= __GNUC__) \
|| (defined __clang_major__ && 4 <= __clang_major__) \
|| (defined __IBMC__ && 1210 <= __IBMC__ && defined __IBM__TYPEOF__) \
|| (defined __SUNPRO_C && 0x5110 <= __SUNPRO_C && !__STDC__) \
|| 202311 <= __STDC_VERSION__)
# if __HAVE_GENERIC_SELECTION
# define TEST_TYPE(EXPR, TYPE) \
static_assert (_Generic (EXPR, TYPE: 1, default: 0))
# else
# define TEST_TYPE(EXPR, TYPE) static_assert (sizeof (EXPR) == sizeof (TYPE))
# endif
#else
/* A pre-C11 platform that lacks typeof. */
# define TEST_TYPE(EXPR, TYPE) static_assert (sizeof (TYPE) <= sizeof (EXPR))
#endif
/* Test a <stdbit.h> function / macro. For each function family, and
each input type, we test both with and without macros from the
header being used, both with a possibly wider argument being passed
(that must be truncated by the prototype) and with the argument
truncated in the caller, as well as testing the type-generic macro
(with the argument truncated in the caller). Also test that the
results have the correct type; also test truncation from
floating-point arguments (valid for functions, including with macro
expansion, because the prototype must implicitly convert to integer
type; not valid for the type-generic macros). Also test that the
argument is evaluated exactly once. Also test the macros are
usable (e.g. in typeof) at top level (GCC doesn't allow ({})
outside functions: bug 93239). */
#define TEST_STDBIT_T(FUNC, X, RES, TTYPE, TYPE, SUFFIX) \
do \
{ \
TEST_COMPARE (FUNC ## SUFFIX (X), (RES)); \
TEST_TYPE (FUNC ## SUFFIX (X), TTYPE); \
TEST_COMPARE ((FUNC ## SUFFIX) (X), (RES)); \
TEST_TYPE ((FUNC ## SUFFIX) (X), TTYPE); \
TEST_COMPARE (FUNC ## SUFFIX ((TYPE) (X)), (RES)); \
TEST_TYPE (FUNC ## SUFFIX ((TYPE) (X)), TTYPE); \
TEST_COMPARE ((FUNC ## SUFFIX) ((TYPE) (X)), (RES)); \
TEST_TYPE ((FUNC ## SUFFIX) ((TYPE) (X)), TTYPE); \
TEST_COMPARE (FUNC ((TYPE) (X)), (RES)); \
TEST_TYPE (FUNC ((TYPE) (X)), TTYPE); \
if (sizeof (TYPE) <= 2) \
{ \
TEST_COMPARE (FUNC ## SUFFIX ((float) (TYPE) (X)), (RES)); \
TEST_TYPE (FUNC ## SUFFIX ((float) (TYPE) (X)), TTYPE); \
TEST_COMPARE ((FUNC ## SUFFIX) ((float) (TYPE) (X)), (RES)); \
TEST_TYPE ((FUNC ## SUFFIX) ((float) (TYPE) (X)), TTYPE); \
} \
if (sizeof (TYPE) <= 4) \
{ \
TEST_COMPARE (FUNC ## SUFFIX ((double) (TYPE) (X)), (RES)); \
TEST_TYPE (FUNC ## SUFFIX ((double) (TYPE) (X)), TTYPE); \
TEST_COMPARE ((FUNC ## SUFFIX) ((double) (TYPE) (X)), (RES)); \
TEST_TYPE ((FUNC ## SUFFIX) ((double) (TYPE) (X)), TTYPE); \
TEST_COMPARE (FUNC ## SUFFIX ((long double) (TYPE) (X)), (RES)); \
TEST_TYPE (FUNC ## SUFFIX ((long double) (TYPE) (X)), TTYPE); \
TEST_COMPARE ((FUNC ## SUFFIX) ((long double) (TYPE) (X)), (RES)); \
TEST_TYPE ((FUNC ## SUFFIX) ((long double) (TYPE) (X)), TTYPE); \
} \
TYPE xt = (X); \
TEST_COMPARE (FUNC ## SUFFIX (xt++), (RES)); \
TEST_COMPARE (xt, (TYPE) ((X) + 1)); \
xt = (X); \
TEST_COMPARE (FUNC (xt++), (RES)); \
TEST_COMPARE (xt, (TYPE) ((X) + 1)); \
} \
while (0)
#define TEST_STDBIT_UI(FUNC, INPUTS) \
do \
for (int i = 0; i < array_length (INPUTS); i++) \
{ \
uint64_t x = (INPUTS)[i].x; \
unsigned int res_8 = (INPUTS)[i].res_8; \
unsigned int res_16 = (INPUTS)[i].res_16; \
unsigned int res_32 = (INPUTS)[i].res_32; \
unsigned int res_64 = (INPUTS)[i].res_64; \
unsigned int res_l = (sizeof (long int) == 4 \
? res_32 : res_64); \
TEST_STDBIT_T (FUNC, x, res_8, unsigned int, \
unsigned char, _uc); \
TEST_STDBIT_T (FUNC, x, res_16, unsigned int, \
unsigned short, _us); \
TEST_STDBIT_T (FUNC, x, res_32, unsigned int, \
unsigned int, _ui); \
TEST_STDBIT_T (FUNC, x, res_l, unsigned int, \
unsigned long int, _ul); \
TEST_STDBIT_T (FUNC, x, res_64, unsigned int, \
unsigned long long int, _ull); \
} \
while (0)
#define TEST_STDBIT_BOOL(FUNC, INPUTS) \
do \
for (int i = 0; i < array_length (INPUTS); i++) \
{ \
uint64_t x = (INPUTS)[i].x; \
bool res_8 = (INPUTS)[i].res_8; \
bool res_16 = (INPUTS)[i].res_16; \
bool res_32 = (INPUTS)[i].res_32; \
bool res_64 = (INPUTS)[i].res_64; \
bool res_l = (sizeof (long int) == 4 ? res_32 : res_64); \
TEST_STDBIT_T (FUNC, x, res_8, _Bool, unsigned char, _uc); \
TEST_STDBIT_T (FUNC, x, res_16, _Bool, unsigned short, _us); \
TEST_STDBIT_T (FUNC, x, res_32, _Bool, unsigned int, _ui); \
TEST_STDBIT_T (FUNC, x, res_l, _Bool, unsigned long int, _ul); \
TEST_STDBIT_T (FUNC, x, res_64, _Bool, \
unsigned long long int, _ull); \
} \
while (0)
#define TEST_STDBIT_SAME(FUNC, INPUTS) \
do \
for (int i = 0; i < array_length (INPUTS); i++) \
{ \
uint64_t x = (INPUTS)[i].x; \
unsigned char res_8 = (INPUTS)[i].res_8; \
unsigned short res_16 = (INPUTS)[i].res_16; \
unsigned int res_32 = (INPUTS)[i].res_32; \
unsigned long long int res_64 = (INPUTS)[i].res_64; \
unsigned long int res_l = (sizeof (long int) == 4 \
? res_32 : res_64); \
TEST_STDBIT_T (FUNC, x, res_8, unsigned char, \
unsigned char, _uc); \
TEST_STDBIT_T (FUNC, x, res_16, unsigned short, \
unsigned short, _us); \
TEST_STDBIT_T (FUNC, x, res_32, unsigned int, \
unsigned int, _ui); \
TEST_STDBIT_T (FUNC, x, res_l, unsigned long int, \
unsigned long int, _ul); \
TEST_STDBIT_T (FUNC, x, res_64, unsigned long long int, \
unsigned long long int, _ull); \
} \
while (0)
#define TEST_STDBIT_UI_TOPLEVEL(FUNC) \
TEST_TYPE (FUNC ## _uc ((unsigned char) 0), unsigned int); \
TEST_TYPE (FUNC ((unsigned char) 0), unsigned int); \
TEST_TYPE (FUNC ## _us ((unsigned short) 0), unsigned int); \
TEST_TYPE (FUNC ((unsigned short) 0), unsigned int); \
TEST_TYPE (FUNC ## _ui (0U), unsigned int); \
TEST_TYPE (FUNC (0U), unsigned int); \
TEST_TYPE (FUNC ## _ul (0UL), unsigned int); \
TEST_TYPE (FUNC (0UL), unsigned int); \
TEST_TYPE (FUNC ## _ull (0ULL), unsigned int); \
TEST_TYPE (FUNC (0ULL), unsigned int)
#define TEST_STDBIT_BOOL_TOPLEVEL(FUNC) \
TEST_TYPE (FUNC ## _uc ((unsigned char) 0), _Bool); \
TEST_TYPE (FUNC ((unsigned char) 0), _Bool); \
TEST_TYPE (FUNC ## _us ((unsigned short) 0), _Bool); \
TEST_TYPE (FUNC ((unsigned short) 0), _Bool); \
TEST_TYPE (FUNC ## _ui (0U), _Bool); \
TEST_TYPE (FUNC (0U), _Bool); \
TEST_TYPE (FUNC ## _ul (0UL), _Bool); \
TEST_TYPE (FUNC (0UL), _Bool); \
TEST_TYPE (FUNC ## _ull (0ULL), _Bool); \
TEST_TYPE (FUNC (0ULL), _Bool)
#define TEST_STDBIT_SAME_TOPLEVEL(FUNC) \
TEST_TYPE (FUNC ## _uc ((unsigned char) 0), unsigned char); \
TEST_TYPE (FUNC ((unsigned char) 0), unsigned char); \
TEST_TYPE (FUNC ## _us ((unsigned short) 0), unsigned short); \
TEST_TYPE (FUNC ((unsigned short) 0), unsigned short); \
TEST_TYPE (FUNC ## _ui (0U), unsigned int); \
TEST_TYPE (FUNC (0U), unsigned int); \
TEST_TYPE (FUNC ## _ul (0UL), unsigned long int); \
TEST_TYPE (FUNC (0UL), unsigned long int); \
TEST_TYPE (FUNC ## _ull (0ULL), unsigned long long int); \
TEST_TYPE (FUNC (0ULL), unsigned long long int)
#endif
@@ -0,0 +1,88 @@
/* Test stdc_bit_width functions and macros.
Copyright (C) 2024-2025 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library 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 2.1 of the License, or (at your option) any later version.
The GNU C Library 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 the GNU C Library; if not, see
<https://www.gnu.org/licenses/>. */
#include <tst-stdbit.h>
static const struct stdbit_test inputs[] =
{
{ 0ULL, 0, 0, 0, 0 },
{ 0x1ULL, 1, 1, 1, 1 },
{ 0x2ULL, 2, 2, 2, 2 },
{ 0x3ULL, 2, 2, 2, 2 },
{ 0x4ULL, 3, 3, 3, 3 },
{ 0x5ULL, 3, 3, 3, 3 },
{ 0x6ULL, 3, 3, 3, 3 },
{ 0x7ULL, 3, 3, 3, 3 },
{ 0x8ULL, 4, 4, 4, 4 },
{ 0x9ULL, 4, 4, 4, 4 },
{ 0xaULL, 4, 4, 4, 4 },
{ 0xbULL, 4, 4, 4, 4 },
{ 0xcULL, 4, 4, 4, 4 },
{ 0xdULL, 4, 4, 4, 4 },
{ 0xeULL, 4, 4, 4, 4 },
{ 0xfULL, 4, 4, 4, 4 },
{ 0x10ULL, 5, 5, 5, 5 },
{ 0x11ULL, 5, 5, 5, 5 },
{ 0x12ULL, 5, 5, 5, 5 },
{ 0x1fULL, 5, 5, 5, 5 },
{ 0x20ULL, 6, 6, 6, 6 },
{ 0x7fULL, 7, 7, 7, 7 },
{ 0x80ULL, 8, 8, 8, 8 },
{ 0x81ULL, 8, 8, 8, 8 },
{ 0x9aULL, 8, 8, 8, 8 },
{ 0xf3ULL, 8, 8, 8, 8 },
{ 0xffULL, 8, 8, 8, 8 },
{ 0x100ULL, 0, 9, 9, 9 },
{ 0x101ULL, 1, 9, 9, 9 },
{ 0x102ULL, 2, 9, 9, 9 },
{ 0x1feULL, 8, 9, 9, 9 },
{ 0x1ffULL, 8, 9, 9, 9 },
{ 0x200ULL, 0, 10, 10, 10 },
{ 0x234ULL, 6, 10, 10, 10 },
{ 0x4567ULL, 7, 15, 15, 15 },
{ 0x7fffULL, 8, 15, 15, 15 },
{ 0x8000ULL, 0, 16, 16, 16 },
{ 0x8001ULL, 1, 16, 16, 16 },
{ 0xfffeULL, 8, 16, 16, 16 },
{ 0xffffULL, 8, 16, 16, 16 },
{ 0x10000ULL, 0, 0, 17, 17 },
{ 0x10001ULL, 1, 1, 17, 17 },
{ 0xfedcba98ULL, 8, 16, 32, 32 },
{ 0xfffffefeULL, 8, 16, 32, 32 },
{ 0xffffffffULL, 8, 16, 32, 32 },
{ 0x100000000ULL, 0, 0, 0, 33 },
{ 0x100000001ULL, 1, 1, 1, 33 },
{ 0x123456789ULL, 8, 15, 30, 33 },
{ 0x123456789abcdefULL, 8, 16, 32, 57 },
{ 0x789abcdef0123456ULL, 7, 14, 32, 63 },
{ 0x8000000000000000ULL, 0, 0, 0, 64 },
{ 0x8000000000000001ULL, 1, 1, 1, 64 },
{ 0xfffffffffffffffeULL, 8, 16, 32, 64 },
{ 0xffffffffffffffffULL, 8, 16, 32, 64 },
};
TEST_STDBIT_UI_TOPLEVEL (stdc_bit_width);
static int
do_test (void)
{
TEST_STDBIT_UI (stdc_bit_width, inputs);
return 0;
}
#include <support/test-driver.c>
@@ -0,0 +1,88 @@
/* Test stdc_leading_zeros functions and macros.
Copyright (C) 2024-2025 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library 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 2.1 of the License, or (at your option) any later version.
The GNU C Library 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 the GNU C Library; if not, see
<https://www.gnu.org/licenses/>. */
#include <tst-stdbit.h>
static const struct stdbit_test inputs[] =
{
{ 0ULL, 8, 16, 32, 64 },
{ 0x1ULL, 7, 15, 31, 63 },
{ 0x2ULL, 6, 14, 30, 62 },
{ 0x3ULL, 6, 14, 30, 62 },
{ 0x4ULL, 5, 13, 29, 61 },
{ 0x5ULL, 5, 13, 29, 61 },
{ 0x6ULL, 5, 13, 29, 61 },
{ 0x7ULL, 5, 13, 29, 61 },
{ 0x8ULL, 4, 12, 28, 60 },
{ 0x9ULL, 4, 12, 28, 60 },
{ 0xaULL, 4, 12, 28, 60 },
{ 0xbULL, 4, 12, 28, 60 },
{ 0xcULL, 4, 12, 28, 60 },
{ 0xdULL, 4, 12, 28, 60 },
{ 0xeULL, 4, 12, 28, 60 },
{ 0xfULL, 4, 12, 28, 60 },
{ 0x10ULL, 3, 11, 27, 59 },
{ 0x11ULL, 3, 11, 27, 59 },
{ 0x12ULL, 3, 11, 27, 59 },
{ 0x1fULL, 3, 11, 27, 59 },
{ 0x20ULL, 2, 10, 26, 58 },
{ 0x7fULL, 1, 9, 25, 57 },
{ 0x80ULL, 0, 8, 24, 56 },
{ 0x81ULL, 0, 8, 24, 56 },
{ 0x9aULL, 0, 8, 24, 56 },
{ 0xf3ULL, 0, 8, 24, 56 },
{ 0xffULL, 0, 8, 24, 56 },
{ 0x100ULL, 8, 7, 23, 55 },
{ 0x101ULL, 7, 7, 23, 55 },
{ 0x102ULL, 6, 7, 23, 55 },
{ 0x1feULL, 0, 7, 23, 55 },
{ 0x1ffULL, 0, 7, 23, 55 },
{ 0x200ULL, 8, 6, 22, 54 },
{ 0x234ULL, 2, 6, 22, 54 },
{ 0x4567ULL, 1, 1, 17, 49 },
{ 0x7fffULL, 0, 1, 17, 49 },
{ 0x8000ULL, 8, 0, 16, 48 },
{ 0x8001ULL, 7, 0, 16, 48 },
{ 0xfffeULL, 0, 0, 16, 48 },
{ 0xffffULL, 0, 0, 16, 48 },
{ 0x10000ULL, 8, 16, 15, 47 },
{ 0x10001ULL, 7, 15, 15, 47 },
{ 0xfedcba98ULL, 0, 0, 0, 32 },
{ 0xfffffefeULL, 0, 0, 0, 32 },
{ 0xffffffffULL, 0, 0, 0, 32 },
{ 0x100000000ULL, 8, 16, 32, 31 },
{ 0x100000001ULL, 7, 15, 31, 31 },
{ 0x123456789ULL, 0, 1, 2, 31 },
{ 0x123456789abcdefULL, 0, 0, 0, 7 },
{ 0x789abcdef0123456ULL, 1, 2, 0, 1 },
{ 0x8000000000000000ULL, 8, 16, 32, 0 },
{ 0x8000000000000001ULL, 7, 15, 31, 0 },
{ 0xfffffffffffffffeULL, 0, 0, 0, 0 },
{ 0xffffffffffffffffULL, 0, 0, 0, 0 },
};
TEST_STDBIT_UI_TOPLEVEL (stdc_leading_zeros);
static int
do_test (void)
{
TEST_STDBIT_UI (stdc_leading_zeros, inputs);
return 0;
}
#include <support/test-driver.c>
@@ -1,9 +1,9 @@
/* ftruncate emulations for native Windows.
Copyright (C) 1992-2017 Free Software Foundation, Inc.
Copyright (C) 1992-2025 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)
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,
@@ -12,26 +12,32 @@
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 <http://www.gnu.org/licenses/>. */
with this program; if not, see <https://www.gnu.org/licenses/>. */
#include <config.h>
/* Specification. */
#include <unistd.h>
#if HAVE_CHSIZE
#if HAVE__CHSIZE
/* A native Windows platform. */
# include <errno.h>
# if _GL_WINDOWS_64_BIT_OFF_T
/* We need to test _FILE_OFFSET_BITS for mingw-w64
and _GL_WINDOWS_64_BIT_OFF_T for MSVC. */
# if (_FILE_OFFSET_BITS == 64 || _GL_WINDOWS_64_BIT_OFF_T)
/* Large File Support: off_t is 64-bit, but chsize() takes only a 32-bit
argument. So, define a 64-bit safe SetFileSize function ourselves. */
/* Large File Support: off_t is 64-bit, but _chsize() takes only a 32-bit
argument. Some newer versions of the Windows CRT have a _chsize_s function
that takes a 64-bit argument, but we cannot rely on that.
So, define a 64-bit safe SetFileSize function ourselves. */
/* Ensure that <windows.h> declares GetFileSizeEx. */
# undef _WIN32_WINNT
# define _WIN32_WINNT _WIN32_WINNT_WIN2K
# if !defined _WIN32_WINNT || (_WIN32_WINNT < _WIN32_WINNT_WIN2K)
# undef _WIN32_WINNT
# define _WIN32_WINNT _WIN32_WINNT_WIN2K
# endif
/* Get declarations of the native Windows API functions. */
# define WIN32_LEAN_AND_MEAN
@@ -168,7 +174,7 @@ chsize_nothrow (int fd, long length)
TRY_MSVC_INVAL
{
result = chsize (fd, length);
result = _chsize (fd, length);
}
CATCH_MSVC_INVAL
{
@@ -180,7 +186,7 @@ chsize_nothrow (int fd, long length)
return result;
}
# else
# define chsize_nothrow chsize
# define chsize_nothrow _chsize
# endif
int
@@ -1,39 +0,0 @@
/* getpagesize emulation for systems where it cannot be done in a C macro.
Copyright (C) 2007, 2009-2017 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 <http://www.gnu.org/licenses/>. */
/* Written by Bruno Haible and Martin Lambers. */
#include <config.h>
/* Specification. */
#include <unistd.h>
/* This implementation is only for native Windows systems. */
#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
# define WIN32_LEAN_AND_MEAN
# include <windows.h>
int
getpagesize (void)
{
SYSTEM_INFO system_info;
GetSystemInfo (&system_info);
return system_info.dwPageSize;
}
#endif
@@ -0,0 +1,217 @@
/* Creating and controlling threads.
Copyright (C) 2005-2025 Free Software Foundation, Inc.
This file 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 2.1 of the
License, or (at your option) any later version.
This file 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 <https://www.gnu.org/licenses/>. */
/* Written by Bruno Haible <bruno@clisp.org>, 2005.
Based on GCC's gthr-posix.h, gthr-posix95.h, gthr-win32.h. */
#include <config.h>
/* Specification. */
#include "glthread/thread.h"
#include <stdlib.h>
/* ========================================================================= */
#if USE_ISOC_THREADS
struct thrd_with_exitvalue
{
thrd_t volatile tid;
void * volatile exitvalue;
};
/* The Thread-Specific Storage (TSS) key that allows to access each thread's
'struct thrd_with_exitvalue *' pointer. */
static tss_t thrd_with_exitvalue_key;
/* Initializes thrd_with_exitvalue_key.
This function must only be called once. */
static void
do_init_thrd_with_exitvalue_key (void)
{
if (tss_create (&thrd_with_exitvalue_key, NULL) != thrd_success)
abort ();
}
/* Initializes thrd_with_exitvalue_key. */
static void
init_thrd_with_exitvalue_key (void)
{
static once_flag once = ONCE_FLAG_INIT;
call_once (&once, do_init_thrd_with_exitvalue_key);
}
typedef union
{
struct thrd_with_exitvalue t;
struct
{
thrd_t tid; /* reserve memory for t.tid */
void *(*mainfunc) (void *);
void *arg;
} a;
}
main_arg_t;
static int
thrd_main_func (void *pmarg)
{
/* Unpack the object that combines mainfunc and arg. */
main_arg_t *main_arg = (main_arg_t *) pmarg;
void *(*mainfunc) (void *) = main_arg->a.mainfunc;
void *arg = main_arg->a.arg;
if (tss_set (thrd_with_exitvalue_key, &main_arg->t) != thrd_success)
abort ();
/* Execute mainfunc, with arg as argument. */
{
void *exitvalue = mainfunc (arg);
/* Store the exitvalue, for use by glthread_join(). */
main_arg->t.exitvalue = exitvalue;
return 0;
}
}
int
glthread_create (gl_thread_t *threadp, void *(*mainfunc) (void *), void *arg)
{
init_thrd_with_exitvalue_key ();
{
/* Combine mainfunc and arg in a single object.
A stack-allocated object does not work, because it would be out of
existence when thrd_create returns before thrd_main_func is
entered. So, allocate it in the heap. */
main_arg_t *main_arg = (main_arg_t *) malloc (sizeof (main_arg_t));
if (main_arg == NULL)
return ENOMEM;
main_arg->a.mainfunc = mainfunc;
main_arg->a.arg = arg;
switch (thrd_create ((thrd_t *) &main_arg->t.tid, thrd_main_func, main_arg))
{
case thrd_success:
break;
case thrd_nomem:
free (main_arg);
return ENOMEM;
default:
free (main_arg);
return EAGAIN;
}
*threadp = &main_arg->t;
return 0;
}
}
gl_thread_t
gl_thread_self (void)
{
init_thrd_with_exitvalue_key ();
{
gl_thread_t thread =
(struct thrd_with_exitvalue *) tss_get (thrd_with_exitvalue_key);
if (thread == NULL)
{
/* This happens only in threads that have not been created through
glthread_create(), such as the main thread. */
for (;;)
{
thread =
(struct thrd_with_exitvalue *)
malloc (sizeof (struct thrd_with_exitvalue));
if (thread != NULL)
break;
/* Memory allocation failed. There is not much we can do. Have to
busy-loop, waiting for the availability of memory. */
{
struct timespec ts =
{
.tv_sec = 1,
.tv_nsec = 0
};
thrd_sleep (&ts, NULL);
}
}
thread->tid = thrd_current ();
thread->exitvalue = NULL; /* just to be deterministic */
if (tss_set (thrd_with_exitvalue_key, thread) != thrd_success)
abort ();
}
return thread;
}
}
int
glthread_join (gl_thread_t thread, void **return_value_ptr)
{
/* On Solaris 11.4, thrd_join crashes when the second argument we pass is
NULL. */
int dummy;
if (thread == gl_thread_self ())
return EINVAL;
if (thrd_join (thread->tid, &dummy) != thrd_success)
return EINVAL;
if (return_value_ptr != NULL)
*return_value_ptr = thread->exitvalue;
free (thread);
return 0;
}
_Noreturn void
gl_thread_exit (void *return_value)
{
gl_thread_t thread = gl_thread_self ();
thread->exitvalue = return_value;
thrd_exit (0);
}
#endif
/* ========================================================================= */
#if USE_POSIX_THREADS || USE_ISOC_AND_POSIX_THREADS
#include <pthread.h>
#if defined PTW32_VERSION || defined __MVS__
const gl_thread_t gl_null_thread /* = { .p = NULL } */;
#endif
#endif
/* ========================================================================= */
#if USE_WINDOWS_THREADS
#endif
/* ========================================================================= */
gl_thread_t
gl_thread_create (void *(*func) (void *arg), void *arg)
{
gl_thread_t thread;
int ret;
ret = glthread_create (&thread, func, arg);
if (ret != 0)
abort ();
return thread;
}
@@ -0,0 +1,346 @@
/* Creating and controlling threads.
Copyright (C) 2005-2025 Free Software Foundation, Inc.
This file 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 2.1 of the
License, or (at your option) any later version.
This file 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 <https://www.gnu.org/licenses/>. */
/* Written by Bruno Haible <bruno@clisp.org>, 2005.
Based on GCC's gthr-posix.h, gthr-posix95.h, gthr-win32.h. */
/* This file contains primitives for creating and controlling threads.
Thread data type: gl_thread_t.
Creating a thread:
thread = gl_thread_create (func, arg);
Or with control of error handling:
err = glthread_create (&thread, func, arg);
extern int glthread_create (gl_thread_t *result,
void *(*func) (void *), void *arg);
Querying and changing the signal mask of a thread (not supported on all
platforms):
gl_thread_sigmask (how, newmask, oldmask);
Or with control of error handling:
err = glthread_sigmask (how, newmask, oldmask);
extern int glthread_sigmask (int how, const sigset_t *newmask, sigset_t *oldmask);
Waiting for termination of another thread:
gl_thread_join (thread, &return_value);
Or with control of error handling:
err = glthread_join (thread, &return_value);
extern int glthread_join (gl_thread_t thread, void **return_value_ptr);
Getting a reference to the current thread:
current = gl_thread_self ();
extern gl_thread_t gl_thread_self (void);
Getting a reference to the current thread as a pointer, for debugging:
ptr = gl_thread_self_pointer ();
extern void * gl_thread_self_pointer (void);
Terminating the current thread:
gl_thread_exit (return_value);
extern _Noreturn void gl_thread_exit (void *return_value);
Requesting custom code to be executed at fork() time (not supported on all
platforms):
gl_thread_atfork (prepare_func, parent_func, child_func);
Or with control of error handling:
err = glthread_atfork (prepare_func, parent_func, child_func);
extern int glthread_atfork (void (*prepare_func) (void),
void (*parent_func) (void),
void (*child_func) (void));
Note that even on platforms where this is supported, use of fork() and
threads together is problematic, see
<https://lists.gnu.org/r/bug-gnulib/2008-08/msg00062.html>
*/
#ifndef _GLTHREAD_THREAD_H
#define _GLTHREAD_THREAD_H
/* This file uses _Noreturn, HAVE_THREADS_H, HAVE_PTHREAD_ATFORK. */
#if !_GL_CONFIG_H_INCLUDED
#error "Please include config.h first."
#endif
#include <errno.h>
#include <stdlib.h>
#if !defined c11_threads_in_use
# if HAVE_THREADS_H && USE_POSIX_THREADS_FROM_LIBC
# define c11_threads_in_use() 1
# elif HAVE_THREADS_H && USE_POSIX_THREADS_WEAK
# include <threads.h>
# pragma weak thrd_exit
# define c11_threads_in_use() (thrd_exit != NULL)
# else
# define c11_threads_in_use() 0
# endif
#endif
/* ========================================================================= */
#if USE_ISOC_THREADS
/* Use the ISO C threads library. */
# include <threads.h>
# ifdef __cplusplus
extern "C" {
# endif
/* -------------------------- gl_thread_t datatype -------------------------- */
typedef struct thrd_with_exitvalue *gl_thread_t;
extern int glthread_create (gl_thread_t *threadp,
void *(*func) (void *), void *arg);
# define glthread_sigmask(HOW, SET, OSET) \
pthread_sigmask (HOW, SET, OSET)
extern int glthread_join (gl_thread_t thread, void **return_value_ptr);
extern gl_thread_t gl_thread_self (void);
# define gl_thread_self_pointer() \
(void *) gl_thread_self ()
extern _Noreturn void gl_thread_exit (void *return_value);
# define glthread_atfork(PREPARE_FUNC, PARENT_FUNC, CHILD_FUNC) 0
# ifdef __cplusplus
}
# endif
#endif
/* ========================================================================= */
#if USE_POSIX_THREADS || USE_ISOC_AND_POSIX_THREADS
/* Use the POSIX threads library. */
# include <pthread.h>
/* Get intptr_t. */
# include <stdint.h>
/* On IRIX, pthread_atfork is declared in <unistd.h>, not in <pthread.h>. */
# if defined __sgi
# include <unistd.h>
# endif
# if USE_POSIX_THREADS_WEAK
/* Compilers other than GCC need to see the declaration of pthread_sigmask
before the "#pragma weak pthread_sigmask" below. */
# include <signal.h>
# endif
# ifdef __cplusplus
extern "C" {
# endif
# if PTHREAD_IN_USE_DETECTION_HARD
/* The pthread_in_use() detection needs to be done at runtime. */
# define pthread_in_use() \
glthread_in_use ()
extern int glthread_in_use (void);
# endif
# if USE_POSIX_THREADS_WEAK
/* Use weak references to the POSIX threads library. */
/* Weak references avoid dragging in external libraries if the other parts
of the program don't use them. Here we use them, because we don't want
every program that uses libintl to depend on libpthread. This assumes
that libpthread would not be loaded after libintl; i.e. if libintl is
loaded first, by an executable that does not depend on libpthread, and
then a module is dynamically loaded that depends on libpthread, libintl
will not be multithread-safe. */
/* The way to test at runtime whether libpthread is present is to test
whether a function pointer's value, such as &pthread_mutex_init, is
non-NULL. However, some versions of GCC have a bug through which, in
PIC mode, &foo != NULL always evaluates to true if there is a direct
call to foo(...) in the same function. To avoid this, we test the
address of a function in libpthread that we don't use. */
# ifndef pthread_sigmask /* Do not declare rpl_pthread_sigmask weak. */
# pragma weak pthread_sigmask
# endif
# pragma weak pthread_join
# ifndef pthread_self
# pragma weak pthread_self
# endif
# pragma weak pthread_exit
# if HAVE_PTHREAD_ATFORK
# pragma weak pthread_atfork
# endif
# if !PTHREAD_IN_USE_DETECTION_HARD
# pragma weak pthread_mutexattr_gettype
# define pthread_in_use() \
(pthread_mutexattr_gettype != NULL || c11_threads_in_use ())
# endif
# else
# if !PTHREAD_IN_USE_DETECTION_HARD
# define pthread_in_use() 1
# endif
# endif
/* -------------------------- gl_thread_t datatype -------------------------- */
/* This choice of gl_thread_t assumes that
pthread_equal (a, b) is equivalent to ((a) == (b)).
This is the case on all platforms in use in 2008. */
typedef pthread_t gl_thread_t;
# define glthread_create(THREADP, FUNC, ARG) \
(pthread_in_use () ? pthread_create (THREADP, NULL, FUNC, ARG) : ENOSYS)
# define glthread_sigmask(HOW, SET, OSET) \
(pthread_in_use () ? pthread_sigmask (HOW, SET, OSET) : 0)
# define glthread_join(THREAD, RETVALP) \
(pthread_in_use () ? pthread_join (THREAD, RETVALP) : 0)
# ifdef PTW32_VERSION
/* In pthreads-win32, pthread_t is a struct with a pointer field 'p' and
other fields. */
# define gl_thread_self() \
(pthread_in_use () ? pthread_self () : gl_null_thread)
# define gl_thread_self_pointer() \
(pthread_in_use () ? pthread_self ().p : NULL)
extern const gl_thread_t gl_null_thread;
# elif defined __MVS__
/* On IBM z/OS, pthread_t is a struct with an 8-byte '__' field.
The first three bytes of this field appear to uniquely identify a
pthread_t, though not necessarily representing a pointer. */
# define gl_thread_self() \
(pthread_in_use () ? pthread_self () : gl_null_thread)
# define gl_thread_self_pointer() \
(pthread_in_use () ? *((void **) pthread_self ().__) : NULL)
extern const gl_thread_t gl_null_thread;
# else
# define gl_thread_self() \
(pthread_in_use () ? pthread_self () : (pthread_t) 0)
# define gl_thread_self_pointer() \
(pthread_in_use () ? (void *) (intptr_t) (pthread_t) pthread_self () : NULL)
# endif
# define gl_thread_exit(RETVAL) \
(void) (pthread_in_use () ? (pthread_exit (RETVAL), 0) : 0)
# if HAVE_PTHREAD_ATFORK
# define glthread_atfork(PREPARE_FUNC, PARENT_FUNC, CHILD_FUNC) \
(pthread_in_use () ? pthread_atfork (PREPARE_FUNC, PARENT_FUNC, CHILD_FUNC) : 0)
# else
# define glthread_atfork(PREPARE_FUNC, PARENT_FUNC, CHILD_FUNC) 0
# endif
# ifdef __cplusplus
}
# endif
#endif
/* ========================================================================= */
#if USE_WINDOWS_THREADS
# define WIN32_LEAN_AND_MEAN /* avoid including junk */
# include <windows.h>
# include "windows-thread.h"
# ifdef __cplusplus
extern "C" {
# endif
/* -------------------------- gl_thread_t datatype -------------------------- */
typedef glwthread_thread_t gl_thread_t;
# define glthread_create(THREADP, FUNC, ARG) \
glwthread_thread_create (THREADP, 0, FUNC, ARG)
# define glthread_sigmask(HOW, SET, OSET) \
/* unsupported */ 0
# define glthread_join(THREAD, RETVALP) \
glwthread_thread_join (THREAD, RETVALP)
# define gl_thread_self() \
glwthread_thread_self ()
# define gl_thread_self_pointer() \
gl_thread_self ()
# define gl_thread_exit(RETVAL) \
glwthread_thread_exit (RETVAL)
# define glthread_atfork(PREPARE_FUNC, PARENT_FUNC, CHILD_FUNC) 0
# ifdef __cplusplus
}
# endif
#endif
/* ========================================================================= */
#if !(USE_ISOC_THREADS || USE_POSIX_THREADS || USE_ISOC_AND_POSIX_THREADS || USE_WINDOWS_THREADS)
/* Provide dummy implementation if threads are not supported. */
typedef int gl_thread_t;
# define glthread_create(THREADP, FUNC, ARG) ENOSYS
# define glthread_sigmask(HOW, SET, OSET) 0
# define glthread_join(THREAD, RETVALP) 0
# define gl_thread_self() 0
# define gl_thread_self_pointer() \
((void *) gl_thread_self ())
# define gl_thread_exit(RETVAL) (void)0
# define glthread_atfork(PREPARE_FUNC, PARENT_FUNC, CHILD_FUNC) 0
#endif
/* ========================================================================= */
/* Macros with built-in error handling. */
#ifdef __cplusplus
extern "C" {
#endif
extern gl_thread_t gl_thread_create (void *(*func) (void *arg), void *arg);
#define gl_thread_sigmask(HOW, SET, OSET) \
do \
{ \
if (glthread_sigmask (HOW, SET, OSET)) \
abort (); \
} \
while (0)
#define gl_thread_join(THREAD, RETVAL) \
do \
{ \
if (glthread_join (THREAD, RETVAL)) \
abort (); \
} \
while (0)
#define gl_thread_atfork(PREPARE, PARENT, CHILD) \
do \
{ \
if (glthread_atfork (PREPARE, PARENT, CHILD)) \
abort (); \
} \
while (0)
#ifdef __cplusplus
}
#endif
#endif /* _GLTHREAD_THREAD_H */
@@ -0,0 +1,100 @@
/* Yielding the processor to other threads and processes.
Copyright (C) 2005-2025 Free Software Foundation, Inc.
This file 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 2.1 of the
License, or (at your option) any later version.
This file 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 <https://www.gnu.org/licenses/>. */
/* This file contains a primitive for yielding the processor to other threads.
extern void gl_thread_yield (void);
*/
#ifndef _GLTHREAD_YIELD_H
#define _GLTHREAD_YIELD_H
#include <errno.h>
/* ========================================================================= */
#if USE_ISOC_THREADS || USE_ISOC_AND_POSIX_THREADS
/* Use the ISO C threads library. */
# include <threads.h>
# ifdef __cplusplus
extern "C" {
# endif
# define gl_thread_yield() \
thrd_yield ()
# ifdef __cplusplus
}
# endif
#endif
/* ========================================================================= */
#if USE_POSIX_THREADS
/* Use the POSIX threads library. */
# include <sched.h>
# ifdef __cplusplus
extern "C" {
# endif
# define gl_thread_yield() \
sched_yield ()
# ifdef __cplusplus
}
# endif
#endif
/* ========================================================================= */
#if USE_WINDOWS_THREADS
# define WIN32_LEAN_AND_MEAN /* avoid including junk */
# include <windows.h>
# ifdef __cplusplus
extern "C" {
# endif
# define gl_thread_yield() \
Sleep (0)
# ifdef __cplusplus
}
# endif
#endif
/* ========================================================================= */
#if !(USE_ISOC_THREADS || USE_POSIX_THREADS || USE_ISOC_AND_POSIX_THREADS || USE_WINDOWS_THREADS)
/* Provide dummy implementation if threads are not supported. */
# define gl_thread_yield() 0
#endif
/* ========================================================================= */
#endif /* _GLTHREAD_YIELD_H */
File diff suppressed because it is too large Load Diff
@@ -1,19 +1,19 @@
/* hash-pjw.c -- compute a hash value from a NUL-terminated string.
Copyright (C) 2001, 2003, 2006, 2009-2017 Free Software Foundation, Inc.
Copyright (C) 2001, 2003, 2006, 2009-2025 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 file 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 2.1 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
This file 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.
GNU Lesser 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 <http://www.gnu.org/licenses/>. */
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>. */
#include <config.h>
@@ -25,7 +25,7 @@
/* A hash function for NUL-terminated char* strings using
the method described by Bruno Haible.
See http://www.haible.de/bruno/hashfunc.html. */
See https://www.haible.de/bruno/hashfunc.html. */
size_t
hash_pjw (const void *x, size_t tablesize)
@@ -1,23 +1,38 @@
/* hash-pjw.h -- declaration for a simple hash function
Copyright (C) 2001, 2003, 2009-2017 Free Software Foundation, Inc.
Copyright (C) 2001, 2003, 2009-2025 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 file 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 2.1 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
This file 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.
GNU Lesser 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 <http://www.gnu.org/licenses/>. */
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* This file uses _GL_ATTRIBUTE_PURE. */
#if !_GL_CONFIG_H_INCLUDED
#error "Please include config.h first."
#endif
#include <stddef.h>
#ifdef __cplusplus
extern "C" {
#endif
/* Compute a hash code for a NUL-terminated string starting at X,
and return the hash code modulo TABLESIZE.
The result is platform dependent: it depends on the size of the 'size_t'
type and on the signedness of the 'char' type. */
extern size_t hash_pjw (void const *x, size_t tablesize) _GL_ATTRIBUTE_PURE;
#ifdef __cplusplus
}
#endif
@@ -0,0 +1,20 @@
/* Convert 'intmax_t' integer to printable string.
Copyright (C) 2004-2025 Free Software Foundation, Inc.
This file 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 2.1 of the
License, or (at your option) any later version.
This file 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 <https://www.gnu.org/licenses/>. */
#define anytostr imaxtostr
#define inttype intmax_t
#include "anytostr.c"

Some files were not shown because too many files have changed in this diff Show More