]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
configure: prevent a version of getentropy() in a linux libc to be used
authorNikos Mavrogiannopoulos <nmav@gnutls.org>
Fri, 15 Jul 2016 19:55:04 +0000 (21:55 +0200)
committerNikos Mavrogiannopoulos <nmav@gnutls.org>
Fri, 15 Jul 2016 19:55:06 +0000 (21:55 +0200)
For now, we auto-detect and switch between getrandom() and /dev/urandom
when the former is not available. With the complexity of dealing with
libc's that have the feature but kernel not supporting it, or vice versa
it is best keep things simple.

configure.ac

index 9d3681b0060fc81f54463532e04a3525758ad18b..37fc1d1d3b48828d6f1d0c7886a76a4bbbf822ce 100644 (file)
@@ -189,7 +189,11 @@ AC_LINK_IFELSE([AC_LANG_PROGRAM([
 
 AC_MSG_CHECKING([for getentropy])
 AC_LINK_IFELSE([AC_LANG_PROGRAM([
-          #include <unistd.h>],[
+          #include <unistd.h>
+           #ifdef __linux__
+           #error 1
+           #endif
+          ],[
                   getentropy(0, 0);
                  ])],
                  [AC_MSG_RESULT(yes)