Commit 66501445 authored by Paul Eggert's avatar Paul Eggert

Update from Gnulib.

This incorporates:
2020-06-28 getrandom: do not depend on ‘open’ on mingw
2020-06-28 getrandom: fix compilation errors on older versions of mingw
* build-aux/config.sub, lib/getrandom.c, m4/getrandom.m4:
Copy from Gnulib
* lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate.
parent 162f375b
Pipeline #5961 failed with stage
in 90 minutes and 4 seconds
This diff is collapsed.
......@@ -29,7 +29,16 @@
#if defined _WIN32 && ! defined __CYGWIN__
# define WIN32_LEAN_AND_MEAN
# include <windows.h>
# include <bcrypt.h>
# if HAVE_BCRYPT_H
# include <bcrypt.h>
# else
# include <ntdef.h> /* NTSTATUS */
typedef void * BCRYPT_ALG_HANDLE;
# define BCRYPT_USE_SYSTEM_PREFERRED_RNG 0x00000002
# if HAVE_LIB_BCRYPT
extern NTSTATUS WINAPI BCryptGenRandom (BCRYPT_ALG_HANDLE, UCHAR *, ULONG, ULONG);
# endif
# endif
# if !HAVE_LIB_BCRYPT
# include <wincrypt.h>
# ifndef CRYPT_VERIFY_CONTEXT
......
......@@ -109,6 +109,7 @@
# futimens \
# getloadavg \
# getopt-gnu \
# getrandom \
# gettime \
# gettimeofday \
# gitlog-to-changelog \
......@@ -1095,6 +1096,7 @@ gl_GNULIB_ENABLED_getdtablesize = @gl_GNULIB_ENABLED_getdtablesize@
gl_GNULIB_ENABLED_getgroups = @gl_GNULIB_ENABLED_getgroups@
gl_GNULIB_ENABLED_lchmod = @gl_GNULIB_ENABLED_lchmod@
gl_GNULIB_ENABLED_malloca = @gl_GNULIB_ENABLED_malloca@
gl_GNULIB_ENABLED_open = @gl_GNULIB_ENABLED_open@
gl_GNULIB_ENABLED_strtoll = @gl_GNULIB_ENABLED_strtoll@
gl_GNULIB_ENABLED_utimens = @gl_GNULIB_ENABLED_utimens@
gl_LIBOBJS = @gl_LIBOBJS@
......@@ -2168,7 +2170,9 @@ endif
## begin gnulib module open
ifeq (,$(OMIT_GNULIB_MODULE_open))
ifneq (,$(gl_GNULIB_ENABLED_open))
endif
EXTRA_DIST += open.c
EXTRA_libgnu_a_SOURCES += open.c
......
# getrandom.m4 serial 5
# getrandom.m4 serial 6
dnl Copyright 2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
......@@ -36,6 +36,7 @@ AC_DEFUN([gl_FUNC_GETRANDOM],
case "$host_os" in
mingw*)
AC_CHECK_HEADERS([bcrypt.h])
AC_CACHE_CHECK([whether the bcrypt library is guaranteed to be present],
[gl_cv_lib_assume_bcrypt],
[AC_COMPILE_IFELSE(
......
......@@ -308,6 +308,7 @@ AC_DEFUN([gl_INIT],
AC_LIBOBJ([futimens])
fi
gl_SYS_STAT_MODULE_INDICATOR([futimens])
AC_REQUIRE([AC_CANONICAL_HOST])
gl_GETLOADAVG
if test $HAVE_GETLOADAVG = 0; then
AC_LIBOBJ([getloadavg])
......@@ -327,6 +328,7 @@ AC_DEFUN([gl_INIT],
fi
AC_SUBST([GNULIB_GL_UNISTD_H_GETOPT])
gl_UNISTD_MODULE_INDICATOR([getopt-posix])
AC_REQUIRE([AC_CANONICAL_HOST])
gl_FUNC_GETRANDOM
if test $HAVE_GETRANDOM = 0 || test $REPLACE_GETRANDOM = 1; then
AC_LIBOBJ([getrandom])
......@@ -383,12 +385,6 @@ AC_DEFUN([gl_INIT],
gl_TIME_MODULE_INDICATOR([mktime])
gl_MULTIARCH
gl_FUNC_GNU_STRFTIME
gl_FUNC_OPEN
if test $REPLACE_OPEN = 1; then
AC_LIBOBJ([open])
gl_PREREQ_OPEN
fi
gl_FCNTL_MODULE_INDICATOR([open])
gl_PATHMAX
gl_FUNC_PIPE2
gl_UNISTD_MODULE_INDICATOR([pipe2])
......@@ -509,6 +505,7 @@ AC_DEFUN([gl_INIT],
gl_gnulib_enabled_2049e887c7e5308faad27b3f894bb8c9=false
gl_gnulib_enabled_malloca=false
gl_gnulib_enabled_5264294aa0a5557541b53c8c741f7f31=false
gl_gnulib_enabled_open=false
gl_gnulib_enabled_03e0aaad4cb89ca757653bd367a6ccb7=false
gl_gnulib_enabled_6099e9737f757db36c47fa9d9f02e88c=false
gl_gnulib_enabled_strtoll=false
......@@ -517,7 +514,11 @@ AC_DEFUN([gl_INIT],
func_gl_gnulib_m4code_260941c0e5dc67ec9e87d1fb321c300b ()
{
if ! $gl_gnulib_enabled_260941c0e5dc67ec9e87d1fb321c300b; then
AC_REQUIRE([AC_CANONICAL_HOST])
gl_gnulib_enabled_260941c0e5dc67ec9e87d1fb321c300b=true
if case $host_os in mingw*) false;; *) :;; esac; then
func_gl_gnulib_m4code_open
fi
fi
}
func_gl_gnulib_m4code_cloexec ()
......@@ -644,6 +645,21 @@ AC_DEFUN([gl_INIT],
gl_gnulib_enabled_5264294aa0a5557541b53c8c741f7f31=true
fi
}
func_gl_gnulib_m4code_open ()
{
if ! $gl_gnulib_enabled_open; then
gl_FUNC_OPEN
if test $REPLACE_OPEN = 1; then
AC_LIBOBJ([open])
gl_PREREQ_OPEN
fi
gl_FCNTL_MODULE_INDICATOR([open])
gl_gnulib_enabled_open=true
if test $REPLACE_OPEN = 1; then
func_gl_gnulib_m4code_cloexec
fi
fi
}
func_gl_gnulib_m4code_03e0aaad4cb89ca757653bd367a6ccb7 ()
{
if ! $gl_gnulib_enabled_03e0aaad4cb89ca757653bd367a6ccb7; then
......@@ -720,15 +736,18 @@ AC_DEFUN([gl_INIT],
if test $HAVE_FUTIMENS = 0 || test $REPLACE_FUTIMENS = 1; then
func_gl_gnulib_m4code_utimens
fi
if case $host_os in mingw*) false;; *) test $HAVE_GETLOADAVG = 0;; esac; then
func_gl_gnulib_m4code_open
fi
if test $REPLACE_GETOPT = 1; then
func_gl_gnulib_m4code_be453cec5eecf5731a274f2de7f2db36
fi
if case $host_os in mingw*) false;; *) test $HAVE_GETRANDOM = 0 || test $REPLACE_GETRANDOM = 1;; esac; then
func_gl_gnulib_m4code_open
fi
if test $NEED_LOCALTIME_BUFFER = 1; then
func_gl_gnulib_m4code_2049e887c7e5308faad27b3f894bb8c9
fi
if test $REPLACE_OPEN = 1; then
func_gl_gnulib_m4code_cloexec
fi
if test $HAVE_READLINKAT = 0; then
func_gl_gnulib_m4code_260941c0e5dc67ec9e87d1fb321c300b
fi
......@@ -763,6 +782,7 @@ AC_DEFUN([gl_INIT],
AM_CONDITIONAL([gl_GNULIB_ENABLED_2049e887c7e5308faad27b3f894bb8c9], [$gl_gnulib_enabled_2049e887c7e5308faad27b3f894bb8c9])
AM_CONDITIONAL([gl_GNULIB_ENABLED_malloca], [$gl_gnulib_enabled_malloca])
AM_CONDITIONAL([gl_GNULIB_ENABLED_5264294aa0a5557541b53c8c741f7f31], [$gl_gnulib_enabled_5264294aa0a5557541b53c8c741f7f31])
AM_CONDITIONAL([gl_GNULIB_ENABLED_open], [$gl_gnulib_enabled_open])
AM_CONDITIONAL([gl_GNULIB_ENABLED_03e0aaad4cb89ca757653bd367a6ccb7], [$gl_gnulib_enabled_03e0aaad4cb89ca757653bd367a6ccb7])
AM_CONDITIONAL([gl_GNULIB_ENABLED_6099e9737f757db36c47fa9d9f02e88c], [$gl_gnulib_enabled_6099e9737f757db36c47fa9d9f02e88c])
AM_CONDITIONAL([gl_GNULIB_ENABLED_strtoll], [$gl_gnulib_enabled_strtoll])
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment