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
Prev Previous commit
Next Next commit
bpo-45723: Clean up _PYTHON_HOST_PLATFORM check
  • Loading branch information
Erlend E. Aasland committed Dec 10, 2021
commit ac156c82c04348015624eefc412e2169bb282e9c
53 changes: 27 additions & 26 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -3834,32 +3834,33 @@ fi
$as_echo "$MACHDEP" >&6; }


if test "$cross_compiling" = yes; then
case "$host" in
*-*-linux*)
case "$host_cpu" in
arm*)
_host_cpu=arm
;;
*)
_host_cpu=$host_cpu
esac
;;
*-*-cygwin*)
_host_cpu=
;;
*-*-vxworks*)
_host_cpu=$host_cpu
;;
wasm32-*-* | wasm64-*-*)
_host_cpu=$host_cpu
;;
*)
# for now, limit cross builds to known configurations
MACHDEP="unknown"
as_fn_error $? "cross build not supported for $host" "$LINENO" 5
esac
_PYTHON_HOST_PLATFORM="$MACHDEP${_host_cpu:+-$_host_cpu}"
if test "x$cross_compiling" = xyes; then :

case $host in #(
*-*-linux*) :

case $host_cpu in #(
arm*) :
_host_cpu=arm ;; #(
*) :
_host_cpu=$host_cpu
;;
esac
;; #(
*-*-cygwin*) :
_host_cpu= ;; #(
*-*-vxworks*) :
_host_cpu=$host_cpu ;; #(
wasm32-*-*|wasm64-*-*) :
_host_cpu=$host_cpu ;; #(
*) :
MACHDEP="unknown"
as_fn_error $? "cross build not supported for $host" "$LINENO" 5

;;
esac
_PYTHON_HOST_PLATFORM="$MACHDEP${_host_cpu:+-$_host_cpu}"

fi

# Some systems cannot stand _XOPEN_SOURCE being defined at all; they
Expand Down
45 changes: 18 additions & 27 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -529,33 +529,24 @@ AS_VAR_SET_IF([MACHDEP], [], [
AC_MSG_RESULT([$MACHDEP])

AC_SUBST(_PYTHON_HOST_PLATFORM)
if test "$cross_compiling" = yes; then
case "$host" in
*-*-linux*)
case "$host_cpu" in
arm*)
_host_cpu=arm
;;
*)
_host_cpu=$host_cpu
esac
;;
*-*-cygwin*)
_host_cpu=
;;
*-*-vxworks*)
_host_cpu=$host_cpu
;;
wasm32-*-* | wasm64-*-*)
_host_cpu=$host_cpu
;;
*)
# for now, limit cross builds to known configurations
MACHDEP="unknown"
AC_MSG_ERROR([cross build not supported for $host])
esac
_PYTHON_HOST_PLATFORM="$MACHDEP${_host_cpu:+-$_host_cpu}"
fi
AS_VAR_IF([cross_compiling], [yes], [
AS_CASE([$host],
[*-*-linux*], [
AS_CASE([$host_cpu],
[arm*], [_host_cpu=arm],
[_host_cpu=$host_cpu]
)
],
[*-*-cygwin*], [_host_cpu=],
[*-*-vxworks*], [_host_cpu=$host_cpu],
[wasm32-*-*|wasm64-*-*], [_host_cpu=$host_cpu],
[dnl For now, limit cross builds to known configurations.
MACHDEP="unknown"
AC_MSG_ERROR([cross build not supported for $host])
]
)
_PYTHON_HOST_PLATFORM="$MACHDEP${_host_cpu:+-$_host_cpu}"
])

# Some systems cannot stand _XOPEN_SOURCE being defined at all; they
# disable features if it is defined, without any means to access these
Expand Down