summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorNils Maier <maierman@web.de>2014-12-30 18:17:44 +0100
committerNils Maier <maierman@web.de>2015-01-20 22:37:24 +0100
commit81bdd5f61a8f8da53e22d68190be700902b7dbae (patch)
treef706934a5e5e208d8d09490d216fe03f10b38654 /configure.ac
parent747131a06c1f1d92a5312a103f4446fabedb6cf7 (diff)
Revise getRandom facilities
Use one of the following to provide random bytes: - Windows CryptGenRandom - Linux getrandom (syscall interface to urandom, without nasty corner cases such as file descriptor exhaustion or re-linked /dev/urandom) - std::device_random (C++ random device, which usually will be urandom) This also equalizes util::getRandom and SimpleRandomizer (the former will now use the latter) instead of having essentially two different PRNG interfaces with potentially different quality. Closes GH-320
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac14
1 files changed, 14 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 18c8374b..41ca35df 100644
--- a/configure.ac
+++ b/configure.ac
@@ -720,6 +720,7 @@ AC_CHECK_FUNCS([__argz_count \
gethostbyname \
getifaddrs \
getpagesize \
+ getrandom \
memchr \
memmove \
mempcpy \
@@ -755,6 +756,19 @@ AC_CHECK_FUNCS([__argz_count \
utime \
utimes])
+AC_MSG_CHECKING([for getrandom linux syscall interface])
+AC_LINK_IFELSE([AC_LANG_PROGRAM([[
+#include <linux/random.h>
+]],
+[[
+int x = GRND_NONBLOCK;
+]])],
+ [have_getrandom_interface=yes
+ AC_DEFINE([HAVE_GETRANDOM_INTERFACE], [1], [Define to 1 if getrandom linux syscall interface is available.])],
+ [have_getrandom_interface=no])
+AC_MSG_RESULT([$have_getrandom_interface])
+AM_CONDITIONAL([HAVE_GETRANDOM_INTERFACE], [test "x$have_getrandom_interface" = "xyes"])
+
dnl Put tcmalloc/jemalloc checks after the posix_memalign check.
dnl These libraries may implement posix_memalign, while the usual CRT may not
dnl (e.g. mingw). Since we aren't including the corresponding library headers