2008-08-24 Paolo Carlini <paolo.carlini@oracle.com>
+ * acinclude.m4 ([GLIBCXX_CHECK_RANDOM_TR1]): Simplify, just use
+ two test -r instead of an AC_TRY_RUN.
+ * configure: Regenerate.
+ * config.h.in: Likewise.
+
+2008-08-24 Paolo Carlini <paolo.carlini@oracle.com>
+
* acinclude.m4 ([GLIBCXX_ENABLE_CLOCK_GETTIME]): Improve documentation.
* doc/xml/manual/configure.xml: Likewise.
])
dnl
-dnl Check whether "dev/random" and "dev/urandom" are available for the
+dnl Check whether "/dev/random" and "/dev/urandom" are available for the
dnl random_device of "TR1" (Chapter 5.1, "Random number generation").
dnl
AC_DEFUN([GLIBCXX_CHECK_RANDOM_TR1], [
- AC_MSG_CHECKING([for "dev/random" and "dev/urandom" for TR1 random_device])
+ AC_MSG_CHECKING([for "/dev/random" and "/dev/urandom" for TR1 random_device])
AC_CACHE_VAL(glibcxx_cv_random_tr1, [
- AC_TRY_RUN([#include <stdio.h>
- int main()
- {
- return !(fopen("/dev/random", "r")
- && fopen("/dev/urandom", "r"));
- }
- ],
- [glibcxx_cv_random_tr1=yes], [glibcxx_cv_random_tr1=no],
- [glibcxx_cv_random_tr1=no])
+ if test -r /dev/random && test -r /dev/urandom; then
+ glibcxx_cv_random_tr1=yes;
+ else
+ glibcxx_cv_random_tr1=no;
+ fi
])
AC_MSG_RESULT($glibcxx_cv_random_tr1)
+
if test x"$glibcxx_cv_random_tr1" = x"yes"; then
AC_DEFINE(_GLIBCXX_USE_RANDOM_TR1, 1,
- [Define if dev/random and dev/urandom are available for
+ [Define if /dev/random and /dev/urandom are available for
the random_device of TR1 (Chapter 5.1).])
fi
/* Define if NLS translations are to be used. */
#undef _GLIBCXX_USE_NLS
-/* Define if dev/random and dev/urandom are available for the random_device of
- TR1 (Chapter 5.1). */
+/* Define if /dev/random and /dev/urandom are available for the random_device
+ of TR1 (Chapter 5.1). */
#undef _GLIBCXX_USE_RANDOM_TR1
/* Define if standard layout types are supported in C++200x. */
# For dev/random and dev/urandom for TR1.
- echo "$as_me:$LINENO: checking for \"dev/random\" and \"dev/urandom\" for TR1 random_device" >&5
-echo $ECHO_N "checking for \"dev/random\" and \"dev/urandom\" for TR1 random_device... $ECHO_C" >&6
+ echo "$as_me:$LINENO: checking for \"/dev/random\" and \"/dev/urandom\" for TR1 random_device" >&5
+echo $ECHO_N "checking for \"/dev/random\" and \"/dev/urandom\" for TR1 random_device... $ECHO_C" >&6
if test "${glibcxx_cv_random_tr1+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
- if test "$cross_compiling" = yes; then
- glibcxx_cv_random_tr1=no
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <stdio.h>
- int main()
- {
- return !(fopen("/dev/random", "r")
- && fopen("/dev/urandom", "r"));
- }
-
-_ACEOF
-rm -f conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- glibcxx_cv_random_tr1=yes
-else
- echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-( exit $ac_status )
-glibcxx_cv_random_tr1=no
-fi
-rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-fi
+ if test -r /dev/random && test -r /dev/urandom; then
+ glibcxx_cv_random_tr1=yes;
+ else
+ glibcxx_cv_random_tr1=no;
+ fi
fi
echo "$as_me:$LINENO: result: $glibcxx_cv_random_tr1" >&5
echo "${ECHO_T}$glibcxx_cv_random_tr1" >&6
+
if test x"$glibcxx_cv_random_tr1" = x"yes"; then
cat >>confdefs.h <<\_ACEOF