diff options
author | James Hilliard <james.hilliard1@gmail.com> | 2017-07-27 15:34:09 +0300 |
---|---|---|
committer | James Hilliard <james.hilliard1@gmail.com> | 2017-07-27 15:34:09 +0300 |
commit | ee2d10ad0c0e04d0b9da4535a6fff265ac2501e5 (patch) | |
tree | 3818176646573cda7792fdf472408e345c7e33c3 /configure.ac | |
parent | ba1bbb049b8f3ad295f36b060f775591b1fed8c1 (diff) |
Check if sys/random.h is required for getentropy on OSX.
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 8 |
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>]], |