diff configure.in @ 9204:1849c4269ad8 HEAD

If /dev/arandom exists (OpenBSD), use it instead of /dev/urandom.
author Timo Sirainen <tss@iki.fi>
date Sun, 03 May 2009 22:04:39 -0400
parents 6324a79d3ee1
children 2e2b957f1cca
line wrap: on
line diff
--- a/configure.in	Sun May 03 21:35:28 2009 -0400
+++ b/configure.in	Sun May 03 22:04:39 2009 -0400
@@ -853,14 +853,24 @@
 AC_DEFINE_UNQUOTED(MEM_ALIGN_SIZE, $mem_align, Required memory alignment)
 
 dnl * find random source
-AC_MSG_CHECKING([for /dev/urandom])
-if test -c /dev/urandom || test -s /dev/urandom; then
+AC_MSG_CHECKING([for OpenBSD /dev/arandom])
+if test -c /dev/arandom; then
   AC_MSG_RESULT(yes)
-  AC_DEFINE(HAVE_DEV_URANDOM,, Define if you have /dev/urandom)
+  AC_DEFINE(DEV_URANDOM_PATH, "/dev/arandom", Path to /dev/urandom)
   have_random_source=yes
 else
   AC_MSG_RESULT(no)
+  AC_MSG_CHECKING([for /dev/urandom])
+  if test -c /dev/urandom || test -s /dev/urandom; then
+    AC_MSG_RESULT(yes)
+    AC_DEFINE(DEV_URANDOM_PATH, "/dev/urandom", Path to /dev/urandom)
+    have_random_source=yes
+  else
+    AC_MSG_RESULT(no)
+  fi
+fi
 
+if test "$have_random_source" != "yes"; then
   AC_CHECK_HEADER(openssl/rand.h, [
     AC_DEFINE(HAVE_OPENSSL_RAND_H,, Define if you have openssl/rand.h)
     LIBS="$LIBS -lcrypto"