summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjwoolley <jwoolley@13f79535-47bb-0310-9956-ffa450edef68>2002-05-28 23:15:10 +0000
committerjwoolley <jwoolley@13f79535-47bb-0310-9956-ffa450edef68>2002-05-28 23:15:10 +0000
commit2a9754194d8401c2900be8c40791c48645d15521 (patch)
treee27a0874bc043c07dfb2c43be62b51d7b6a6645d
parent4178057eb2cc17b833f5d29435da916945633740 (diff)
downloadlibapr-2a9754194d8401c2900be8c40791c48645d15521.tar.gz
Added --with-devrandom=[DEV] configure flag which allows a particular
"/dev/random"-compatible device to be specified, overriding the default search path (/dev/random then /dev/arandom then /dev/urandom). Also, if --with-egd=<path> is specified, it now implies --without-devrandom. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@63437 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--CHANGES6
-rw-r--r--configure.in61
2 files changed, 48 insertions, 19 deletions
diff --git a/CHANGES b/CHANGES
index d65892e93..6cae608ca 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,5 +1,11 @@
Changes with APR b1
+ *) Added --with-devrandom=[DEV] configure flag which allows a particular
+ "/dev/random"-compatible device to be specified, overriding the
+ default search path (/dev/random then /dev/arandom then /dev/urandom).
+ Also, if --with-egd=<path> is specified, it now implies
+ --without-devrandom. [Cliff Woolley]
+
*) Darwin/Mac OS X: Don't leave zombie processes when the app calls
apr_signal(SIGCHLD, SIG_IGN). This fixes a problem with Apache's
mod_cgid. PR 9168. [Jeff Trawick]
diff --git a/configure.in b/configure.in
index fe6684cdd..f9bb7a4eb 100644
--- a/configure.in
+++ b/configure.in
@@ -1525,17 +1525,50 @@ else
fi
dnl #----------------------------- Checking for /dev/random
-AC_MSG_CHECKING(for /dev/random)
+AC_MSG_CHECKING(for entropy source)
-if test -r "/dev/random"; then
- AC_DEFINE(DEV_RANDOM, [/dev/random])
- AC_MSG_RESULT(/dev/random)
- rand="1"
-elif test -r "/dev/urandom"; then
- AC_DEFINE(DEV_RANDOM, [/dev/urandom])
- AC_MSG_RESULT(/dev/urandom)
+AC_ARG_WITH(egd,
+ [ --with-egd=<path> use egd-compatible socket],
+ [ if test "$withval" = "yes"; then
+ AC_ERROR([You must specify a default EGD socket path.])
+ fi
+ AC_DEFINE(HAVE_EGD)
+ AC_DEFINE_UNQUOTED(EGD_DEFAULT_SOCKET, [$withval])
+ AC_MSG_RESULT(EGD-compatible daemon)
rand="1"
-else
+ ])
+
+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" ])
+
+ if test "$apr_devrandom" = "yes"; then
+ if test -r "/dev/random"; then
+ AC_DEFINE(DEV_RANDOM, [/dev/random])
+ AC_MSG_RESULT(/dev/random)
+ rand="1"
+ elif test -r "/dev/arandom"; then
+ AC_DEFINE(DEV_RANDOM, [/dev/arandom])
+ AC_MSG_RESULT(/dev/arandom)
+ rand="1"
+ elif test -r "/dev/urandom"; then
+ AC_DEFINE(DEV_RANDOM, [/dev/urandom])
+ AC_MSG_RESULT(/dev/urandom)
+ rand="1"
+ fi
+ elif test "$apr_devrandom" != "no"; then
+ if test -r "$apr_devrandom"; then
+ AC_DEFINE(DEV_RANDOM, [$apr_devrandom])
+ AC_MSG_RESULT($apr_devrandom)
+ rand="1"
+ else
+ AC_ERROR([$apr_devrandom not found or unreadable.])
+ fi
+ fi
+fi
+
+if test "$rand" != "1"; then
case $host in
# we have built in support for OS/2
*-os2*)
@@ -1543,16 +1576,6 @@ else
rand="1"
;;
*)
- AC_ARG_WITH(egd,
- [ --with-egd=<path> use egd-compatible socket],
- [ if test "$withval" = "yes"; then
- AC_ERROR([You must specify a default EGD socket path.])
- fi
- AC_DEFINE(HAVE_EGD)
- AC_DEFINE_UNQUOTED(EGD_DEFAULT_SOCKET, [$withval])
- AC_MSG_RESULT(EGD-compatible daemon)
- rand="1"
- ])
if test "$rand" != "1"; then
if test "$ac_cv_lib_truerand_main" = "yes"; then
AC_DEFINE(HAVE_TRUERAND)