summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorMartin Storsjo <martin@martin.st>2018-06-14 12:52:03 +0300
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2018-06-16 15:22:34 +0200
commite4c2963add8a1173e6e33a789a6f5b131cb65a5a (patch)
tree5821b331a0c4b0bbcda17adc66cc12d6aa864c3f /configure.ac
parent317f382ddc5839f5d65203dd749234fde2ab6d63 (diff)
downloadgnutls-e4c2963add8a1173e6e33a789a6f5b131cb65a5a.tar.gz
configure: Include sys/random.h before checking for getentropy on macOS
This function is available since macOS 10.12, but it's in sys/random.h on macOS, contrary to the other platforms supporting it where it is present in unistd.h. If we don't include the right header that declares the function and its availability, the configure check would succeed even if targeting older versions of macOS that lacks the function. Also include the same header in the source file that actually uses getentropy. Signed-off-by: Martin Storsjo <martin@martin.st>
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac3
1 files changed, 3 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 162f187d4d..53adee922a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -241,6 +241,9 @@ AC_LINK_IFELSE([AC_LANG_PROGRAM([
AC_MSG_CHECKING([for getentropy])
AC_LINK_IFELSE([AC_LANG_PROGRAM([
#include <unistd.h>
+ #ifdef __APPLE__
+ #include <sys/random.h>
+ #endif
#ifdef __linux__
#error 1
#endif