linamh/sys-libs/glibc/files/2.3.2/glibc-2.3.2-frandom-detect.patch
2009-09-12 08:46:08 +00:00

53 lines
1.7 KiB
Diff
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

diff -Naur glibc-2.3.2-orig/config.h.in glibc-2.3.2/config.h.in
--- glibc-2.3.2-orig/config.h.in 2004-05-11 21:44:51.000000000 -0400
+++ glibc-2.3.2/config.h.in 2004-05-11 22:41:34.903935791 -0400
@@ -208,6 +208,9 @@
/* Defined of libidn is available. */
#undef HAVE_LIBIDN
+/* Defined if economical random device is available. */
+#undef HAVE_DEV_ERANDOM
+
/*
*/
diff -Naur glibc-2.3.2-orig/configure.in glibc-2.3.2/configure.in
--- glibc-2.3.2-orig/configure.in 2004-05-11 21:44:51.000000000 -0400
+++ glibc-2.3.2/configure.in 2004-05-11 22:32:57.999546229 -0400
@@ -289,6 +289,13 @@
[])
AC_SUBST(all_warnings)
+dnl See whether the user wants to disable checking for /dev/erandom
+AC_ARG_ENABLE([dev-erandom],
+ AC_HELP_STRING([--disable-dev-erandom],
+ [disable testing for /dev/erandom]),
+ [try_dev_erandom=$enableval],
+ [try_dev_erandom=yes])
+
AC_CANONICAL_HOST
# The way shlib-versions is used to generate soversions.mk uses a
@@ -1911,6 +1918,21 @@
sizeof_long_double=$ac_cv_sizeof_long_double
AC_SUBST(sizeof_long_double)
+dnl check whether we have an economical random device
+if test "$try_dev_erandom" = yes ; then
+ AC_CACHE_CHECK(for economical random device, ac_cv_have_dev_random,
+ [if test -r "/dev/erandom" ; then
+ ac_cv_have_dev_erandom=yes; else ac_cv_have_dev_erandom=no; fi])
+ if test "$ac_cv_have_dev_erandom" = yes; then
+ AC_DEFINE(HAVE_DEV_ERANDOM,1,
+ [defined if the system supports an economical random device] )
+ fi
+else
+ AC_MSG_CHECKING(for economical random device)
+ ac_cv_have_dev_erandom=no
+ AC_MSG_RESULT(has been disabled)
+fi
+
### End of automated tests.
### Now run sysdeps configure fragments.