jorton 2002/11/14 15:52:56
Modified: . configure.in acconfig.h
Log:
Simplify logic of /dev/*random search, reducing to a single AC_DEFINE
expansion for the DEV_RANDOM variable. This allows the removal of
DEV_RANDOM from acconfig.h even with autoheader 2.13.
Revision Changes Path
1.502 +12 -15 apr/configure.in
Index: configure.in
===================================================================
RCS file: /home/cvs/apr/configure.in,v
retrieving revision 1.501
retrieving revision 1.502
diff -u -r1.501 -r1.502
--- configure.in 14 Nov 2002 21:45:34 -0000 1.501
+++ configure.in 14 Nov 2002 23:52:56 -0000 1.502
@@ -1628,27 +1628,24 @@
[ apr_devrandom="$withval" ], [ apr_devrandom="yes" ])
if test "$apr_devrandom" = "yes"; then
- if test -r "/dev/random"; then
- AC_DEFINE_UNQUOTED(DEV_RANDOM, ["/dev/random"], [Define to path of
random device])
- AC_MSG_RESULT(/dev/random)
- rand="1"
- elif test -r "/dev/arandom"; then
- AC_DEFINE_UNQUOTED(DEV_RANDOM, ["/dev/arandom"])
- AC_MSG_RESULT(/dev/arandom)
- rand="1"
- elif test -r "/dev/urandom"; then
- AC_DEFINE_UNQUOTED(DEV_RANDOM, ["/dev/urandom"])
- AC_MSG_RESULT(/dev/urandom)
- rand="1"
- fi
+ for f in /dev/random /dev/arandom /dev/urandom; do
+ if test -r $f; then
+ apr_devrandom=$f
+ rand=1
+ break
+ fi
+ done
elif test "$apr_devrandom" != "no"; then
if test -r "$apr_devrandom"; then
- AC_DEFINE_UNQUOTED(DEV_RANDOM, ["$apr_devrandom"])
- AC_MSG_RESULT($apr_devrandom)
rand="1"
else
AC_ERROR([$apr_devrandom not found or unreadable.])
fi
+ fi
+
+ if test "$rand" = "1"; then
+ AC_DEFINE_UNQUOTED(DEV_RANDOM, ["$apr_devrandom"], [Define to path of
random device])
+ AC_MSG_RESULT([$apr_devrandom])
fi
fi
1.62 +0 -1 apr/acconfig.h
Index: acconfig.h
===================================================================
RCS file: /home/cvs/apr/acconfig.h,v
retrieving revision 1.61
retrieving revision 1.62
diff -u -r1.61 -r1.62
--- acconfig.h 14 Nov 2002 20:29:58 -0000 1.61
+++ acconfig.h 14 Nov 2002 23:52:56 -0000 1.62
@@ -5,7 +5,6 @@
/* Various #defines we need to know about */
#undef USE_THREADS
-#undef DEV_RANDOM
#undef EGD_DEFAULT_SOCKET
#undef HAVE_isascii