# HG changeset patch # User Kim Alvefur # Date 1512310872 -3600 # Node ID f516a52f19e82ff80317e3da24c47d92fb8648ef # Parent 200f4f1b7833aea8593d0b88aef616dc06541064 util.crand: Make it possible to use arc4random on Linux (needs libbsd) diff -r 200f4f1b7833 -r f516a52f19e8 configure --- a/configure Sun Dec 03 15:03:25 2017 +0100 +++ b/configure Sun Dec 03 15:21:12 2017 +0100 @@ -528,6 +528,8 @@ if [ "$PRNG" = "OPENSSL" ]; then PRNGLIBS=$OPENSSL_LIBS +elif [ "$PRNG" = "ARC4RANDOM" -a "$(uname)" = "Linux" ]; then + PRNGLIBS="-lbsd" fi # Write config diff -r 200f4f1b7833 -r f516a52f19e8 util-src/crand.c --- a/util-src/crand.c Sun Dec 03 15:03:25 2017 +0100 +++ b/util-src/crand.c Sun Dec 03 15:21:12 2017 +0100 @@ -54,7 +54,11 @@ #elif defined(WITH_OPENSSL) #include -#elif ! defined(WITH_ARC4RANDOM) +#elif defined(WITH_ARC4RANDOM) +#ifdef __linux__ +#include +#endif +#else #error util.crand compiled without a random source #endif