summaryrefslogtreecommitdiff
path: root/configure.in
diff options
context:
space:
mode:
authorYann Ylavic <ylavic@apache.org>2018-06-21 11:22:39 +0000
committerYann Ylavic <ylavic@apache.org>2018-06-21 11:22:39 +0000
commitc418e28c0cbf95a74c7e8a8bda7e79c1f07ec141 (patch)
tree8ff0e4e07cca0faa68dad48e740b8b0272e773d3 /configure.in
parent023e11ac39c236325444dd14ee0ccc4dc1f4378b (diff)
downloadapr-c418e28c0cbf95a74c7e8a8bda7e79c1f07ec141.tar.gz
Merge r1832691 from trunk:
Follow up to r1828287 in 1.7.x. rand: follow up to r1814240: still honor --with-devrandom if specified. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/branches/1.7.x@1833996 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'configure.in')
-rw-r--r--configure.in30
1 files changed, 17 insertions, 13 deletions
diff --git a/configure.in b/configure.in
index 309914d55..42000a877 100644
--- a/configure.in
+++ b/configure.in
@@ -2521,25 +2521,25 @@ AC_ARG_WITH(egd,
if test "$rand" != "1"; then
if test "$ac_cv_func_getrandom" = yes; then
- AC_MSG_RESULT(getrandom)
- rand="1"
+ rand="getrandom"
elif test "$ac_cv_have_decl_SYS_getrandom" = yes; then
- AC_MSG_RESULT(SYS_getrandom)
- rand="1"
- fi
-fi
-
-if test "$rand" != "1"; then
- if test "$ac_cv_func_arc4random_buf" = yes; then
- AC_MSG_RESULT(arc4random)
- rand="1"
+ rand="SYS_getrandom"
+ elif test "$ac_cv_func_arc4random_buf" = yes; then
+ rand="arc4random"
fi
fi
if test "$rand" != "1"; then
AC_ARG_WITH(devrandom,
[ --with-devrandom[[=DEV]] use /dev/random or compatible [[searches by default]]],
- [ apr_devrandom="$withval" ], [ apr_devrandom="yes" ])
+ [ apr_devrandom="$withval" ], [ apr_devrandom="no" ])
+ if test "$apr_devrandom" = "no"; then
+ if test -z "$rand"; then
+ apr_devrandom="yes"
+ else
+ apr_devrandom="no"
+ fi
+ fi
if test "$apr_devrandom" = "yes"; then
# /dev/random on OpenBSD doesn't provide random data, so
@@ -2547,7 +2547,7 @@ if test "$rand" != "1"; then
for f in /dev/arandom /dev/urandom /dev/random; do
if test -r $f; then
apr_devrandom=$f
- rand=1
+ rand="1"
break
fi
done
@@ -2573,6 +2573,10 @@ if test "$rand" != "1"; then
if test "$rand" = "1"; then
AC_DEFINE_UNQUOTED(DEV_RANDOM, ["$apr_devrandom"], [Define to path of random device])
AC_MSG_RESULT([$apr_devrandom])
+ elif test -n "$rand"; then
+ AC_DEFINE_UNQUOTED(SYS_RANDOM, ["$rand"], [Define system call of random])
+ AC_MSG_RESULT([$rand])
+ rand="1"
fi
fi