From e03296f7cbeb81014d16598c34336dd9f0d3f7d0 Mon Sep 17 00:00:00 2001
From: Joshua Colp <jcolp@digium.com>
Date: Wed, 1 Aug 2007 18:56:31 +0000
Subject: [PATCH] Don't look for /dev/urandom when cross compiling. Just assume
 it is not available.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@77875 65c4cc65-6c06-0410-ace0-fbb531ad65f3
---
 configure    | 7 +++++--
 configure.ac | 5 ++++-
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/configure b/configure
index b76fc18fbc..c6eba581f2 100755
--- a/configure
+++ b/configure
@@ -1,5 +1,5 @@
 #! /bin/sh
-# From configure.ac Revision: 77864 .
+# From configure.ac Revision: 77866 .
 # Guess values for system-dependent variables and create Makefiles.
 # Generated by GNU Autoconf 2.61.
 #
@@ -15454,7 +15454,9 @@ fi
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 
-{ echo "$as_me:$LINENO: checking for /dev/urandom" >&5
+if test "${cross_compiling}" = "no";
+then
+  { echo "$as_me:$LINENO: checking for /dev/urandom" >&5
 echo $ECHO_N "checking for /dev/urandom... $ECHO_C" >&6; }
 if test "${ac_cv_file__dev_urandom+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -15479,6 +15481,7 @@ _ACEOF
 
 fi
 
+fi
 
 
     if test "x${PBX_PTHREAD_RWLOCK_INITIALIZER}" != "x1" -a "${USE_PTHREAD_RWLOCK_INITIALIZER}" != "no"; then
diff --git a/configure.ac b/configure.ac
index dd2e95d863..c32eb54a2a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -322,7 +322,10 @@ AC_DEFINE([HAVE_SYS_ENDIAN_BSWAP16], 1, [Define to 1 if your sys/endian.h header
 AC_MSG_RESULT(no)
 )
 
-AC_CHECK_FILE(/dev/urandom, AC_DEFINE([HAVE_DEV_URANDOM], 1, [Define to 1 if your system has /dev/urandom.]))
+if test "${cross_compiling}" = "no";
+then
+  AC_CHECK_FILE(/dev/urandom, AC_DEFINE([HAVE_DEV_URANDOM], 1, [Define to 1 if your system has /dev/urandom.]))
+fi
 
 AST_C_DEFINE_CHECK([PTHREAD_RWLOCK_INITIALIZER], [PTHREAD_RWLOCK_INITIALIZER], [pthread.h])
 AST_C_DEFINE_CHECK([PTHREAD_RWLOCK_PREFER_WRITER_NP], [PTHREAD_RWLOCK_PREFER_WRITER_NP], [pthread.h])
-- 
GitLab