summaryrefslogtreecommitdiffstats
path: root/gl/m4
diff options
context:
space:
mode:
Diffstat (limited to 'gl/m4')
-rw-r--r--gl/m4/af_alg.m457
-rw-r--r--gl/m4/byteswap.m417
-rw-r--r--gl/m4/fflush.m4100
-rw-r--r--gl/m4/fpurge.m473
-rw-r--r--gl/m4/freading.m411
-rw-r--r--gl/m4/fseek.m415
-rw-r--r--gl/m4/fseeko.m477
-rw-r--r--gl/m4/ftell.m415
-rw-r--r--gl/m4/ftello.m4151
-rw-r--r--gl/m4/gl-openssl.m476
-rw-r--r--gl/m4/gnulib-cache.m42
-rw-r--r--gl/m4/gnulib-comp.m487
-rw-r--r--gl/m4/lseek.m478
-rw-r--r--gl/m4/sha256.m414
-rw-r--r--gl/m4/ungetc.m473
15 files changed, 0 insertions, 846 deletions
diff --git a/gl/m4/af_alg.m4 b/gl/m4/af_alg.m4
deleted file mode 100644
index 9c7edf0..0000000
--- a/gl/m4/af_alg.m4
+++ /dev/null
@@ -1,57 +0,0 @@
1# af_alg.m4 serial 6
2dnl Copyright 2018-2022 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved.
6
7dnl From Matteo Croce.
8
9AC_DEFUN_ONCE([gl_AF_ALG],
10[
11 AC_REQUIRE([gl_SYS_SOCKET_H])
12 AC_REQUIRE([AC_C_INLINE])
13
14 dnl Check whether linux/if_alg.h has needed features.
15 AC_CACHE_CHECK([whether linux/if_alg.h has struct sockaddr_alg.],
16 [gl_cv_header_linux_if_alg_salg],
17 [AC_COMPILE_IFELSE(
18 [AC_LANG_PROGRAM([[#include <sys/socket.h>
19 #include <linux/if_alg.h>
20 struct sockaddr_alg salg = {
21 .salg_family = AF_ALG,
22 .salg_type = "hash",
23 .salg_name = "sha1",
24 };]])],
25 [gl_cv_header_linux_if_alg_salg=yes],
26 [gl_cv_header_linux_if_alg_salg=no])])
27 if test "$gl_cv_header_linux_if_alg_salg" = yes; then
28 AC_DEFINE([HAVE_LINUX_IF_ALG_H], [1],
29 [Define to 1 if you have 'struct sockaddr_alg' defined.])
30 fi
31
32 dnl The default is to not use AF_ALG if available,
33 dnl as it's system dependent as to whether the kernel
34 dnl routines are faster than libcrypto for example.
35 use_af_alg=no
36 AC_ARG_WITH([linux-crypto],
37 [AS_HELP_STRING([[--with-linux-crypto]],
38 [use Linux kernel cryptographic API (if available) for the hash functions
39 MD5, SHA-1, SHA-224, SHA-256, SHA-384, SHA-512 on files])],
40 [use_af_alg=$withval],
41 [use_af_alg=no])
42 dnl We cannot use it if it is not available.
43 if test "$gl_cv_header_linux_if_alg_salg" != yes; then
44 if test "$use_af_alg" != no; then
45 AC_MSG_WARN([Linux kernel cryptographic API not found])
46 fi
47 use_af_alg=no
48 fi
49
50 if test "$use_af_alg" != no; then
51 USE_AF_ALG=1
52 else
53 USE_AF_ALG=0
54 fi
55 AC_DEFINE_UNQUOTED([USE_LINUX_CRYPTO_API], [$USE_AF_ALG],
56 [Define to 1 if you want to use the Linux kernel cryptographic API.])
57])
diff --git a/gl/m4/byteswap.m4 b/gl/m4/byteswap.m4
deleted file mode 100644
index 99aeb68..0000000
--- a/gl/m4/byteswap.m4
+++ /dev/null
@@ -1,17 +0,0 @@
1# byteswap.m4 serial 5
2dnl Copyright (C) 2005, 2007, 2009-2022 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved.
6
7dnl Written by Oskar Liljeblad.
8
9AC_DEFUN([gl_BYTESWAP],
10[
11 dnl Prerequisites of lib/byteswap.in.h.
12 AC_CHECK_HEADERS([byteswap.h], [
13 GL_GENERATE_BYTESWAP_H=false
14 ], [
15 GL_GENERATE_BYTESWAP_H=true
16 ])
17])
diff --git a/gl/m4/fflush.m4 b/gl/m4/fflush.m4
deleted file mode 100644
index e36f90e..0000000
--- a/gl/m4/fflush.m4
+++ /dev/null
@@ -1,100 +0,0 @@
1# fflush.m4 serial 18
2
3# Copyright (C) 2007-2022 Free Software Foundation, Inc.
4# This file is free software; the Free Software Foundation
5# gives unlimited permission to copy and/or distribute it,
6# with or without modifications, as long as this notice is preserved.
7
8dnl From Eric Blake
9
10dnl Find out how to obey POSIX semantics of fflush(stdin) discarding
11dnl unread input on seekable streams, rather than C99 undefined semantics.
12
13AC_DEFUN([gl_FUNC_FFLUSH],
14[
15 AC_REQUIRE([gl_STDIO_H_DEFAULTS])
16 gl_FUNC_FFLUSH_STDIN
17 case "$gl_cv_func_fflush_stdin" in
18 *yes) ;;
19 *) REPLACE_FFLUSH=1 ;;
20 esac
21])
22
23dnl Determine whether fflush works on input streams.
24dnl Sets gl_cv_func_fflush_stdin.
25
26AC_DEFUN([gl_FUNC_FFLUSH_STDIN],
27[
28 AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
29 AC_CHECK_HEADERS_ONCE([unistd.h])
30 AC_CACHE_CHECK([whether fflush works on input streams],
31 [gl_cv_func_fflush_stdin],
32 [echo hello world > conftest.txt
33 AC_RUN_IFELSE([AC_LANG_PROGRAM(
34 [[
35#include <stdio.h>
36#if HAVE_UNISTD_H
37# include <unistd.h>
38#else /* on Windows with MSVC */
39# include <io.h>
40#endif
41 ]GL_MDA_DEFINES],
42 [[FILE *f = fopen ("conftest.txt", "r");
43 char buffer[10];
44 int fd;
45 int c;
46 if (f == NULL)
47 return 1;
48 fd = fileno (f);
49 if (fd < 0 || fread (buffer, 1, 5, f) != 5)
50 { fclose (f); return 2; }
51 /* For deterministic results, ensure f read a bigger buffer. */
52 if (lseek (fd, 0, SEEK_CUR) == 5)
53 { fclose (f); return 3; }
54 /* POSIX requires fflush-fseek to set file offset of fd. This fails
55 on BSD systems and on mingw. */
56 if (fflush (f) != 0 || fseek (f, 0, SEEK_CUR) != 0)
57 { fclose (f); return 4; }
58 if (lseek (fd, 0, SEEK_CUR) != 5)
59 { fclose (f); return 5; }
60 /* Verify behaviour of fflush after ungetc. See
61 <https://www.opengroup.org/austin/aardvark/latest/xshbug3.txt> */
62 /* Verify behaviour of fflush after a backup ungetc. This fails on
63 mingw. */
64 c = fgetc (f);
65 ungetc (c, f);
66 fflush (f);
67 if (fgetc (f) != c)
68 { fclose (f); return 6; }
69 /* Verify behaviour of fflush after a non-backup ungetc. This fails
70 on glibc 2.8 and on BSD systems. */
71 c = fgetc (f);
72 ungetc ('@', f);
73 fflush (f);
74 if (fgetc (f) != c)
75 { fclose (f); return 7; }
76 fclose (f);
77 return 0;
78 ]])],
79 [gl_cv_func_fflush_stdin=yes],
80 [gl_cv_func_fflush_stdin=no],
81 [case "$host_os" in
82 # Guess no on native Windows.
83 mingw*) gl_cv_func_fflush_stdin="guessing no" ;;
84 *) gl_cv_func_fflush_stdin=cross ;;
85 esac
86 ])
87 rm conftest.txt
88 ])
89 case "$gl_cv_func_fflush_stdin" in
90 *yes) gl_func_fflush_stdin=1 ;;
91 *no) gl_func_fflush_stdin=0 ;;
92 *) gl_func_fflush_stdin='(-1)' ;;
93 esac
94 AC_DEFINE_UNQUOTED([FUNC_FFLUSH_STDIN], [$gl_func_fflush_stdin],
95 [Define to 1 if fflush is known to work on stdin as per POSIX.1-2008,
96 0 if fflush is known to not work, -1 if unknown.])
97])
98
99# Prerequisites of lib/fflush.c.
100AC_DEFUN([gl_PREREQ_FFLUSH], [:])
diff --git a/gl/m4/fpurge.m4 b/gl/m4/fpurge.m4
deleted file mode 100644
index 1a15454..0000000
--- a/gl/m4/fpurge.m4
+++ /dev/null
@@ -1,73 +0,0 @@
1# fpurge.m4 serial 12
2dnl Copyright (C) 2007, 2009-2022 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved.
6
7AC_DEFUN([gl_FUNC_FPURGE],
8[
9 AC_REQUIRE([gl_STDIO_H_DEFAULTS])
10 AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
11 AC_CHECK_HEADERS_ONCE([stdio_ext.h])
12 AC_CHECK_FUNCS_ONCE([fpurge])
13 AC_CHECK_FUNCS_ONCE([__fpurge])
14 AC_CHECK_DECLS([fpurge], , , [[#include <stdio.h>]])
15 if test "x$ac_cv_func_fpurge" = xyes; then
16 HAVE_FPURGE=1
17 # Detect BSD bug. Only cygwin 1.7 and musl are known to be immune.
18 AC_CACHE_CHECK([whether fpurge works], [gl_cv_func_fpurge_works],
19 [AC_RUN_IFELSE(
20 [AC_LANG_PROGRAM(
21 [[#include <stdio.h>
22]],
23 [[FILE *f = fopen ("conftest.txt", "w+");
24 if (!f)
25 return 1;
26 if (fputc ('a', f) != 'a')
27 { fclose (f); return 2; }
28 rewind (f);
29 if (fgetc (f) != 'a')
30 { fclose (f); return 3; }
31 if (fgetc (f) != EOF)
32 { fclose (f); return 4; }
33 if (fpurge (f) != 0)
34 { fclose (f); return 5; }
35 if (putc ('b', f) != 'b')
36 { fclose (f); return 6; }
37 if (fclose (f) != 0)
38 return 7;
39 if ((f = fopen ("conftest.txt", "r")) == NULL)
40 return 8;
41 if (fgetc (f) != 'a')
42 { fclose (f); return 9; }
43 if (fgetc (f) != 'b')
44 { fclose (f); return 10; }
45 if (fgetc (f) != EOF)
46 { fclose (f); return 11; }
47 if (fclose (f) != 0)
48 return 12;
49 if (remove ("conftest.txt") != 0)
50 return 13;
51 return 0;
52 ]])],
53 [gl_cv_func_fpurge_works=yes],
54 [gl_cv_func_fpurge_works=no],
55 [case "$host_os" in
56 # Guess yes on musl systems.
57 *-musl*) gl_cv_func_fpurge_works="guessing yes" ;;
58 # Otherwise obey --enable-cross-guesses.
59 *) gl_cv_func_fpurge_works="$gl_cross_guess_normal" ;;
60 esac
61 ])
62 ])
63 case "$gl_cv_func_fpurge_works" in
64 *yes) ;;
65 *) REPLACE_FPURGE=1 ;;
66 esac
67 else
68 HAVE_FPURGE=0
69 fi
70 if test "x$ac_cv_have_decl_fpurge" = xno; then
71 HAVE_DECL_FPURGE=0
72 fi
73])
diff --git a/gl/m4/freading.m4 b/gl/m4/freading.m4
deleted file mode 100644
index 81b17a6..0000000
--- a/gl/m4/freading.m4
+++ /dev/null
@@ -1,11 +0,0 @@
1# freading.m4 serial 2
2dnl Copyright (C) 2007, 2009-2022 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved.
6
7AC_DEFUN([gl_FUNC_FREADING],
8[
9 AC_CHECK_HEADERS_ONCE([stdio_ext.h])
10 AC_CHECK_FUNCS_ONCE([__freading])
11])
diff --git a/gl/m4/fseek.m4 b/gl/m4/fseek.m4
deleted file mode 100644
index bd4a55b..0000000
--- a/gl/m4/fseek.m4
+++ /dev/null
@@ -1,15 +0,0 @@
1# fseek.m4 serial 4
2dnl Copyright (C) 2007, 2009-2022 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved.
6
7AC_DEFUN([gl_FUNC_FSEEK],
8[
9 AC_REQUIRE([gl_STDIO_H_DEFAULTS])
10 AC_REQUIRE([gl_FUNC_FSEEKO])
11 dnl When fseeko needs fixes, fseek needs them too.
12 if test $HAVE_FSEEKO = 0 || test $REPLACE_FSEEKO = 1; then
13 REPLACE_FSEEK=1
14 fi
15])
diff --git a/gl/m4/fseeko.m4 b/gl/m4/fseeko.m4
deleted file mode 100644
index e50fe39..0000000
--- a/gl/m4/fseeko.m4
+++ /dev/null
@@ -1,77 +0,0 @@
1# fseeko.m4 serial 20
2dnl Copyright (C) 2007-2022 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved.
6
7AC_DEFUN([gl_FUNC_FSEEKO],
8[
9 AC_REQUIRE([gl_STDIO_H_DEFAULTS])
10 AC_REQUIRE([gl_STDIN_LARGE_OFFSET])
11 AC_REQUIRE([gl_SYS_TYPES_H])
12 AC_REQUIRE([AC_PROG_CC])
13
14 dnl Persuade glibc <stdio.h> to declare fseeko().
15 AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
16
17 AC_CACHE_CHECK([for fseeko], [gl_cv_func_fseeko],
18 [
19 AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <stdio.h>
20]], [[fseeko (stdin, 0, 0);]])],
21 [gl_cv_func_fseeko=yes], [gl_cv_func_fseeko=no])
22 ])
23
24 AC_CHECK_DECLS_ONCE([fseeko])
25 if test $ac_cv_have_decl_fseeko = no; then
26 HAVE_DECL_FSEEKO=0
27 fi
28
29 if test $gl_cv_func_fseeko = no; then
30 HAVE_FSEEKO=0
31 else
32 if test $WINDOWS_64_BIT_OFF_T = 1; then
33 REPLACE_FSEEKO=1
34 fi
35 if test $gl_cv_var_stdin_large_offset = no; then
36 REPLACE_FSEEKO=1
37 fi
38 m4_ifdef([gl_FUNC_FFLUSH_STDIN], [
39 gl_FUNC_FFLUSH_STDIN
40 case "$gl_cv_func_fflush_stdin" in
41 *yes) ;;
42 *) REPLACE_FSEEKO=1 ;;
43 esac
44 ])
45 fi
46])
47
48dnl Code shared by fseeko and ftello. Determine if large files are supported,
49dnl but stdin does not start as a large file by default.
50AC_DEFUN([gl_STDIN_LARGE_OFFSET],
51 [
52 AC_CACHE_CHECK([whether stdin defaults to large file offsets],
53 [gl_cv_var_stdin_large_offset],
54 [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <stdio.h>]],
55[[#if defined __SL64 && defined __SCLE /* cygwin */
56 /* Cygwin 1.5.24 and earlier fail to put stdin in 64-bit mode, making
57 fseeko/ftello needlessly fail. This bug was fixed in 1.5.25, and
58 it is easier to do a version check than building a runtime test. */
59# include <cygwin/version.h>
60# if CYGWIN_VERSION_DLL_COMBINED < CYGWIN_VERSION_DLL_MAKE_COMBINED (1005, 25)
61 choke me
62# endif
63#endif]])],
64 [gl_cv_var_stdin_large_offset=yes],
65 [gl_cv_var_stdin_large_offset=no])])
66])
67
68# Prerequisites of lib/fseeko.c.
69AC_DEFUN([gl_PREREQ_FSEEKO],
70[
71 dnl Native Windows has the function _fseeki64. mingw hides it in some
72 dnl circumstances, but mingw64 makes it usable again.
73 AC_CHECK_FUNCS([_fseeki64])
74 if test $ac_cv_func__fseeki64 = yes; then
75 AC_CHECK_DECLS([_fseeki64])
76 fi
77])
diff --git a/gl/m4/ftell.m4 b/gl/m4/ftell.m4
deleted file mode 100644
index 89f2d1b..0000000
--- a/gl/m4/ftell.m4
+++ /dev/null
@@ -1,15 +0,0 @@
1# ftell.m4 serial 3
2dnl Copyright (C) 2007, 2009-2022 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved.
6
7AC_DEFUN([gl_FUNC_FTELL],
8[
9 AC_REQUIRE([gl_STDIO_H_DEFAULTS])
10 AC_REQUIRE([gl_FUNC_FTELLO])
11 dnl When ftello needs fixes, ftell needs them too.
12 if test $HAVE_FTELLO = 0 || test $REPLACE_FTELLO = 1; then
13 REPLACE_FTELL=1
14 fi
15])
diff --git a/gl/m4/ftello.m4 b/gl/m4/ftello.m4
deleted file mode 100644
index 919f39d..0000000
--- a/gl/m4/ftello.m4
+++ /dev/null
@@ -1,151 +0,0 @@
1# ftello.m4 serial 14
2dnl Copyright (C) 2007-2022 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved.
6
7AC_DEFUN([gl_FUNC_FTELLO],
8[
9 AC_REQUIRE([gl_STDIO_H_DEFAULTS])
10 AC_REQUIRE([AC_PROG_CC])
11 AC_REQUIRE([gl_STDIN_LARGE_OFFSET])
12 AC_REQUIRE([gl_SYS_TYPES_H])
13
14 dnl Persuade glibc <stdio.h> to declare ftello().
15 AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
16
17 AC_CHECK_DECLS_ONCE([ftello])
18 if test $ac_cv_have_decl_ftello = no; then
19 HAVE_DECL_FTELLO=0
20 fi
21
22 AC_CACHE_CHECK([for ftello], [gl_cv_func_ftello],
23 [
24 AC_LINK_IFELSE(
25 [AC_LANG_PROGRAM(
26 [[#include <stdio.h>]],
27 [[ftello (stdin);]])],
28 [gl_cv_func_ftello=yes],
29 [gl_cv_func_ftello=no])
30 ])
31 if test $gl_cv_func_ftello = no; then
32 HAVE_FTELLO=0
33 else
34 if test $WINDOWS_64_BIT_OFF_T = 1; then
35 REPLACE_FTELLO=1
36 fi
37 if test $gl_cv_var_stdin_large_offset = no; then
38 REPLACE_FTELLO=1
39 fi
40 if test $REPLACE_FTELLO = 0; then
41 dnl Detect bug on Solaris.
42 dnl ftell and ftello produce incorrect results after putc that followed a
43 dnl getc call that reached EOF on Solaris. This is because the _IOREAD
44 dnl flag does not get cleared in this case, even though _IOWRT gets set,
45 dnl and ftell and ftello look whether the _IOREAD flag is set.
46 AC_REQUIRE([AC_CANONICAL_HOST])
47 AC_CACHE_CHECK([whether ftello works],
48 [gl_cv_func_ftello_works],
49 [
50 dnl Initial guess, used when cross-compiling or when /dev/tty cannot
51 dnl be opened.
52changequote(,)dnl
53 case "$host_os" in
54 # Guess no on Solaris.
55 solaris*) gl_cv_func_ftello_works="guessing no" ;;
56 # Guess yes on native Windows.
57 mingw*) gl_cv_func_ftello_works="guessing yes" ;;
58 # Guess yes otherwise.
59 *) gl_cv_func_ftello_works="guessing yes" ;;
60 esac
61changequote([,])dnl
62 AC_RUN_IFELSE(
63 [AC_LANG_SOURCE([[
64#include <stdio.h>
65#include <stdlib.h>
66#include <string.h>
67#define TESTFILE "conftest.tmp"
68int
69main (void)
70{
71 FILE *fp;
72
73 /* Create a file with some contents. */
74 fp = fopen (TESTFILE, "w");
75 if (fp == NULL)
76 return 70;
77 if (fwrite ("foogarsh", 1, 8, fp) < 8)
78 { fclose (fp); return 71; }
79 if (fclose (fp))
80 return 72;
81
82 /* The file's contents is now "foogarsh". */
83
84 /* Try writing after reading to EOF. */
85 fp = fopen (TESTFILE, "r+");
86 if (fp == NULL)
87 return 73;
88 if (fseek (fp, -1, SEEK_END))
89 { fclose (fp); return 74; }
90 if (!(getc (fp) == 'h'))
91 { fclose (fp); return 1; }
92 if (!(getc (fp) == EOF))
93 { fclose (fp); return 2; }
94 if (!(ftell (fp) == 8))
95 { fclose (fp); return 3; }
96 if (!(ftell (fp) == 8))
97 { fclose (fp); return 4; }
98 if (!(putc ('!', fp) == '!'))
99 { fclose (fp); return 5; }
100 if (!(ftell (fp) == 9))
101 { fclose (fp); return 6; }
102 if (!(fclose (fp) == 0))
103 return 7;
104 fp = fopen (TESTFILE, "r");
105 if (fp == NULL)
106 return 75;
107 {
108 char buf[10];
109 if (!(fread (buf, 1, 10, fp) == 9))
110 { fclose (fp); return 10; }
111 if (!(memcmp (buf, "foogarsh!", 9) == 0))
112 { fclose (fp); return 11; }
113 }
114 if (!(fclose (fp) == 0))
115 return 12;
116
117 /* The file's contents is now "foogarsh!". */
118
119 return 0;
120}]])],
121 [gl_cv_func_ftello_works=yes],
122 [gl_cv_func_ftello_works=no], [:])
123 ])
124 case "$gl_cv_func_ftello_works" in
125 *yes) ;;
126 *)
127 REPLACE_FTELLO=1
128 AC_DEFINE([FTELLO_BROKEN_AFTER_SWITCHING_FROM_READ_TO_WRITE], [1],
129 [Define to 1 if the system's ftello function has the Solaris bug.])
130 ;;
131 esac
132 fi
133 if test $REPLACE_FTELLO = 0; then
134 dnl Detect bug on macOS >= 10.15.
135 gl_FUNC_UNGETC_WORKS
136 if test $gl_ftello_broken_after_ungetc = yes; then
137 REPLACE_FTELLO=1
138 AC_DEFINE([FTELLO_BROKEN_AFTER_UNGETC], [1],
139 [Define to 1 if the system's ftello function has the macOS bug.])
140 fi
141 fi
142 fi
143])
144
145# Prerequisites of lib/ftello.c.
146AC_DEFUN([gl_PREREQ_FTELLO],
147[
148 dnl Native Windows has the function _ftelli64. mingw hides it, but mingw64
149 dnl makes it usable again.
150 AC_CHECK_FUNCS([_ftelli64])
151])
diff --git a/gl/m4/gl-openssl.m4 b/gl/m4/gl-openssl.m4
deleted file mode 100644
index d076f84..0000000
--- a/gl/m4/gl-openssl.m4
+++ /dev/null
@@ -1,76 +0,0 @@
1# gl-openssl.m4 serial 6
2dnl Copyright (C) 2013-2022 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved.
6
7AC_DEFUN([gl_SET_CRYPTO_CHECK_DEFAULT],
8[
9 m4_define([gl_CRYPTO_CHECK_DEFAULT], [$1])
10])
11gl_SET_CRYPTO_CHECK_DEFAULT([no])
12
13AC_DEFUN([gl_CRYPTO_CHECK],
14[
15 dnl gnulib users set this before gl_INIT with gl_SET_CRYPTO_CHECK_DEFAULT()
16 m4_divert_once([DEFAULTS], [with_openssl_default='gl_CRYPTO_CHECK_DEFAULT'])
17
18 dnl Only clear once, so crypto routines can be checked for individually
19 m4_divert_once([DEFAULTS], [LIB_CRYPTO=])
20
21 AC_ARG_WITH([openssl],
22 [[ --with-openssl[=ARG] use libcrypto hash routines for the hash functions
23 MD5, SHA-1, SHA-224, SHA-256, SHA-384, SHA-512.
24 Valid ARGs are:
25 'yes',
26 'no',
27 'auto' => use if any version available,
28 'auto-gpl-compat' => use if GPL compatible version
29 available,
30 'optional' => use if available
31 and warn if not available;
32 Default is ']gl_CRYPTO_CHECK_DEFAULT['.]m4_ifdef([gl_AF_ALG], [
33 Note also --with-linux-crypto, which will enable the
34 use of Linux kernel crypto routines (if available),
35 which has precedence for files.])],
36 [],
37 [with_openssl=$with_openssl_default])
38
39 AC_SUBST([LIB_CRYPTO])
40 if test "x$with_openssl" != xno; then
41 if test "x$with_openssl" = xauto-gpl-compat; then
42 AC_CACHE_CHECK([whether openssl is GPL compatible],
43 [gl_cv_openssl_gpl_compat],
44 [AC_COMPILE_IFELSE(
45 [AC_LANG_PROGRAM([[
46 #include <openssl/opensslv.h>
47 #if OPENSSL_VERSION_MAJOR < 3
48 #error "openssl >= version 3 not found"
49 #endif
50 ]])],
51 [gl_cv_openssl_gpl_compat=yes],
52 [gl_cv_openssl_gpl_compat=no])])
53 fi
54 if test "x$with_openssl" != xauto-gpl-compat ||
55 test "x$gl_cv_openssl_gpl_compat" = xyes; then
56 AC_CHECK_LIB([crypto], [$1],
57 [AC_CHECK_HEADERS(
58 m4_if([$1], [MD5], [openssl/md5.h], [openssl/sha.h]),
59 [LIB_CRYPTO=-lcrypto
60 AC_DEFINE([HAVE_OPENSSL_$1], [1],
61 [Define to 1 if libcrypto is used for $1.])])])
62 fi
63 if test "x$LIB_CRYPTO" = x; then
64 message='openssl development library not found for $1.
65 If you want to install it, first find the pre-built package name:
66 - On Debian and Debian-based systems: libssl-dev,
67 - On Red Hat distributions: openssl-devel.
68 - Other: https://repology.org/project/openssl/versions'
69 if test "x$with_openssl" = xyes; then
70 AC_MSG_ERROR([$message])
71 elif test "x$with_openssl" = xoptional; then
72 AC_MSG_WARN([$message])
73 fi
74 fi
75 fi
76])
diff --git a/gl/m4/gnulib-cache.m4 b/gl/m4/gnulib-cache.m4
index 06fed91..7551d09 100644
--- a/gl/m4/gnulib-cache.m4
+++ b/gl/m4/gnulib-cache.m4
@@ -39,7 +39,6 @@
39# --macro-prefix=gl \ 39# --macro-prefix=gl \
40# --no-vc-files \ 40# --no-vc-files \
41# base64 \ 41# base64 \
42# crypto/sha256 \
43# dirname \ 42# dirname \
44# environ \ 43# environ \
45# floorf \ 44# floorf \
@@ -65,7 +64,6 @@
65gl_LOCAL_DIR([]) 64gl_LOCAL_DIR([])
66gl_MODULES([ 65gl_MODULES([
67 base64 66 base64
68 crypto/sha256
69 dirname 67 dirname
70 environ 68 environ
71 floorf 69 floorf
diff --git a/gl/m4/gnulib-comp.m4 b/gl/m4/gnulib-comp.m4
index 93b7884..563b9ae 100644
--- a/gl/m4/gnulib-comp.m4
+++ b/gl/m4/gnulib-comp.m4
@@ -50,15 +50,11 @@ AC_DEFUN([gl_EARLY],
50 # Code from module basename-lgpl: 50 # Code from module basename-lgpl:
51 # Code from module btowc: 51 # Code from module btowc:
52 # Code from module builtin-expect: 52 # Code from module builtin-expect:
53 # Code from module byteswap:
54 # Code from module c99: 53 # Code from module c99:
55 # Code from module calloc-gnu: 54 # Code from module calloc-gnu:
56 # Code from module calloc-posix: 55 # Code from module calloc-posix:
57 # Code from module cloexec: 56 # Code from module cloexec:
58 # Code from module close: 57 # Code from module close:
59 # Code from module crypto/af_alg:
60 # Code from module crypto/sha256:
61 # Code from module crypto/sha256-buffer:
62 # Code from module dirname: 58 # Code from module dirname:
63 # Code from module dirname-lgpl: 59 # Code from module dirname-lgpl:
64 # Code from module double-slash-root: 60 # Code from module double-slash-root:
@@ -73,24 +69,14 @@ AC_DEFUN([gl_EARLY],
73 # Code from module fcntl: 69 # Code from module fcntl:
74 # Code from module fcntl-h: 70 # Code from module fcntl-h:
75 # Code from module fd-hook: 71 # Code from module fd-hook:
76 # Code from module fflush:
77 AC_REQUIRE([gl_SET_LARGEFILE_SOURCE])
78 # Code from module filename: 72 # Code from module filename:
79 # Code from module float: 73 # Code from module float:
80 # Code from module floorf: 74 # Code from module floorf:
81 # Code from module fopen: 75 # Code from module fopen:
82 # Code from module fopen-gnu: 76 # Code from module fopen-gnu:
83 # Code from module fpurge:
84 # Code from module freading:
85 # Code from module free-posix: 77 # Code from module free-posix:
86 # Code from module fseek:
87 # Code from module fseeko:
88 AC_REQUIRE([gl_SET_LARGEFILE_SOURCE])
89 # Code from module fstat: 78 # Code from module fstat:
90 # Code from module fsusage: 79 # Code from module fsusage:
91 # Code from module ftell:
92 # Code from module ftello:
93 AC_REQUIRE([gl_SET_LARGEFILE_SOURCE])
94 # Code from module gen-header: 80 # Code from module gen-header:
95 # Code from module getaddrinfo: 81 # Code from module getaddrinfo:
96 # Code from module getdelim: 82 # Code from module getdelim:
@@ -123,7 +109,6 @@ AC_DEFUN([gl_EARLY],
123 # Code from module locale: 109 # Code from module locale:
124 # Code from module localeconv: 110 # Code from module localeconv:
125 # Code from module lock: 111 # Code from module lock:
126 # Code from module lseek:
127 # Code from module malloc-gnu: 112 # Code from module malloc-gnu:
128 # Code from module malloc-posix: 113 # Code from module malloc-posix:
129 # Code from module malloca: 114 # Code from module malloca:
@@ -246,9 +231,6 @@ AC_DEFUN([gl_INIT],
246 ]) 231 ])
247 gl_WCHAR_MODULE_INDICATOR([btowc]) 232 gl_WCHAR_MODULE_INDICATOR([btowc])
248 gl___BUILTIN_EXPECT 233 gl___BUILTIN_EXPECT
249 gl_BYTESWAP
250 gl_CONDITIONAL_HEADER([byteswap.h])
251 AC_PROG_MKDIR_P
252 gl_FUNC_CALLOC_GNU 234 gl_FUNC_CALLOC_GNU
253 if test $REPLACE_CALLOC_FOR_CALLOC_GNU = 1; then 235 if test $REPLACE_CALLOC_FOR_CALLOC_GNU = 1; then
254 AC_LIBOBJ([calloc]) 236 AC_LIBOBJ([calloc])
@@ -263,9 +245,6 @@ AC_DEFUN([gl_INIT],
263 gl_FUNC_CLOSE 245 gl_FUNC_CLOSE
264 gl_CONDITIONAL([GL_COND_OBJ_CLOSE], [test $REPLACE_CLOSE = 1]) 246 gl_CONDITIONAL([GL_COND_OBJ_CLOSE], [test $REPLACE_CLOSE = 1])
265 gl_UNISTD_MODULE_INDICATOR([close]) 247 gl_UNISTD_MODULE_INDICATOR([close])
266 gl_AF_ALG
267 AC_REQUIRE([AC_C_RESTRICT])
268 gl_SHA256
269 gl_MODULE_INDICATOR([dirname]) 248 gl_MODULE_INDICATOR([dirname])
270 gl_DOUBLE_SLASH_ROOT 249 gl_DOUBLE_SLASH_ROOT
271 gl_FUNC_DUP2 250 gl_FUNC_DUP2
@@ -296,13 +275,6 @@ AC_DEFUN([gl_INIT],
296 gl_FCNTL_H 275 gl_FCNTL_H
297 gl_FCNTL_H_REQUIRE_DEFAULTS 276 gl_FCNTL_H_REQUIRE_DEFAULTS
298 AC_PROG_MKDIR_P 277 AC_PROG_MKDIR_P
299 gl_FUNC_FFLUSH
300 gl_CONDITIONAL([GL_COND_OBJ_FFLUSH], [test $REPLACE_FFLUSH = 1])
301 AM_COND_IF([GL_COND_OBJ_FFLUSH], [
302 gl_PREREQ_FFLUSH
303 ])
304 gl_MODULE_INDICATOR([fflush])
305 gl_STDIO_MODULE_INDICATOR([fflush])
306 gl_FLOAT_H 278 gl_FLOAT_H
307 gl_CONDITIONAL_HEADER([float.h]) 279 gl_CONDITIONAL_HEADER([float.h])
308 AC_PROG_MKDIR_P 280 AC_PROG_MKDIR_P
@@ -325,27 +297,12 @@ AC_DEFUN([gl_INIT],
325 fi 297 fi
326 gl_MODULE_INDICATOR([fopen-gnu]) 298 gl_MODULE_INDICATOR([fopen-gnu])
327 gl_STDIO_MODULE_INDICATOR([fopen-gnu]) 299 gl_STDIO_MODULE_INDICATOR([fopen-gnu])
328 gl_FUNC_FPURGE
329 gl_CONDITIONAL([GL_COND_OBJ_FPURGE],
330 [test $HAVE_FPURGE = 0 || test $REPLACE_FPURGE = 1])
331 gl_STDIO_MODULE_INDICATOR([fpurge])
332 gl_FUNC_FREADING
333 gl_FUNC_FREE 300 gl_FUNC_FREE
334 gl_CONDITIONAL([GL_COND_OBJ_FREE], [test $REPLACE_FREE = 1]) 301 gl_CONDITIONAL([GL_COND_OBJ_FREE], [test $REPLACE_FREE = 1])
335 AM_COND_IF([GL_COND_OBJ_FREE], [ 302 AM_COND_IF([GL_COND_OBJ_FREE], [
336 gl_PREREQ_FREE 303 gl_PREREQ_FREE
337 ]) 304 ])
338 gl_STDLIB_MODULE_INDICATOR([free-posix]) 305 gl_STDLIB_MODULE_INDICATOR([free-posix])
339 gl_FUNC_FSEEK
340 gl_CONDITIONAL([GL_COND_OBJ_FSEEK], [test $REPLACE_FSEEK = 1])
341 gl_STDIO_MODULE_INDICATOR([fseek])
342 gl_FUNC_FSEEKO
343 gl_CONDITIONAL([GL_COND_OBJ_FSEEKO],
344 [test $HAVE_FSEEKO = 0 || test $REPLACE_FSEEKO = 1])
345 AM_COND_IF([GL_COND_OBJ_FSEEKO], [
346 gl_PREREQ_FSEEKO
347 ])
348 gl_STDIO_MODULE_INDICATOR([fseeko])
349 gl_FUNC_FSTAT 306 gl_FUNC_FSTAT
350 gl_CONDITIONAL([GL_COND_OBJ_FSTAT], [test $REPLACE_FSTAT = 1]) 307 gl_CONDITIONAL([GL_COND_OBJ_FSTAT], [test $REPLACE_FSTAT = 1])
351 AM_COND_IF([GL_COND_OBJ_FSTAT], [ 308 AM_COND_IF([GL_COND_OBJ_FSTAT], [
@@ -362,16 +319,6 @@ AC_DEFUN([gl_INIT],
362 AM_COND_IF([GL_COND_OBJ_FSUSAGE], [ 319 AM_COND_IF([GL_COND_OBJ_FSUSAGE], [
363 gl_PREREQ_FSUSAGE_EXTRA 320 gl_PREREQ_FSUSAGE_EXTRA
364 ]) 321 ])
365 gl_FUNC_FTELL
366 gl_CONDITIONAL([GL_COND_OBJ_FTELL], [test $REPLACE_FTELL = 1])
367 gl_STDIO_MODULE_INDICATOR([ftell])
368 gl_FUNC_FTELLO
369 gl_CONDITIONAL([GL_COND_OBJ_FTELLO],
370 [test $HAVE_FTELLO = 0 || test $REPLACE_FTELLO = 1])
371 AM_COND_IF([GL_COND_OBJ_FTELLO], [
372 gl_PREREQ_FTELLO
373 ])
374 gl_STDIO_MODULE_INDICATOR([ftello])
375 gl_GETADDRINFO 322 gl_GETADDRINFO
376 gl_CONDITIONAL([GL_COND_OBJ_GETADDRINFO], 323 gl_CONDITIONAL([GL_COND_OBJ_GETADDRINFO],
377 [test $HAVE_GETADDRINFO = 0 || test $REPLACE_GETADDRINFO = 1]) 324 [test $HAVE_GETADDRINFO = 0 || test $REPLACE_GETADDRINFO = 1])
@@ -470,9 +417,6 @@ AC_DEFUN([gl_INIT],
470 gl_LOCALE_MODULE_INDICATOR([localeconv]) 417 gl_LOCALE_MODULE_INDICATOR([localeconv])
471 gl_LOCK 418 gl_LOCK
472 gl_MODULE_INDICATOR([lock]) 419 gl_MODULE_INDICATOR([lock])
473 gl_FUNC_LSEEK
474 gl_CONDITIONAL([GL_COND_OBJ_LSEEK], [test $REPLACE_LSEEK = 1])
475 gl_UNISTD_MODULE_INDICATOR([lseek])
476 gl_FUNC_MALLOC_GNU 420 gl_FUNC_MALLOC_GNU
477 if test $REPLACE_MALLOC_FOR_MALLOC_GNU = 1; then 421 if test $REPLACE_MALLOC_FOR_MALLOC_GNU = 1; then
478 AC_LIBOBJ([malloc]) 422 AC_LIBOBJ([malloc])
@@ -978,8 +922,6 @@ AC_DEFUN([gltests_LIBSOURCES], [
978AC_DEFUN([gl_FILE_LIST], [ 922AC_DEFUN([gl_FILE_LIST], [
979 build-aux/config.rpath 923 build-aux/config.rpath
980 lib/_Noreturn.h 924 lib/_Noreturn.h
981 lib/af_alg.c
982 lib/af_alg.h
983 lib/alloca.in.h 925 lib/alloca.in.h
984 lib/arg-nonnull.h 926 lib/arg-nonnull.h
985 lib/arpa_inet.in.h 927 lib/arpa_inet.in.h
@@ -992,7 +934,6 @@ AC_DEFUN([gl_FILE_LIST], [
992 lib/basename-lgpl.h 934 lib/basename-lgpl.h
993 lib/basename.c 935 lib/basename.c
994 lib/btowc.c 936 lib/btowc.c
995 lib/byteswap.in.h
996 lib/c++defs.h 937 lib/c++defs.h
997 lib/calloc.c 938 lib/calloc.c
998 lib/cdefs.h 939 lib/cdefs.h
@@ -1013,7 +954,6 @@ AC_DEFUN([gl_FILE_LIST], [
1013 lib/fcntl.in.h 954 lib/fcntl.in.h
1014 lib/fd-hook.c 955 lib/fd-hook.c
1015 lib/fd-hook.h 956 lib/fd-hook.h
1016 lib/fflush.c
1017 lib/filename.h 957 lib/filename.h
1018 lib/float+.h 958 lib/float+.h
1019 lib/float.c 959 lib/float.c
@@ -1021,17 +961,10 @@ AC_DEFUN([gl_FILE_LIST], [
1021 lib/floor.c 961 lib/floor.c
1022 lib/floorf.c 962 lib/floorf.c
1023 lib/fopen.c 963 lib/fopen.c
1024 lib/fpurge.c
1025 lib/freading.c
1026 lib/freading.h
1027 lib/free.c 964 lib/free.c
1028 lib/fseek.c
1029 lib/fseeko.c
1030 lib/fstat.c 965 lib/fstat.c
1031 lib/fsusage.c 966 lib/fsusage.c
1032 lib/fsusage.h 967 lib/fsusage.h
1033 lib/ftell.c
1034 lib/ftello.c
1035 lib/gai_strerror.c 968 lib/gai_strerror.c
1036 lib/getaddrinfo.c 969 lib/getaddrinfo.c
1037 lib/getdelim.c 970 lib/getdelim.c
@@ -1051,7 +984,6 @@ AC_DEFUN([gl_FILE_LIST], [
1051 lib/getprogname.c 984 lib/getprogname.c
1052 lib/getprogname.h 985 lib/getprogname.h
1053 lib/gettext.h 986 lib/gettext.h
1054 lib/gl_openssl.h
1055 lib/glthread/lock.c 987 lib/glthread/lock.c
1056 lib/glthread/lock.h 988 lib/glthread/lock.h
1057 lib/glthread/threadlib.c 989 lib/glthread/threadlib.c
@@ -1076,7 +1008,6 @@ AC_DEFUN([gl_FILE_LIST], [
1076 lib/localcharset.h 1008 lib/localcharset.h
1077 lib/locale.in.h 1009 lib/locale.in.h
1078 lib/localeconv.c 1010 lib/localeconv.c
1079 lib/lseek.c
1080 lib/malloc.c 1011 lib/malloc.c
1081 lib/malloc/dynarray-skeleton.c 1012 lib/malloc/dynarray-skeleton.c
1082 lib/malloc/dynarray.h 1013 lib/malloc/dynarray.h
@@ -1130,9 +1061,6 @@ AC_DEFUN([gl_FILE_LIST], [
1130 lib/setlocale-lock.c 1061 lib/setlocale-lock.c
1131 lib/setlocale_null.c 1062 lib/setlocale_null.c
1132 lib/setlocale_null.h 1063 lib/setlocale_null.h
1133 lib/sha256-stream.c
1134 lib/sha256.c
1135 lib/sha256.h
1136 lib/size_max.h 1064 lib/size_max.h
1137 lib/snprintf.c 1065 lib/snprintf.c
1138 lib/sockets.c 1066 lib/sockets.c
@@ -1147,7 +1075,6 @@ AC_DEFUN([gl_FILE_LIST], [
1147 lib/stdckdint.in.h 1075 lib/stdckdint.in.h
1148 lib/stddef.in.h 1076 lib/stddef.in.h
1149 lib/stdint.in.h 1077 lib/stdint.in.h
1150 lib/stdio-impl.h
1151 lib/stdio-read.c 1078 lib/stdio-read.c
1152 lib/stdio-write.c 1079 lib/stdio-write.c
1153 lib/stdio.in.h 1080 lib/stdio.in.h
@@ -1165,7 +1092,6 @@ AC_DEFUN([gl_FILE_LIST], [
1165 lib/strncasecmp.c 1092 lib/strncasecmp.c
1166 lib/strsep.c 1093 lib/strsep.c
1167 lib/strstr.c 1094 lib/strstr.c
1168 lib/sys-limits.h
1169 lib/sys_socket.c 1095 lib/sys_socket.c
1170 lib/sys_socket.in.h 1096 lib/sys_socket.in.h
1171 lib/sys_stat.in.h 1097 lib/sys_stat.in.h
@@ -1207,13 +1133,11 @@ AC_DEFUN([gl_FILE_LIST], [
1207 m4/00gnulib.m4 1133 m4/00gnulib.m4
1208 m4/__inline.m4 1134 m4/__inline.m4
1209 m4/absolute-header.m4 1135 m4/absolute-header.m4
1210 m4/af_alg.m4
1211 m4/alloca.m4 1136 m4/alloca.m4
1212 m4/arpa_inet_h.m4 1137 m4/arpa_inet_h.m4
1213 m4/base64.m4 1138 m4/base64.m4
1214 m4/btowc.m4 1139 m4/btowc.m4
1215 m4/builtin-expect.m4 1140 m4/builtin-expect.m4
1216 m4/byteswap.m4
1217 m4/calloc.m4 1141 m4/calloc.m4
1218 m4/close.m4 1142 m4/close.m4
1219 m4/codeset.m4 1143 m4/codeset.m4
@@ -1229,20 +1153,13 @@ AC_DEFUN([gl_FILE_LIST], [
1229 m4/fcntl-o.m4 1153 m4/fcntl-o.m4
1230 m4/fcntl.m4 1154 m4/fcntl.m4
1231 m4/fcntl_h.m4 1155 m4/fcntl_h.m4
1232 m4/fflush.m4
1233 m4/float_h.m4 1156 m4/float_h.m4
1234 m4/floorf.m4 1157 m4/floorf.m4
1235 m4/fopen.m4 1158 m4/fopen.m4
1236 m4/fpurge.m4
1237 m4/freading.m4
1238 m4/free.m4 1159 m4/free.m4
1239 m4/fseek.m4
1240 m4/fseeko.m4
1241 m4/fstat.m4 1160 m4/fstat.m4
1242 m4/fstypename.m4 1161 m4/fstypename.m4
1243 m4/fsusage.m4 1162 m4/fsusage.m4
1244 m4/ftell.m4
1245 m4/ftello.m4
1246 m4/getaddrinfo.m4 1163 m4/getaddrinfo.m4
1247 m4/getdelim.m4 1164 m4/getdelim.m4
1248 m4/getdtablesize.m4 1165 m4/getdtablesize.m4
@@ -1252,7 +1169,6 @@ AC_DEFUN([gl_FILE_LIST], [
1252 m4/getopt.m4 1169 m4/getopt.m4
1253 m4/getprogname.m4 1170 m4/getprogname.m4
1254 m4/gettext.m4 1171 m4/gettext.m4
1255 m4/gl-openssl.m4
1256 m4/gnulib-common.m4 1172 m4/gnulib-common.m4
1257 m4/host-cpu-c-abi.m4 1173 m4/host-cpu-c-abi.m4
1258 m4/hostent.m4 1174 m4/hostent.m4
@@ -1278,7 +1194,6 @@ AC_DEFUN([gl_FILE_LIST], [
1278 m4/locale_h.m4 1194 m4/locale_h.m4
1279 m4/localeconv.m4 1195 m4/localeconv.m4
1280 m4/lock.m4 1196 m4/lock.m4
1281 m4/lseek.m4
1282 m4/malloc.m4 1197 m4/malloc.m4
1283 m4/malloca.m4 1198 m4/malloca.m4
1284 m4/math_h.m4 1199 m4/math_h.m4
@@ -1316,7 +1231,6 @@ AC_DEFUN([gl_FILE_LIST], [
1316 m4/servent.m4 1231 m4/servent.m4
1317 m4/setenv.m4 1232 m4/setenv.m4
1318 m4/setlocale_null.m4 1233 m4/setlocale_null.m4
1319 m4/sha256.m4
1320 m4/size_max.m4 1234 m4/size_max.m4
1321 m4/snprintf.m4 1235 m4/snprintf.m4
1322 m4/socketlib.m4 1236 m4/socketlib.m4
@@ -1349,7 +1263,6 @@ AC_DEFUN([gl_FILE_LIST], [
1349 m4/time_h.m4 1263 m4/time_h.m4
1350 m4/time_r.m4 1264 m4/time_r.m4
1351 m4/timegm.m4 1265 m4/timegm.m4
1352 m4/ungetc.m4
1353 m4/unistd_h.m4 1266 m4/unistd_h.m4
1354 m4/unlocked-io.m4 1267 m4/unlocked-io.m4
1355 m4/vararrays.m4 1268 m4/vararrays.m4
diff --git a/gl/m4/lseek.m4 b/gl/m4/lseek.m4
deleted file mode 100644
index 0583511..0000000
--- a/gl/m4/lseek.m4
+++ /dev/null
@@ -1,78 +0,0 @@
1# lseek.m4 serial 12
2dnl Copyright (C) 2007, 2009-2022 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved.
6
7AC_DEFUN([gl_FUNC_LSEEK],
8[
9 AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
10
11 AC_REQUIRE([AC_CANONICAL_HOST])
12 AC_REQUIRE([AC_PROG_CC])
13 AC_CHECK_HEADERS_ONCE([unistd.h])
14 AC_CACHE_CHECK([whether lseek detects pipes], [gl_cv_func_lseek_pipe],
15 [case "$host_os" in
16 mingw*)
17 dnl Native Windows.
18 dnl The result of lseek (fd, (off_t)0, SEEK_CUR) or
19 dnl SetFilePointer(handle, 0, NULL, FILE_CURRENT)
20 dnl for a pipe depends on the environment: In a Cygwin 1.5
21 dnl environment it succeeds (wrong); in a Cygwin 1.7 environment
22 dnl it fails with a wrong errno value.
23 gl_cv_func_lseek_pipe=no
24 ;;
25 *)
26 if test $cross_compiling = no; then
27 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
28#include <sys/types.h> /* for off_t */
29#include <stdio.h> /* for SEEK_CUR */
30#if HAVE_UNISTD_H
31# include <unistd.h>
32#else /* on Windows with MSVC */
33# include <io.h>
34#endif
35]GL_MDA_DEFINES],
36[[
37 /* Exit with success only if stdin is seekable. */
38 return lseek (0, (off_t)0, SEEK_CUR) < 0;
39]])],
40 [if test -s conftest$ac_exeext \
41 && ./conftest$ac_exeext < conftest.$ac_ext \
42 && test 1 = "`echo hi \
43 | { ./conftest$ac_exeext; echo $?; cat >/dev/null; }`"; then
44 gl_cv_func_lseek_pipe=yes
45 else
46 gl_cv_func_lseek_pipe=no
47 fi
48 ],
49 [gl_cv_func_lseek_pipe=no])
50 else
51 AC_COMPILE_IFELSE(
52 [AC_LANG_SOURCE([[
53#if defined __BEOS__
54/* BeOS mistakenly return 0 when trying to seek on pipes. */
55 Choke me.
56#endif]])],
57 [gl_cv_func_lseek_pipe=yes], [gl_cv_func_lseek_pipe=no])
58 fi
59 ;;
60 esac
61 ])
62 if test "$gl_cv_func_lseek_pipe" = no; then
63 REPLACE_LSEEK=1
64 AC_DEFINE([LSEEK_PIPE_BROKEN], [1],
65 [Define to 1 if lseek does not detect pipes.])
66 fi
67
68 AC_REQUIRE([gl_SYS_TYPES_H])
69 if test $WINDOWS_64_BIT_OFF_T = 1; then
70 REPLACE_LSEEK=1
71 fi
72
73 dnl macOS SEEK_DATA is incompatible with other platforms.
74 case $host_os in
75 darwin*)
76 REPLACE_LSEEK=1;;
77 esac
78])
diff --git a/gl/m4/sha256.m4 b/gl/m4/sha256.m4
deleted file mode 100644
index b3d8f92..0000000
--- a/gl/m4/sha256.m4
+++ /dev/null
@@ -1,14 +0,0 @@
1# sha256.m4 serial 8
2dnl Copyright (C) 2005, 2008-2022 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved.
6
7AC_DEFUN([gl_SHA256],
8[
9 dnl Prerequisites of lib/sha256.c.
10 AC_REQUIRE([gl_BIGENDIAN])
11
12 dnl Determine HAVE_OPENSSL_SHA256 and LIB_CRYPTO
13 gl_CRYPTO_CHECK([SHA256])
14])
diff --git a/gl/m4/ungetc.m4 b/gl/m4/ungetc.m4
deleted file mode 100644
index 12a1099..0000000
--- a/gl/m4/ungetc.m4
+++ /dev/null
@@ -1,73 +0,0 @@
1# ungetc.m4 serial 10
2dnl Copyright (C) 2009-2022 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved.
6
7AC_DEFUN_ONCE([gl_FUNC_UNGETC_WORKS],
8[
9 AC_REQUIRE([AC_PROG_CC])
10 AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
11
12 AC_CACHE_CHECK([whether ungetc works on arbitrary bytes],
13 [gl_cv_func_ungetc_works],
14 [AC_RUN_IFELSE([AC_LANG_PROGRAM([[
15#include <stdio.h>
16 ]], [[FILE *f;
17 if (!(f = fopen ("conftest.tmp", "w+")))
18 return 1;
19 if (fputs ("abc", f) < 0)
20 { fclose (f); return 2; }
21 rewind (f);
22 if (fgetc (f) != 'a')
23 { fclose (f); return 3; }
24 if (fgetc (f) != 'b')
25 { fclose (f); return 4; }
26 if (ungetc ('d', f) != 'd')
27 { fclose (f); return 5; }
28 if (ftell (f) != 1)
29 { fclose (f); return 6; }
30 if (fgetc (f) != 'd')
31 { fclose (f); return 7; }
32 if (ftell (f) != 2)
33 { fclose (f); return 8; }
34 if (fseek (f, 0, SEEK_CUR) != 0)
35 { fclose (f); return 9; }
36 if (ftell (f) != 2)
37 { fclose (f); return 10; }
38 if (fgetc (f) != 'c')
39 { fclose (f); return 11; }
40 fclose (f);
41 remove ("conftest.tmp");
42 ]])],
43 [gl_cv_func_ungetc_works=yes], [gl_cv_func_ungetc_works=no],
44 [case "$host_os" in
45 # Guess yes on glibc systems.
46 *-gnu* | gnu*) gl_cv_func_ungetc_works="guessing yes" ;;
47 # Guess yes on musl systems.
48 *-musl*) gl_cv_func_ungetc_works="guessing yes" ;;
49 # Guess yes on bionic systems.
50 *-android*) gl_cv_func_ungetc_works="guessing yes" ;;
51 # Guess yes on native Windows.
52 mingw*) gl_cv_func_ungetc_works="guessing yes" ;;
53 # If we don't know, obey --enable-cross-guesses.
54 *) gl_cv_func_ungetc_works="$gl_cross_guess_normal" ;;
55 esac
56 ])
57 ])
58 gl_ftello_broken_after_ungetc=no
59 case "$gl_cv_func_ungetc_works" in
60 *yes) ;;
61 *)
62 dnl On macOS >= 10.15, where the above program fails with exit code 6,
63 dnl we fix it through an ftello override.
64 case "$host_os" in
65 darwin*) gl_ftello_broken_after_ungetc=yes ;;
66 *)
67 AC_DEFINE([FUNC_UNGETC_BROKEN], [1],
68 [Define to 1 if ungetc is broken when used on arbitrary bytes.])
69 ;;
70 esac
71 ;;
72 esac
73])