aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Eggert2022-02-23 11:11:52 -0800
committerPaul Eggert2022-02-23 11:41:02 -0800
commit308e63ccfcc6a6b1285bb17eff641f48639fb329 (patch)
treee3f1daf0bdfb7180fc1f007280fa2a4ee43c259c
parent995aed477dc9be708920cc46442673126ed75760 (diff)
downloademacs-308e63ccfcc6a6b1285bb17eff641f48639fb329.tar.gz
emacs-308e63ccfcc6a6b1285bb17eff641f48639fb329.zip
Update from Gnulib by running admin/merge-gnulib
-rwxr-xr-xbuild-aux/config.guess11
-rwxr-xr-xbuild-aux/config.sub2
-rwxr-xr-xbuild-aux/gitlog-to-changelog2
-rwxr-xr-xbuild-aux/update-copyright2
-rw-r--r--lib/acl-errno-valid.c2
-rw-r--r--lib/acl-internal.c2
-rw-r--r--lib/acl-internal.h2
-rw-r--r--lib/acl.h2
-rw-r--r--lib/acl_entries.c2
-rw-r--r--lib/at-func.c2
-rw-r--r--lib/cdefs.h3
-rw-r--r--lib/close-stream.c2
-rw-r--r--lib/close-stream.h2
-rw-r--r--lib/copy-file-range.c34
-rw-r--r--lib/diffseq.h2
-rw-r--r--lib/dtoastr.c2
-rw-r--r--lib/dtotimespec.c2
-rw-r--r--lib/faccessat.c2
-rw-r--r--lib/fchmodat.c2
-rw-r--r--lib/fdopendir.c2
-rw-r--r--lib/file-has-acl.c2
-rw-r--r--lib/filemode.c2
-rw-r--r--lib/filemode.h2
-rw-r--r--lib/filevercmp.c189
-rw-r--r--lib/filevercmp.h68
-rw-r--r--lib/fpending.c2
-rw-r--r--lib/fpending.h2
-rw-r--r--lib/fstatat.c2
-rw-r--r--lib/fsusage.c2
-rw-r--r--lib/fsusage.h2
-rw-r--r--lib/ftoastr.c2
-rw-r--r--lib/ftoastr.h2
-rw-r--r--lib/futimens.c2
-rw-r--r--lib/get-permissions.c2
-rw-r--r--lib/getloadavg.c2
-rw-r--r--lib/gettime.c2
-rw-r--r--lib/gnulib.mk.in411
-rw-r--r--lib/intprops.h8
-rw-r--r--lib/lchmod.c2
-rw-r--r--lib/memrchr.c2
-rw-r--r--lib/mini-gmp-gnulib.c2
-rw-r--r--lib/mini-gmp.c2
-rw-r--r--lib/mini-gmp.h2
-rw-r--r--lib/mktime.c28
-rw-r--r--lib/nstrftime.c3
-rw-r--r--lib/openat-priv.h2
-rw-r--r--lib/openat-proc.c2
-rw-r--r--lib/openat.h2
-rw-r--r--lib/qcopy-acl.c2
-rw-r--r--lib/readlinkat.c2
-rw-r--r--lib/save-cwd.h2
-rw-r--r--lib/set-permissions.c2
-rw-r--r--lib/sig2str.c2
-rw-r--r--lib/sig2str.h2
-rw-r--r--lib/strftime.h2
-rw-r--r--lib/string.in.h29
-rw-r--r--lib/strtoimax.c2
-rw-r--r--lib/strtol.c2
-rw-r--r--lib/strtoll.c2
-rw-r--r--lib/symlink.c2
-rw-r--r--lib/time-internal.h2
-rw-r--r--lib/time_rz.c2
-rw-r--r--lib/timespec-add.c2
-rw-r--r--lib/timespec-sub.c2
-rw-r--r--lib/timespec.c2
-rw-r--r--lib/timespec.h2
-rw-r--r--lib/unistd.in.h16
-rw-r--r--lib/unlocked-io.h2
-rw-r--r--lib/utimens.c2
-rw-r--r--lib/utimens.h2
-rw-r--r--lib/utimensat.c2
-rw-r--r--lib/vla.h2
-rw-r--r--m4/copy-file-range.m425
-rw-r--r--m4/extern-inline.m419
-rw-r--r--m4/gnulib-common.m495
-rw-r--r--m4/gnulib-comp.m4312
-rw-r--r--m4/libgmp.m46
-rw-r--r--m4/mktime.m429
-rw-r--r--m4/stdio_h.m429
-rw-r--r--m4/unistd_h.m41
80 files changed, 896 insertions, 542 deletions
diff --git a/build-aux/config.guess b/build-aux/config.guess
index 1105a749838..7f76b6228f7 100755
--- a/build-aux/config.guess
+++ b/build-aux/config.guess
@@ -1,14 +1,14 @@
1#! /bin/sh 1#! /bin/sh
2# Attempt to guess a canonical system name. 2# Attempt to guess a canonical system name.
3# Copyright 1992-2021 Free Software Foundation, Inc. 3# Copyright 1992-2022 Free Software Foundation, Inc.
4 4
5# shellcheck disable=SC2006,SC2268 # see below for rationale 5# shellcheck disable=SC2006,SC2268 # see below for rationale
6 6
7timestamp='2021-11-30' 7timestamp='2022-01-09'
8 8
9# This file is free software; you can redistribute it and/or modify it 9# This file is free software; you can redistribute it and/or modify it
10# under the terms of the GNU General Public License as published by 10# under the terms of the GNU General Public License as published by
11# the Free Software Foundation; either version 3 of the License, or 11# the Free Software Foundation, either version 3 of the License, or
12# (at your option) any later version. 12# (at your option) any later version.
13# 13#
14# This program is distributed in the hope that it will be useful, but 14# This program is distributed in the hope that it will be useful, but
@@ -60,7 +60,7 @@ version="\
60GNU config.guess ($timestamp) 60GNU config.guess ($timestamp)
61 61
62Originally written by Per Bothner. 62Originally written by Per Bothner.
63Copyright 1992-2021 Free Software Foundation, Inc. 63Copyright 1992-2022 Free Software Foundation, Inc.
64 64
65This is free software; see the source for copying conditions. There is NO 65This is free software; see the source for copying conditions. There is NO
66warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." 66warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@@ -929,6 +929,9 @@ EOF
929 i*:PW*:*) 929 i*:PW*:*)
930 GUESS=$UNAME_MACHINE-pc-pw32 930 GUESS=$UNAME_MACHINE-pc-pw32
931 ;; 931 ;;
932 *:SerenityOS:*:*)
933 GUESS=$UNAME_MACHINE-pc-serenity
934 ;;
932 *:Interix*:*) 935 *:Interix*:*)
933 case $UNAME_MACHINE in 936 case $UNAME_MACHINE in
934 x86) 937 x86)
diff --git a/build-aux/config.sub b/build-aux/config.sub
index 5ba9a97d2c9..9b62e37c43c 100755
--- a/build-aux/config.sub
+++ b/build-aux/config.sub
@@ -8,7 +8,7 @@ timestamp='2021-12-25'
8 8
9# This file is free software; you can redistribute it and/or modify it 9# This file is free software; you can redistribute it and/or modify it
10# under the terms of the GNU General Public License as published by 10# under the terms of the GNU General Public License as published by
11# the Free Software Foundation; either version 3 of the License, or 11# the Free Software Foundation, either version 3 of the License, or
12# (at your option) any later version. 12# (at your option) any later version.
13# 13#
14# This program is distributed in the hope that it will be useful, but 14# This program is distributed in the hope that it will be useful, but
diff --git a/build-aux/gitlog-to-changelog b/build-aux/gitlog-to-changelog
index 1c6847ae3b3..82d9f973366 100755
--- a/build-aux/gitlog-to-changelog
+++ b/build-aux/gitlog-to-changelog
@@ -35,7 +35,7 @@
35eval 'exec perl -wSx "$0" "$@"' 35eval 'exec perl -wSx "$0" "$@"'
36 if 0; 36 if 0;
37 37
38my $VERSION = '2021-02-24 23:42'; # UTC 38my $VERSION = '2022-01-27 18:49'; # UTC
39# The definition above must lie within the first 8 lines in order 39# The definition above must lie within the first 8 lines in order
40# for the Emacs time-stamp write hook (at end) to update it. 40# for the Emacs time-stamp write hook (at end) to update it.
41# If you change this file with Emacs, please let the write hook 41# If you change this file with Emacs, please let the write hook
diff --git a/build-aux/update-copyright b/build-aux/update-copyright
index 51b25dd0a5e..81b691e8570 100755
--- a/build-aux/update-copyright
+++ b/build-aux/update-copyright
@@ -7,7 +7,7 @@
7# 7#
8# This program is free software: you can redistribute it and/or modify 8# This program is free software: you can redistribute it and/or modify
9# it under the terms of the GNU General Public License as published by 9# it under the terms of the GNU General Public License as published by
10# the Free Software Foundation; either version 3, or (at your option) 10# the Free Software Foundation, either version 3, or (at your option)
11# any later version. 11# any later version.
12# 12#
13# This program is distributed in the hope that it will be useful, 13# This program is distributed in the hope that it will be useful,
diff --git a/lib/acl-errno-valid.c b/lib/acl-errno-valid.c
index 39717c35174..a364e413256 100644
--- a/lib/acl-errno-valid.c
+++ b/lib/acl-errno-valid.c
@@ -4,7 +4,7 @@
4 4
5 This program is free software: you can redistribute it and/or modify 5 This program is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by 6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 3 of the License, or 7 the Free Software Foundation, either version 3 of the License, or
8 (at your option) any later version. 8 (at your option) any later version.
9 9
10 This program is distributed in the hope that it will be useful, 10 This program is distributed in the hope that it will be useful,
diff --git a/lib/acl-internal.c b/lib/acl-internal.c
index 75a80bf0df2..be244c67a2a 100644
--- a/lib/acl-internal.c
+++ b/lib/acl-internal.c
@@ -4,7 +4,7 @@
4 4
5 This program is free software: you can redistribute it and/or modify 5 This program is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by 6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 3 of the License, or 7 the Free Software Foundation, either version 3 of the License, or
8 (at your option) any later version. 8 (at your option) any later version.
9 9
10 This program is distributed in the hope that it will be useful, 10 This program is distributed in the hope that it will be useful,
diff --git a/lib/acl-internal.h b/lib/acl-internal.h
index 582f9e1c1a1..93533762dd0 100644
--- a/lib/acl-internal.h
+++ b/lib/acl-internal.h
@@ -4,7 +4,7 @@
4 4
5 This program is free software: you can redistribute it and/or modify 5 This program is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by 6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 3 of the License, or 7 the Free Software Foundation, either version 3 of the License, or
8 (at your option) any later version. 8 (at your option) any later version.
9 9
10 This program is distributed in the hope that it will be useful, 10 This program is distributed in the hope that it will be useful,
diff --git a/lib/acl.h b/lib/acl.h
index 8b933c20b94..f4d0df80618 100644
--- a/lib/acl.h
+++ b/lib/acl.h
@@ -4,7 +4,7 @@
4 4
5 This program is free software: you can redistribute it and/or modify 5 This program is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by 6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 3 of the License, or 7 the Free Software Foundation, either version 3 of the License, or
8 (at your option) any later version. 8 (at your option) any later version.
9 9
10 This program is distributed in the hope that it will be useful, 10 This program is distributed in the hope that it will be useful,
diff --git a/lib/acl_entries.c b/lib/acl_entries.c
index e4c014ce715..677de23e0cb 100644
--- a/lib/acl_entries.c
+++ b/lib/acl_entries.c
@@ -4,7 +4,7 @@
4 4
5 This program is free software: you can redistribute it and/or modify 5 This program is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by 6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 3 of the License, or 7 the Free Software Foundation, either version 3 of the License, or
8 (at your option) any later version. 8 (at your option) any later version.
9 9
10 This program is distributed in the hope that it will be useful, 10 This program is distributed in the hope that it will be useful,
diff --git a/lib/at-func.c b/lib/at-func.c
index 92d65f6341f..afcc819beb0 100644
--- a/lib/at-func.c
+++ b/lib/at-func.c
@@ -3,7 +3,7 @@
3 3
4 This program is free software: you can redistribute it and/or modify 4 This program is free software: you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by 5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 3 of the License, or 6 the Free Software Foundation, either version 3 of the License, or
7 (at your option) any later version. 7 (at your option) any later version.
8 8
9 This program is distributed in the hope that it will be useful, 9 This program is distributed in the hope that it will be useful,
diff --git a/lib/cdefs.h b/lib/cdefs.h
index abf13a90862..44d3826bca9 100644
--- a/lib/cdefs.h
+++ b/lib/cdefs.h
@@ -143,7 +143,8 @@
143#define __bos0(ptr) __builtin_object_size (ptr, 0) 143#define __bos0(ptr) __builtin_object_size (ptr, 0)
144 144
145/* Use __builtin_dynamic_object_size at _FORTIFY_SOURCE=3 when available. */ 145/* Use __builtin_dynamic_object_size at _FORTIFY_SOURCE=3 when available. */
146#if __USE_FORTIFY_LEVEL == 3 && __glibc_clang_prereq (9, 0) 146#if __USE_FORTIFY_LEVEL == 3 && (__glibc_clang_prereq (9, 0) \
147 || __GNUC_PREREQ (12, 0))
147# define __glibc_objsize0(__o) __builtin_dynamic_object_size (__o, 0) 148# define __glibc_objsize0(__o) __builtin_dynamic_object_size (__o, 0)
148# define __glibc_objsize(__o) __builtin_dynamic_object_size (__o, 1) 149# define __glibc_objsize(__o) __builtin_dynamic_object_size (__o, 1)
149#else 150#else
diff --git a/lib/close-stream.c b/lib/close-stream.c
index 54f3e3c3d0c..9b0e97b271d 100644
--- a/lib/close-stream.c
+++ b/lib/close-stream.c
@@ -4,7 +4,7 @@
4 4
5 This program is free software: you can redistribute it and/or modify 5 This program is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by 6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 3 of the License, or 7 the Free Software Foundation, either version 3 of the License, or
8 (at your option) any later version. 8 (at your option) any later version.
9 9
10 This program is distributed in the hope that it will be useful, 10 This program is distributed in the hope that it will be useful,
diff --git a/lib/close-stream.h b/lib/close-stream.h
index 537506c4896..2b4c8ed8f5b 100644
--- a/lib/close-stream.h
+++ b/lib/close-stream.h
@@ -4,7 +4,7 @@
4 4
5 This file is free software: you can redistribute it and/or modify 5 This file is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published 6 it under the terms of the GNU General Public License as published
7 by the Free Software Foundation; either version 3 of the License, 7 by the Free Software Foundation, either version 3 of the License,
8 or (at your option) any later version. 8 or (at your option) any later version.
9 9
10 This file is distributed in the hope that it will be useful, 10 This file is distributed in the hope that it will be useful,
diff --git a/lib/copy-file-range.c b/lib/copy-file-range.c
index 96f1ec7c5e8..1ec7f4de67c 100644
--- a/lib/copy-file-range.c
+++ b/lib/copy-file-range.c
@@ -20,11 +20,45 @@
20 20
21#include <errno.h> 21#include <errno.h>
22 22
23#if defined __linux__ && HAVE_COPY_FILE_RANGE
24# include <sys/utsname.h>
25#endif
26
23ssize_t 27ssize_t
24copy_file_range (int infd, off_t *pinoff, 28copy_file_range (int infd, off_t *pinoff,
25 int outfd, off_t *poutoff, 29 int outfd, off_t *poutoff,
26 size_t length, unsigned int flags) 30 size_t length, unsigned int flags)
27{ 31{
32#undef copy_file_range
33
34#if defined __linux__ && HAVE_COPY_FILE_RANGE
35 /* The implementation of copy_file_range (which first appeared in
36 Linux kernel release 4.5) had many issues before release 5.3
37 <https://lwn.net/Articles/789527/>, so fail with ENOSYS for Linux
38 kernels 5.2 and earlier.
39
40 This workaround, and the configure-time check for Linux, can be
41 removed when such kernels (released March 2016 through September
42 2019) are no longer a consideration. As of January 2021, the
43 furthest-future planned kernel EOL is December 2024 for kernel
44 release 4.19. */
45
46 static signed char ok;
47
48 if (! ok)
49 {
50 struct utsname name;
51 uname (&name);
52 char *p = name.release;
53 ok = ((p[1] != '.' || '5' < p[0]
54 || (p[0] == '5' && (p[3] != '.' || '2' < p[2])))
55 ? 1 : -1);
56 }
57
58 if (0 < ok)
59 return copy_file_range (infd, pinoff, outfd, poutoff, length, flags);
60#endif
61
28 /* There is little need to emulate copy_file_range with read+write, 62 /* There is little need to emulate copy_file_range with read+write,
29 since programs that use copy_file_range must fall back on 63 since programs that use copy_file_range must fall back on
30 read+write anyway. */ 64 read+write anyway. */
diff --git a/lib/diffseq.h b/lib/diffseq.h
index 0c901a6ecfd..0f76ea1d5ad 100644
--- a/lib/diffseq.h
+++ b/lib/diffseq.h
@@ -5,7 +5,7 @@
5 5
6 This program is free software: you can redistribute it and/or modify 6 This program is free software: you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by 7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 3 of the License, or 8 the Free Software Foundation, either version 3 of the License, or
9 (at your option) any later version. 9 (at your option) any later version.
10 10
11 This program is distributed in the hope that it will be useful, 11 This program is distributed in the hope that it will be useful,
diff --git a/lib/dtoastr.c b/lib/dtoastr.c
index eaade8fa016..71af14c9df4 100644
--- a/lib/dtoastr.c
+++ b/lib/dtoastr.c
@@ -4,7 +4,7 @@
4 4
5 This file is free software: you can redistribute it and/or modify 5 This file is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published 6 it under the terms of the GNU General Public License as published
7 by the Free Software Foundation; either version 3 of the License, 7 by the Free Software Foundation, either version 3 of the License,
8 or (at your option) any later version. 8 or (at your option) any later version.
9 9
10 This file is distributed in the hope that it will be useful, 10 This file is distributed in the hope that it will be useful,
diff --git a/lib/dtotimespec.c b/lib/dtotimespec.c
index 225a2be67c4..b62a8bd6cfc 100644
--- a/lib/dtotimespec.c
+++ b/lib/dtotimespec.c
@@ -4,7 +4,7 @@
4 4
5 This program is free software: you can redistribute it and/or modify 5 This program is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by 6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 3 of the License, or 7 the Free Software Foundation, either version 3 of the License, or
8 (at your option) any later version. 8 (at your option) any later version.
9 9
10 This program is distributed in the hope that it will be useful, 10 This program is distributed in the hope that it will be useful,
diff --git a/lib/faccessat.c b/lib/faccessat.c
index 2c0c07aac10..c1737d03a10 100644
--- a/lib/faccessat.c
+++ b/lib/faccessat.c
@@ -3,7 +3,7 @@
3 3
4 This program is free software: you can redistribute it and/or modify 4 This program is free software: you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by 5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 3 of the License, or 6 the Free Software Foundation, either version 3 of the License, or
7 (at your option) any later version. 7 (at your option) any later version.
8 8
9 This program is distributed in the hope that it will be useful, 9 This program is distributed in the hope that it will be useful,
diff --git a/lib/fchmodat.c b/lib/fchmodat.c
index 506e6badd7d..dc535833660 100644
--- a/lib/fchmodat.c
+++ b/lib/fchmodat.c
@@ -3,7 +3,7 @@
3 3
4 This program is free software: you can redistribute it and/or modify 4 This program is free software: you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by 5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 3 of the License, or 6 the Free Software Foundation, either version 3 of the License, or
7 (at your option) any later version. 7 (at your option) any later version.
8 8
9 This program is distributed in the hope that it will be useful, 9 This program is distributed in the hope that it will be useful,
diff --git a/lib/fdopendir.c b/lib/fdopendir.c
index a61bad66e23..c2b0e1ed347 100644
--- a/lib/fdopendir.c
+++ b/lib/fdopendir.c
@@ -3,7 +3,7 @@
3 3
4 This program is free software: you can redistribute it and/or modify 4 This program is free software: you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by 5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 3 of the License, or 6 the Free Software Foundation, either version 3 of the License, or
7 (at your option) any later version. 7 (at your option) any later version.
8 8
9 This program is distributed in the hope that it will be useful, 9 This program is distributed in the hope that it will be useful,
diff --git a/lib/file-has-acl.c b/lib/file-has-acl.c
index 2b6f91ff20a..e02f0626ad3 100644
--- a/lib/file-has-acl.c
+++ b/lib/file-has-acl.c
@@ -4,7 +4,7 @@
4 4
5 This program is free software: you can redistribute it and/or modify 5 This program is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by 6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 3 of the License, or 7 the Free Software Foundation, either version 3 of the License, or
8 (at your option) any later version. 8 (at your option) any later version.
9 9
10 This program is distributed in the hope that it will be useful, 10 This program is distributed in the hope that it will be useful,
diff --git a/lib/filemode.c b/lib/filemode.c
index cb508ad12d1..a8cbea844c8 100644
--- a/lib/filemode.c
+++ b/lib/filemode.c
@@ -5,7 +5,7 @@
5 5
6 This program is free software: you can redistribute it and/or modify 6 This program is free software: you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by 7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 3 of the License, or 8 the Free Software Foundation, either version 3 of the License, or
9 (at your option) any later version. 9 (at your option) any later version.
10 10
11 This program is distributed in the hope that it will be useful, 11 This program is distributed in the hope that it will be useful,
diff --git a/lib/filemode.h b/lib/filemode.h
index 7c645c16b51..bf38181cdcd 100644
--- a/lib/filemode.h
+++ b/lib/filemode.h
@@ -5,7 +5,7 @@
5 5
6 This program is free software: you can redistribute it and/or modify 6 This program is free software: you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by 7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 3 of the License, or 8 the Free Software Foundation, either version 3 of the License, or
9 (at your option) any later version. 9 (at your option) any later version.
10 10
11 This program is distributed in the hope that it will be useful, 11 This program is distributed in the hope that it will be useful,
diff --git a/lib/filevercmp.c b/lib/filevercmp.c
index b3e6e2f3cb8..d546e790548 100644
--- a/lib/filevercmp.c
+++ b/lib/filevercmp.c
@@ -1,11 +1,12 @@
1/* 1/* Compare file names containing version numbers.
2
2 Copyright (C) 1995 Ian Jackson <iwj10@cus.cam.ac.uk> 3 Copyright (C) 1995 Ian Jackson <iwj10@cus.cam.ac.uk>
3 Copyright (C) 2001 Anthony Towns <aj@azure.humbug.org.au> 4 Copyright (C) 2001 Anthony Towns <aj@azure.humbug.org.au>
4 Copyright (C) 2008-2022 Free Software Foundation, Inc. 5 Copyright (C) 2008-2022 Free Software Foundation, Inc.
5 6
6 This file is free software: you can redistribute it and/or modify 7 This file is free software: you can redistribute it and/or modify
7 it under the terms of the GNU Lesser General Public License as 8 it under the terms of the GNU Lesser General Public License as
8 published by the Free Software Foundation; either version 3 of the 9 published by the Free Software Foundation, either version 3 of the
9 License, or (at your option) any later version. 10 License, or (at your option) any later version.
10 11
11 This file is distributed in the hope that it will be useful, 12 This file is distributed in the hope that it will be useful,
@@ -19,60 +20,65 @@
19#include <config.h> 20#include <config.h>
20#include "filevercmp.h" 21#include "filevercmp.h"
21 22
22#include <sys/types.h>
23#include <stdlib.h>
24#include <stdbool.h> 23#include <stdbool.h>
25#include <string.h>
26#include <c-ctype.h> 24#include <c-ctype.h>
27#include <limits.h> 25#include <limits.h>
28 26#include <idx.h>
29/* Match a file suffix defined by this regular expression: 27#include <verify.h>
30 /(\.[A-Za-z~][A-Za-z0-9~]*)*$/ 28
31 Scan the string *STR and return a pointer to the matching suffix, or 29/* Return the length of a prefix of S that corresponds to the suffix
32 NULL if not found. Upon return, *STR points to terminating NUL. */ 30 defined by this extended regular expression in the C locale:
33static const char * 31 (\.[A-Za-z~][A-Za-z0-9~]*)*$
34match_suffix (const char **str) 32 If *LEN is -1, S is a string; set *LEN to S's length.
33 Otherwise, *LEN should be nonnegative, S is a char array,
34 and *LEN does not change. */
35static idx_t
36file_prefixlen (char const *s, ptrdiff_t *len)
35{ 37{
36 const char *match = NULL; 38 size_t n = *len; /* SIZE_MAX if N == -1. */
37 bool read_alpha = false; 39
38 while (**str) 40 for (idx_t i = 0; ; i++)
39 { 41 {
40 if (read_alpha) 42 idx_t prefixlen = i;
41 { 43 while (i + 1 < n && s[i] == '.' && (c_isalpha (s[i + 1])
42 read_alpha = false; 44 || s[i + 1] == '~'))
43 if (!c_isalpha (**str) && '~' != **str) 45 for (i += 2; i < n && (c_isalnum (s[i]) || s[i] == '~'); i++)
44 match = NULL; 46 continue;
45 } 47
46 else if ('.' == **str) 48 if (*len < 0 ? !s[i] : i == n)
47 { 49 {
48 read_alpha = true; 50 *len = i;
49 if (!match) 51 return prefixlen;
50 match = *str;
51 } 52 }
52 else if (!c_isalnum (**str) && '~' != **str)
53 match = NULL;
54 (*str)++;
55 } 53 }
56 return match;
57} 54}
58 55
59/* verrevcmp helper function */ 56/* Return a version sort comparison value for S's byte at position POS.
57 S has length LEN. If POS == LEN, sort before all non-'~' bytes. */
58
60static int 59static int
61order (unsigned char c) 60order (char const *s, idx_t pos, idx_t len)
62{ 61{
62 if (pos == len)
63 return -1;
64
65 unsigned char c = s[pos];
63 if (c_isdigit (c)) 66 if (c_isdigit (c))
64 return 0; 67 return 0;
65 else if (c_isalpha (c)) 68 else if (c_isalpha (c))
66 return c; 69 return c;
67 else if (c == '~') 70 else if (c == '~')
68 return -1; 71 return -2;
69 else 72 else
70 return (int) c + UCHAR_MAX + 1; 73 {
74 verify (UCHAR_MAX <= (INT_MAX - 1 - 2) / 2);
75 return c + UCHAR_MAX + 1;
76 }
71} 77}
72 78
73/* slightly modified verrevcmp function from dpkg 79/* slightly modified verrevcmp function from dpkg
74 S1, S2 - compared string 80 S1, S2 - compared char array
75 S1_LEN, S2_LEN - length of strings to be scanned 81 S1_LEN, S2_LEN - length of arrays to be scanned
76 82
77 This implements the algorithm for comparison of version strings 83 This implements the algorithm for comparison of version strings
78 specified by Debian and now widely adopted. The detailed 84 specified by Debian and now widely adopted. The detailed
@@ -81,37 +87,38 @@ order (unsigned char c)
81 implements that from s5.6.12 of Debian Policy v3.8.0.1 87 implements that from s5.6.12 of Debian Policy v3.8.0.1
82 https://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-Version */ 88 https://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-Version */
83static int _GL_ATTRIBUTE_PURE 89static int _GL_ATTRIBUTE_PURE
84verrevcmp (const char *s1, size_t s1_len, const char *s2, size_t s2_len) 90verrevcmp (const char *s1, idx_t s1_len, const char *s2, idx_t s2_len)
85{ 91{
86 size_t s1_pos = 0; 92 idx_t s1_pos = 0;
87 size_t s2_pos = 0; 93 idx_t s2_pos = 0;
88 while (s1_pos < s1_len || s2_pos < s2_len) 94 while (s1_pos < s1_len || s2_pos < s2_len)
89 { 95 {
90 int first_diff = 0; 96 int first_diff = 0;
91 while ((s1_pos < s1_len && !c_isdigit (s1[s1_pos])) 97 while ((s1_pos < s1_len && !c_isdigit (s1[s1_pos]))
92 || (s2_pos < s2_len && !c_isdigit (s2[s2_pos]))) 98 || (s2_pos < s2_len && !c_isdigit (s2[s2_pos])))
93 { 99 {
94 int s1_c = (s1_pos == s1_len) ? 0 : order (s1[s1_pos]); 100 int s1_c = order (s1, s1_pos, s1_len);
95 int s2_c = (s2_pos == s2_len) ? 0 : order (s2[s2_pos]); 101 int s2_c = order (s2, s2_pos, s2_len);
96 if (s1_c != s2_c) 102 if (s1_c != s2_c)
97 return s1_c - s2_c; 103 return s1_c - s2_c;
98 s1_pos++; 104 s1_pos++;
99 s2_pos++; 105 s2_pos++;
100 } 106 }
101 while (s1[s1_pos] == '0') 107 while (s1_pos < s1_len && s1[s1_pos] == '0')
102 s1_pos++; 108 s1_pos++;
103 while (s2[s2_pos] == '0') 109 while (s2_pos < s2_len && s2[s2_pos] == '0')
104 s2_pos++; 110 s2_pos++;
105 while (c_isdigit (s1[s1_pos]) && c_isdigit (s2[s2_pos])) 111 while (s1_pos < s1_len && s2_pos < s2_len
112 && c_isdigit (s1[s1_pos]) && c_isdigit (s2[s2_pos]))
106 { 113 {
107 if (!first_diff) 114 if (!first_diff)
108 first_diff = s1[s1_pos] - s2[s2_pos]; 115 first_diff = s1[s1_pos] - s2[s2_pos];
109 s1_pos++; 116 s1_pos++;
110 s2_pos++; 117 s2_pos++;
111 } 118 }
112 if (c_isdigit (s1[s1_pos])) 119 if (s1_pos < s1_len && c_isdigit (s1[s1_pos]))
113 return 1; 120 return 1;
114 if (c_isdigit (s2[s2_pos])) 121 if (s2_pos < s2_len && c_isdigit (s2[s2_pos]))
115 return -1; 122 return -1;
116 if (first_diff) 123 if (first_diff)
117 return first_diff; 124 return first_diff;
@@ -124,58 +131,56 @@ verrevcmp (const char *s1, size_t s1_len, const char *s2, size_t s2_len)
124int 131int
125filevercmp (const char *s1, const char *s2) 132filevercmp (const char *s1, const char *s2)
126{ 133{
127 const char *s1_pos; 134 return filenvercmp (s1, -1, s2, -1);
128 const char *s2_pos; 135}
129 const char *s1_suffix, *s2_suffix;
130 size_t s1_len, s2_len;
131 int result;
132
133 /* easy comparison to see if strings are identical */
134 int simple_cmp = strcmp (s1, s2);
135 if (simple_cmp == 0)
136 return 0;
137 136
138 /* special handle for "", "." and ".." */ 137/* Compare versions A (of length ALEN) and B (of length BLEN).
139 if (!*s1) 138 See filevercmp.h for function description. */
140 return -1; 139int
141 if (!*s2) 140filenvercmp (char const *a, ptrdiff_t alen, char const *b, ptrdiff_t blen)
142 return 1; 141{
143 if (0 == strcmp (".", s1)) 142 /* Special case for empty versions. */
144 return -1; 143 bool aempty = alen < 0 ? !a[0] : !alen;
145 if (0 == strcmp (".", s2)) 144 bool bempty = blen < 0 ? !b[0] : !blen;
146 return 1; 145 if (aempty)
147 if (0 == strcmp ("..", s1)) 146 return -!bempty;
148 return -1; 147 if (bempty)
149 if (0 == strcmp ("..", s2))
150 return 1; 148 return 1;
151 149
152 /* special handle for other hidden files */ 150 /* Special cases for leading ".": "." sorts first, then "..", then
153 if (*s1 == '.' && *s2 != '.') 151 other names with leading ".", then other names. */
154 return -1; 152 if (a[0] == '.')
155 if (*s1 != '.' && *s2 == '.')
156 return 1;
157 if (*s1 == '.' && *s2 == '.')
158 { 153 {
159 s1++; 154 if (b[0] != '.')
160 s2++; 155 return -1;
161 }
162 156
163 /* "cut" file suffixes */ 157 bool adot = alen < 0 ? !a[1] : alen == 1;
164 s1_pos = s1; 158 bool bdot = blen < 0 ? !b[1] : blen == 1;
165 s2_pos = s2; 159 if (adot)
166 s1_suffix = match_suffix (&s1_pos); 160 return -!bdot;
167 s2_suffix = match_suffix (&s2_pos); 161 if (bdot)
168 s1_len = (s1_suffix ? s1_suffix : s1_pos) - s1; 162 return 1;
169 s2_len = (s2_suffix ? s2_suffix : s2_pos) - s2; 163
170 164 bool adotdot = a[1] == '.' && (alen < 0 ? !a[2] : alen == 2);
171 /* restore file suffixes if strings are identical after "cut" */ 165 bool bdotdot = b[1] == '.' && (blen < 0 ? !b[2] : blen == 2);
172 if ((s1_suffix || s2_suffix) && (s1_len == s2_len) 166 if (adotdot)
173 && 0 == strncmp (s1, s2, s1_len)) 167 return -!bdotdot;
174 { 168 if (bdotdot)
175 s1_len = s1_pos - s1; 169 return 1;
176 s2_len = s2_pos - s2;
177 } 170 }
171 else if (b[0] == '.')
172 return 1;
173
174 /* Cut file suffixes. */
175 idx_t aprefixlen = file_prefixlen (a, &alen);
176 idx_t bprefixlen = file_prefixlen (b, &blen);
177
178 /* If both suffixes are empty, a second pass would return the same thing. */
179 bool one_pass_only = aprefixlen == alen && bprefixlen == blen;
180
181 int result = verrevcmp (a, aprefixlen, b, bprefixlen);
178 182
179 result = verrevcmp (s1, s1_len, s2, s2_len); 183 /* Return the initial result if nonzero, or if no second pass is needed.
180 return result == 0 ? simple_cmp : result; 184 Otherwise, restore the suffixes and try again. */
185 return result || one_pass_only ? result : verrevcmp (a, alen, b, blen);
181} 186}
diff --git a/lib/filevercmp.h b/lib/filevercmp.h
index 98020e66674..5a336776719 100644
--- a/lib/filevercmp.h
+++ b/lib/filevercmp.h
@@ -1,11 +1,12 @@
1/* 1/* Compare file names containing version numbers.
2
2 Copyright (C) 1995 Ian Jackson <iwj10@cus.cam.ac.uk> 3 Copyright (C) 1995 Ian Jackson <iwj10@cus.cam.ac.uk>
3 Copyright (C) 2001 Anthony Towns <aj@azure.humbug.org.au> 4 Copyright (C) 2001 Anthony Towns <aj@azure.humbug.org.au>
4 Copyright (C) 2008-2022 Free Software Foundation, Inc. 5 Copyright (C) 2008-2022 Free Software Foundation, Inc.
5 6
6 This file is free software: you can redistribute it and/or modify 7 This file is free software: you can redistribute it and/or modify
7 it under the terms of the GNU Lesser General Public License as 8 it under the terms of the GNU Lesser General Public License as
8 published by the Free Software Foundation; either version 3 of the 9 published by the Free Software Foundation, either version 3 of the
9 License, or (at your option) any later version. 10 License, or (at your option) any later version.
10 11
11 This file is distributed in the hope that it will be useful, 12 This file is distributed in the hope that it will be useful,
@@ -19,24 +20,57 @@
19#ifndef FILEVERCMP_H 20#ifndef FILEVERCMP_H
20#define FILEVERCMP_H 21#define FILEVERCMP_H
21 22
22/* Compare version strings: 23#include <stddef.h>
24
25/* Compare strings A and B as file names containing version numbers,
26 and return an integer that is negative, zero, or positive depending
27 on whether A compares less than, equal to, or greater than B.
28
29 Use the following version sort algorithm:
30
31 1. Compare the strings' maximal-length non-digit prefixes lexically.
32 If there is a difference return that difference.
33 Otherwise discard the prefixes and continue with the next step.
34
35 2. Compare the strings' maximal-length digit prefixes, using
36 numeric comparison of the numbers represented by each prefix.
37 (Treat an empty prefix as zero; this can happen only at string end.)
38 If there is a difference, return that difference.
39 Otherwise discard the prefixes and continue with the next step.
40
41 3. If both strings are empty, return 0. Otherwise continue with step 1.
42
43 In version sort, lexical comparison is left to right, byte by byte,
44 using the byte's numeric value (0-255), except that:
45
46 1. ASCII letters sort before other bytes.
47 2. A tilde sorts before anything, even an empty string.
48
49 In addition to the version sort rules, the following strings have
50 special priority and sort before all other strings (listed in order):
23 51
24 This function compares strings S1 and S2: 52 1. The empty string.
25 1) By PREFIX in the same way as strcmp. 53 2. ".".
26 2) Then by VERSION (most similarly to version compare of Debian's dpkg). 54 3. "..".
27 Leading zeros in version numbers are ignored. 55 4. Strings starting with "." sort before other strings.
28 3) If both (PREFIX and VERSION) are equal, strcmp function is used for
29 comparison. So this function can return 0 if (and only if) strings S1
30 and S2 are identical.
31 56
32 It returns number >0 for S1 > S2, 0 for S1 == S2 and number <0 for S1 < S2. 57 Before comparing two strings where both begin with non-".",
58 or where both begin with "." but neither is "." or "..",
59 suffixes matching the C-locale extended regular expression
60 (\.[A-Za-z~][A-Za-z0-9~]*)*$ are removed and the strings compared
61 without them, using version sort without special priority;
62 if they do not compare equal, this comparison result is used and
63 the suffixes are effectively ignored. Otherwise, the entire
64 strings are compared using version sort.
33 65
34 This function compares strings, in a way that if VER1 and VER2 are version 66 This function is intended to be a replacement for strverscmp. */
35 numbers and PREFIX and SUFFIX (SUFFIX defined as (\.[A-Za-z~][A-Za-z0-9~]*)*) 67int filevercmp (char const *a, char const *b) _GL_ATTRIBUTE_PURE;
36 are strings then VER1 < VER2 implies filevercmp (PREFIX VER1 SUFFIX,
37 PREFIX VER2 SUFFIX) < 0.
38 68
39 This function is intended to be a replacement for strverscmp. */ 69/* Like filevercmp, except compare the byte arrays A (of length ALEN)
40int filevercmp (const char *s1, const char *s2) _GL_ATTRIBUTE_PURE; 70 and B (of length BLEN) so that A and B can contain '\0', which
71 sorts just before '\1'. But if ALEN is -1 treat A as a string
72 terminated by '\0', and similarly for BLEN. */
73int filenvercmp (char const *a, ptrdiff_t alen, char const *b, ptrdiff_t blen)
74 _GL_ATTRIBUTE_PURE;
41 75
42#endif /* FILEVERCMP_H */ 76#endif /* FILEVERCMP_H */
diff --git a/lib/fpending.c b/lib/fpending.c
index 617f3977f8f..6408cff4647 100644
--- a/lib/fpending.c
+++ b/lib/fpending.c
@@ -4,7 +4,7 @@
4 4
5 This program is free software: you can redistribute it and/or modify 5 This program is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by 6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 3 of the License, or 7 the Free Software Foundation, either version 3 of the License, or
8 (at your option) any later version. 8 (at your option) any later version.
9 9
10 This program is distributed in the hope that it will be useful, 10 This program is distributed in the hope that it will be useful,
diff --git a/lib/fpending.h b/lib/fpending.h
index 2b45e9031bb..43542c5b8ad 100644
--- a/lib/fpending.h
+++ b/lib/fpending.h
@@ -5,7 +5,7 @@
5 5
6 This program is free software: you can redistribute it and/or modify 6 This program is free software: you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by 7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 3 of the License, or 8 the Free Software Foundation, either version 3 of the License, or
9 (at your option) any later version. 9 (at your option) any later version.
10 10
11 This program is distributed in the hope that it will be useful, 11 This program is distributed in the hope that it will be useful,
diff --git a/lib/fstatat.c b/lib/fstatat.c
index 56de0cab4b2..6e8344964bc 100644
--- a/lib/fstatat.c
+++ b/lib/fstatat.c
@@ -4,7 +4,7 @@
4 4
5 This program is free software: you can redistribute it and/or modify 5 This program is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by 6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 3 of the License, or 7 the Free Software Foundation, either version 3 of the License, or
8 (at your option) any later version. 8 (at your option) any later version.
9 9
10 This program is distributed in the hope that it will be useful, 10 This program is distributed in the hope that it will be useful,
diff --git a/lib/fsusage.c b/lib/fsusage.c
index 734f0fc7460..18f790f6e7b 100644
--- a/lib/fsusage.c
+++ b/lib/fsusage.c
@@ -5,7 +5,7 @@
5 5
6 This file is free software: you can redistribute it and/or modify 6 This file is free software: you can redistribute it and/or modify
7 it under the terms of the GNU Lesser General Public License as 7 it under the terms of the GNU Lesser General Public License as
8 published by the Free Software Foundation; either version 3 of the 8 published by the Free Software Foundation, either version 3 of the
9 License, or (at your option) any later version. 9 License, or (at your option) any later version.
10 10
11 This file is distributed in the hope that it will be useful, 11 This file is distributed in the hope that it will be useful,
diff --git a/lib/fsusage.h b/lib/fsusage.h
index f4f50aba29c..0443d19f922 100644
--- a/lib/fsusage.h
+++ b/lib/fsusage.h
@@ -5,7 +5,7 @@
5 5
6 This file is free software: you can redistribute it and/or modify 6 This file is free software: you can redistribute it and/or modify
7 it under the terms of the GNU Lesser General Public License as 7 it under the terms of the GNU Lesser General Public License as
8 published by the Free Software Foundation; either version 3 of the 8 published by the Free Software Foundation, either version 3 of the
9 License, or (at your option) any later version. 9 License, or (at your option) any later version.
10 10
11 This file is distributed in the hope that it will be useful, 11 This file is distributed in the hope that it will be useful,
diff --git a/lib/ftoastr.c b/lib/ftoastr.c
index 4349c8c5611..91057529221 100644
--- a/lib/ftoastr.c
+++ b/lib/ftoastr.c
@@ -4,7 +4,7 @@
4 4
5 This program is free software: you can redistribute it and/or modify 5 This program is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by 6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 3 of the License, or 7 the Free Software Foundation, either version 3 of the License, or
8 (at your option) any later version. 8 (at your option) any later version.
9 9
10 This program is distributed in the hope that it will be useful, 10 This program is distributed in the hope that it will be useful,
diff --git a/lib/ftoastr.h b/lib/ftoastr.h
index 065574a9ff4..bac32a387e2 100644
--- a/lib/ftoastr.h
+++ b/lib/ftoastr.h
@@ -4,7 +4,7 @@
4 4
5 This program is free software: you can redistribute it and/or modify 5 This program is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by 6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 3 of the License, or 7 the Free Software Foundation, either version 3 of the License, or
8 (at your option) any later version. 8 (at your option) any later version.
9 9
10 This program is distributed in the hope that it will be useful, 10 This program is distributed in the hope that it will be useful,
diff --git a/lib/futimens.c b/lib/futimens.c
index 97228242b1e..bc3e41a9439 100644
--- a/lib/futimens.c
+++ b/lib/futimens.c
@@ -3,7 +3,7 @@
3 3
4 This file is free software: you can redistribute it and/or modify 4 This file is free software: you can redistribute it and/or modify
5 it under the terms of the GNU Lesser General Public License as 5 it under the terms of the GNU Lesser General Public License as
6 published by the Free Software Foundation; either version 3 of the 6 published by the Free Software Foundation, either version 3 of the
7 License, or (at your option) any later version. 7 License, or (at your option) any later version.
8 8
9 This file is distributed in the hope that it will be useful, 9 This file is distributed in the hope that it will be useful,
diff --git a/lib/get-permissions.c b/lib/get-permissions.c
index a17b791c8d8..ff79adae72f 100644
--- a/lib/get-permissions.c
+++ b/lib/get-permissions.c
@@ -4,7 +4,7 @@
4 4
5 This program is free software: you can redistribute it and/or modify 5 This program is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by 6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 3 of the License, or 7 the Free Software Foundation, either version 3 of the License, or
8 (at your option) any later version. 8 (at your option) any later version.
9 9
10 This program is distributed in the hope that it will be useful, 10 This program is distributed in the hope that it will be useful,
diff --git a/lib/getloadavg.c b/lib/getloadavg.c
index 53d1b81a3ba..37e82808671 100644
--- a/lib/getloadavg.c
+++ b/lib/getloadavg.c
@@ -8,7 +8,7 @@
8 8
9 This program is free software: you can redistribute it and/or modify 9 This program is free software: you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by 10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 3 of the License, or 11 the Free Software Foundation, either version 3 of the License, or
12 (at your option) any later version. 12 (at your option) any later version.
13 13
14 This program is distributed in the hope that it will be useful, 14 This program is distributed in the hope that it will be useful,
diff --git a/lib/gettime.c b/lib/gettime.c
index a44a69dfc43..541af18bbfa 100644
--- a/lib/gettime.c
+++ b/lib/gettime.c
@@ -4,7 +4,7 @@
4 4
5 This file is free software: you can redistribute it and/or modify 5 This file is free software: you can redistribute it and/or modify
6 it under the terms of the GNU Lesser General Public License as 6 it under the terms of the GNU Lesser General Public License as
7 published by the Free Software Foundation; either version 3 of the 7 published by the Free Software Foundation, either version 3 of the
8 License, or (at your option) any later version. 8 License, or (at your option) any later version.
9 9
10 This file is distributed in the hope that it will be useful, 10 This file is distributed in the hope that it will be useful,
diff --git a/lib/gnulib.mk.in b/lib/gnulib.mk.in
index a8a6cd782d5..6b90a80f64a 100644
--- a/lib/gnulib.mk.in
+++ b/lib/gnulib.mk.in
@@ -3,7 +3,7 @@
3# 3#
4# This file is free software; you can redistribute it and/or modify 4# This file is free software; you can redistribute it and/or modify
5# it under the terms of the GNU General Public License as published by 5# it under the terms of the GNU General Public License as published by
6# the Free Software Foundation; either version 3 of the License, or 6# the Free Software Foundation, either version 3 of the License, or
7# (at your option) any later version. 7# (at your option) any later version.
8# 8#
9# This file is distributed in the hope that it will be useful, 9# This file is distributed in the hope that it will be useful,
@@ -191,6 +191,10 @@ BUILD_DETAILS = @BUILD_DETAILS@
191BYTESWAP_H = @BYTESWAP_H@ 191BYTESWAP_H = @BYTESWAP_H@
192CAIRO_CFLAGS = @CAIRO_CFLAGS@ 192CAIRO_CFLAGS = @CAIRO_CFLAGS@
193CAIRO_LIBS = @CAIRO_LIBS@ 193CAIRO_LIBS = @CAIRO_LIBS@
194CAIRO_XCB_CFLAGS = @CAIRO_XCB_CFLAGS@
195CAIRO_XCB_LIBS = @CAIRO_XCB_LIBS@
196CAIRO_XLIB_CFLAGS = @CAIRO_XLIB_CFLAGS@
197CAIRO_XLIB_LIBS = @CAIRO_XLIB_LIBS@
194CC = @CC@ 198CC = @CC@
195CFLAGS = @CFLAGS@ 199CFLAGS = @CFLAGS@
196CFLAGS_SOUND = @CFLAGS_SOUND@ 200CFLAGS_SOUND = @CFLAGS_SOUND@
@@ -247,7 +251,59 @@ GETOPT_CDEFS_H = @GETOPT_CDEFS_H@
247GETOPT_H = @GETOPT_H@ 251GETOPT_H = @GETOPT_H@
248GFILENOTIFY_CFLAGS = @GFILENOTIFY_CFLAGS@ 252GFILENOTIFY_CFLAGS = @GFILENOTIFY_CFLAGS@
249GFILENOTIFY_LIBS = @GFILENOTIFY_LIBS@ 253GFILENOTIFY_LIBS = @GFILENOTIFY_LIBS@
254GL_CFLAG_ALLOW_WARNINGS = @GL_CFLAG_ALLOW_WARNINGS@
255GL_CFLAG_GNULIB_WARNINGS = @GL_CFLAG_GNULIB_WARNINGS@
250GL_COND_LIBTOOL_CONDITION = @GL_COND_LIBTOOL_CONDITION@ 256GL_COND_LIBTOOL_CONDITION = @GL_COND_LIBTOOL_CONDITION@
257GL_COND_OBJ_CANONICALIZE_LGPL_CONDITION = @GL_COND_OBJ_CANONICALIZE_LGPL_CONDITION@
258GL_COND_OBJ_COPY_FILE_RANGE_CONDITION = @GL_COND_OBJ_COPY_FILE_RANGE_CONDITION@
259GL_COND_OBJ_DIRFD_CONDITION = @GL_COND_OBJ_DIRFD_CONDITION@
260GL_COND_OBJ_DUP2_CONDITION = @GL_COND_OBJ_DUP2_CONDITION@
261GL_COND_OBJ_EUIDACCESS_CONDITION = @GL_COND_OBJ_EUIDACCESS_CONDITION@
262GL_COND_OBJ_EXECINFO_CONDITION = @GL_COND_OBJ_EXECINFO_CONDITION@
263GL_COND_OBJ_EXPLICIT_BZERO_CONDITION = @GL_COND_OBJ_EXPLICIT_BZERO_CONDITION@
264GL_COND_OBJ_FACCESSAT_CONDITION = @GL_COND_OBJ_FACCESSAT_CONDITION@
265GL_COND_OBJ_FCHMODAT_CONDITION = @GL_COND_OBJ_FCHMODAT_CONDITION@
266GL_COND_OBJ_FCNTL_CONDITION = @GL_COND_OBJ_FCNTL_CONDITION@
267GL_COND_OBJ_FDOPENDIR_CONDITION = @GL_COND_OBJ_FDOPENDIR_CONDITION@
268GL_COND_OBJ_FPENDING_CONDITION = @GL_COND_OBJ_FPENDING_CONDITION@
269GL_COND_OBJ_FREE_CONDITION = @GL_COND_OBJ_FREE_CONDITION@
270GL_COND_OBJ_FSTATAT_CONDITION = @GL_COND_OBJ_FSTATAT_CONDITION@
271GL_COND_OBJ_FSUSAGE_CONDITION = @GL_COND_OBJ_FSUSAGE_CONDITION@
272GL_COND_OBJ_FSYNC_CONDITION = @GL_COND_OBJ_FSYNC_CONDITION@
273GL_COND_OBJ_FUTIMENS_CONDITION = @GL_COND_OBJ_FUTIMENS_CONDITION@
274GL_COND_OBJ_GETDTABLESIZE_CONDITION = @GL_COND_OBJ_GETDTABLESIZE_CONDITION@
275GL_COND_OBJ_GETGROUPS_CONDITION = @GL_COND_OBJ_GETGROUPS_CONDITION@
276GL_COND_OBJ_GETLOADAVG_CONDITION = @GL_COND_OBJ_GETLOADAVG_CONDITION@
277GL_COND_OBJ_GETOPT_CONDITION = @GL_COND_OBJ_GETOPT_CONDITION@
278GL_COND_OBJ_GETRANDOM_CONDITION = @GL_COND_OBJ_GETRANDOM_CONDITION@
279GL_COND_OBJ_GETTIMEOFDAY_CONDITION = @GL_COND_OBJ_GETTIMEOFDAY_CONDITION@
280GL_COND_OBJ_GROUP_MEMBER_CONDITION = @GL_COND_OBJ_GROUP_MEMBER_CONDITION@
281GL_COND_OBJ_LCHMOD_CONDITION = @GL_COND_OBJ_LCHMOD_CONDITION@
282GL_COND_OBJ_LSTAT_CONDITION = @GL_COND_OBJ_LSTAT_CONDITION@
283GL_COND_OBJ_MEMPCPY_CONDITION = @GL_COND_OBJ_MEMPCPY_CONDITION@
284GL_COND_OBJ_MEMRCHR_CONDITION = @GL_COND_OBJ_MEMRCHR_CONDITION@
285GL_COND_OBJ_MINI_GMP_GNULIB_CONDITION = @GL_COND_OBJ_MINI_GMP_GNULIB_CONDITION@
286GL_COND_OBJ_MKOSTEMP_CONDITION = @GL_COND_OBJ_MKOSTEMP_CONDITION@
287GL_COND_OBJ_OPEN_CONDITION = @GL_COND_OBJ_OPEN_CONDITION@
288GL_COND_OBJ_PSELECT_CONDITION = @GL_COND_OBJ_PSELECT_CONDITION@
289GL_COND_OBJ_PTHREAD_SIGMASK_CONDITION = @GL_COND_OBJ_PTHREAD_SIGMASK_CONDITION@
290GL_COND_OBJ_RAWMEMCHR_CONDITION = @GL_COND_OBJ_RAWMEMCHR_CONDITION@
291GL_COND_OBJ_READLINKAT_CONDITION = @GL_COND_OBJ_READLINKAT_CONDITION@
292GL_COND_OBJ_READLINK_CONDITION = @GL_COND_OBJ_READLINK_CONDITION@
293GL_COND_OBJ_REGEX_CONDITION = @GL_COND_OBJ_REGEX_CONDITION@
294GL_COND_OBJ_SIG2STR_CONDITION = @GL_COND_OBJ_SIG2STR_CONDITION@
295GL_COND_OBJ_SIGDESCR_NP_CONDITION = @GL_COND_OBJ_SIGDESCR_NP_CONDITION@
296GL_COND_OBJ_STDIO_READ_CONDITION = @GL_COND_OBJ_STDIO_READ_CONDITION@
297GL_COND_OBJ_STDIO_WRITE_CONDITION = @GL_COND_OBJ_STDIO_WRITE_CONDITION@
298GL_COND_OBJ_STPCPY_CONDITION = @GL_COND_OBJ_STPCPY_CONDITION@
299GL_COND_OBJ_STRNLEN_CONDITION = @GL_COND_OBJ_STRNLEN_CONDITION@
300GL_COND_OBJ_STRTOIMAX_CONDITION = @GL_COND_OBJ_STRTOIMAX_CONDITION@
301GL_COND_OBJ_STRTOLL_CONDITION = @GL_COND_OBJ_STRTOLL_CONDITION@
302GL_COND_OBJ_SYMLINK_CONDITION = @GL_COND_OBJ_SYMLINK_CONDITION@
303GL_COND_OBJ_TIMEGM_CONDITION = @GL_COND_OBJ_TIMEGM_CONDITION@
304GL_COND_OBJ_TIME_RZ_CONDITION = @GL_COND_OBJ_TIME_RZ_CONDITION@
305GL_COND_OBJ_TIME_R_CONDITION = @GL_COND_OBJ_TIME_R_CONDITION@
306GL_COND_OBJ_UTIMENSAT_CONDITION = @GL_COND_OBJ_UTIMENSAT_CONDITION@
251GL_GENERATE_ALLOCA_H_CONDITION = @GL_GENERATE_ALLOCA_H_CONDITION@ 307GL_GENERATE_ALLOCA_H_CONDITION = @GL_GENERATE_ALLOCA_H_CONDITION@
252GL_GENERATE_BYTESWAP_H_CONDITION = @GL_GENERATE_BYTESWAP_H_CONDITION@ 308GL_GENERATE_BYTESWAP_H_CONDITION = @GL_GENERATE_BYTESWAP_H_CONDITION@
253GL_GENERATE_ERRNO_H_CONDITION = @GL_GENERATE_ERRNO_H_CONDITION@ 309GL_GENERATE_ERRNO_H_CONDITION = @GL_GENERATE_ERRNO_H_CONDITION@
@@ -974,6 +1030,7 @@ REPLACE_CANONICALIZE_FILE_NAME = @REPLACE_CANONICALIZE_FILE_NAME@
974REPLACE_CHOWN = @REPLACE_CHOWN@ 1030REPLACE_CHOWN = @REPLACE_CHOWN@
975REPLACE_CLOSE = @REPLACE_CLOSE@ 1031REPLACE_CLOSE = @REPLACE_CLOSE@
976REPLACE_CLOSEDIR = @REPLACE_CLOSEDIR@ 1032REPLACE_CLOSEDIR = @REPLACE_CLOSEDIR@
1033REPLACE_COPY_FILE_RANGE = @REPLACE_COPY_FILE_RANGE@
977REPLACE_CREAT = @REPLACE_CREAT@ 1034REPLACE_CREAT = @REPLACE_CREAT@
978REPLACE_CTIME = @REPLACE_CTIME@ 1035REPLACE_CTIME = @REPLACE_CTIME@
979REPLACE_DIRFD = @REPLACE_DIRFD@ 1036REPLACE_DIRFD = @REPLACE_DIRFD@
@@ -1197,6 +1254,8 @@ XOBJ = @XOBJ@
1197XRANDR_CFLAGS = @XRANDR_CFLAGS@ 1254XRANDR_CFLAGS = @XRANDR_CFLAGS@
1198XRANDR_LIBS = @XRANDR_LIBS@ 1255XRANDR_LIBS = @XRANDR_LIBS@
1199XRENDER_LIBS = @XRENDER_LIBS@ 1256XRENDER_LIBS = @XRENDER_LIBS@
1257XSYNC_CFLAGS = @XSYNC_CFLAGS@
1258XSYNC_LIBS = @XSYNC_LIBS@
1200XWIDGETS_OBJ = @XWIDGETS_OBJ@ 1259XWIDGETS_OBJ = @XWIDGETS_OBJ@
1201X_TOOLKIT_TYPE = @X_TOOLKIT_TYPE@ 1260X_TOOLKIT_TYPE = @X_TOOLKIT_TYPE@
1202ac_ct_CC = @ac_ct_CC@ 1261ac_ct_CC = @ac_ct_CC@
@@ -1251,8 +1310,10 @@ gl_GNULIB_ENABLED_rawmemchr_CONDITION = @gl_GNULIB_ENABLED_rawmemchr_CONDITION@
1251gl_GNULIB_ENABLED_scratch_buffer_CONDITION = @gl_GNULIB_ENABLED_scratch_buffer_CONDITION@ 1310gl_GNULIB_ENABLED_scratch_buffer_CONDITION = @gl_GNULIB_ENABLED_scratch_buffer_CONDITION@
1252gl_GNULIB_ENABLED_strtoll_CONDITION = @gl_GNULIB_ENABLED_strtoll_CONDITION@ 1311gl_GNULIB_ENABLED_strtoll_CONDITION = @gl_GNULIB_ENABLED_strtoll_CONDITION@
1253gl_GNULIB_ENABLED_utimens_CONDITION = @gl_GNULIB_ENABLED_utimens_CONDITION@ 1312gl_GNULIB_ENABLED_utimens_CONDITION = @gl_GNULIB_ENABLED_utimens_CONDITION@
1313gl_LIBOBJDEPS = @gl_LIBOBJDEPS@
1254gl_LIBOBJS = @gl_LIBOBJS@ 1314gl_LIBOBJS = @gl_LIBOBJS@
1255gl_LTLIBOBJS = @gl_LTLIBOBJS@ 1315gl_LTLIBOBJS = @gl_LTLIBOBJS@
1316gltests_LIBOBJDEPS = @gltests_LIBOBJDEPS@
1256gltests_LIBOBJS = @gltests_LIBOBJS@ 1317gltests_LIBOBJS = @gltests_LIBOBJS@
1257gltests_LTLIBOBJS = @gltests_LTLIBOBJS@ 1318gltests_LTLIBOBJS = @gltests_LTLIBOBJS@
1258gltests_WITNESS = @gltests_WITNESS@ 1319gltests_WITNESS = @gltests_WITNESS@
@@ -1303,6 +1364,7 @@ x_default_search_path = @x_default_search_path@
1303noinst_LIBRARIES += libgnu.a 1364noinst_LIBRARIES += libgnu.a
1304 1365
1305libgnu_a_SOURCES = 1366libgnu_a_SOURCES =
1367libgnu_a_CFLAGS = $(AM_CFLAGS) $(GL_CFLAG_GNULIB_WARNINGS)
1306libgnu_a_LIBADD = $(gl_LIBOBJS) 1368libgnu_a_LIBADD = $(gl_LIBOBJS)
1307libgnu_a_DEPENDENCIES = $(gl_LIBOBJS) 1369libgnu_a_DEPENDENCIES = $(gl_LIBOBJS)
1308EXTRA_libgnu_a_SOURCES = 1370EXTRA_libgnu_a_SOURCES =
@@ -1432,10 +1494,9 @@ endif
1432## begin gnulib module canonicalize-lgpl 1494## begin gnulib module canonicalize-lgpl
1433ifeq (,$(OMIT_GNULIB_MODULE_canonicalize-lgpl)) 1495ifeq (,$(OMIT_GNULIB_MODULE_canonicalize-lgpl))
1434 1496
1435 1497ifneq (,$(GL_COND_OBJ_CANONICALIZE_LGPL_CONDITION))
1436EXTRA_DIST += canonicalize-lgpl.c 1498libgnu_a_SOURCES += canonicalize-lgpl.c
1437 1499endif
1438EXTRA_libgnu_a_SOURCES += canonicalize-lgpl.c
1439 1500
1440endif 1501endif
1441## end gnulib module canonicalize-lgpl 1502## end gnulib module canonicalize-lgpl
@@ -1475,10 +1536,9 @@ endif
1475## begin gnulib module copy-file-range 1536## begin gnulib module copy-file-range
1476ifeq (,$(OMIT_GNULIB_MODULE_copy-file-range)) 1537ifeq (,$(OMIT_GNULIB_MODULE_copy-file-range))
1477 1538
1478 1539ifneq (,$(GL_COND_OBJ_COPY_FILE_RANGE_CONDITION))
1479EXTRA_DIST += copy-file-range.c 1540libgnu_a_SOURCES += copy-file-range.c
1480 1541endif
1481EXTRA_libgnu_a_SOURCES += copy-file-range.c
1482 1542
1483endif 1543endif
1484## end gnulib module copy-file-range 1544## end gnulib module copy-file-range
@@ -1621,13 +1681,12 @@ endif
1621ifeq (,$(OMIT_GNULIB_MODULE_dirfd)) 1681ifeq (,$(OMIT_GNULIB_MODULE_dirfd))
1622 1682
1623ifneq (,$(gl_GNULIB_ENABLED_dirfd_CONDITION)) 1683ifneq (,$(gl_GNULIB_ENABLED_dirfd_CONDITION))
1624 1684ifneq (,$(GL_COND_OBJ_DIRFD_CONDITION))
1685libgnu_a_SOURCES += dirfd.c
1625endif 1686endif
1626EXTRA_DIST += dirfd.c
1627
1628EXTRA_libgnu_a_SOURCES += dirfd.c
1629 1687
1630endif 1688endif
1689endif
1631## end gnulib module dirfd 1690## end gnulib module dirfd
1632 1691
1633## begin gnulib module dtoastr 1692## begin gnulib module dtoastr
@@ -1653,10 +1712,9 @@ endif
1653## begin gnulib module dup2 1712## begin gnulib module dup2
1654ifeq (,$(OMIT_GNULIB_MODULE_dup2)) 1713ifeq (,$(OMIT_GNULIB_MODULE_dup2))
1655 1714
1656 1715ifneq (,$(GL_COND_OBJ_DUP2_CONDITION))
1657EXTRA_DIST += dup2.c 1716libgnu_a_SOURCES += dup2.c
1658 1717endif
1659EXTRA_libgnu_a_SOURCES += dup2.c
1660 1718
1661endif 1719endif
1662## end gnulib module dup2 1720## end gnulib module dup2
@@ -1747,13 +1805,12 @@ endif
1747ifeq (,$(OMIT_GNULIB_MODULE_euidaccess)) 1805ifeq (,$(OMIT_GNULIB_MODULE_euidaccess))
1748 1806
1749ifneq (,$(gl_GNULIB_ENABLED_euidaccess_CONDITION)) 1807ifneq (,$(gl_GNULIB_ENABLED_euidaccess_CONDITION))
1750 1808ifneq (,$(GL_COND_OBJ_EUIDACCESS_CONDITION))
1809libgnu_a_SOURCES += euidaccess.c
1751endif 1810endif
1752EXTRA_DIST += euidaccess.c
1753
1754EXTRA_libgnu_a_SOURCES += euidaccess.c
1755 1811
1756endif 1812endif
1813endif
1757## end gnulib module euidaccess 1814## end gnulib module euidaccess
1758 1815
1759## begin gnulib module execinfo 1816## begin gnulib module execinfo
@@ -1773,9 +1830,11 @@ execinfo.h: $(top_builddir)/config.status
1773endif 1830endif
1774MOSTLYCLEANFILES += execinfo.h execinfo.h-t 1831MOSTLYCLEANFILES += execinfo.h execinfo.h-t
1775 1832
1776EXTRA_DIST += execinfo.c execinfo.in.h 1833ifneq (,$(GL_COND_OBJ_EXECINFO_CONDITION))
1834libgnu_a_SOURCES += execinfo.c
1835endif
1777 1836
1778EXTRA_libgnu_a_SOURCES += execinfo.c 1837EXTRA_DIST += execinfo.in.h
1779 1838
1780endif 1839endif
1781## end gnulib module execinfo 1840## end gnulib module execinfo
@@ -1783,10 +1842,9 @@ endif
1783## begin gnulib module explicit_bzero 1842## begin gnulib module explicit_bzero
1784ifeq (,$(OMIT_GNULIB_MODULE_explicit_bzero)) 1843ifeq (,$(OMIT_GNULIB_MODULE_explicit_bzero))
1785 1844
1786 1845ifneq (,$(GL_COND_OBJ_EXPLICIT_BZERO_CONDITION))
1787EXTRA_DIST += explicit_bzero.c 1846libgnu_a_SOURCES += explicit_bzero.c
1788 1847endif
1789EXTRA_libgnu_a_SOURCES += explicit_bzero.c
1790 1848
1791endif 1849endif
1792## end gnulib module explicit_bzero 1850## end gnulib module explicit_bzero
@@ -1794,10 +1852,13 @@ endif
1794## begin gnulib module faccessat 1852## begin gnulib module faccessat
1795ifeq (,$(OMIT_GNULIB_MODULE_faccessat)) 1853ifeq (,$(OMIT_GNULIB_MODULE_faccessat))
1796 1854
1855ifneq (,$(GL_COND_OBJ_FACCESSAT_CONDITION))
1856libgnu_a_SOURCES += faccessat.c
1857endif
1797 1858
1798EXTRA_DIST += at-func.c faccessat.c 1859EXTRA_DIST += at-func.c
1799 1860
1800EXTRA_libgnu_a_SOURCES += at-func.c faccessat.c 1861EXTRA_libgnu_a_SOURCES += at-func.c
1801 1862
1802endif 1863endif
1803## end gnulib module faccessat 1864## end gnulib module faccessat
@@ -1805,10 +1866,13 @@ endif
1805## begin gnulib module fchmodat 1866## begin gnulib module fchmodat
1806ifeq (,$(OMIT_GNULIB_MODULE_fchmodat)) 1867ifeq (,$(OMIT_GNULIB_MODULE_fchmodat))
1807 1868
1869ifneq (,$(GL_COND_OBJ_FCHMODAT_CONDITION))
1870libgnu_a_SOURCES += fchmodat.c
1871endif
1808 1872
1809EXTRA_DIST += at-func.c fchmodat.c 1873EXTRA_DIST += at-func.c
1810 1874
1811EXTRA_libgnu_a_SOURCES += at-func.c fchmodat.c 1875EXTRA_libgnu_a_SOURCES += at-func.c
1812 1876
1813endif 1877endif
1814## end gnulib module fchmodat 1878## end gnulib module fchmodat
@@ -1816,10 +1880,9 @@ endif
1816## begin gnulib module fcntl 1880## begin gnulib module fcntl
1817ifeq (,$(OMIT_GNULIB_MODULE_fcntl)) 1881ifeq (,$(OMIT_GNULIB_MODULE_fcntl))
1818 1882
1819 1883ifneq (,$(GL_COND_OBJ_FCNTL_CONDITION))
1820EXTRA_DIST += fcntl.c 1884libgnu_a_SOURCES += fcntl.c
1821 1885endif
1822EXTRA_libgnu_a_SOURCES += fcntl.c
1823 1886
1824endif 1887endif
1825## end gnulib module fcntl 1888## end gnulib module fcntl
@@ -1866,10 +1929,9 @@ endif
1866## begin gnulib module fdopendir 1929## begin gnulib module fdopendir
1867ifeq (,$(OMIT_GNULIB_MODULE_fdopendir)) 1930ifeq (,$(OMIT_GNULIB_MODULE_fdopendir))
1868 1931
1869 1932ifneq (,$(GL_COND_OBJ_FDOPENDIR_CONDITION))
1870EXTRA_DIST += fdopendir.c 1933libgnu_a_SOURCES += fdopendir.c
1871 1934endif
1872EXTRA_libgnu_a_SOURCES += fdopendir.c
1873 1935
1874endif 1936endif
1875## end gnulib module fdopendir 1937## end gnulib module fdopendir
@@ -1925,10 +1987,11 @@ endif
1925## begin gnulib module fpending 1987## begin gnulib module fpending
1926ifeq (,$(OMIT_GNULIB_MODULE_fpending)) 1988ifeq (,$(OMIT_GNULIB_MODULE_fpending))
1927 1989
1990ifneq (,$(GL_COND_OBJ_FPENDING_CONDITION))
1991libgnu_a_SOURCES += fpending.c
1992endif
1928 1993
1929EXTRA_DIST += fpending.c fpending.h stdio-impl.h 1994EXTRA_DIST += fpending.h stdio-impl.h
1930
1931EXTRA_libgnu_a_SOURCES += fpending.c
1932 1995
1933endif 1996endif
1934## end gnulib module fpending 1997## end gnulib module fpending
@@ -1936,10 +1999,9 @@ endif
1936## begin gnulib module free-posix 1999## begin gnulib module free-posix
1937ifeq (,$(OMIT_GNULIB_MODULE_free-posix)) 2000ifeq (,$(OMIT_GNULIB_MODULE_free-posix))
1938 2001
1939 2002ifneq (,$(GL_COND_OBJ_FREE_CONDITION))
1940EXTRA_DIST += free.c 2003libgnu_a_SOURCES += free.c
1941 2004endif
1942EXTRA_libgnu_a_SOURCES += free.c
1943 2005
1944endif 2006endif
1945## end gnulib module free-posix 2007## end gnulib module free-posix
@@ -1947,10 +2009,13 @@ endif
1947## begin gnulib module fstatat 2009## begin gnulib module fstatat
1948ifeq (,$(OMIT_GNULIB_MODULE_fstatat)) 2010ifeq (,$(OMIT_GNULIB_MODULE_fstatat))
1949 2011
2012ifneq (,$(GL_COND_OBJ_FSTATAT_CONDITION))
2013libgnu_a_SOURCES += fstatat.c
2014endif
1950 2015
1951EXTRA_DIST += at-func.c fstatat.c 2016EXTRA_DIST += at-func.c
1952 2017
1953EXTRA_libgnu_a_SOURCES += at-func.c fstatat.c 2018EXTRA_libgnu_a_SOURCES += at-func.c
1954 2019
1955endif 2020endif
1956## end gnulib module fstatat 2021## end gnulib module fstatat
@@ -1958,10 +2023,11 @@ endif
1958## begin gnulib module fsusage 2023## begin gnulib module fsusage
1959ifeq (,$(OMIT_GNULIB_MODULE_fsusage)) 2024ifeq (,$(OMIT_GNULIB_MODULE_fsusage))
1960 2025
2026ifneq (,$(GL_COND_OBJ_FSUSAGE_CONDITION))
2027libgnu_a_SOURCES += fsusage.c
2028endif
1961 2029
1962EXTRA_DIST += fsusage.c fsusage.h 2030EXTRA_DIST += fsusage.h
1963
1964EXTRA_libgnu_a_SOURCES += fsusage.c
1965 2031
1966endif 2032endif
1967## end gnulib module fsusage 2033## end gnulib module fsusage
@@ -1969,10 +2035,9 @@ endif
1969## begin gnulib module fsync 2035## begin gnulib module fsync
1970ifeq (,$(OMIT_GNULIB_MODULE_fsync)) 2036ifeq (,$(OMIT_GNULIB_MODULE_fsync))
1971 2037
1972 2038ifneq (,$(GL_COND_OBJ_FSYNC_CONDITION))
1973EXTRA_DIST += fsync.c 2039libgnu_a_SOURCES += fsync.c
1974 2040endif
1975EXTRA_libgnu_a_SOURCES += fsync.c
1976 2041
1977endif 2042endif
1978## end gnulib module fsync 2043## end gnulib module fsync
@@ -1980,10 +2045,9 @@ endif
1980## begin gnulib module futimens 2045## begin gnulib module futimens
1981ifeq (,$(OMIT_GNULIB_MODULE_futimens)) 2046ifeq (,$(OMIT_GNULIB_MODULE_futimens))
1982 2047
1983 2048ifneq (,$(GL_COND_OBJ_FUTIMENS_CONDITION))
1984EXTRA_DIST += futimens.c 2049libgnu_a_SOURCES += futimens.c
1985 2050endif
1986EXTRA_libgnu_a_SOURCES += futimens.c
1987 2051
1988endif 2052endif
1989## end gnulib module futimens 2053## end gnulib module futimens
@@ -2013,35 +2077,32 @@ endif
2013ifeq (,$(OMIT_GNULIB_MODULE_getdtablesize)) 2077ifeq (,$(OMIT_GNULIB_MODULE_getdtablesize))
2014 2078
2015ifneq (,$(gl_GNULIB_ENABLED_getdtablesize_CONDITION)) 2079ifneq (,$(gl_GNULIB_ENABLED_getdtablesize_CONDITION))
2016 2080ifneq (,$(GL_COND_OBJ_GETDTABLESIZE_CONDITION))
2081libgnu_a_SOURCES += getdtablesize.c
2017endif 2082endif
2018EXTRA_DIST += getdtablesize.c
2019
2020EXTRA_libgnu_a_SOURCES += getdtablesize.c
2021 2083
2022endif 2084endif
2085endif
2023## end gnulib module getdtablesize 2086## end gnulib module getdtablesize
2024 2087
2025## begin gnulib module getgroups 2088## begin gnulib module getgroups
2026ifeq (,$(OMIT_GNULIB_MODULE_getgroups)) 2089ifeq (,$(OMIT_GNULIB_MODULE_getgroups))
2027 2090
2028ifneq (,$(gl_GNULIB_ENABLED_getgroups_CONDITION)) 2091ifneq (,$(gl_GNULIB_ENABLED_getgroups_CONDITION))
2029 2092ifneq (,$(GL_COND_OBJ_GETGROUPS_CONDITION))
2093libgnu_a_SOURCES += getgroups.c
2030endif 2094endif
2031EXTRA_DIST += getgroups.c
2032
2033EXTRA_libgnu_a_SOURCES += getgroups.c
2034 2095
2035endif 2096endif
2097endif
2036## end gnulib module getgroups 2098## end gnulib module getgroups
2037 2099
2038## begin gnulib module getloadavg 2100## begin gnulib module getloadavg
2039ifeq (,$(OMIT_GNULIB_MODULE_getloadavg)) 2101ifeq (,$(OMIT_GNULIB_MODULE_getloadavg))
2040 2102
2041 2103ifneq (,$(GL_COND_OBJ_GETLOADAVG_CONDITION))
2042EXTRA_DIST += getloadavg.c 2104libgnu_a_SOURCES += getloadavg.c
2043 2105endif
2044EXTRA_libgnu_a_SOURCES += getloadavg.c
2045 2106
2046endif 2107endif
2047## end gnulib module getloadavg 2108## end gnulib module getloadavg
@@ -2083,9 +2144,11 @@ endif
2083 2144
2084MOSTLYCLEANFILES += getopt.h getopt.h-t getopt-cdefs.h getopt-cdefs.h-t 2145MOSTLYCLEANFILES += getopt.h getopt.h-t getopt-cdefs.h getopt-cdefs.h-t
2085 2146
2086EXTRA_DIST += getopt-cdefs.in.h getopt-core.h getopt-ext.h getopt-pfx-core.h getopt-pfx-ext.h getopt.c getopt.in.h getopt1.c getopt_int.h 2147ifneq (,$(GL_COND_OBJ_GETOPT_CONDITION))
2148libgnu_a_SOURCES += getopt.c getopt1.c
2149endif
2087 2150
2088EXTRA_libgnu_a_SOURCES += getopt.c getopt1.c 2151EXTRA_DIST += getopt-cdefs.in.h getopt-core.h getopt-ext.h getopt-pfx-core.h getopt-pfx-ext.h getopt.in.h getopt_int.h
2089 2152
2090endif 2153endif
2091## end gnulib module getopt-posix 2154## end gnulib module getopt-posix
@@ -2093,10 +2156,9 @@ endif
2093## begin gnulib module getrandom 2156## begin gnulib module getrandom
2094ifeq (,$(OMIT_GNULIB_MODULE_getrandom)) 2157ifeq (,$(OMIT_GNULIB_MODULE_getrandom))
2095 2158
2096 2159ifneq (,$(GL_COND_OBJ_GETRANDOM_CONDITION))
2097EXTRA_DIST += getrandom.c 2160libgnu_a_SOURCES += getrandom.c
2098 2161endif
2099EXTRA_libgnu_a_SOURCES += getrandom.c
2100 2162
2101endif 2163endif
2102## end gnulib module getrandom 2164## end gnulib module getrandom
@@ -2122,10 +2184,9 @@ endif
2122## begin gnulib module gettimeofday 2184## begin gnulib module gettimeofday
2123ifeq (,$(OMIT_GNULIB_MODULE_gettimeofday)) 2185ifeq (,$(OMIT_GNULIB_MODULE_gettimeofday))
2124 2186
2125 2187ifneq (,$(GL_COND_OBJ_GETTIMEOFDAY_CONDITION))
2126EXTRA_DIST += gettimeofday.c 2188libgnu_a_SOURCES += gettimeofday.c
2127 2189endif
2128EXTRA_libgnu_a_SOURCES += gettimeofday.c
2129 2190
2130endif 2191endif
2131## end gnulib module gettimeofday 2192## end gnulib module gettimeofday
@@ -2143,13 +2204,12 @@ endif
2143ifeq (,$(OMIT_GNULIB_MODULE_group-member)) 2204ifeq (,$(OMIT_GNULIB_MODULE_group-member))
2144 2205
2145ifneq (,$(gl_GNULIB_ENABLED_a9786850e999ae65a836a6041e8e5ed1_CONDITION)) 2206ifneq (,$(gl_GNULIB_ENABLED_a9786850e999ae65a836a6041e8e5ed1_CONDITION))
2146 2207ifneq (,$(GL_COND_OBJ_GROUP_MEMBER_CONDITION))
2208libgnu_a_SOURCES += group-member.c
2147endif 2209endif
2148EXTRA_DIST += group-member.c
2149
2150EXTRA_libgnu_a_SOURCES += group-member.c
2151 2210
2152endif 2211endif
2212endif
2153## end gnulib module group-member 2213## end gnulib module group-member
2154 2214
2155## begin gnulib module idx 2215## begin gnulib module idx
@@ -2249,13 +2309,12 @@ endif
2249ifeq (,$(OMIT_GNULIB_MODULE_lchmod)) 2309ifeq (,$(OMIT_GNULIB_MODULE_lchmod))
2250 2310
2251ifneq (,$(gl_GNULIB_ENABLED_lchmod_CONDITION)) 2311ifneq (,$(gl_GNULIB_ENABLED_lchmod_CONDITION))
2252 2312ifneq (,$(GL_COND_OBJ_LCHMOD_CONDITION))
2313libgnu_a_SOURCES += lchmod.c
2253endif 2314endif
2254EXTRA_DIST += lchmod.c
2255
2256EXTRA_libgnu_a_SOURCES += lchmod.c
2257 2315
2258endif 2316endif
2317endif
2259## end gnulib module lchmod 2318## end gnulib module lchmod
2260 2319
2261## begin gnulib module libc-config 2320## begin gnulib module libc-config
@@ -2291,9 +2350,13 @@ gmp.h: $(top_builddir)/config.status
2291endif 2350endif
2292MOSTLYCLEANFILES += gmp.h gmp.h-t 2351MOSTLYCLEANFILES += gmp.h gmp.h-t
2293 2352
2294EXTRA_DIST += mini-gmp-gnulib.c mini-gmp.c mini-gmp.h 2353ifneq (,$(GL_COND_OBJ_MINI_GMP_GNULIB_CONDITION))
2354libgnu_a_SOURCES += mini-gmp-gnulib.c
2355endif
2356
2357EXTRA_DIST += mini-gmp.c mini-gmp.h
2295 2358
2296EXTRA_libgnu_a_SOURCES += mini-gmp-gnulib.c mini-gmp.c 2359EXTRA_libgnu_a_SOURCES += mini-gmp.c
2297 2360
2298endif 2361endif
2299## end gnulib module libgmp 2362## end gnulib module libgmp
@@ -2329,10 +2392,9 @@ endif
2329## begin gnulib module lstat 2392## begin gnulib module lstat
2330ifeq (,$(OMIT_GNULIB_MODULE_lstat)) 2393ifeq (,$(OMIT_GNULIB_MODULE_lstat))
2331 2394
2332 2395ifneq (,$(GL_COND_OBJ_LSTAT_CONDITION))
2333EXTRA_DIST += lstat.c 2396libgnu_a_SOURCES += lstat.c
2334 2397endif
2335EXTRA_libgnu_a_SOURCES += lstat.c
2336 2398
2337endif 2399endif
2338## end gnulib module lstat 2400## end gnulib module lstat
@@ -2377,10 +2439,9 @@ endif
2377## begin gnulib module mempcpy 2439## begin gnulib module mempcpy
2378ifeq (,$(OMIT_GNULIB_MODULE_mempcpy)) 2440ifeq (,$(OMIT_GNULIB_MODULE_mempcpy))
2379 2441
2380 2442ifneq (,$(GL_COND_OBJ_MEMPCPY_CONDITION))
2381EXTRA_DIST += mempcpy.c 2443libgnu_a_SOURCES += mempcpy.c
2382 2444endif
2383EXTRA_libgnu_a_SOURCES += mempcpy.c
2384 2445
2385endif 2446endif
2386## end gnulib module mempcpy 2447## end gnulib module mempcpy
@@ -2388,10 +2449,9 @@ endif
2388## begin gnulib module memrchr 2449## begin gnulib module memrchr
2389ifeq (,$(OMIT_GNULIB_MODULE_memrchr)) 2450ifeq (,$(OMIT_GNULIB_MODULE_memrchr))
2390 2451
2391 2452ifneq (,$(GL_COND_OBJ_MEMRCHR_CONDITION))
2392EXTRA_DIST += memrchr.c 2453libgnu_a_SOURCES += memrchr.c
2393 2454endif
2394EXTRA_libgnu_a_SOURCES += memrchr.c
2395 2455
2396endif 2456endif
2397## end gnulib module memrchr 2457## end gnulib module memrchr
@@ -2407,10 +2467,9 @@ endif
2407## begin gnulib module mkostemp 2467## begin gnulib module mkostemp
2408ifeq (,$(OMIT_GNULIB_MODULE_mkostemp)) 2468ifeq (,$(OMIT_GNULIB_MODULE_mkostemp))
2409 2469
2410 2470ifneq (,$(GL_COND_OBJ_MKOSTEMP_CONDITION))
2411EXTRA_DIST += mkostemp.c 2471libgnu_a_SOURCES += mkostemp.c
2412 2472endif
2413EXTRA_libgnu_a_SOURCES += mkostemp.c
2414 2473
2415endif 2474endif
2416## end gnulib module mkostemp 2475## end gnulib module mkostemp
@@ -2463,13 +2522,12 @@ endif
2463ifeq (,$(OMIT_GNULIB_MODULE_open)) 2522ifeq (,$(OMIT_GNULIB_MODULE_open))
2464 2523
2465ifneq (,$(gl_GNULIB_ENABLED_open_CONDITION)) 2524ifneq (,$(gl_GNULIB_ENABLED_open_CONDITION))
2466 2525ifneq (,$(GL_COND_OBJ_OPEN_CONDITION))
2526libgnu_a_SOURCES += open.c
2467endif 2527endif
2468EXTRA_DIST += open.c
2469
2470EXTRA_libgnu_a_SOURCES += open.c
2471 2528
2472endif 2529endif
2530endif
2473## end gnulib module open 2531## end gnulib module open
2474 2532
2475## begin gnulib module openat-h 2533## begin gnulib module openat-h
@@ -2503,10 +2561,9 @@ endif
2503## begin gnulib module pselect 2561## begin gnulib module pselect
2504ifeq (,$(OMIT_GNULIB_MODULE_pselect)) 2562ifeq (,$(OMIT_GNULIB_MODULE_pselect))
2505 2563
2506 2564ifneq (,$(GL_COND_OBJ_PSELECT_CONDITION))
2507EXTRA_DIST += pselect.c 2565libgnu_a_SOURCES += pselect.c
2508 2566endif
2509EXTRA_libgnu_a_SOURCES += pselect.c
2510 2567
2511endif 2568endif
2512## end gnulib module pselect 2569## end gnulib module pselect
@@ -2514,10 +2571,9 @@ endif
2514## begin gnulib module pthread_sigmask 2571## begin gnulib module pthread_sigmask
2515ifeq (,$(OMIT_GNULIB_MODULE_pthread_sigmask)) 2572ifeq (,$(OMIT_GNULIB_MODULE_pthread_sigmask))
2516 2573
2517 2574ifneq (,$(GL_COND_OBJ_PTHREAD_SIGMASK_CONDITION))
2518EXTRA_DIST += pthread_sigmask.c 2575libgnu_a_SOURCES += pthread_sigmask.c
2519 2576endif
2520EXTRA_libgnu_a_SOURCES += pthread_sigmask.c
2521 2577
2522endif 2578endif
2523## end gnulib module pthread_sigmask 2579## end gnulib module pthread_sigmask
@@ -2534,11 +2590,12 @@ endif
2534ifeq (,$(OMIT_GNULIB_MODULE_rawmemchr)) 2590ifeq (,$(OMIT_GNULIB_MODULE_rawmemchr))
2535 2591
2536ifneq (,$(gl_GNULIB_ENABLED_rawmemchr_CONDITION)) 2592ifneq (,$(gl_GNULIB_ENABLED_rawmemchr_CONDITION))
2537 2593ifneq (,$(GL_COND_OBJ_RAWMEMCHR_CONDITION))
2594libgnu_a_SOURCES += rawmemchr.c
2538endif 2595endif
2539EXTRA_DIST += rawmemchr.c rawmemchr.valgrind
2540 2596
2541EXTRA_libgnu_a_SOURCES += rawmemchr.c 2597endif
2598EXTRA_DIST += rawmemchr.valgrind
2542 2599
2543endif 2600endif
2544## end gnulib module rawmemchr 2601## end gnulib module rawmemchr
@@ -2546,10 +2603,9 @@ endif
2546## begin gnulib module readlink 2603## begin gnulib module readlink
2547ifeq (,$(OMIT_GNULIB_MODULE_readlink)) 2604ifeq (,$(OMIT_GNULIB_MODULE_readlink))
2548 2605
2549 2606ifneq (,$(GL_COND_OBJ_READLINK_CONDITION))
2550EXTRA_DIST += readlink.c 2607libgnu_a_SOURCES += readlink.c
2551 2608endif
2552EXTRA_libgnu_a_SOURCES += readlink.c
2553 2609
2554endif 2610endif
2555## end gnulib module readlink 2611## end gnulib module readlink
@@ -2557,10 +2613,13 @@ endif
2557## begin gnulib module readlinkat 2613## begin gnulib module readlinkat
2558ifeq (,$(OMIT_GNULIB_MODULE_readlinkat)) 2614ifeq (,$(OMIT_GNULIB_MODULE_readlinkat))
2559 2615
2616ifneq (,$(GL_COND_OBJ_READLINKAT_CONDITION))
2617libgnu_a_SOURCES += readlinkat.c
2618endif
2560 2619
2561EXTRA_DIST += at-func.c readlinkat.c 2620EXTRA_DIST += at-func.c
2562 2621
2563EXTRA_libgnu_a_SOURCES += at-func.c readlinkat.c 2622EXTRA_libgnu_a_SOURCES += at-func.c
2564 2623
2565endif 2624endif
2566## end gnulib module readlinkat 2625## end gnulib module readlinkat
@@ -2594,10 +2653,13 @@ endif
2594## begin gnulib module regex 2653## begin gnulib module regex
2595ifeq (,$(OMIT_GNULIB_MODULE_regex)) 2654ifeq (,$(OMIT_GNULIB_MODULE_regex))
2596 2655
2656ifneq (,$(GL_COND_OBJ_REGEX_CONDITION))
2657libgnu_a_SOURCES += regex.c
2658endif
2597 2659
2598EXTRA_DIST += regcomp.c regex.c regex.h regex_internal.c regex_internal.h regexec.c 2660EXTRA_DIST += regcomp.c regex.h regex_internal.c regex_internal.h regexec.c
2599 2661
2600EXTRA_libgnu_a_SOURCES += regcomp.c regex.c regex_internal.c regexec.c 2662EXTRA_libgnu_a_SOURCES += regcomp.c regex_internal.c regexec.c
2601 2663
2602endif 2664endif
2603## end gnulib module regex 2665## end gnulib module regex
@@ -2641,10 +2703,11 @@ endif
2641## begin gnulib module sig2str 2703## begin gnulib module sig2str
2642ifeq (,$(OMIT_GNULIB_MODULE_sig2str)) 2704ifeq (,$(OMIT_GNULIB_MODULE_sig2str))
2643 2705
2706ifneq (,$(GL_COND_OBJ_SIG2STR_CONDITION))
2707libgnu_a_SOURCES += sig2str.c
2708endif
2644 2709
2645EXTRA_DIST += sig2str.c sig2str.h 2710EXTRA_DIST += sig2str.h
2646
2647EXTRA_libgnu_a_SOURCES += sig2str.c
2648 2711
2649endif 2712endif
2650## end gnulib module sig2str 2713## end gnulib module sig2str
@@ -2652,10 +2715,9 @@ endif
2652## begin gnulib module sigdescr_np 2715## begin gnulib module sigdescr_np
2653ifeq (,$(OMIT_GNULIB_MODULE_sigdescr_np)) 2716ifeq (,$(OMIT_GNULIB_MODULE_sigdescr_np))
2654 2717
2655 2718ifneq (,$(GL_COND_OBJ_SIGDESCR_NP_CONDITION))
2656EXTRA_DIST += sigdescr_np.c 2719libgnu_a_SOURCES += sigdescr_np.c
2657 2720endif
2658EXTRA_libgnu_a_SOURCES += sigdescr_np.c
2659 2721
2660endif 2722endif
2661## end gnulib module sigdescr_np 2723## end gnulib module sigdescr_np
@@ -3004,6 +3066,13 @@ stdio.h: stdio.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H)
3004 $(AM_V_at)mv $@-t $@ 3066 $(AM_V_at)mv $@-t $@
3005MOSTLYCLEANFILES += stdio.h stdio.h-t 3067MOSTLYCLEANFILES += stdio.h stdio.h-t
3006 3068
3069ifneq (,$(GL_COND_OBJ_STDIO_READ_CONDITION))
3070libgnu_a_SOURCES += stdio-read.c
3071endif
3072ifneq (,$(GL_COND_OBJ_STDIO_WRITE_CONDITION))
3073libgnu_a_SOURCES += stdio-write.c
3074endif
3075
3007EXTRA_DIST += stdio.in.h 3076EXTRA_DIST += stdio.in.h
3008 3077
3009endif 3078endif
@@ -3163,10 +3232,9 @@ endif
3163## begin gnulib module stpcpy 3232## begin gnulib module stpcpy
3164ifeq (,$(OMIT_GNULIB_MODULE_stpcpy)) 3233ifeq (,$(OMIT_GNULIB_MODULE_stpcpy))
3165 3234
3166 3235ifneq (,$(GL_COND_OBJ_STPCPY_CONDITION))
3167EXTRA_DIST += stpcpy.c 3236libgnu_a_SOURCES += stpcpy.c
3168 3237endif
3169EXTRA_libgnu_a_SOURCES += stpcpy.c
3170 3238
3171endif 3239endif
3172## end gnulib module stpcpy 3240## end gnulib module stpcpy
@@ -3287,10 +3355,9 @@ endif
3287## begin gnulib module strnlen 3355## begin gnulib module strnlen
3288ifeq (,$(OMIT_GNULIB_MODULE_strnlen)) 3356ifeq (,$(OMIT_GNULIB_MODULE_strnlen))
3289 3357
3290 3358ifneq (,$(GL_COND_OBJ_STRNLEN_CONDITION))
3291EXTRA_DIST += strnlen.c 3359libgnu_a_SOURCES += strnlen.c
3292 3360endif
3293EXTRA_libgnu_a_SOURCES += strnlen.c
3294 3361
3295endif 3362endif
3296## end gnulib module strnlen 3363## end gnulib module strnlen
@@ -3298,10 +3365,9 @@ endif
3298## begin gnulib module strtoimax 3365## begin gnulib module strtoimax
3299ifeq (,$(OMIT_GNULIB_MODULE_strtoimax)) 3366ifeq (,$(OMIT_GNULIB_MODULE_strtoimax))
3300 3367
3301 3368ifneq (,$(GL_COND_OBJ_STRTOIMAX_CONDITION))
3302EXTRA_DIST += strtoimax.c 3369libgnu_a_SOURCES += strtoimax.c
3303 3370endif
3304EXTRA_libgnu_a_SOURCES += strtoimax.c
3305 3371
3306endif 3372endif
3307## end gnulib module strtoimax 3373## end gnulib module strtoimax
@@ -3310,11 +3376,14 @@ endif
3310ifeq (,$(OMIT_GNULIB_MODULE_strtoll)) 3376ifeq (,$(OMIT_GNULIB_MODULE_strtoll))
3311 3377
3312ifneq (,$(gl_GNULIB_ENABLED_strtoll_CONDITION)) 3378ifneq (,$(gl_GNULIB_ENABLED_strtoll_CONDITION))
3379ifneq (,$(GL_COND_OBJ_STRTOLL_CONDITION))
3380libgnu_a_SOURCES += strtoll.c
3381endif
3313 3382
3314endif 3383endif
3315EXTRA_DIST += strtol.c strtoll.c 3384EXTRA_DIST += strtol.c
3316 3385
3317EXTRA_libgnu_a_SOURCES += strtol.c strtoll.c 3386EXTRA_libgnu_a_SOURCES += strtol.c
3318 3387
3319endif 3388endif
3320## end gnulib module strtoll 3389## end gnulib module strtoll
@@ -3322,10 +3391,9 @@ endif
3322## begin gnulib module symlink 3391## begin gnulib module symlink
3323ifeq (,$(OMIT_GNULIB_MODULE_symlink)) 3392ifeq (,$(OMIT_GNULIB_MODULE_symlink))
3324 3393
3325 3394ifneq (,$(GL_COND_OBJ_SYMLINK_CONDITION))
3326EXTRA_DIST += symlink.c 3395libgnu_a_SOURCES += symlink.c
3327 3396endif
3328EXTRA_libgnu_a_SOURCES += symlink.c
3329 3397
3330endif 3398endif
3331## end gnulib module symlink 3399## end gnulib module symlink
@@ -3602,10 +3670,9 @@ endif
3602## begin gnulib module time_r 3670## begin gnulib module time_r
3603ifeq (,$(OMIT_GNULIB_MODULE_time_r)) 3671ifeq (,$(OMIT_GNULIB_MODULE_time_r))
3604 3672
3605 3673ifneq (,$(GL_COND_OBJ_TIME_R_CONDITION))
3606EXTRA_DIST += time_r.c 3674libgnu_a_SOURCES += time_r.c
3607 3675endif
3608EXTRA_libgnu_a_SOURCES += time_r.c
3609 3676
3610endif 3677endif
3611## end gnulib module time_r 3678## end gnulib module time_r
@@ -3613,10 +3680,11 @@ endif
3613## begin gnulib module time_rz 3680## begin gnulib module time_rz
3614ifeq (,$(OMIT_GNULIB_MODULE_time_rz)) 3681ifeq (,$(OMIT_GNULIB_MODULE_time_rz))
3615 3682
3683ifneq (,$(GL_COND_OBJ_TIME_RZ_CONDITION))
3684libgnu_a_SOURCES += time_rz.c
3685endif
3616 3686
3617EXTRA_DIST += time-internal.h time_rz.c 3687EXTRA_DIST += time-internal.h
3618
3619EXTRA_libgnu_a_SOURCES += time_rz.c
3620 3688
3621endif 3689endif
3622## end gnulib module time_rz 3690## end gnulib module time_rz
@@ -3624,10 +3692,11 @@ endif
3624## begin gnulib module timegm 3692## begin gnulib module timegm
3625ifeq (,$(OMIT_GNULIB_MODULE_timegm)) 3693ifeq (,$(OMIT_GNULIB_MODULE_timegm))
3626 3694
3695ifneq (,$(GL_COND_OBJ_TIMEGM_CONDITION))
3696libgnu_a_SOURCES += timegm.c
3697endif
3627 3698
3628EXTRA_DIST += mktime-internal.h timegm.c 3699EXTRA_DIST += mktime-internal.h
3629
3630EXTRA_libgnu_a_SOURCES += timegm.c
3631 3700
3632endif 3701endif
3633## end gnulib module timegm 3702## end gnulib module timegm
@@ -3821,6 +3890,7 @@ unistd.h: unistd.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H
3821 sed -e 's|@''REPLACE_ACCESS''@|$(REPLACE_ACCESS)|g' \ 3890 sed -e 's|@''REPLACE_ACCESS''@|$(REPLACE_ACCESS)|g' \
3822 -e 's|@''REPLACE_CHOWN''@|$(REPLACE_CHOWN)|g' \ 3891 -e 's|@''REPLACE_CHOWN''@|$(REPLACE_CHOWN)|g' \
3823 -e 's|@''REPLACE_CLOSE''@|$(REPLACE_CLOSE)|g' \ 3892 -e 's|@''REPLACE_CLOSE''@|$(REPLACE_CLOSE)|g' \
3893 -e 's|@''REPLACE_COPY_FILE_RANGE''@|$(REPLACE_COPY_FILE_RANGE)|g' \
3824 -e 's|@''REPLACE_DUP''@|$(REPLACE_DUP)|g' \ 3894 -e 's|@''REPLACE_DUP''@|$(REPLACE_DUP)|g' \
3825 -e 's|@''REPLACE_DUP2''@|$(REPLACE_DUP2)|g' \ 3895 -e 's|@''REPLACE_DUP2''@|$(REPLACE_DUP2)|g' \
3826 -e 's|@''REPLACE_EXECL''@|$(REPLACE_EXECL)|g' \ 3896 -e 's|@''REPLACE_EXECL''@|$(REPLACE_EXECL)|g' \
@@ -3909,10 +3979,13 @@ endif
3909## begin gnulib module utimensat 3979## begin gnulib module utimensat
3910ifeq (,$(OMIT_GNULIB_MODULE_utimensat)) 3980ifeq (,$(OMIT_GNULIB_MODULE_utimensat))
3911 3981
3982ifneq (,$(GL_COND_OBJ_UTIMENSAT_CONDITION))
3983libgnu_a_SOURCES += utimensat.c
3984endif
3912 3985
3913EXTRA_DIST += at-func.c utimensat.c 3986EXTRA_DIST += at-func.c
3914 3987
3915EXTRA_libgnu_a_SOURCES += at-func.c utimensat.c 3988EXTRA_libgnu_a_SOURCES += at-func.c
3916 3989
3917endif 3990endif
3918## end gnulib module utimensat 3991## end gnulib module utimensat
@@ -3954,3 +4027,7 @@ mostlyclean-local: mostlyclean-generic
3954 fi; \ 4027 fi; \
3955 done; \ 4028 done; \
3956 : 4029 :
4030distclean-local: distclean-gnulib-libobjs
4031distclean-gnulib-libobjs:
4032 -rm -f @gl_LIBOBJDEPS@
4033maintainer-clean-local: distclean-gnulib-libobjs
diff --git a/lib/intprops.h b/lib/intprops.h
index 68d6daa5706..d4a917f72a0 100644
--- a/lib/intprops.h
+++ b/lib/intprops.h
@@ -229,11 +229,15 @@
229 229
230/* True if __builtin_add_overflow (A, B, P) and __builtin_sub_overflow 230/* True if __builtin_add_overflow (A, B, P) and __builtin_sub_overflow
231 (A, B, P) work when P is non-null. */ 231 (A, B, P) work when P is non-null. */
232#if defined __has_builtin 232#ifdef __EDG__
233/* EDG-based compilers like nvc 22.1 cannot add 64-bit signed to unsigned
234 <https://bugs.gnu.org/53256>. */
235# define _GL_HAS_BUILTIN_ADD_OVERFLOW 0
236#elif defined __has_builtin
233# define _GL_HAS_BUILTIN_ADD_OVERFLOW __has_builtin (__builtin_add_overflow) 237# define _GL_HAS_BUILTIN_ADD_OVERFLOW __has_builtin (__builtin_add_overflow)
234/* __builtin_{add,sub}_overflow exists but is not reliable in GCC 5.x and 6.x, 238/* __builtin_{add,sub}_overflow exists but is not reliable in GCC 5.x and 6.x,
235 see <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98269>. */ 239 see <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98269>. */
236#elif 7 <= __GNUC__ && !defined __EDG__ 240#elif 7 <= __GNUC__
237# define _GL_HAS_BUILTIN_ADD_OVERFLOW 1 241# define _GL_HAS_BUILTIN_ADD_OVERFLOW 1
238#else 242#else
239# define _GL_HAS_BUILTIN_ADD_OVERFLOW 0 243# define _GL_HAS_BUILTIN_ADD_OVERFLOW 0
diff --git a/lib/lchmod.c b/lib/lchmod.c
index 479ed776cba..706dddff7bb 100644
--- a/lib/lchmod.c
+++ b/lib/lchmod.c
@@ -4,7 +4,7 @@
4 4
5 This program is free software: you can redistribute it and/or modify 5 This program is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by 6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 3 of the License, or 7 the Free Software Foundation, either version 3 of the License, or
8 (at your option) any later version. 8 (at your option) any later version.
9 9
10 This program is distributed in the hope that it will be useful, 10 This program is distributed in the hope that it will be useful,
diff --git a/lib/memrchr.c b/lib/memrchr.c
index e853996ad0a..90fdb86f1f1 100644
--- a/lib/memrchr.c
+++ b/lib/memrchr.c
@@ -11,7 +11,7 @@
11 11
12 This file is free software: you can redistribute it and/or modify 12 This file is free software: you can redistribute it and/or modify
13 it under the terms of the GNU Lesser General Public License as 13 it under the terms of the GNU Lesser General Public License as
14 published by the Free Software Foundation; either version 3 of the 14 published by the Free Software Foundation, either version 3 of the
15 License, or (at your option) any later version. 15 License, or (at your option) any later version.
16 16
17 This file is distributed in the hope that it will be useful, 17 This file is distributed in the hope that it will be useful,
diff --git a/lib/mini-gmp-gnulib.c b/lib/mini-gmp-gnulib.c
index 7620da38dbb..a18ee8f6ab7 100644
--- a/lib/mini-gmp-gnulib.c
+++ b/lib/mini-gmp-gnulib.c
@@ -6,7 +6,7 @@
6 It is dual-licensed under "the GNU LGPLv3+ or the GNU GPLv2+". 6 It is dual-licensed under "the GNU LGPLv3+ or the GNU GPLv2+".
7 You can redistribute it and/or modify it under either 7 You can redistribute it and/or modify it under either
8 - the terms of the GNU Lesser General Public License as published 8 - the terms of the GNU Lesser General Public License as published
9 by the Free Software Foundation; either version 3, or (at your 9 by the Free Software Foundation, either version 3, or (at your
10 option) any later version, or 10 option) any later version, or
11 - the terms of the GNU General Public License as published by the 11 - the terms of the GNU General Public License as published by the
12 Free Software Foundation; either version 2, or (at your option) 12 Free Software Foundation; either version 2, or (at your option)
diff --git a/lib/mini-gmp.c b/lib/mini-gmp.c
index 8577b59ef6d..e7a320a6420 100644
--- a/lib/mini-gmp.c
+++ b/lib/mini-gmp.c
@@ -10,7 +10,7 @@ The GNU MP Library is free software; you can redistribute it and/or modify
10it under the terms of either: 10it under the terms of either:
11 11
12 * the GNU Lesser General Public License as published by the Free 12 * the GNU Lesser General Public License as published by the Free
13 Software Foundation; either version 3 of the License, or (at your 13 Software Foundation, either version 3 of the License, or (at your
14 option) any later version. 14 option) any later version.
15 15
16or 16or
diff --git a/lib/mini-gmp.h b/lib/mini-gmp.h
index 59c24cf5111..508712d235b 100644
--- a/lib/mini-gmp.h
+++ b/lib/mini-gmp.h
@@ -8,7 +8,7 @@ The GNU MP Library is free software; you can redistribute it and/or modify
8it under the terms of either: 8it under the terms of either:
9 9
10 * the GNU Lesser General Public License as published by the Free 10 * the GNU Lesser General Public License as published by the Free
11 Software Foundation; either version 3 of the License, or (at your 11 Software Foundation, either version 3 of the License, or (at your
12 option) any later version. 12 option) any later version.
13 13
14or 14or
diff --git a/lib/mktime.c b/lib/mktime.c
index aa12e28e168..7dc9d67ef9d 100644
--- a/lib/mktime.c
+++ b/lib/mktime.c
@@ -429,8 +429,13 @@ __mktime_internal (struct tm *tp,
429 time with the right value, and use its UTC offset. 429 time with the right value, and use its UTC offset.
430 430
431 Heuristic: probe the adjacent timestamps in both directions, 431 Heuristic: probe the adjacent timestamps in both directions,
432 looking for the desired isdst. This should work for all real 432 looking for the desired isdst. If none is found within a
433 time zone histories in the tz database. */ 433 reasonable duration bound, assume a one-hour DST difference.
434 This should work for all real time zone histories in the tz
435 database. */
436
437 /* +1 if we wanted standard time but got DST, -1 if the reverse. */
438 int dst_difference = (isdst == 0) - (tm.tm_isdst == 0);
434 439
435 /* Distance between probes when looking for a DST boundary. In 440 /* Distance between probes when looking for a DST boundary. In
436 tzdata2003a, the shortest period of DST is 601200 seconds 441 tzdata2003a, the shortest period of DST is 601200 seconds
@@ -441,12 +446,14 @@ __mktime_internal (struct tm *tp,
441 periods when probing. */ 446 periods when probing. */
442 int stride = 601200; 447 int stride = 601200;
443 448
444 /* The longest period of DST in tzdata2003a is 536454000 seconds 449 /* In TZDB 2021e, the longest period of DST (or of non-DST), in
445 (e.g., America/Jujuy starting 1946-10-01 01:00). The longest 450 which the DST (or adjacent DST) difference is not one hour,
446 period of non-DST is much longer, but it makes no real sense 451 is 457243209 seconds: e.g., America/Cambridge_Bay with leap
447 to search for more than a year of non-DST, so use the DST 452 seconds, starting 1965-10-31 00:00 in a switch from
448 max. */ 453 double-daylight time (-05) to standard time (-07), and
449 int duration_max = 536454000; 454 continuing to 1980-04-27 02:00 in a switch from standard time
455 (-07) to daylight time (-06). */
456 int duration_max = 457243209;
450 457
451 /* Search in both directions, so the maximum distance is half 458 /* Search in both directions, so the maximum distance is half
452 the duration; add the stride to avoid off-by-1 problems. */ 459 the duration; add the stride to avoid off-by-1 problems. */
@@ -483,6 +490,11 @@ __mktime_internal (struct tm *tp,
483 } 490 }
484 } 491 }
485 492
493 /* No unusual DST offset was found nearby. Assume one-hour DST. */
494 t += 60 * 60 * dst_difference;
495 if (mktime_min <= t && t <= mktime_max && convert_time (convert, t, &tm))
496 goto offset_found;
497
486 __set_errno (EOVERFLOW); 498 __set_errno (EOVERFLOW);
487 return -1; 499 return -1;
488 } 500 }
diff --git a/lib/nstrftime.c b/lib/nstrftime.c
index 190ff4d8f20..c1dd5542478 100644
--- a/lib/nstrftime.c
+++ b/lib/nstrftime.c
@@ -3,7 +3,7 @@
3 3
4 This file is free software: you can redistribute it and/or modify 4 This file is free software: you can redistribute it and/or modify
5 it under the terms of the GNU Lesser General Public License as 5 it under the terms of the GNU Lesser General Public License as
6 published by the Free Software Foundation; either version 3 of the 6 published by the Free Software Foundation, either version 3 of the
7 License, or (at your option) any later version. 7 License, or (at your option) any later version.
8 8
9 This file is distributed in the hope that it will be useful, 9 This file is distributed in the hope that it will be useful,
@@ -1158,7 +1158,6 @@ __strftime_internal (STREAM_OR_CHAR_T *s, STRFTIME_ARG (size_t maxsize)
1158 1158
1159 case L_('q'): /* GNU extension. */ 1159 case L_('q'): /* GNU extension. */
1160 DO_SIGNED_NUMBER (1, false, ((tp->tm_mon * 11) >> 5) + 1); 1160 DO_SIGNED_NUMBER (1, false, ((tp->tm_mon * 11) >> 5) + 1);
1161 break;
1162 1161
1163 case L_('R'): 1162 case L_('R'):
1164 subfmt = L_("%H:%M"); 1163 subfmt = L_("%H:%M");
diff --git a/lib/openat-priv.h b/lib/openat-priv.h
index 451cac10cc6..5d60810709d 100644
--- a/lib/openat-priv.h
+++ b/lib/openat-priv.h
@@ -4,7 +4,7 @@
4 4
5 This program is free software: you can redistribute it and/or modify 5 This program is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by 6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 3 of the License, or 7 the Free Software Foundation, either version 3 of the License, or
8 (at your option) any later version. 8 (at your option) any later version.
9 9
10 This program is distributed in the hope that it will be useful, 10 This program is distributed in the hope that it will be useful,
diff --git a/lib/openat-proc.c b/lib/openat-proc.c
index d5f4296d478..3bacf7dbd13 100644
--- a/lib/openat-proc.c
+++ b/lib/openat-proc.c
@@ -4,7 +4,7 @@
4 4
5 This program is free software: you can redistribute it and/or modify 5 This program is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by 6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 3 of the License, or 7 the Free Software Foundation, either version 3 of the License, or
8 (at your option) any later version. 8 (at your option) any later version.
9 9
10 This program is distributed in the hope that it will be useful, 10 This program is distributed in the hope that it will be useful,
diff --git a/lib/openat.h b/lib/openat.h
index dcb2864ffc8..5c8ff90b804 100644
--- a/lib/openat.h
+++ b/lib/openat.h
@@ -3,7 +3,7 @@
3 3
4 This program is free software: you can redistribute it and/or modify 4 This program is free software: you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by 5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 3 of the License, or 6 the Free Software Foundation, either version 3 of the License, or
7 (at your option) any later version. 7 (at your option) any later version.
8 8
9 This program is distributed in the hope that it will be useful, 9 This program is distributed in the hope that it will be useful,
diff --git a/lib/qcopy-acl.c b/lib/qcopy-acl.c
index 42ae68ffc1d..37fb179260d 100644
--- a/lib/qcopy-acl.c
+++ b/lib/qcopy-acl.c
@@ -4,7 +4,7 @@
4 4
5 This program is free software: you can redistribute it and/or modify 5 This program is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by 6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 3 of the License, or 7 the Free Software Foundation, either version 3 of the License, or
8 (at your option) any later version. 8 (at your option) any later version.
9 9
10 This program is distributed in the hope that it will be useful, 10 This program is distributed in the hope that it will be useful,
diff --git a/lib/readlinkat.c b/lib/readlinkat.c
index f3d39604d2e..ab45e140b59 100644
--- a/lib/readlinkat.c
+++ b/lib/readlinkat.c
@@ -3,7 +3,7 @@
3 3
4 This program is free software: you can redistribute it and/or modify 4 This program is free software: you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by 5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 3 of the License, or 6 the Free Software Foundation, either version 3 of the License, or
7 (at your option) any later version. 7 (at your option) any later version.
8 8
9 This program is distributed in the hope that it will be useful, 9 This program is distributed in the hope that it will be useful,
diff --git a/lib/save-cwd.h b/lib/save-cwd.h
index 7aa124c42f8..90e8a0747ce 100644
--- a/lib/save-cwd.h
+++ b/lib/save-cwd.h
@@ -5,7 +5,7 @@
5 5
6 This program is free software: you can redistribute it and/or modify 6 This program is free software: you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by 7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 3 of the License, or 8 the Free Software Foundation, either version 3 of the License, or
9 (at your option) any later version. 9 (at your option) any later version.
10 10
11 This program is distributed in the hope that it will be useful, 11 This program is distributed in the hope that it will be useful,
diff --git a/lib/set-permissions.c b/lib/set-permissions.c
index 7a7c5e4ed0e..c1a4b82a0d0 100644
--- a/lib/set-permissions.c
+++ b/lib/set-permissions.c
@@ -4,7 +4,7 @@
4 4
5 This program is free software: you can redistribute it and/or modify 5 This program is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by 6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 3 of the License, or 7 the Free Software Foundation, either version 3 of the License, or
8 (at your option) any later version. 8 (at your option) any later version.
9 9
10 This program is distributed in the hope that it will be useful, 10 This program is distributed in the hope that it will be useful,
diff --git a/lib/sig2str.c b/lib/sig2str.c
index f2f01d1f6fc..8e2fc0c0754 100644
--- a/lib/sig2str.c
+++ b/lib/sig2str.c
@@ -4,7 +4,7 @@
4 4
5 This program is free software: you can redistribute it and/or modify 5 This program is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by 6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 3 of the License, or 7 the Free Software Foundation, either version 3 of the License, or
8 (at your option) any later version. 8 (at your option) any later version.
9 9
10 This program is distributed in the hope that it will be useful, 10 This program is distributed in the hope that it will be useful,
diff --git a/lib/sig2str.h b/lib/sig2str.h
index a507170b64a..a45af7f9686 100644
--- a/lib/sig2str.h
+++ b/lib/sig2str.h
@@ -4,7 +4,7 @@
4 4
5 This program is free software: you can redistribute it and/or modify 5 This program is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by 6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 3 of the License, or 7 the Free Software Foundation, either version 3 of the License, or
8 (at your option) any later version. 8 (at your option) any later version.
9 9
10 This program is distributed in the hope that it will be useful, 10 This program is distributed in the hope that it will be useful,
diff --git a/lib/strftime.h b/lib/strftime.h
index 9e5cdc3f32c..a9847084f01 100644
--- a/lib/strftime.h
+++ b/lib/strftime.h
@@ -4,7 +4,7 @@
4 4
5 This file is free software: you can redistribute it and/or modify 5 This file is free software: you can redistribute it and/or modify
6 it under the terms of the GNU Lesser General Public License as 6 it under the terms of the GNU Lesser General Public License as
7 published by the Free Software Foundation; either version 3 of the 7 published by the Free Software Foundation, either version 3 of the
8 License, or (at your option) any later version. 8 License, or (at your option) any later version.
9 9
10 This file is distributed in the hope that it will be useful, 10 This file is distributed in the hope that it will be useful,
diff --git a/lib/string.in.h b/lib/string.in.h
index 03e6a17a36d..c9432948c15 100644
--- a/lib/string.in.h
+++ b/lib/string.in.h
@@ -563,22 +563,35 @@ _GL_WARN_ON_USE (strncat, "strncat is unportable - "
563# undef strndup 563# undef strndup
564# define strndup rpl_strndup 564# define strndup rpl_strndup
565# endif 565# endif
566_GL_FUNCDECL_RPL (strndup, char *, (char const *__s, size_t __n) 566_GL_FUNCDECL_RPL (strndup, char *,
567 _GL_ARG_NONNULL ((1))); 567 (char const *__s, size_t __n)
568 _GL_ARG_NONNULL ((1))
569 _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
568_GL_CXXALIAS_RPL (strndup, char *, (char const *__s, size_t __n)); 570_GL_CXXALIAS_RPL (strndup, char *, (char const *__s, size_t __n));
569# else 571# else
570# if ! @HAVE_DECL_STRNDUP@ 572# if !@HAVE_DECL_STRNDUP@ || __GNUC__ >= 11
571_GL_FUNCDECL_SYS (strndup, char *, (char const *__s, size_t __n) 573_GL_FUNCDECL_SYS (strndup, char *,
572 _GL_ARG_NONNULL ((1))); 574 (char const *__s, size_t __n)
575 _GL_ARG_NONNULL ((1))
576 _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
573# endif 577# endif
574_GL_CXXALIAS_SYS (strndup, char *, (char const *__s, size_t __n)); 578_GL_CXXALIAS_SYS (strndup, char *, (char const *__s, size_t __n));
575# endif 579# endif
576_GL_CXXALIASWARN (strndup); 580_GL_CXXALIASWARN (strndup);
577#elif defined GNULIB_POSIXCHECK 581#else
578# undef strndup 582# if __GNUC__ >= 11
579# if HAVE_RAW_DECL_STRNDUP 583/* For -Wmismatched-dealloc: Associate strndup with free or rpl_free. */
584_GL_FUNCDECL_SYS (strndup, char *,
585 (char const *__s, size_t __n)
586 _GL_ARG_NONNULL ((1))
587 _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
588# endif
589# if defined GNULIB_POSIXCHECK
590# undef strndup
591# if HAVE_RAW_DECL_STRNDUP
580_GL_WARN_ON_USE (strndup, "strndup is unportable - " 592_GL_WARN_ON_USE (strndup, "strndup is unportable - "
581 "use gnulib module strndup for portability"); 593 "use gnulib module strndup for portability");
594# endif
582# endif 595# endif
583#endif 596#endif
584 597
diff --git a/lib/strtoimax.c b/lib/strtoimax.c
index d562746ee78..cad12d0d9be 100644
--- a/lib/strtoimax.c
+++ b/lib/strtoimax.c
@@ -5,7 +5,7 @@
5 5
6 This file is free software: you can redistribute it and/or modify 6 This file is free software: you can redistribute it and/or modify
7 it under the terms of the GNU Lesser General Public License as 7 it under the terms of the GNU Lesser General Public License as
8 published by the Free Software Foundation; either version 3 of the 8 published by the Free Software Foundation, either version 3 of the
9 License, or (at your option) any later version. 9 License, or (at your option) any later version.
10 10
11 This file is distributed in the hope that it will be useful, 11 This file is distributed in the hope that it will be useful,
diff --git a/lib/strtol.c b/lib/strtol.c
index 457f7a5d649..6c2e9333abc 100644
--- a/lib/strtol.c
+++ b/lib/strtol.c
@@ -8,7 +8,7 @@
8 8
9 This file is free software: you can redistribute it and/or modify 9 This file is free software: you can redistribute it and/or modify
10 it under the terms of the GNU Lesser General Public License as 10 it under the terms of the GNU Lesser General Public License as
11 published by the Free Software Foundation; either version 3 of the 11 published by the Free Software Foundation, either version 3 of the
12 License, or (at your option) any later version. 12 License, or (at your option) any later version.
13 13
14 This file is distributed in the hope that it will be useful, 14 This file is distributed in the hope that it will be useful,
diff --git a/lib/strtoll.c b/lib/strtoll.c
index 5124168c1bb..acea42ee003 100644
--- a/lib/strtoll.c
+++ b/lib/strtoll.c
@@ -5,7 +5,7 @@
5 5
6 This file is free software: you can redistribute it and/or modify 6 This file is free software: you can redistribute it and/or modify
7 it under the terms of the GNU Lesser General Public License as 7 it under the terms of the GNU Lesser General Public License as
8 published by the Free Software Foundation; either version 3 of the 8 published by the Free Software Foundation, either version 3 of the
9 License, or (at your option) any later version. 9 License, or (at your option) any later version.
10 10
11 This file is distributed in the hope that it will be useful, 11 This file is distributed in the hope that it will be useful,
diff --git a/lib/symlink.c b/lib/symlink.c
index 51850b2732c..26310af7b12 100644
--- a/lib/symlink.c
+++ b/lib/symlink.c
@@ -3,7 +3,7 @@
3 3
4 This file is free software: you can redistribute it and/or modify 4 This file is free software: you can redistribute it and/or modify
5 it under the terms of the GNU Lesser General Public License as 5 it under the terms of the GNU Lesser General Public License as
6 published by the Free Software Foundation; either version 3 of the 6 published by the Free Software Foundation, either version 3 of the
7 License, or (at your option) any later version. 7 License, or (at your option) any later version.
8 8
9 This file is distributed in the hope that it will be useful, 9 This file is distributed in the hope that it will be useful,
diff --git a/lib/time-internal.h b/lib/time-internal.h
index e1bb56e53ec..c8a2a8ce6bc 100644
--- a/lib/time-internal.h
+++ b/lib/time-internal.h
@@ -4,7 +4,7 @@
4 4
5 This file is free software: you can redistribute it and/or modify 5 This file is free software: you can redistribute it and/or modify
6 it under the terms of the GNU Lesser General Public License as 6 it under the terms of the GNU Lesser General Public License as
7 published by the Free Software Foundation; either version 3 of the 7 published by the Free Software Foundation, either version 3 of the
8 License, or (at your option) any later version. 8 License, or (at your option) any later version.
9 9
10 This file is distributed in the hope that it will be useful, 10 This file is distributed in the hope that it will be useful,
diff --git a/lib/time_rz.c b/lib/time_rz.c
index d0ae717f308..1a91d3778e7 100644
--- a/lib/time_rz.c
+++ b/lib/time_rz.c
@@ -4,7 +4,7 @@
4 4
5 This file is free software: you can redistribute it and/or modify 5 This file is free software: you can redistribute it and/or modify
6 it under the terms of the GNU Lesser General Public License as 6 it under the terms of the GNU Lesser General Public License as
7 published by the Free Software Foundation; either version 3 of the 7 published by the Free Software Foundation, either version 3 of the
8 License, or (at your option) any later version. 8 License, or (at your option) any later version.
9 9
10 This file is distributed in the hope that it will be useful, 10 This file is distributed in the hope that it will be useful,
diff --git a/lib/timespec-add.c b/lib/timespec-add.c
index cd0b5f5f5be..0f270e5bc8c 100644
--- a/lib/timespec-add.c
+++ b/lib/timespec-add.c
@@ -4,7 +4,7 @@
4 4
5 This program is free software: you can redistribute it and/or modify 5 This program is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by 6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 3 of the License, or 7 the Free Software Foundation, either version 3 of the License, or
8 (at your option) any later version. 8 (at your option) any later version.
9 9
10 This program is distributed in the hope that it will be useful, 10 This program is distributed in the hope that it will be useful,
diff --git a/lib/timespec-sub.c b/lib/timespec-sub.c
index 2b2aaa59373..36747833e39 100644
--- a/lib/timespec-sub.c
+++ b/lib/timespec-sub.c
@@ -4,7 +4,7 @@
4 4
5 This program is free software: you can redistribute it and/or modify 5 This program is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by 6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 3 of the License, or 7 the Free Software Foundation, either version 3 of the License, or
8 (at your option) any later version. 8 (at your option) any later version.
9 9
10 This program is distributed in the hope that it will be useful, 10 This program is distributed in the hope that it will be useful,
diff --git a/lib/timespec.c b/lib/timespec.c
index 82630c2f5a0..9d136cb803b 100644
--- a/lib/timespec.c
+++ b/lib/timespec.c
@@ -4,7 +4,7 @@
4 4
5 This file is free software: you can redistribute it and/or modify 5 This file is free software: you can redistribute it and/or modify
6 it under the terms of the GNU Lesser General Public License as 6 it under the terms of the GNU Lesser General Public License as
7 published by the Free Software Foundation; either version 3 of the 7 published by the Free Software Foundation, either version 3 of the
8 License, or (at your option) any later version. 8 License, or (at your option) any later version.
9 9
10 This file is distributed in the hope that it will be useful, 10 This file is distributed in the hope that it will be useful,
diff --git a/lib/timespec.h b/lib/timespec.h
index e130d2c6e25..9e358289a2a 100644
--- a/lib/timespec.h
+++ b/lib/timespec.h
@@ -5,7 +5,7 @@
5 5
6 This file is free software: you can redistribute it and/or modify 6 This file is free software: you can redistribute it and/or modify
7 it under the terms of the GNU Lesser General Public License as 7 it under the terms of the GNU Lesser General Public License as
8 published by the Free Software Foundation; either version 3 of the 8 published by the Free Software Foundation, either version 3 of the
9 License, or (at your option) any later version. 9 License, or (at your option) any later version.
10 10
11 This file is distributed in the hope that it will be useful, 11 This file is distributed in the hope that it will be useful,
diff --git a/lib/unistd.in.h b/lib/unistd.in.h
index 3386f0b0f75..57df09ecdf4 100644
--- a/lib/unistd.in.h
+++ b/lib/unistd.in.h
@@ -415,16 +415,30 @@ _GL_CXXALIASWARN (close);
415 415
416 416
417#if @GNULIB_COPY_FILE_RANGE@ 417#if @GNULIB_COPY_FILE_RANGE@
418# if !@HAVE_COPY_FILE_RANGE@ 418# if @REPLACE_COPY_FILE_RANGE@
419# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
420# undef copy_file_range
421# define copy_file_range rpl_copy_file_range
422# endif
423_GL_FUNCDECL_RPL (copy_file_range, ssize_t, (int ifd, off_t *ipos,
424 int ofd, off_t *opos,
425 size_t len, unsigned flags));
426_GL_CXXALIAS_RPL (copy_file_range, ssize_t, (int ifd, off_t *ipos,
427 int ofd, off_t *opos,
428 size_t len, unsigned flags));
429# else
430# if !@HAVE_COPY_FILE_RANGE@
419_GL_FUNCDECL_SYS (copy_file_range, ssize_t, (int ifd, off_t *ipos, 431_GL_FUNCDECL_SYS (copy_file_range, ssize_t, (int ifd, off_t *ipos,
420 int ofd, off_t *opos, 432 int ofd, off_t *opos,
421 size_t len, unsigned flags)); 433 size_t len, unsigned flags));
434# endif
422_GL_CXXALIAS_SYS (copy_file_range, ssize_t, (int ifd, off_t *ipos, 435_GL_CXXALIAS_SYS (copy_file_range, ssize_t, (int ifd, off_t *ipos,
423 int ofd, off_t *opos, 436 int ofd, off_t *opos,
424 size_t len, unsigned flags)); 437 size_t len, unsigned flags));
425# endif 438# endif
426_GL_CXXALIASWARN (copy_file_range); 439_GL_CXXALIASWARN (copy_file_range);
427#elif defined GNULIB_POSIXCHECK 440#elif defined GNULIB_POSIXCHECK
441# undef copy_file_range
428# if HAVE_RAW_DECL_COPY_FILE_RANGE 442# if HAVE_RAW_DECL_COPY_FILE_RANGE
429_GL_WARN_ON_USE (copy_file_range, 443_GL_WARN_ON_USE (copy_file_range,
430 "copy_file_range is unportable - " 444 "copy_file_range is unportable - "
diff --git a/lib/unlocked-io.h b/lib/unlocked-io.h
index ce52f8f9773..7461d740959 100644
--- a/lib/unlocked-io.h
+++ b/lib/unlocked-io.h
@@ -4,7 +4,7 @@
4 4
5 This program is free software: you can redistribute it and/or modify 5 This program is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by 6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 3 of the License, or 7 the Free Software Foundation, either version 3 of the License, or
8 (at your option) any later version. 8 (at your option) any later version.
9 9
10 This program is distributed in the hope that it will be useful, 10 This program is distributed in the hope that it will be useful,
diff --git a/lib/utimens.c b/lib/utimens.c
index f4907ae4e61..2fa12518507 100644
--- a/lib/utimens.c
+++ b/lib/utimens.c
@@ -4,7 +4,7 @@
4 4
5 This file is free software: you can redistribute it and/or modify 5 This file is free software: you can redistribute it and/or modify
6 it under the terms of the GNU Lesser General Public License as 6 it under the terms of the GNU Lesser General Public License as
7 published by the Free Software Foundation; either version 3 of the 7 published by the Free Software Foundation, either version 3 of the
8 License, or (at your option) any later version. 8 License, or (at your option) any later version.
9 9
10 This file is distributed in the hope that it will be useful, 10 This file is distributed in the hope that it will be useful,
diff --git a/lib/utimens.h b/lib/utimens.h
index c3054da0c67..2ccc06e5ed6 100644
--- a/lib/utimens.h
+++ b/lib/utimens.h
@@ -4,7 +4,7 @@
4 4
5 This file is free software: you can redistribute it and/or modify 5 This file is free software: you can redistribute it and/or modify
6 it under the terms of the GNU Lesser General Public License as 6 it under the terms of the GNU Lesser General Public License as
7 published by the Free Software Foundation; either version 3 of the 7 published by the Free Software Foundation, either version 3 of the
8 License, or (at your option) any later version. 8 License, or (at your option) any later version.
9 9
10 This file is distributed in the hope that it will be useful, 10 This file is distributed in the hope that it will be useful,
diff --git a/lib/utimensat.c b/lib/utimensat.c
index 2e4c7bf9660..f81b0c790ef 100644
--- a/lib/utimensat.c
+++ b/lib/utimensat.c
@@ -3,7 +3,7 @@
3 3
4 This program is free software: you can redistribute it and/or modify 4 This program is free software: you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by 5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 3 of the License, or 6 the Free Software Foundation, either version 3 of the License, or
7 (at your option) any later version. 7 (at your option) any later version.
8 8
9 This program is distributed in the hope that it will be useful, 9 This program is distributed in the hope that it will be useful,
diff --git a/lib/vla.h b/lib/vla.h
index adc8f8f68b6..ce02428f53a 100644
--- a/lib/vla.h
+++ b/lib/vla.h
@@ -4,7 +4,7 @@
4 4
5 This program is free software: you can redistribute it and/or modify 5 This program is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by 6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 3 of the License, or 7 the Free Software Foundation, either version 3 of the License, or
8 (at your option) any later version. 8 (at your option) any later version.
9 9
10 This program is distributed in the hope that it will be useful, 10 This program is distributed in the hope that it will be useful,
diff --git a/m4/copy-file-range.m4 b/m4/copy-file-range.m4
index 4c7ec4eaafa..1b8b9d88589 100644
--- a/m4/copy-file-range.m4
+++ b/m4/copy-file-range.m4
@@ -7,6 +7,7 @@ dnl with or without modifications, as long as this notice is preserved.
7AC_DEFUN([gl_FUNC_COPY_FILE_RANGE], 7AC_DEFUN([gl_FUNC_COPY_FILE_RANGE],
8[ 8[
9 AC_REQUIRE([gl_UNISTD_H_DEFAULTS]) 9 AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
10 AC_REQUIRE([AC_CANONICAL_HOST])
10 11
11 dnl Persuade glibc <unistd.h> to declare copy_file_range. 12 dnl Persuade glibc <unistd.h> to declare copy_file_range.
12 AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS]) 13 AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
@@ -21,7 +22,7 @@ AC_DEFUN([gl_FUNC_COPY_FILE_RANGE],
21 [AC_LANG_PROGRAM( 22 [AC_LANG_PROGRAM(
22 [[#include <unistd.h> 23 [[#include <unistd.h>
23 ]], 24 ]],
24 [[ssize_t (*func) (int, off_t *, int, off_t, size_t, unsigned) 25 [[ssize_t (*func) (int, off_t *, int, off_t *, size_t, unsigned)
25 = copy_file_range; 26 = copy_file_range;
26 return func (0, 0, 0, 0, 0, 0) & 127; 27 return func (0, 0, 0, 0, 0, 0) & 127;
27 ]]) 28 ]])
@@ -32,5 +33,27 @@ AC_DEFUN([gl_FUNC_COPY_FILE_RANGE],
32 33
33 if test "$gl_cv_func_copy_file_range" != yes; then 34 if test "$gl_cv_func_copy_file_range" != yes; then
34 HAVE_COPY_FILE_RANGE=0 35 HAVE_COPY_FILE_RANGE=0
36 else
37 AC_DEFINE([HAVE_COPY_FILE_RANGE], 1,
38 [Define to 1 if the function copy_file_range exists.])
39
40 case $host_os in
41 linux*)
42 AC_CACHE_CHECK([whether copy_file_range is known to work],
43 [gl_cv_copy_file_range_known_to_work],
44 [AC_COMPILE_IFELSE(
45 [AC_LANG_PROGRAM(
46 [[#include <linux/version.h>
47 ]],
48 [[#if LINUX_VERSION_CODE < KERNEL_VERSION (5, 3, 0)
49 #error "copy_file_range is buggy"
50 #endif
51 ]])],
52 [gl_cv_copy_file_range_known_to_work=yes],
53 [gl_cv_copy_file_range_known_to_work=no])])
54 if test "$gl_cv_copy_file_range_known_to_work" = no; then
55 REPLACE_COPY_FILE_RANGE=1
56 fi;;
57 esac
35 fi 58 fi
36]) 59])
diff --git a/m4/extern-inline.m4 b/m4/extern-inline.m4
index 2e914dbc070..8a12bddd571 100644
--- a/m4/extern-inline.m4
+++ b/m4/extern-inline.m4
@@ -7,7 +7,22 @@ dnl with or without modifications, as long as this notice is preserved.
7 7
8AC_DEFUN([gl_EXTERN_INLINE], 8AC_DEFUN([gl_EXTERN_INLINE],
9[ 9[
10 AH_VERBATIM([extern_inline], 10 AC_CACHE_CHECK([whether ctype.h defines __header_inline],
11 [gl_cv_have___header_inline],
12 [AC_PREPROC_IFELSE(
13 [AC_LANG_SOURCE([[#include <ctype.h>
14 #ifndef __header_inline
15 #error "<ctype.h> does not define __header_inline"
16 #endif
17 ]])],
18 [gl_cv_have___header_inline=yes],
19 [gl_cv_have___header_inline=no])])
20 if test "$gl_cv_have___header_inline" = yes; then
21 AC_DEFINE([HAVE___HEADER_INLINE], [1],
22 [Define to 1 if ctype.h defines __header_inline.])
23 fi
24
25 AH_VERBATIM([HAVE___HEADER_INLINE_1],
11[/* Please see the Gnulib manual for how to use these macros. 26[/* Please see the Gnulib manual for how to use these macros.
12 27
13 Suppress extern inline with HP-UX cc, as it appears to be broken; see 28 Suppress extern inline with HP-UX cc, as it appears to be broken; see
@@ -54,7 +69,7 @@ AC_DEFUN([gl_EXTERN_INLINE],
54 */ 69 */
55#if (((defined __APPLE__ && defined __MACH__) \ 70#if (((defined __APPLE__ && defined __MACH__) \
56 || defined __DragonFly__ || defined __FreeBSD__) \ 71 || defined __DragonFly__ || defined __FreeBSD__) \
57 && (defined __header_inline \ 72 && (defined HAVE___HEADER_INLINE \
58 ? (defined __cplusplus && defined __GNUC_STDC_INLINE__ \ 73 ? (defined __cplusplus && defined __GNUC_STDC_INLINE__ \
59 && ! defined __clang__) \ 74 && ! defined __clang__) \
60 : ((! defined _DONT_USE_CTYPE_INLINE_ \ 75 : ((! defined _DONT_USE_CTYPE_INLINE_ \
diff --git a/m4/gnulib-common.m4 b/m4/gnulib-common.m4
index 87a9a751b6a..dbc40796148 100644
--- a/m4/gnulib-common.m4
+++ b/m4/gnulib-common.m4
@@ -1,4 +1,4 @@
1# gnulib-common.m4 serial 69 1# gnulib-common.m4 serial 72
2dnl Copyright (C) 2007-2022 Free Software Foundation, Inc. 2dnl Copyright (C) 2007-2022 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 3dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 4dnl gives unlimited permission to copy and/or distribute it,
@@ -181,7 +181,12 @@ AC_DEFUN([gl_COMMON_BODY], [
181#else 181#else
182# define _GL_ATTRIBUTE_DEALLOC(f, i) 182# define _GL_ATTRIBUTE_DEALLOC(f, i)
183#endif 183#endif
184#define _GL_ATTRIBUTE_DEALLOC_FREE _GL_ATTRIBUTE_DEALLOC (free, 1) 184/* If gnulib's <string.h> or <wchar.h> has already defined this macro, continue
185 to use this earlier definition, since <stdlib.h> may not have been included
186 yet. */
187#ifndef _GL_ATTRIBUTE_DEALLOC_FREE
188# define _GL_ATTRIBUTE_DEALLOC_FREE _GL_ATTRIBUTE_DEALLOC (free, 1)
189#endif
185 190
186/* _GL_ATTRIBUTE_DEPRECATED: Declares that an entity is deprecated. 191/* _GL_ATTRIBUTE_DEPRECATED: Declares that an entity is deprecated.
187 The compiler may warn if the entity is used. */ 192 The compiler may warn if the entity is used. */
@@ -813,6 +818,24 @@ AC_DEFUN([gl_CACHE_VAL_SILENT],
813 ]) 818 ])
814]) 819])
815 820
821# gl_CONDITIONAL(conditional, condition)
822# is like AM_CONDITIONAL(conditional, condition), except that it does not
823# produce an error
824# configure: error: conditional "..." was never defined.
825# Usually this means the macro was only invoked conditionally.
826# when only invoked conditionally. Instead, in that case, both the _TRUE
827# and the _FALSE case are disabled.
828AC_DEFUN([gl_CONDITIONAL],
829[
830 pushdef([AC_CONFIG_COMMANDS_PRE], [:])dnl
831 AM_CONDITIONAL([$1], [$2])
832 popdef([AC_CONFIG_COMMANDS_PRE])dnl
833 if test -z "${[$1]_TRUE}" && test -z "${[$1]_FALSE}"; then
834 [$1]_TRUE='#'
835 [$1]_FALSE='#'
836 fi
837])
838
816# gl_CC_ALLOW_WARNINGS 839# gl_CC_ALLOW_WARNINGS
817# sets and substitutes a variable GL_CFLAG_ALLOW_WARNINGS, to a $(CC) option 840# sets and substitutes a variable GL_CFLAG_ALLOW_WARNINGS, to a $(CC) option
818# that reverts a preceding '-Werror' option, if available. 841# that reverts a preceding '-Werror' option, if available.
@@ -879,6 +902,72 @@ AC_DEFUN([gl_CXX_ALLOW_WARNINGS],
879 AC_SUBST([GL_CXXFLAG_ALLOW_WARNINGS]) 902 AC_SUBST([GL_CXXFLAG_ALLOW_WARNINGS])
880]) 903])
881 904
905# gl_CC_GNULIB_WARNINGS
906# sets and substitutes a variable GL_CFLAG_GNULIB_WARNINGS, to a $(CC) option
907# set that enables or disables warnings as suitable for the Gnulib coding style.
908AC_DEFUN([gl_CC_GNULIB_WARNINGS],
909[
910 AC_REQUIRE([gl_CC_ALLOW_WARNINGS])
911 dnl Assume that the compiler supports -Wno-* options only if it also supports
912 dnl -Wno-error.
913 GL_CFLAG_GNULIB_WARNINGS=''
914 if test -n "$GL_CFLAG_ALLOW_WARNINGS"; then
915 dnl Enable these warning options:
916 dnl
917 dnl GCC clang
918 dnl -Wno-cast-qual >= 3 >= 3.9
919 dnl -Wno-conversion >= 3 >= 3.9
920 dnl -Wno-float-conversion >= 4.9 >= 3.9
921 dnl -Wno-float-equal >= 3 >= 3.9
922 dnl -Wimplicit-fallthrough >= 7 >= 3.9
923 dnl -Wno-pedantic >= 4.8 >= 3.9
924 dnl -Wno-sign-compare >= 3 >= 3.9
925 dnl -Wno-sign-conversion >= 4.3 >= 3.9
926 dnl -Wno-type-limits >= 4.3 >= 3.9
927 dnl -Wno-undef >= 3 >= 3.9
928 dnl -Wno-unsuffixed-float-constants >= 4.5
929 dnl -Wno-unused-function >= 3 >= 3.9
930 dnl -Wno-unused-parameter >= 3 >= 3.9
931 dnl
932 cat > conftest.c <<\EOF
933 #if __GNUC__ >= 3 || (__clang_major__ + (__clang_minor__ >= 9) > 3)
934 -Wno-cast-qual
935 -Wno-conversion
936 -Wno-float-equal
937 -Wno-sign-compare
938 -Wno-undef
939 -Wno-unused-function
940 -Wno-unused-parameter
941 #endif
942 #if __GNUC__ + (__GNUC_MINOR__ >= 9) > 4 || (__clang_major__ + (__clang_minor__ >= 9) > 3)
943 -Wno-float-conversion
944 #endif
945 #if __GNUC__ >= 7 || (__clang_major__ + (__clang_minor__ >= 9) > 3)
946 -Wimplicit-fallthrough
947 #endif
948 #if __GNUC__ + (__GNUC_MINOR__ >= 8) > 4 || (__clang_major__ + (__clang_minor__ >= 9) > 3)
949 -Wno-pedantic
950 #endif
951 #if __GNUC__ + (__GNUC_MINOR__ >= 3) > 4 || (__clang_major__ + (__clang_minor__ >= 9) > 3)
952 -Wno-sign-conversion
953 -Wno-type-limits
954 #endif
955 #if __GNUC__ + (__GNUC_MINOR__ >= 5) > 4
956 -Wno-unsuffixed-float-constants
957 #endif
958EOF
959 gl_command="$CC $CFLAGS $CPPFLAGS -E conftest.c > conftest.out"
960 if AC_TRY_EVAL([gl_command]); then
961 gl_options=`grep -v '#' conftest.out`
962 for word in $gl_options; do
963 GL_CFLAG_GNULIB_WARNINGS="$GL_CFLAG_GNULIB_WARNINGS $word"
964 done
965 fi
966 rm -f conftest.c conftest.out
967 fi
968 AC_SUBST([GL_CFLAG_GNULIB_WARNINGS])
969])
970
882dnl gl_CONDITIONAL_HEADER([foo.h]) 971dnl gl_CONDITIONAL_HEADER([foo.h])
883dnl takes a shell variable GL_GENERATE_FOO_H (with value true or false) as input 972dnl takes a shell variable GL_GENERATE_FOO_H (with value true or false) as input
884dnl and produces 973dnl and produces
@@ -903,7 +992,7 @@ AC_DEFUN([gl_CONDITIONAL_HEADER],
903 *) echo "*** gl_generate_var is not set correctly" 1>&2; exit 1 ;; 992 *) echo "*** gl_generate_var is not set correctly" 1>&2; exit 1 ;;
904 esac 993 esac
905 AC_SUBST(gl_header_name) 994 AC_SUBST(gl_header_name)
906 AM_CONDITIONAL(gl_generate_cond, [$gl_generate_var]) 995 gl_CONDITIONAL(gl_generate_cond, [$gl_generate_var])
907 m4_popdef([gl_generate_cond]) 996 m4_popdef([gl_generate_cond])
908 m4_popdef([gl_generate_var]) 997 m4_popdef([gl_generate_var])
909 m4_popdef([gl_header_name]) 998 m4_popdef([gl_header_name])
diff --git a/m4/gnulib-comp.m4 b/m4/gnulib-comp.m4
index c47ea915f14..1d31239d2db 100644
--- a/m4/gnulib-comp.m4
+++ b/m4/gnulib-comp.m4
@@ -3,7 +3,7 @@
3# 3#
4# This file is free software; you can redistribute it and/or modify 4# This file is free software; you can redistribute it and/or modify
5# it under the terms of the GNU General Public License as published by 5# it under the terms of the GNU General Public License as published by
6# the Free Software Foundation; either version 3 of the License, or 6# the Free Software Foundation, either version 3 of the License, or
7# (at your option) any later version. 7# (at your option) any later version.
8# 8#
9# This file is distributed in the hope that it will be useful, 9# This file is distributed in the hope that it will be useful,
@@ -236,9 +236,8 @@ AC_DEFUN([gl_INIT],
236 gl_CONDITIONAL_HEADER([byteswap.h]) 236 gl_CONDITIONAL_HEADER([byteswap.h])
237 AC_PROG_MKDIR_P 237 AC_PROG_MKDIR_P
238 gl_CANONICALIZE_LGPL 238 gl_CANONICALIZE_LGPL
239 if test $HAVE_CANONICALIZE_FILE_NAME = 0 || test $REPLACE_CANONICALIZE_FILE_NAME = 1; then 239 gl_CONDITIONAL([GL_COND_OBJ_CANONICALIZE_LGPL],
240 AC_LIBOBJ([canonicalize-lgpl]) 240 [test $HAVE_CANONICALIZE_FILE_NAME = 0 || test $REPLACE_CANONICALIZE_FILE_NAME = 1])
241 fi
242 gl_MODULE_INDICATOR([canonicalize-lgpl]) 241 gl_MODULE_INDICATOR([canonicalize-lgpl])
243 gl_STDLIB_MODULE_INDICATOR([canonicalize_file_name]) 242 gl_STDLIB_MODULE_INDICATOR([canonicalize_file_name])
244 gl_STDLIB_MODULE_INDICATOR([realpath]) 243 gl_STDLIB_MODULE_INDICATOR([realpath])
@@ -247,9 +246,9 @@ AC_DEFUN([gl_INIT],
247 gl_CLOCK_TIME 246 gl_CLOCK_TIME
248 gl_MODULE_INDICATOR([close-stream]) 247 gl_MODULE_INDICATOR([close-stream])
249 gl_FUNC_COPY_FILE_RANGE 248 gl_FUNC_COPY_FILE_RANGE
250 if test $HAVE_COPY_FILE_RANGE = 0; then 249 gl_CONDITIONAL([GL_COND_OBJ_COPY_FILE_RANGE],
251 AC_LIBOBJ([copy-file-range]) 250 [test $HAVE_COPY_FILE_RANGE = 0 ||
252 fi 251 test $REPLACE_COPY_FILE_RANGE = 1])
253 gl_UNISTD_MODULE_INDICATOR([copy-file-range]) 252 gl_UNISTD_MODULE_INDICATOR([copy-file-range])
254 AC_REQUIRE([AC_C_RESTRICT]) 253 AC_REQUIRE([AC_C_RESTRICT])
255 gl_MD5 254 gl_MD5
@@ -265,10 +264,10 @@ AC_DEFUN([gl_INIT],
265 AC_PROG_MKDIR_P 264 AC_PROG_MKDIR_P
266 gl_DOUBLE_SLASH_ROOT 265 gl_DOUBLE_SLASH_ROOT
267 gl_FUNC_DUP2 266 gl_FUNC_DUP2
268 if test $REPLACE_DUP2 = 1; then 267 gl_CONDITIONAL([GL_COND_OBJ_DUP2], [test $REPLACE_DUP2 = 1])
269 AC_LIBOBJ([dup2]) 268 AM_COND_IF([GL_COND_OBJ_DUP2], [
270 gl_PREREQ_DUP2 269 gl_PREREQ_DUP2
271 fi 270 ])
272 gl_UNISTD_MODULE_INDICATOR([dup2]) 271 gl_UNISTD_MODULE_INDICATOR([dup2])
273 gl_ENVIRON 272 gl_ENVIRON
274 gl_UNISTD_MODULE_INDICATOR([environ]) 273 gl_UNISTD_MODULE_INDICATOR([environ])
@@ -278,83 +277,77 @@ AC_DEFUN([gl_INIT],
278 gl_EXECINFO_H 277 gl_EXECINFO_H
279 gl_CONDITIONAL_HEADER([execinfo.h]) 278 gl_CONDITIONAL_HEADER([execinfo.h])
280 AC_PROG_MKDIR_P 279 AC_PROG_MKDIR_P
281 if $GL_GENERATE_EXECINFO_H; then 280 gl_CONDITIONAL([GL_COND_OBJ_EXECINFO], [$GL_GENERATE_EXECINFO_H])
282 AC_LIBOBJ([execinfo])
283 fi
284 gl_FUNC_EXPLICIT_BZERO 281 gl_FUNC_EXPLICIT_BZERO
285 if test $HAVE_EXPLICIT_BZERO = 0; then 282 gl_CONDITIONAL([GL_COND_OBJ_EXPLICIT_BZERO], [test $HAVE_EXPLICIT_BZERO = 0])
286 AC_LIBOBJ([explicit_bzero]) 283 AM_COND_IF([GL_COND_OBJ_EXPLICIT_BZERO], [
287 gl_PREREQ_EXPLICIT_BZERO 284 gl_PREREQ_EXPLICIT_BZERO
288 fi 285 ])
289 gl_STRING_MODULE_INDICATOR([explicit_bzero]) 286 gl_STRING_MODULE_INDICATOR([explicit_bzero])
290 AC_REQUIRE([gl_EXTERN_INLINE]) 287 AC_REQUIRE([gl_EXTERN_INLINE])
291 gl_FUNC_FACCESSAT 288 gl_FUNC_FACCESSAT
292 if test $HAVE_FACCESSAT = 0 || test $REPLACE_FACCESSAT = 1; then 289 gl_CONDITIONAL([GL_COND_OBJ_FACCESSAT],
293 AC_LIBOBJ([faccessat]) 290 [test $HAVE_FACCESSAT = 0 || test $REPLACE_FACCESSAT = 1])
291 AM_COND_IF([GL_COND_OBJ_FACCESSAT], [
294 gl_PREREQ_FACCESSAT 292 gl_PREREQ_FACCESSAT
295 fi 293 ])
296 gl_MODULE_INDICATOR([faccessat]) 294 gl_MODULE_INDICATOR([faccessat])
297 gl_UNISTD_MODULE_INDICATOR([faccessat]) 295 gl_UNISTD_MODULE_INDICATOR([faccessat])
298 gl_FUNC_FCHMODAT 296 gl_FUNC_FCHMODAT
299 if test $HAVE_FCHMODAT = 0 || test $REPLACE_FCHMODAT = 1; then 297 gl_CONDITIONAL([GL_COND_OBJ_FCHMODAT],
300 AC_LIBOBJ([fchmodat]) 298 [test $HAVE_FCHMODAT = 0 || test $REPLACE_FCHMODAT = 1])
299 AM_COND_IF([GL_COND_OBJ_FCHMODAT], [
301 gl_PREREQ_FCHMODAT 300 gl_PREREQ_FCHMODAT
302 fi 301 ])
303 gl_SYS_STAT_MODULE_INDICATOR([fchmodat]) 302 gl_SYS_STAT_MODULE_INDICATOR([fchmodat])
304 gl_FUNC_FCNTL 303 gl_FUNC_FCNTL
305 if test $HAVE_FCNTL = 0 || test $REPLACE_FCNTL = 1; then 304 gl_CONDITIONAL([GL_COND_OBJ_FCNTL],
306 AC_LIBOBJ([fcntl]) 305 [test $HAVE_FCNTL = 0 || test $REPLACE_FCNTL = 1])
307 fi
308 gl_FCNTL_MODULE_INDICATOR([fcntl]) 306 gl_FCNTL_MODULE_INDICATOR([fcntl])
309 gl_FCNTL_H 307 gl_FCNTL_H
310 gl_FCNTL_H_REQUIRE_DEFAULTS 308 gl_FCNTL_H_REQUIRE_DEFAULTS
311 AC_PROG_MKDIR_P 309 AC_PROG_MKDIR_P
312 gl_FUNC_FDOPENDIR 310 gl_FUNC_FDOPENDIR
313 if test $HAVE_FDOPENDIR = 0 || test $REPLACE_FDOPENDIR = 1; then 311 gl_CONDITIONAL([GL_COND_OBJ_FDOPENDIR],
314 AC_LIBOBJ([fdopendir]) 312 [test $HAVE_FDOPENDIR = 0 || test $REPLACE_FDOPENDIR = 1])
315 fi
316 gl_DIRENT_MODULE_INDICATOR([fdopendir]) 313 gl_DIRENT_MODULE_INDICATOR([fdopendir])
317 gl_MODULE_INDICATOR([fdopendir]) 314 gl_MODULE_INDICATOR([fdopendir])
318 gl_FILE_HAS_ACL 315 gl_FILE_HAS_ACL
319 gl_FILEMODE 316 gl_FILEMODE
320 AC_C_FLEXIBLE_ARRAY_MEMBER 317 AC_C_FLEXIBLE_ARRAY_MEMBER
321 gl_FUNC_FPENDING 318 gl_FUNC_FPENDING
322 if test $gl_cv_func___fpending = no; then 319 gl_CONDITIONAL([GL_COND_OBJ_FPENDING], [test $gl_cv_func___fpending = no])
323 AC_LIBOBJ([fpending])
324 fi
325 gl_FUNC_FREE 320 gl_FUNC_FREE
326 if test $REPLACE_FREE = 1; then 321 gl_CONDITIONAL([GL_COND_OBJ_FREE], [test $REPLACE_FREE = 1])
327 AC_LIBOBJ([free]) 322 AM_COND_IF([GL_COND_OBJ_FREE], [
328 gl_PREREQ_FREE 323 gl_PREREQ_FREE
329 fi 324 ])
330 gl_STDLIB_MODULE_INDICATOR([free-posix]) 325 gl_STDLIB_MODULE_INDICATOR([free-posix])
331 gl_FUNC_FSTATAT 326 gl_FUNC_FSTATAT
332 if test $HAVE_FSTATAT = 0 || test $REPLACE_FSTATAT = 1; then 327 gl_CONDITIONAL([GL_COND_OBJ_FSTATAT],
333 AC_LIBOBJ([fstatat]) 328 [test $HAVE_FSTATAT = 0 || test $REPLACE_FSTATAT = 1])
334 fi
335 gl_SYS_STAT_MODULE_INDICATOR([fstatat]) 329 gl_SYS_STAT_MODULE_INDICATOR([fstatat])
336 gl_FSUSAGE 330 gl_FSUSAGE
337 if test $gl_cv_fs_space = yes; then 331 gl_CONDITIONAL([GL_COND_OBJ_FSUSAGE], [test $gl_cv_fs_space = yes])
338 AC_LIBOBJ([fsusage]) 332 AM_COND_IF([GL_COND_OBJ_FSUSAGE], [
339 gl_PREREQ_FSUSAGE_EXTRA 333 gl_PREREQ_FSUSAGE_EXTRA
340 fi 334 ])
341 gl_FUNC_FSYNC 335 gl_FUNC_FSYNC
342 if test $HAVE_FSYNC = 0; then 336 gl_CONDITIONAL([GL_COND_OBJ_FSYNC], [test $HAVE_FSYNC = 0])
343 AC_LIBOBJ([fsync]) 337 AM_COND_IF([GL_COND_OBJ_FSYNC], [
344 gl_PREREQ_FSYNC 338 gl_PREREQ_FSYNC
345 fi 339 ])
346 gl_UNISTD_MODULE_INDICATOR([fsync]) 340 gl_UNISTD_MODULE_INDICATOR([fsync])
347 gl_FUNC_FUTIMENS 341 gl_FUNC_FUTIMENS
348 if test $HAVE_FUTIMENS = 0 || test $REPLACE_FUTIMENS = 1; then 342 gl_CONDITIONAL([GL_COND_OBJ_FUTIMENS],
349 AC_LIBOBJ([futimens]) 343 [test $HAVE_FUTIMENS = 0 || test $REPLACE_FUTIMENS = 1])
350 fi
351 gl_SYS_STAT_MODULE_INDICATOR([futimens]) 344 gl_SYS_STAT_MODULE_INDICATOR([futimens])
352 AC_REQUIRE([AC_CANONICAL_HOST]) 345 AC_REQUIRE([AC_CANONICAL_HOST])
353 gl_GETLOADAVG 346 gl_GETLOADAVG
354 if test $HAVE_GETLOADAVG = 0; then 347 gl_CONDITIONAL([GL_COND_OBJ_GETLOADAVG], [test $HAVE_GETLOADAVG = 0])
355 AC_LIBOBJ([getloadavg]) 348 AM_COND_IF([GL_COND_OBJ_GETLOADAVG], [
356 gl_PREREQ_GETLOADAVG 349 gl_PREREQ_GETLOADAVG
357 fi 350 ])
358 gl_STDLIB_MODULE_INDICATOR([getloadavg]) 351 gl_STDLIB_MODULE_INDICATOR([getloadavg])
359 gl_FUNC_GETOPT_GNU 352 gl_FUNC_GETOPT_GNU
360 dnl Because of the way gl_FUNC_GETOPT_GNU is implemented (the gl_getopt_required 353 dnl Because of the way gl_FUNC_GETOPT_GNU is implemented (the gl_getopt_required
@@ -364,26 +357,25 @@ AC_DEFUN([gl_INIT],
364 gl_CONDITIONAL_HEADER([getopt.h]) 357 gl_CONDITIONAL_HEADER([getopt.h])
365 gl_CONDITIONAL_HEADER([getopt-cdefs.h]) 358 gl_CONDITIONAL_HEADER([getopt-cdefs.h])
366 AC_PROG_MKDIR_P 359 AC_PROG_MKDIR_P
367 if test $REPLACE_GETOPT = 1; then 360 gl_CONDITIONAL([GL_COND_OBJ_GETOPT], [test $REPLACE_GETOPT = 1])
368 AC_LIBOBJ([getopt]) 361 AM_COND_IF([GL_COND_OBJ_GETOPT], [
369 AC_LIBOBJ([getopt1])
370 dnl Define the substituted variable GNULIB_UNISTD_H_GETOPT to 1. 362 dnl Define the substituted variable GNULIB_UNISTD_H_GETOPT to 1.
371 gl_UNISTD_H_REQUIRE_DEFAULTS 363 gl_UNISTD_H_REQUIRE_DEFAULTS
372 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNISTD_H_GETOPT], [1]) 364 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNISTD_H_GETOPT], [1])
373 fi 365 ])
374 gl_UNISTD_MODULE_INDICATOR([getopt-posix]) 366 gl_UNISTD_MODULE_INDICATOR([getopt-posix])
375 AC_REQUIRE([AC_CANONICAL_HOST]) 367 AC_REQUIRE([AC_CANONICAL_HOST])
376 gl_FUNC_GETRANDOM 368 gl_FUNC_GETRANDOM
377 if test $HAVE_GETRANDOM = 0 || test $REPLACE_GETRANDOM = 1; then 369 gl_CONDITIONAL([GL_COND_OBJ_GETRANDOM],
378 AC_LIBOBJ([getrandom]) 370 [test $HAVE_GETRANDOM = 0 || test $REPLACE_GETRANDOM = 1])
379 fi
380 gl_SYS_RANDOM_MODULE_INDICATOR([getrandom]) 371 gl_SYS_RANDOM_MODULE_INDICATOR([getrandom])
381 gl_GETTIME 372 gl_GETTIME
382 gl_FUNC_GETTIMEOFDAY 373 gl_FUNC_GETTIMEOFDAY
383 if test $HAVE_GETTIMEOFDAY = 0 || test $REPLACE_GETTIMEOFDAY = 1; then 374 gl_CONDITIONAL([GL_COND_OBJ_GETTIMEOFDAY],
384 AC_LIBOBJ([gettimeofday]) 375 [test $HAVE_GETTIMEOFDAY = 0 || test $REPLACE_GETTIMEOFDAY = 1])
376 AM_COND_IF([GL_COND_OBJ_GETTIMEOFDAY], [
385 gl_PREREQ_GETTIMEOFDAY 377 gl_PREREQ_GETTIMEOFDAY
386 fi 378 ])
387 gl_SYS_TIME_MODULE_INDICATOR([gettimeofday]) 379 gl_SYS_TIME_MODULE_INDICATOR([gettimeofday])
388 gl_IEEE754_H 380 gl_IEEE754_H
389 gl_CONDITIONAL_HEADER([ieee754.h]) 381 gl_CONDITIONAL_HEADER([ieee754.h])
@@ -396,17 +388,15 @@ AC_DEFUN([gl_INIT],
396 gl_LIBGMP 388 gl_LIBGMP
397 gl_CONDITIONAL_HEADER([gmp.h]) 389 gl_CONDITIONAL_HEADER([gmp.h])
398 AC_PROG_MKDIR_P 390 AC_PROG_MKDIR_P
399 if test $HAVE_LIBGMP != yes; then 391 gl_CONDITIONAL([GL_COND_OBJ_MINI_GMP_GNULIB], [test $HAVE_LIBGMP != yes])
400 AC_LIBOBJ([mini-gmp-gnulib])
401 fi
402 gl_LIMITS_H 392 gl_LIMITS_H
403 gl_CONDITIONAL_HEADER([limits.h]) 393 gl_CONDITIONAL_HEADER([limits.h])
404 AC_PROG_MKDIR_P 394 AC_PROG_MKDIR_P
405 gl_FUNC_LSTAT 395 gl_FUNC_LSTAT
406 if test $REPLACE_LSTAT = 1; then 396 gl_CONDITIONAL([GL_COND_OBJ_LSTAT], [test $REPLACE_LSTAT = 1])
407 AC_LIBOBJ([lstat]) 397 AM_COND_IF([GL_COND_OBJ_LSTAT], [
408 gl_PREREQ_LSTAT 398 gl_PREREQ_LSTAT
409 fi 399 ])
410 gl_SYS_STAT_MODULE_INDICATOR([lstat]) 400 gl_SYS_STAT_MODULE_INDICATOR([lstat])
411 gl_FUNC_MEMMEM_SIMPLE 401 gl_FUNC_MEMMEM_SIMPLE
412 if test $HAVE_MEMMEM = 0 || test $REPLACE_MEMMEM = 1; then 402 if test $HAVE_MEMMEM = 0 || test $REPLACE_MEMMEM = 1; then
@@ -414,23 +404,23 @@ AC_DEFUN([gl_INIT],
414 fi 404 fi
415 gl_STRING_MODULE_INDICATOR([memmem]) 405 gl_STRING_MODULE_INDICATOR([memmem])
416 gl_FUNC_MEMPCPY 406 gl_FUNC_MEMPCPY
417 if test $HAVE_MEMPCPY = 0; then 407 gl_CONDITIONAL([GL_COND_OBJ_MEMPCPY], [test $HAVE_MEMPCPY = 0])
418 AC_LIBOBJ([mempcpy]) 408 AM_COND_IF([GL_COND_OBJ_MEMPCPY], [
419 gl_PREREQ_MEMPCPY 409 gl_PREREQ_MEMPCPY
420 fi 410 ])
421 gl_STRING_MODULE_INDICATOR([mempcpy]) 411 gl_STRING_MODULE_INDICATOR([mempcpy])
422 gl_FUNC_MEMRCHR 412 gl_FUNC_MEMRCHR
423 if test $ac_cv_func_memrchr = no; then 413 gl_CONDITIONAL([GL_COND_OBJ_MEMRCHR], [test $ac_cv_func_memrchr = no])
424 AC_LIBOBJ([memrchr]) 414 AM_COND_IF([GL_COND_OBJ_MEMRCHR], [
425 gl_PREREQ_MEMRCHR 415 gl_PREREQ_MEMRCHR
426 fi 416 ])
427 gl_STRING_MODULE_INDICATOR([memrchr]) 417 gl_STRING_MODULE_INDICATOR([memrchr])
428 gl_MINMAX 418 gl_MINMAX
429 gl_FUNC_MKOSTEMP 419 gl_FUNC_MKOSTEMP
430 if test $HAVE_MKOSTEMP = 0; then 420 gl_CONDITIONAL([GL_COND_OBJ_MKOSTEMP], [test $HAVE_MKOSTEMP = 0])
431 AC_LIBOBJ([mkostemp]) 421 AM_COND_IF([GL_COND_OBJ_MKOSTEMP], [
432 gl_PREREQ_MKOSTEMP 422 gl_PREREQ_MKOSTEMP
433 fi 423 ])
434 gl_MODULE_INDICATOR([mkostemp]) 424 gl_MODULE_INDICATOR([mkostemp])
435 gl_STDLIB_MODULE_INDICATOR([mkostemp]) 425 gl_STDLIB_MODULE_INDICATOR([mkostemp])
436 gl_FUNC_MKTIME 426 gl_FUNC_MKTIME
@@ -446,41 +436,39 @@ AC_DEFUN([gl_INIT],
446 gl_FUNC_PIPE2 436 gl_FUNC_PIPE2
447 gl_UNISTD_MODULE_INDICATOR([pipe2]) 437 gl_UNISTD_MODULE_INDICATOR([pipe2])
448 gl_FUNC_PSELECT 438 gl_FUNC_PSELECT
449 if test $HAVE_PSELECT = 0 || test $REPLACE_PSELECT = 1; then 439 gl_CONDITIONAL([GL_COND_OBJ_PSELECT],
450 AC_LIBOBJ([pselect]) 440 [test $HAVE_PSELECT = 0 || test $REPLACE_PSELECT = 1])
451 fi
452 gl_SYS_SELECT_MODULE_INDICATOR([pselect]) 441 gl_SYS_SELECT_MODULE_INDICATOR([pselect])
453 gl_FUNC_PTHREAD_SIGMASK 442 gl_FUNC_PTHREAD_SIGMASK
454 if test $HAVE_PTHREAD_SIGMASK = 0 || test $REPLACE_PTHREAD_SIGMASK = 1; then 443 gl_CONDITIONAL([GL_COND_OBJ_PTHREAD_SIGMASK],
455 AC_LIBOBJ([pthread_sigmask]) 444 [test $HAVE_PTHREAD_SIGMASK = 0 || test $REPLACE_PTHREAD_SIGMASK = 1])
445 AM_COND_IF([GL_COND_OBJ_PTHREAD_SIGMASK], [
456 gl_PREREQ_PTHREAD_SIGMASK 446 gl_PREREQ_PTHREAD_SIGMASK
457 fi 447 ])
458 gl_SIGNAL_MODULE_INDICATOR([pthread_sigmask]) 448 gl_SIGNAL_MODULE_INDICATOR([pthread_sigmask])
459 gl_FUNC_READLINK 449 gl_FUNC_READLINK
460 if test $HAVE_READLINK = 0 || test $REPLACE_READLINK = 1; then 450 gl_CONDITIONAL([GL_COND_OBJ_READLINK],
461 AC_LIBOBJ([readlink]) 451 [test $HAVE_READLINK = 0 || test $REPLACE_READLINK = 1])
452 AM_COND_IF([GL_COND_OBJ_READLINK], [
462 gl_PREREQ_READLINK 453 gl_PREREQ_READLINK
463 fi 454 ])
464 gl_UNISTD_MODULE_INDICATOR([readlink]) 455 gl_UNISTD_MODULE_INDICATOR([readlink])
465 gl_FUNC_READLINKAT 456 gl_FUNC_READLINKAT
466 if test $HAVE_READLINKAT = 0 || test $REPLACE_READLINKAT = 1; then 457 gl_CONDITIONAL([GL_COND_OBJ_READLINKAT],
467 AC_LIBOBJ([readlinkat]) 458 [test $HAVE_READLINKAT = 0 || test $REPLACE_READLINKAT = 1])
468 fi
469 gl_UNISTD_MODULE_INDICATOR([readlinkat]) 459 gl_UNISTD_MODULE_INDICATOR([readlinkat])
470 gl_REGEX 460 gl_REGEX
471 if test $ac_use_included_regex = yes; then 461 gl_CONDITIONAL([GL_COND_OBJ_REGEX], [test $ac_use_included_regex = yes])
472 AC_LIBOBJ([regex]) 462 AM_COND_IF([GL_COND_OBJ_REGEX], [
473 gl_PREREQ_REGEX 463 gl_PREREQ_REGEX
474 fi 464 ])
475 gl_FUNC_SIG2STR 465 gl_FUNC_SIG2STR
476 if test $ac_cv_func_sig2str = no; then 466 gl_CONDITIONAL([GL_COND_OBJ_SIG2STR], [test $ac_cv_func_sig2str = no])
477 AC_LIBOBJ([sig2str]) 467 AM_COND_IF([GL_COND_OBJ_SIG2STR], [
478 gl_PREREQ_SIG2STR 468 gl_PREREQ_SIG2STR
479 fi 469 ])
480 gl_FUNC_SIGDESCR_NP 470 gl_FUNC_SIGDESCR_NP
481 if test $HAVE_SIGDESCR_NP = 0; then 471 gl_CONDITIONAL([GL_COND_OBJ_SIGDESCR_NP], [test $HAVE_SIGDESCR_NP = 0])
482 AC_LIBOBJ([sigdescr_np])
483 fi
484 gl_STRING_MODULE_INDICATOR([sigdescr_np]) 472 gl_STRING_MODULE_INDICATOR([sigdescr_np])
485 gl_SIGNAL_H 473 gl_SIGNAL_H
486 gl_SIGNAL_H_REQUIRE_DEFAULTS 474 gl_SIGNAL_H_REQUIRE_DEFAULTS
@@ -504,6 +492,8 @@ AC_DEFUN([gl_INIT],
504 gl_STDIO_H 492 gl_STDIO_H
505 gl_STDIO_H_REQUIRE_DEFAULTS 493 gl_STDIO_H_REQUIRE_DEFAULTS
506 AC_PROG_MKDIR_P 494 AC_PROG_MKDIR_P
495 gl_CONDITIONAL([GL_COND_OBJ_STDIO_READ], [test $REPLACE_STDIO_READ_FUNCS = 1])
496 gl_CONDITIONAL([GL_COND_OBJ_STDIO_WRITE], [test $REPLACE_STDIO_WRITE_FUNCS = 1])
507 dnl No need to create extra modules for these functions. Everyone who uses 497 dnl No need to create extra modules for these functions. Everyone who uses
508 dnl <stdio.h> likely needs them. 498 dnl <stdio.h> likely needs them.
509 gl_STDIO_MODULE_INDICATOR([fscanf]) 499 gl_STDIO_MODULE_INDICATOR([fscanf])
@@ -531,30 +521,31 @@ AC_DEFUN([gl_INIT],
531 gl_STDLIB_H_REQUIRE_DEFAULTS 521 gl_STDLIB_H_REQUIRE_DEFAULTS
532 AC_PROG_MKDIR_P 522 AC_PROG_MKDIR_P
533 gl_FUNC_STPCPY 523 gl_FUNC_STPCPY
534 if test $HAVE_STPCPY = 0; then 524 gl_CONDITIONAL([GL_COND_OBJ_STPCPY], [test $HAVE_STPCPY = 0])
535 AC_LIBOBJ([stpcpy]) 525 AM_COND_IF([GL_COND_OBJ_STPCPY], [
536 gl_PREREQ_STPCPY 526 gl_PREREQ_STPCPY
537 fi 527 ])
538 gl_STRING_MODULE_INDICATOR([stpcpy]) 528 gl_STRING_MODULE_INDICATOR([stpcpy])
539 gl_STRING_H 529 gl_STRING_H
540 gl_STRING_H_REQUIRE_DEFAULTS 530 gl_STRING_H_REQUIRE_DEFAULTS
541 AC_PROG_MKDIR_P 531 AC_PROG_MKDIR_P
542 gl_FUNC_STRNLEN 532 gl_FUNC_STRNLEN
543 if test $HAVE_DECL_STRNLEN = 0 || test $REPLACE_STRNLEN = 1; then 533 gl_CONDITIONAL([GL_COND_OBJ_STRNLEN],
544 AC_LIBOBJ([strnlen]) 534 [test $HAVE_DECL_STRNLEN = 0 || test $REPLACE_STRNLEN = 1])
535 AM_COND_IF([GL_COND_OBJ_STRNLEN], [
545 gl_PREREQ_STRNLEN 536 gl_PREREQ_STRNLEN
546 fi 537 ])
547 gl_STRING_MODULE_INDICATOR([strnlen]) 538 gl_STRING_MODULE_INDICATOR([strnlen])
548 gl_FUNC_STRTOIMAX 539 gl_FUNC_STRTOIMAX
549 if test $HAVE_DECL_STRTOIMAX = 0 || test $REPLACE_STRTOIMAX = 1; then 540 gl_CONDITIONAL([GL_COND_OBJ_STRTOIMAX],
550 AC_LIBOBJ([strtoimax]) 541 [test $HAVE_DECL_STRTOIMAX = 0 || test $REPLACE_STRTOIMAX = 1])
542 AM_COND_IF([GL_COND_OBJ_STRTOIMAX], [
551 gl_PREREQ_STRTOIMAX 543 gl_PREREQ_STRTOIMAX
552 fi 544 ])
553 gl_INTTYPES_MODULE_INDICATOR([strtoimax]) 545 gl_INTTYPES_MODULE_INDICATOR([strtoimax])
554 gl_FUNC_SYMLINK 546 gl_FUNC_SYMLINK
555 if test $HAVE_SYMLINK = 0 || test $REPLACE_SYMLINK = 1; then 547 gl_CONDITIONAL([GL_COND_OBJ_SYMLINK],
556 AC_LIBOBJ([symlink]) 548 [test $HAVE_SYMLINK = 0 || test $REPLACE_SYMLINK = 1])
557 fi
558 gl_UNISTD_MODULE_INDICATOR([symlink]) 549 gl_UNISTD_MODULE_INDICATOR([symlink])
559 gl_SYS_RANDOM_H 550 gl_SYS_RANDOM_H
560 gl_SYS_RANDOM_H_REQUIRE_DEFAULTS 551 gl_SYS_RANDOM_H_REQUIRE_DEFAULTS
@@ -577,21 +568,21 @@ AC_DEFUN([gl_INIT],
577 gl_TIME_H_REQUIRE_DEFAULTS 568 gl_TIME_H_REQUIRE_DEFAULTS
578 AC_PROG_MKDIR_P 569 AC_PROG_MKDIR_P
579 gl_TIME_R 570 gl_TIME_R
580 if test $HAVE_LOCALTIME_R = 0 || test $REPLACE_LOCALTIME_R = 1; then 571 gl_CONDITIONAL([GL_COND_OBJ_TIME_R],
581 AC_LIBOBJ([time_r]) 572 [test $HAVE_LOCALTIME_R = 0 || test $REPLACE_LOCALTIME_R = 1])
573 AM_COND_IF([GL_COND_OBJ_TIME_R], [
582 gl_PREREQ_TIME_R 574 gl_PREREQ_TIME_R
583 fi 575 ])
584 gl_TIME_MODULE_INDICATOR([time_r]) 576 gl_TIME_MODULE_INDICATOR([time_r])
585 gl_TIME_RZ 577 gl_TIME_RZ
586 if test $HAVE_TIMEZONE_T = 0; then 578 gl_CONDITIONAL([GL_COND_OBJ_TIME_RZ], [test $HAVE_TIMEZONE_T = 0])
587 AC_LIBOBJ([time_rz])
588 fi
589 gl_TIME_MODULE_INDICATOR([time_rz]) 579 gl_TIME_MODULE_INDICATOR([time_rz])
590 gl_FUNC_TIMEGM 580 gl_FUNC_TIMEGM
591 if test $HAVE_TIMEGM = 0 || test $REPLACE_TIMEGM = 1; then 581 gl_CONDITIONAL([GL_COND_OBJ_TIMEGM],
592 AC_LIBOBJ([timegm]) 582 [test $HAVE_TIMEGM = 0 || test $REPLACE_TIMEGM = 1])
583 AM_COND_IF([GL_COND_OBJ_TIMEGM], [
593 gl_PREREQ_TIMEGM 584 gl_PREREQ_TIMEGM
594 fi 585 ])
595 gl_TIME_MODULE_INDICATOR([timegm]) 586 gl_TIME_MODULE_INDICATOR([timegm])
596 gl_TIMER_TIME 587 gl_TIMER_TIME
597 gl_TIMESPEC 588 gl_TIMESPEC
@@ -610,9 +601,8 @@ AC_DEFUN([gl_INIT],
610 [An alias of GNULIB_STDIO_SINGLE_THREAD.]) 601 [An alias of GNULIB_STDIO_SINGLE_THREAD.])
611 gl_FUNC_GLIBC_UNLOCKED_IO 602 gl_FUNC_GLIBC_UNLOCKED_IO
612 gl_FUNC_UTIMENSAT 603 gl_FUNC_UTIMENSAT
613 if test $HAVE_UTIMENSAT = 0 || test $REPLACE_UTIMENSAT = 1; then 604 gl_CONDITIONAL([GL_COND_OBJ_UTIMENSAT],
614 AC_LIBOBJ([utimensat]) 605 [test $HAVE_UTIMENSAT = 0 || test $REPLACE_UTIMENSAT = 1])
615 fi
616 gl_SYS_STAT_MODULE_INDICATOR([utimensat]) 606 gl_SYS_STAT_MODULE_INDICATOR([utimensat])
617 AC_C_VARARRAYS 607 AC_C_VARARRAYS
618 gl_gnulib_enabled_260941c0e5dc67ec9e87d1fb321c300b=false 608 gl_gnulib_enabled_260941c0e5dc67ec9e87d1fb321c300b=false
@@ -660,11 +650,11 @@ AC_DEFUN([gl_INIT],
660 { 650 {
661 if ! $gl_gnulib_enabled_dirfd; then 651 if ! $gl_gnulib_enabled_dirfd; then
662 gl_FUNC_DIRFD 652 gl_FUNC_DIRFD
663 if test $ac_cv_func_dirfd = no && test $gl_cv_func_dirfd_macro = no \ 653 gl_CONDITIONAL([GL_COND_OBJ_DIRFD],
664 || test $REPLACE_DIRFD = 1; then 654 [test $ac_cv_func_dirfd = no && test $gl_cv_func_dirfd_macro = no || test $REPLACE_DIRFD = 1])
665 AC_LIBOBJ([dirfd]) 655 AM_COND_IF([GL_COND_OBJ_DIRFD], [
666 gl_PREREQ_DIRFD 656 gl_PREREQ_DIRFD
667 fi 657 ])
668 gl_DIRENT_MODULE_INDICATOR([dirfd]) 658 gl_DIRENT_MODULE_INDICATOR([dirfd])
669 gl_gnulib_enabled_dirfd=true 659 gl_gnulib_enabled_dirfd=true
670 fi 660 fi
@@ -686,10 +676,10 @@ AC_DEFUN([gl_INIT],
686 { 676 {
687 if ! $gl_gnulib_enabled_euidaccess; then 677 if ! $gl_gnulib_enabled_euidaccess; then
688 gl_FUNC_EUIDACCESS 678 gl_FUNC_EUIDACCESS
689 if test $HAVE_EUIDACCESS = 0; then 679 gl_CONDITIONAL([GL_COND_OBJ_EUIDACCESS], [test $HAVE_EUIDACCESS = 0])
690 AC_LIBOBJ([euidaccess]) 680 AM_COND_IF([GL_COND_OBJ_EUIDACCESS], [
691 gl_PREREQ_EUIDACCESS 681 gl_PREREQ_EUIDACCESS
692 fi 682 ])
693 gl_UNISTD_MODULE_INDICATOR([euidaccess]) 683 gl_UNISTD_MODULE_INDICATOR([euidaccess])
694 gl_gnulib_enabled_euidaccess=true 684 gl_gnulib_enabled_euidaccess=true
695 if test $HAVE_EUIDACCESS = 0; then 685 if test $HAVE_EUIDACCESS = 0; then
@@ -702,10 +692,11 @@ AC_DEFUN([gl_INIT],
702 { 692 {
703 if ! $gl_gnulib_enabled_getdtablesize; then 693 if ! $gl_gnulib_enabled_getdtablesize; then
704 gl_FUNC_GETDTABLESIZE 694 gl_FUNC_GETDTABLESIZE
705 if test $HAVE_GETDTABLESIZE = 0 || test $REPLACE_GETDTABLESIZE = 1; then 695 gl_CONDITIONAL([GL_COND_OBJ_GETDTABLESIZE],
706 AC_LIBOBJ([getdtablesize]) 696 [test $HAVE_GETDTABLESIZE = 0 || test $REPLACE_GETDTABLESIZE = 1])
697 AM_COND_IF([GL_COND_OBJ_GETDTABLESIZE], [
707 gl_PREREQ_GETDTABLESIZE 698 gl_PREREQ_GETDTABLESIZE
708 fi 699 ])
709 gl_UNISTD_MODULE_INDICATOR([getdtablesize]) 700 gl_UNISTD_MODULE_INDICATOR([getdtablesize])
710 gl_gnulib_enabled_getdtablesize=true 701 gl_gnulib_enabled_getdtablesize=true
711 fi 702 fi
@@ -714,9 +705,8 @@ AC_DEFUN([gl_INIT],
714 { 705 {
715 if ! $gl_gnulib_enabled_getgroups; then 706 if ! $gl_gnulib_enabled_getgroups; then
716 gl_FUNC_GETGROUPS 707 gl_FUNC_GETGROUPS
717 if test $HAVE_GETGROUPS = 0 || test $REPLACE_GETGROUPS = 1; then 708 gl_CONDITIONAL([GL_COND_OBJ_GETGROUPS],
718 AC_LIBOBJ([getgroups]) 709 [test $HAVE_GETGROUPS = 0 || test $REPLACE_GETGROUPS = 1])
719 fi
720 gl_UNISTD_MODULE_INDICATOR([getgroups]) 710 gl_UNISTD_MODULE_INDICATOR([getgroups])
721 gl_gnulib_enabled_getgroups=true 711 gl_gnulib_enabled_getgroups=true
722 if test $HAVE_GETGROUPS = 0 || test $REPLACE_GETGROUPS = 1; then 712 if test $HAVE_GETGROUPS = 0 || test $REPLACE_GETGROUPS = 1; then
@@ -736,10 +726,10 @@ AC_DEFUN([gl_INIT],
736 { 726 {
737 if ! $gl_gnulib_enabled_a9786850e999ae65a836a6041e8e5ed1; then 727 if ! $gl_gnulib_enabled_a9786850e999ae65a836a6041e8e5ed1; then
738 gl_FUNC_GROUP_MEMBER 728 gl_FUNC_GROUP_MEMBER
739 if test $HAVE_GROUP_MEMBER = 0; then 729 gl_CONDITIONAL([GL_COND_OBJ_GROUP_MEMBER], [test $HAVE_GROUP_MEMBER = 0])
740 AC_LIBOBJ([group-member]) 730 AM_COND_IF([GL_COND_OBJ_GROUP_MEMBER], [
741 gl_PREREQ_GROUP_MEMBER 731 gl_PREREQ_GROUP_MEMBER
742 fi 732 ])
743 gl_UNISTD_MODULE_INDICATOR([group-member]) 733 gl_UNISTD_MODULE_INDICATOR([group-member])
744 gl_gnulib_enabled_a9786850e999ae65a836a6041e8e5ed1=true 734 gl_gnulib_enabled_a9786850e999ae65a836a6041e8e5ed1=true
745 if test $HAVE_GROUP_MEMBER = 0; then 735 if test $HAVE_GROUP_MEMBER = 0; then
@@ -754,10 +744,10 @@ AC_DEFUN([gl_INIT],
754 { 744 {
755 if ! $gl_gnulib_enabled_lchmod; then 745 if ! $gl_gnulib_enabled_lchmod; then
756 gl_FUNC_LCHMOD 746 gl_FUNC_LCHMOD
757 if test $HAVE_LCHMOD = 0; then 747 gl_CONDITIONAL([GL_COND_OBJ_LCHMOD], [test $HAVE_LCHMOD = 0])
758 AC_LIBOBJ([lchmod]) 748 AM_COND_IF([GL_COND_OBJ_LCHMOD], [
759 gl_PREREQ_LCHMOD 749 gl_PREREQ_LCHMOD
760 fi 750 ])
761 gl_SYS_STAT_MODULE_INDICATOR([lchmod]) 751 gl_SYS_STAT_MODULE_INDICATOR([lchmod])
762 gl_gnulib_enabled_lchmod=true 752 gl_gnulib_enabled_lchmod=true
763 fi 753 fi
@@ -806,10 +796,10 @@ AC_DEFUN([gl_INIT],
806 { 796 {
807 if ! $gl_gnulib_enabled_open; then 797 if ! $gl_gnulib_enabled_open; then
808 gl_FUNC_OPEN 798 gl_FUNC_OPEN
809 if test $REPLACE_OPEN = 1; then 799 gl_CONDITIONAL([GL_COND_OBJ_OPEN], [test $REPLACE_OPEN = 1])
810 AC_LIBOBJ([open]) 800 AM_COND_IF([GL_COND_OBJ_OPEN], [
811 gl_PREREQ_OPEN 801 gl_PREREQ_OPEN
812 fi 802 ])
813 gl_FCNTL_MODULE_INDICATOR([open]) 803 gl_FCNTL_MODULE_INDICATOR([open])
814 gl_gnulib_enabled_open=true 804 gl_gnulib_enabled_open=true
815 if test $REPLACE_OPEN = 1; then 805 if test $REPLACE_OPEN = 1; then
@@ -827,10 +817,10 @@ AC_DEFUN([gl_INIT],
827 { 817 {
828 if ! $gl_gnulib_enabled_rawmemchr; then 818 if ! $gl_gnulib_enabled_rawmemchr; then
829 gl_FUNC_RAWMEMCHR 819 gl_FUNC_RAWMEMCHR
830 if test $HAVE_RAWMEMCHR = 0; then 820 gl_CONDITIONAL([GL_COND_OBJ_RAWMEMCHR], [test $HAVE_RAWMEMCHR = 0])
831 AC_LIBOBJ([rawmemchr]) 821 AM_COND_IF([GL_COND_OBJ_RAWMEMCHR], [
832 gl_PREREQ_RAWMEMCHR 822 gl_PREREQ_RAWMEMCHR
833 fi 823 ])
834 gl_STRING_MODULE_INDICATOR([rawmemchr]) 824 gl_STRING_MODULE_INDICATOR([rawmemchr])
835 gl_gnulib_enabled_rawmemchr=true 825 gl_gnulib_enabled_rawmemchr=true
836 fi 826 fi
@@ -889,10 +879,11 @@ AC_DEFUN([gl_INIT],
889 { 879 {
890 if ! $gl_gnulib_enabled_strtoll; then 880 if ! $gl_gnulib_enabled_strtoll; then
891 gl_FUNC_STRTOLL 881 gl_FUNC_STRTOLL
892 if test $HAVE_STRTOLL = 0 || test $REPLACE_STRTOLL = 1; then 882 gl_CONDITIONAL([GL_COND_OBJ_STRTOLL],
893 AC_LIBOBJ([strtoll]) 883 [test $HAVE_STRTOLL = 0 || test $REPLACE_STRTOLL = 1])
884 AM_COND_IF([GL_COND_OBJ_STRTOLL], [
894 gl_PREREQ_STRTOLL 885 gl_PREREQ_STRTOLL
895 fi 886 ])
896 gl_STDLIB_MODULE_INDICATOR([strtoll]) 887 gl_STDLIB_MODULE_INDICATOR([strtoll])
897 gl_gnulib_enabled_strtoll=true 888 gl_gnulib_enabled_strtoll=true
898 fi 889 fi
@@ -1035,16 +1026,28 @@ AC_DEFUN([gl_INIT],
1035 AC_CONFIG_COMMANDS_PRE([ 1026 AC_CONFIG_COMMANDS_PRE([
1036 gl_libobjs= 1027 gl_libobjs=
1037 gl_ltlibobjs= 1028 gl_ltlibobjs=
1029 gl_libobjdeps=
1038 if test -n "$gl_LIBOBJS"; then 1030 if test -n "$gl_LIBOBJS"; then
1039 # Remove the extension. 1031 # Remove the extension.
1032changequote(,)dnl
1040 sed_drop_objext='s/\.o$//;s/\.obj$//' 1033 sed_drop_objext='s/\.o$//;s/\.obj$//'
1034 sed_dirname1='s,//*,/,g'
1035 sed_dirname2='s,\(.\)/$,\1,'
1036 sed_dirname3='s,^[^/]*$,.,'
1037 sed_dirname4='s,\(.\)/[^/]*$,\1,'
1038 sed_basename1='s,.*/,,'
1039changequote([, ])dnl
1041 for i in `for i in $gl_LIBOBJS; do echo "$i"; done | sed -e "$sed_drop_objext" | sort | uniq`; do 1040 for i in `for i in $gl_LIBOBJS; do echo "$i"; done | sed -e "$sed_drop_objext" | sort | uniq`; do
1042 gl_libobjs="$gl_libobjs $i.$ac_objext" 1041 gl_libobjs="$gl_libobjs $i.$ac_objext"
1043 gl_ltlibobjs="$gl_ltlibobjs $i.lo" 1042 gl_ltlibobjs="$gl_ltlibobjs $i.lo"
1043 i_dir=`echo "$i" | sed -e "$sed_dirname1" -e "$sed_dirname2" -e "$sed_dirname3" -e "$sed_dirname4"`
1044 i_base=`echo "$i" | sed -e "$sed_basename1"`
1045 gl_libobjdeps="$gl_libobjdeps $i_dir/\$(DEPDIR)/$i_base.Po"
1044 done 1046 done
1045 fi 1047 fi
1046 AC_SUBST([gl_LIBOBJS], [$gl_libobjs]) 1048 AC_SUBST([gl_LIBOBJS], [$gl_libobjs])
1047 AC_SUBST([gl_LTLIBOBJS], [$gl_ltlibobjs]) 1049 AC_SUBST([gl_LTLIBOBJS], [$gl_ltlibobjs])
1050 AC_SUBST([gl_LIBOBJDEPS], [$gl_libobjdeps])
1048 ]) 1051 ])
1049 gltests_libdeps= 1052 gltests_libdeps=
1050 gltests_ltlibdeps= 1053 gltests_ltlibdeps=
@@ -1087,17 +1090,30 @@ changequote([, ])dnl
1087 AC_CONFIG_COMMANDS_PRE([ 1090 AC_CONFIG_COMMANDS_PRE([
1088 gltests_libobjs= 1091 gltests_libobjs=
1089 gltests_ltlibobjs= 1092 gltests_ltlibobjs=
1093 gltests_libobjdeps=
1090 if test -n "$gltests_LIBOBJS"; then 1094 if test -n "$gltests_LIBOBJS"; then
1091 # Remove the extension. 1095 # Remove the extension.
1096changequote(,)dnl
1092 sed_drop_objext='s/\.o$//;s/\.obj$//' 1097 sed_drop_objext='s/\.o$//;s/\.obj$//'
1098 sed_dirname1='s,//*,/,g'
1099 sed_dirname2='s,\(.\)/$,\1,'
1100 sed_dirname3='s,^[^/]*$,.,'
1101 sed_dirname4='s,\(.\)/[^/]*$,\1,'
1102 sed_basename1='s,.*/,,'
1103changequote([, ])dnl
1093 for i in `for i in $gltests_LIBOBJS; do echo "$i"; done | sed -e "$sed_drop_objext" | sort | uniq`; do 1104 for i in `for i in $gltests_LIBOBJS; do echo "$i"; done | sed -e "$sed_drop_objext" | sort | uniq`; do
1094 gltests_libobjs="$gltests_libobjs $i.$ac_objext" 1105 gltests_libobjs="$gltests_libobjs $i.$ac_objext"
1095 gltests_ltlibobjs="$gltests_ltlibobjs $i.lo" 1106 gltests_ltlibobjs="$gltests_ltlibobjs $i.lo"
1107 i_dir=`echo "$i" | sed -e "$sed_dirname1" -e "$sed_dirname2" -e "$sed_dirname3" -e "$sed_dirname4"`
1108 i_base=`echo "$i" | sed -e "$sed_basename1"`
1109 gltests_libobjdeps="$gltests_libobjdeps $i_dir/\$(DEPDIR)/$i_base.Po"
1096 done 1110 done
1097 fi 1111 fi
1098 AC_SUBST([gltests_LIBOBJS], [$gltests_libobjs]) 1112 AC_SUBST([gltests_LIBOBJS], [$gltests_libobjs])
1099 AC_SUBST([gltests_LTLIBOBJS], [$gltests_ltlibobjs]) 1113 AC_SUBST([gltests_LTLIBOBJS], [$gltests_ltlibobjs])
1114 AC_SUBST([gltests_LIBOBJDEPS], [$gltests_libobjdeps])
1100 ]) 1115 ])
1116 AC_REQUIRE([gl_CC_GNULIB_WARNINGS])
1101 LIBGNU_LIBDEPS="$gl_libdeps" 1117 LIBGNU_LIBDEPS="$gl_libdeps"
1102 AC_SUBST([LIBGNU_LIBDEPS]) 1118 AC_SUBST([LIBGNU_LIBDEPS])
1103 LIBGNU_LTLIBDEPS="$gl_ltlibdeps" 1119 LIBGNU_LTLIBDEPS="$gl_ltlibdeps"
@@ -1330,6 +1346,8 @@ AC_DEFUN([gl_FILE_LIST], [
1330 lib/stddef.in.h 1346 lib/stddef.in.h
1331 lib/stdint.in.h 1347 lib/stdint.in.h
1332 lib/stdio-impl.h 1348 lib/stdio-impl.h
1349 lib/stdio-read.c
1350 lib/stdio-write.c
1333 lib/stdio.in.h 1351 lib/stdio.in.h
1334 lib/stdlib.in.h 1352 lib/stdlib.in.h
1335 lib/stpcpy.c 1353 lib/stpcpy.c
diff --git a/m4/libgmp.m4 b/m4/libgmp.m4
index a2dee933829..d69dcc7237a 100644
--- a/m4/libgmp.m4
+++ b/m4/libgmp.m4
@@ -1,4 +1,4 @@
1# libgmp.m4 serial 6 1# libgmp.m4 serial 7
2# Configure the GMP library or a replacement. 2# Configure the GMP library or a replacement.
3dnl Copyright 2020-2022 Free Software Foundation, Inc. 3dnl Copyright 2020-2022 Free Software Foundation, Inc.
4dnl This file is free software; the Free Software Foundation 4dnl This file is free software; the Free Software Foundation
@@ -63,8 +63,8 @@ AC_DEFUN([gl_LIBGMP],
63 else 63 else
64 GL_GENERATE_GMP_H=true 64 GL_GENERATE_GMP_H=true
65 fi 65 fi
66 AM_CONDITIONAL([GL_GENERATE_MINI_GMP_H], 66 gl_CONDITIONAL([GL_GENERATE_MINI_GMP_H],
67 [test $HAVE_LIBGMP != yes]) 67 [test $HAVE_LIBGMP != yes])
68 AM_CONDITIONAL([GL_GENERATE_GMP_GMP_H], 68 gl_CONDITIONAL([GL_GENERATE_GMP_GMP_H],
69 [test $HAVE_LIBGMP = yes && test "$ac_cv_header_gmp_h" != yes]) 69 [test $HAVE_LIBGMP = yes && test "$ac_cv_header_gmp_h" != yes])
70]) 70])
diff --git a/m4/mktime.m4 b/m4/mktime.m4
index d48f40d187b..431b17dcb0d 100644
--- a/m4/mktime.m4
+++ b/m4/mktime.m4
@@ -1,4 +1,4 @@
1# serial 36 1# serial 37
2dnl Copyright (C) 2002-2003, 2005-2007, 2009-2022 Free Software Foundation, 2dnl Copyright (C) 2002-2003, 2005-2007, 2009-2022 Free Software Foundation,
3dnl Inc. 3dnl Inc.
4dnl This file is free software; the Free Software Foundation 4dnl This file is free software; the Free Software Foundation
@@ -82,7 +82,8 @@ spring_forward_gap ()
82 instead of "TZ=America/Vancouver" in order to detect the bug even 82 instead of "TZ=America/Vancouver" in order to detect the bug even
83 on systems that don't support the Olson extension, or don't have the 83 on systems that don't support the Olson extension, or don't have the
84 full zoneinfo tables installed. */ 84 full zoneinfo tables installed. */
85 putenv ("TZ=PST8PDT,M4.1.0,M10.5.0"); 85 if (putenv ("TZ=PST8PDT,M4.1.0,M10.5.0") != 0)
86 return -1;
86 87
87 tm.tm_year = 98; 88 tm.tm_year = 98;
88 tm.tm_mon = 3; 89 tm.tm_mon = 3;
@@ -170,7 +171,8 @@ year_2050_test ()
170 instead of "TZ=America/Vancouver" in order to detect the bug even 171 instead of "TZ=America/Vancouver" in order to detect the bug even
171 on systems that don't support the Olson extension, or don't have the 172 on systems that don't support the Olson extension, or don't have the
172 full zoneinfo tables installed. */ 173 full zoneinfo tables installed. */
173 putenv ("TZ=PST8PDT,M4.1.0,M10.5.0"); 174 if (putenv ("TZ=PST8PDT,M4.1.0,M10.5.0") != 0)
175 return -1;
174 176
175 t = mktime (&tm); 177 t = mktime (&tm);
176 178
@@ -181,6 +183,25 @@ year_2050_test ()
181 || (0 < t && answer - 120 <= t && t <= answer + 120)); 183 || (0 < t && answer - 120 <= t && t <= answer + 120));
182} 184}
183 185
186static int
187indiana_test ()
188{
189 if (putenv ("TZ=America/Indiana/Indianapolis") != 0)
190 return -1;
191 struct tm tm;
192 tm.tm_year = 1986 - 1900; tm.tm_mon = 4 - 1; tm.tm_mday = 28;
193 tm.tm_hour = 16; tm.tm_min = 24; tm.tm_sec = 50; tm.tm_isdst = 0;
194 time_t std = mktime (&tm);
195 if (! (std == 515107490 || std == 515107503))
196 return 1;
197
198 /* This platform supports TZDB, either without or with leap seconds.
199 Return true if GNU Bug#48085 is absent. */
200 tm.tm_isdst = 1;
201 time_t dst = mktime (&tm);
202 return std - dst == 60 * 60;
203}
204
184int 205int
185main () 206main ()
186{ 207{
@@ -236,7 +257,7 @@ main ()
236 result |= 16; 257 result |= 16;
237 if (! spring_forward_gap ()) 258 if (! spring_forward_gap ())
238 result |= 32; 259 result |= 32;
239 if (! year_2050_test ()) 260 if (! year_2050_test () || ! indiana_test ())
240 result |= 64; 261 result |= 64;
241 return result; 262 return result;
242}]])], 263}]])],
diff --git a/m4/stdio_h.m4 b/m4/stdio_h.m4
index cc80e77365f..42e96071f8b 100644
--- a/m4/stdio_h.m4
+++ b/m4/stdio_h.m4
@@ -1,4 +1,4 @@
1# stdio_h.m4 serial 57 1# stdio_h.m4 serial 59
2dnl Copyright (C) 2007-2022 Free Software Foundation, Inc. 2dnl Copyright (C) 2007-2022 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 3dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 4dnl gives unlimited permission to copy and/or distribute it,
@@ -40,41 +40,32 @@ AC_DEFUN_ONCE([gl_STDIO_H],
40 attribute "__gnu_printf__" instead of "__printf__"]) 40 attribute "__gnu_printf__" instead of "__printf__"])
41 fi 41 fi
42 42
43 dnl This ifdef is necessary to avoid an error "missing file lib/stdio-read.c" 43 dnl This ifdef is an optimization, to avoid performing a configure check whose
44 dnl "expected source file, required through AC_LIBSOURCES, not found". It is 44 dnl result is not used. But it does not make the test of
45 dnl also an optimization, to avoid performing a configure check whose result 45 dnl GNULIB_STDIO_H_NONBLOCKING or GNULIB_NONBLOCKING redundant.
46 dnl is not used. But it does not make the test of GNULIB_STDIO_H_NONBLOCKING
47 dnl or GNULIB_NONBLOCKING redundant.
48 m4_ifdef([gl_NONBLOCKING_IO], [ 46 m4_ifdef([gl_NONBLOCKING_IO], [
49 gl_NONBLOCKING_IO 47 gl_NONBLOCKING_IO
50 if test $gl_cv_have_nonblocking != yes; then 48 if test $gl_cv_have_nonblocking != yes; then
51 REPLACE_STDIO_READ_FUNCS=1 49 REPLACE_STDIO_READ_FUNCS=1
52 AC_LIBOBJ([stdio-read])
53 fi 50 fi
54 ]) 51 ])
55 52
56 dnl This ifdef is necessary to avoid an error "missing file lib/stdio-write.c" 53 dnl This ifdef is an optimization, to avoid performing a configure check whose
57 dnl "expected source file, required through AC_LIBSOURCES, not found". It is 54 dnl result is not used. But it does not make the test of
58 dnl also an optimization, to avoid performing a configure check whose result 55 dnl GNULIB_STDIO_H_SIGPIPE or GNULIB_SIGPIPE redundant.
59 dnl is not used. But it does not make the test of GNULIB_STDIO_H_SIGPIPE or
60 dnl GNULIB_SIGPIPE redundant.
61 m4_ifdef([gl_SIGNAL_SIGPIPE], [ 56 m4_ifdef([gl_SIGNAL_SIGPIPE], [
62 gl_SIGNAL_SIGPIPE 57 gl_SIGNAL_SIGPIPE
63 if test $gl_cv_header_signal_h_SIGPIPE != yes; then 58 if test $gl_cv_header_signal_h_SIGPIPE != yes; then
64 REPLACE_STDIO_WRITE_FUNCS=1 59 REPLACE_STDIO_WRITE_FUNCS=1
65 AC_LIBOBJ([stdio-write])
66 fi 60 fi
67 ]) 61 ])
68 dnl This ifdef is necessary to avoid an error "missing file lib/stdio-write.c" 62 dnl This ifdef is an optimization, to avoid performing a configure check whose
69 dnl "expected source file, required through AC_LIBSOURCES, not found". It is 63 dnl result is not used. But it does not make the test of
70 dnl also an optimization, to avoid performing a configure check whose result 64 dnl GNULIB_STDIO_H_NONBLOCKING or GNULIB_NONBLOCKING redundant.
71 dnl is not used. But it does not make the test of GNULIB_STDIO_H_NONBLOCKING
72 dnl or GNULIB_NONBLOCKING redundant.
73 m4_ifdef([gl_NONBLOCKING_IO], [ 65 m4_ifdef([gl_NONBLOCKING_IO], [
74 gl_NONBLOCKING_IO 66 gl_NONBLOCKING_IO
75 if test $gl_cv_have_nonblocking != yes; then 67 if test $gl_cv_have_nonblocking != yes; then
76 REPLACE_STDIO_WRITE_FUNCS=1 68 REPLACE_STDIO_WRITE_FUNCS=1
77 AC_LIBOBJ([stdio-write])
78 fi 69 fi
79 ]) 70 ])
80 71
diff --git a/m4/unistd_h.m4 b/m4/unistd_h.m4
index f93f97a1bda..4c66ccc0a40 100644
--- a/m4/unistd_h.m4
+++ b/m4/unistd_h.m4
@@ -222,6 +222,7 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS],
222 REPLACE_ACCESS=0; AC_SUBST([REPLACE_ACCESS]) 222 REPLACE_ACCESS=0; AC_SUBST([REPLACE_ACCESS])
223 REPLACE_CHOWN=0; AC_SUBST([REPLACE_CHOWN]) 223 REPLACE_CHOWN=0; AC_SUBST([REPLACE_CHOWN])
224 REPLACE_CLOSE=0; AC_SUBST([REPLACE_CLOSE]) 224 REPLACE_CLOSE=0; AC_SUBST([REPLACE_CLOSE])
225 REPLACE_COPY_FILE_RANGE=0; AC_SUBST([REPLACE_COPY_FILE_RANGE])
225 REPLACE_DUP=0; AC_SUBST([REPLACE_DUP]) 226 REPLACE_DUP=0; AC_SUBST([REPLACE_DUP])
226 REPLACE_DUP2=0; AC_SUBST([REPLACE_DUP2]) 227 REPLACE_DUP2=0; AC_SUBST([REPLACE_DUP2])
227 REPLACE_EXECL=0; AC_SUBST([REPLACE_EXECL]) 228 REPLACE_EXECL=0; AC_SUBST([REPLACE_EXECL])