1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-30 11:03:19 +03:00

Cope with cross-compiling when checking for a random-number source.

Commit 16f96c74d neglected to consider the possibility of cross-compiling,
causing cross-compiles to fail at the configure stage unless you'd
selected --with-openssl.  Since we're now more or less assuming that
/dev/urandom is available everywhere, it seems reasonable to assume
that the cross-compile target has it too, rather than failing.

Per complaint from Vincas Dargis.  Back-patch to v14 where this came in.

Discussion: https://postgr.es/m/0dc14a31-acaf-8cae-0df4-a87339b22bd9@gmail.com
This commit is contained in:
Tom Lane
2021-11-30 17:18:04 -05:00
parent 4bdfe68559
commit b637101644
2 changed files with 7 additions and 2 deletions

View File

@ -1132,7 +1132,7 @@ if test "$with_python" = yes; then
PGAC_CHECK_PYTHON_EMBED_SETUP
fi
if test "$cross_compiling" = yes && test -z "$with_system_tzdata"; then
if test x"$cross_compiling" = x"yes" && test -z "$with_system_tzdata"; then
PGAC_PATH_PROGS(ZIC, zic)
if test -z "$ZIC"; then
AC_MSG_ERROR([
@ -2287,6 +2287,8 @@ if test x"$with_ssl" = x"openssl" ; then
AC_MSG_RESULT([OpenSSL])
elif test x"$PORTNAME" = x"win32" ; then
AC_MSG_RESULT([Windows native])
elif test x"$cross_compiling" = x"yes"; then
AC_MSG_RESULT([assuming /dev/urandom])
else
AC_MSG_RESULT([/dev/urandom])
AC_CHECK_FILE([/dev/urandom], [], [])