From: Bill Cole Date: Mon, 26 Mar 2018 04:52:06 +0000 (-0400) Subject: Fix arc4random build checks X-Git-Tag: 2.3.2.rc1~84 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a37bae91328e318c537b72a5ed4eeb311cca014d;p=thirdparty%2Fdovecot%2Fcore.git Fix arc4random build checks The configure script checks for arc4random() but the actual code uses arc4random_buf(). This breaks for FreeBSD <8.0 and MacOS X <10.7, which have the former but not the latter. This change (and an autoreconf run) solves the problem at the cost of not using the available ARC4 implementation. --- diff --git a/m4/arc4random.m4 b/m4/arc4random.m4 index 56471f025e..6d6715e595 100644 --- a/m4/arc4random.m4 +++ b/m4/arc4random.m4 @@ -13,11 +13,11 @@ AC_DEFUN([DOVECOT_ARC4RANDOM], [ [--with-libbsd], [Use libbsd (default is no)] ), [want_libbsd=$withval], [want_libbsd=no]) - AC_CHECK_FUNC([arc4random], AC_DEFINE([HAVE_ARC4RANDOM], [1], [Define this if you arc4random()]), [ + AC_CHECK_FUNC([arc4random_buf], AC_DEFINE([HAVE_ARC4RANDOM], [1], [Define this if you have arc4random_buf()]), [ if test "$want_libbsd" = yes; then - AC_CHECK_LIB([bsd], [arc4random], [ + AC_CHECK_LIB([bsd], [arc4random_buf], [ LIBS="$LIBS -lbsd" - AC_DEFINE([HAVE_ARC4RANDOM], [1], [Define this if you arc4random()]) + AC_DEFINE([HAVE_ARC4RANDOM], [1], [Define this if you have arc4random_buf()]) AC_DEFINE([HAVE_LIBBSD], [1], [Define this if you have libbsd]) ]) fi