aboutsummaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorJames Hilliard <james.hilliard1@gmail.com>2017-07-27 15:34:09 +0300
committerJames Hilliard <james.hilliard1@gmail.com>2017-07-27 15:34:09 +0300
commitee2d10ad0c0e04d0b9da4535a6fff265ac2501e5 (patch)
tree3818176646573cda7792fdf472408e345c7e33c3 /configure.ac
parentba1bbb049b8f3ad295f36b060f775591b1fed8c1 (diff)
downloadbitcoin-ee2d10ad0c0e04d0b9da4535a6fff265ac2501e5.tar.xz
Check if sys/random.h is required for getentropy on OSX.
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 aea5d7160c..1fc4e3219e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -675,6 +675,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>]],