aboutsummaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2017-08-07 17:13:49 +0200
committerWladimir J. van der Laan <laanwj@gmail.com>2017-08-07 17:24:55 +0200
commit318392ca7cda813f4117688ce622fcef252744bc (patch)
tree1f510070d05a958673c2d9e559a56ed837919205 /configure.ac
parentfa646369489d5655ac187f2a9e151317829581df (diff)
parentee2d10ad0c0e04d0b9da4535a6fff265ac2501e5 (diff)
downloadbitcoin-318392ca7cda813f4117688ce622fcef252744bc.tar.xz
Merge #10301: Check if sys/random.h is required for getentropy.
ee2d10a Check if sys/random.h is required for getentropy on OSX. (James Hilliard) Pull request description: This should check and include sys/random.h if required for osx as mentioned [here](https://github.com/bitcoin/bitcoin/pull/9821#issuecomment-290936636). Tree-SHA512: e9491f67f2e8b2e6bcdbcbb8063295e844d5627daf5336e3e17b4a8027d888fa65a08e4580a745abdc35ffd8d86b4fc7434daaac172c4a06ab7566a2ed0bfb92
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac8
1 files changed, 8 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index ba523d3762..fd1396fc9e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -674,6 +674,14 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <unistd.h>]],
[ AC_MSG_RESULT(no)]
)
+AC_MSG_CHECKING(for getentropy via random.h)
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <unistd.h>
+ #include <sys/random.h>]],
+ [[ getentropy(nullptr, 32) ]])],
+ [ AC_MSG_RESULT(yes); AC_DEFINE(HAVE_GETENTROPY_RAND, 1,[Define this symbol if the BSD getentropy system call is available with sys/random.h]) ],
+ [ AC_MSG_RESULT(no)]
+)
+
AC_MSG_CHECKING(for sysctl KERN_ARND)
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
#include <sys/sysctl.h>]],