aboutsummaryrefslogtreecommitdiff
path: root/libstdc++-v3
diff options
context:
space:
mode:
authorPaolo Carlini <paolo.carlini@oracle.com>2008-08-24 23:47:35 +0000
committerPaolo Carlini <paolo@gcc.gnu.org>2008-08-24 23:47:35 +0000
commit9ce0a22eb1a1880d49152ecc15a38f7850c875b8 (patch)
treead59f054344aa43ea9eab5f7fddfe2b1d0679a81 /libstdc++-v3
parent8327f9c2da69615df75f9748308d6fdb38149cea (diff)
downloadgcc-9ce0a22eb1a1880d49152ecc15a38f7850c875b8.zip
gcc-9ce0a22eb1a1880d49152ecc15a38f7850c875b8.tar.gz
gcc-9ce0a22eb1a1880d49152ecc15a38f7850c875b8.tar.bz2
acinclude.m4 ([GLIBCXX_CHECK_RANDOM_TR1]): Simplify, just use two test -r instead of an AC_TRY_RUN.
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. From-SVN: r139549
Diffstat (limited to 'libstdc++-v3')
-rw-r--r--libstdc++-v3/ChangeLog7
-rw-r--r--libstdc++-v3/acinclude.m421
-rw-r--r--libstdc++-v3/config.h.in4
-rwxr-xr-xlibstdc++-v3/configure49
4 files changed, 26 insertions, 55 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index 48e0352..623948a 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,5 +1,12 @@
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.
diff --git a/libstdc++-v3/acinclude.m4 b/libstdc++-v3/acinclude.m4
index 7c854ec..8ea21ce 100644
--- a/libstdc++-v3/acinclude.m4
+++ b/libstdc++-v3/acinclude.m4
@@ -1549,27 +1549,24 @@ AC_DEFUN([GLIBCXX_CHECK_C99_TR1], [
])
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
diff --git a/libstdc++-v3/config.h.in b/libstdc++-v3/config.h.in
index 20f298d..ae11784 100644
--- a/libstdc++-v3/config.h.in
+++ b/libstdc++-v3/config.h.in
@@ -829,8 +829,8 @@
/* 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. */
diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure
index 97d9430..98b0934 100755
--- a/libstdc++-v3/configure
+++ b/libstdc++-v3/configure
@@ -42631,56 +42631,23 @@ done
# 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