aboutsummaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorToni Uhlig <matzeton@googlemail.com>2018-12-26 21:12:37 +0100
committerToni Uhlig <matzeton@googlemail.com>2018-12-26 21:12:37 +0100
commit85f77e5953ce6a60235ea3d5af5799668183b497 (patch)
treec4237dc60c5d90c94abbb8126b81a05dd870dcd0 /configure.ac
parent5236e631bb3c6f3a31c920709e3fe6c5cd579c14 (diff)
support BSD arc4random() if available
Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac14
1 files changed, 11 insertions, 3 deletions
diff --git a/configure.ac b/configure.ac
index b0534e0..c9ee465 100644
--- a/configure.ac
+++ b/configure.ac
@@ -146,9 +146,16 @@ if test x"${pcap_enabled}" != x -a \
fi
dnl Check for more secure randomization functions
-AC_CHECK_FUNCS([timespec_get srandom random],
- [random_enabled=yes],
- [random_enabled=])
+AC_CHECK_HEADERS([bsd/stdlib.h],, [random_enabled=yes])
+AC_SEARCH_LIBS([arc4random], [bsd],,,)
+AC_CHECK_FUNCS([arc4random], [random_enabled=],)
+if test x"${random_enabled}" != x; then
+ AC_CHECK_FUNCS([timespec_get srandom random],
+ [random_enabled=yes],
+ [random_enabled=])
+else
+ arc4random_enabled=yes
+fi
dnl Check for SELINUX
if test x"${selinux_enabled}" != x; then
@@ -185,6 +192,7 @@ AM_CONDITIONAL([HAVE_SELINUX], [test x"${selinux_enabled}" = xyes])
AM_CONDITIONAL([IS_WINDOWS], [test x"${use_msw}" = xyes])
AM_CONDITIONAL([HAVE_ICMPFILTER], [test x"${with_icmp_filter}" = xyes])
AM_CONDITIONAL([HAVE_RANDOM], [test x"${random_enabled}" = xyes])
+AM_CONDITIONAL([HAVE_ARC4RANDOM], [test x"${arc4random_enabled}" = xyes])
dnl output config headers
AC_CONFIG_HEADERS([src/config.h:src/config.h.in])