From 997c33ec13e3ba59d7306ef8767eec541cefa690 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Mon, 19 Apr 2021 00:32:55 +0300 Subject: [PATCH 52/53] configure.ac: Don't check for /dev/urandom on Windows It could be found at configure time, but would not be available once freeciv is installed. Make sure it does not get enabled by not checking for it at all in Windows See osdn #42024 Signed-off-by: Marko Lindqvist --- configure.ac | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/configure.ac b/configure.ac index 00e7963963..5b3be6a621 100644 --- a/configure.ac +++ b/configure.ac @@ -1450,15 +1450,20 @@ if test "x$bcrypt_h_found" = "xyes" ; then fi AC_CHECK_FUNCS([getentropy clock_gettime]) -AC_CACHE_VAL([ac_cv_dev_urandom], - [if test "x$cross_compiling" != "xyes" ; then - AC_CHECK_FILES([/dev/urandom], [ac_cv_dev_urandom=yes], [ac_cv_dev_urandom=no]) - else - dnl Pessimistic default when cross-compiling - ac_cv_dev_urandom=no - fi]) -if test "x${ac_cv_dev_urandom}" = "xyes" ; then - AC_DEFINE([HAVE_USABLE_URANDOM], [1], [Build in /dev/urandom support]) +if test "x$MINGW" != "xyes" ; then + dnl /dev/urandom could be found within msys2 environment, but it would not + dnl be available in the final target environment when freeciv gets installed. + dnl Just don't check for it in Windows. + AC_CACHE_VAL([ac_cv_dev_urandom], + [if test "x$cross_compiling" != "xyes" ; then + AC_CHECK_FILES([/dev/urandom], [ac_cv_dev_urandom=yes], [ac_cv_dev_urandom=no]) + else + dnl Pessimistic default when cross-compiling + ac_cv_dev_urandom=no + fi]) + if test "x${ac_cv_dev_urandom}" = "xyes" ; then + AC_DEFINE([HAVE_USABLE_URANDOM], [1], [Build in /dev/urandom support]) + fi fi AC_CHECK_FUNCS([_mkdir]) -- 2.30.2