Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
bpo-44062: Fix PYTHON_FOR_BUILD interpreter lookup for cross-compile …
…builds

Previously, when running configure in a cross-compile scenario, the
PYTHON_FOR_BUILD interpreter could be set to python even if no python
is availble in PATH.

Now, configure will properly set PYTHON_FOR_BUILD based on what is
available in PATH or fail.
  • Loading branch information
vfazio committed Jun 10, 2021
commit 872ef8dbbe797b64e6ce8b1b2a2ac53bee72c5f6
3 changes: 1 addition & 2 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -2997,12 +2997,11 @@ if test "$cross_compiling" = yes; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for python interpreter for cross build" >&5
$as_echo_n "checking for python interpreter for cross build... " >&6; }
if test -z "$PYTHON_FOR_BUILD"; then
for interp in python$PACKAGE_VERSION python3 python; do
for interp in python$PACKAGE_VERSION python3 python ''; do
which $interp >/dev/null 2>&1 || continue
if $interp -c "import sys;sys.exit(not '.'.join(str(n) for n in sys.version_info[:2]) == '$PACKAGE_VERSION')"; then
break
fi
interp=
done
if test x$interp = x; then
as_fn_error $? "python$PACKAGE_VERSION interpreter not found" "$LINENO" 5
Expand Down
3 changes: 1 addition & 2 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,11 @@ AC_SUBST(PYTHON_FOR_REGEN)
if test "$cross_compiling" = yes; then
AC_MSG_CHECKING([for python interpreter for cross build])
if test -z "$PYTHON_FOR_BUILD"; then
for interp in python$PACKAGE_VERSION python3 python; do
for interp in python$PACKAGE_VERSION python3 python ''; do
which $interp >/dev/null 2>&1 || continue
if $interp -c "import sys;sys.exit(not '.'.join(str(n) for n in sys.version_info@<:@:2@:>@) == '$PACKAGE_VERSION')"; then
break
fi
interp=
done
if test x$interp = x; then
AC_MSG_ERROR([python$PACKAGE_VERSION interpreter not found])
Expand Down