summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@redhat.com>2014-10-29 15:06:34 +0100
committerNikos Mavrogiannopoulos <nmav@redhat.com>2014-10-29 15:06:34 +0100
commit28f97101c4c220409ac105f836edb07ed13be4f0 (patch)
tree5442b12d2c6d7d37f82bdca65c87fccba72a1efd /configure.ac
parentb21701a141341c485aa602819df6925c1015365c (diff)
downloadgnutls-28f97101c4c220409ac105f836edb07ed13be4f0.tar.gz
use Linux' getrandom() when available
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac12
1 files changed, 12 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index db286f700a..9c32d23fb8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -144,6 +144,17 @@ AM_CONDITIONAL(ASM_X86, test x"$hw_accel" = x"x86" || test x"$hw_accel" = x"x86-
AM_CONDITIONAL(HAVE_GCC_GNU89_INLINE_OPTION, test "$gnu89_inline" = "yes"])
AM_CONDITIONAL(HAVE_GCC, test "$GCC" = "yes")
+dnl check for getrandom()
+enable_getrandom=no
+AC_LINK_IFELSE([AC_LANG_PROGRAM([
+ #include <linux/random.h>],[
+ getrandom(NULL, 0, 0);
+ ])],
+ [AC_MSG_RESULT(yes)
+ AC_DEFINE([HAVE_LINUX_GETRANDOM], 1, [Enable the Linux getrandom function])
+ enable_getrandom=yes],
+ [AC_MSG_RESULT(no)
+ enable_getrandom=no])
dnl Try the hooks.m4
LIBGNUTLS_HOOKS
@@ -850,6 +861,7 @@ AC_MSG_NOTICE([External hardware support:
/dev/crypto: $enable_cryptodev
Hardware accel: $hw_accel
Padlock accel: $use_padlock
+ Linux getrandom: $enable_getrandom
PKCS#11 support: $with_p11_kit
TPM support: $with_tpm
])