10000 bpo-40280: Emscripten systems use .wasm suffix by default (GH-29842) · python/cpython@6ac3c8a · GitHub
[go: up one dir, main page]

Skip to content

Commit 6ac3c8a

Browse files
authored
bpo-40280: Emscripten systems use .wasm suffix by default (GH-29842)
1 parent c1dec95 commit 6ac3c8a

File tree

4 files changed

+43
-16
lines changed

4 files changed

+43
-16
lines changed

Doc/using/configure.rst

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,11 @@ General Options
5353
Set the Python executable suffix to *SUFFIX*.
5454

5555
The default suffix is ``.exe`` on Windows and macOS (``python.exe``
56-
executable), and an empty string on other platforms (``python`` executable).
56+
executable), ``.wasm`` on Emscripten (``python.wasm`` executable), and
57+
an empty string on other platforms (``python`` executable).
58+
59+
.. versionchanged:: 3.11
60+
The default suffix on Emscripten platform is ``.wasm``.
5761

5862
.. cmdoption:: --with-tzpath=<list of absolute paths separated by pathsep>
5963

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Emscripten platform now uses ``.wasm`` suffix by default.

configure

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1738,7 +1738,8 @@ Optional Packages:
17381738
--with-cxx-main[=COMPILER]
17391739
compile main() and link Python executable with C++
17401740
compiler specified in COMPILER (default is $CXX)
1741-
--with-suffix=SUFFIX set executable suffix to SUFFIX (default is '.exe')
1741+
--with-suffix=SUFFIX set executable suffix to SUFFIX (default is empty,
1742+
yes is mapped to '.exe')
17421743
--with-pydebug build with Py_DEBUG defined (default is no)
17431744
--with-trace-refs enable tracing references for debugging purpose
17441745
(default is no)
@@ -6136,11 +6137,26 @@ $as_echo_n "checking for --with-suffix... " >&6; }
61366137
# Check whether --with-suffix was given.
61376138
if test "${with_suffix+set}" = set; then :
61386139
withval=$with_suffix;
6139-
case $withval in
6140-
no) EXEEXT=;;
6141-
yes) EXEEXT=.exe;;
6142-
*) EXEEXT=$withval;;
6143-
esac
6140+
case $with_suffix in #(
6141+
no) :
6142+
EXEEXT= ;; #(
6143+
yes) :
6144+
EXEEXT=.exe ;; #(
6145+
*) :
6146+
EXEEXT=$with_suffix
6147+
;;
6148+
esac
6149+
6150+
else
6151+
6152+
case $ac_sys_system in #(
6153+
Emscripten) :
6154+
EXEEXT=.wasm ;; #(
6155+
*) :
6156+
EXEEXT=
6157+
;;
6158+
esac
6159+
61446160
fi
61456161

61466162
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $EXEEXT" >&5

configure.ac

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1018,16 +1018,22 @@ atheos*|Linux*/1*)
10181018
exit 1;;
10191019
esac
10201020

1021-
AC_MSG_CHECKING(for --with-suffix)
1022-
AC_ARG_WITH(suffix,
1023-
AS_HELP_STRING([--with-suffix=SUFFIX], [set executable suffix to SUFFIX (default is '.exe')]),
1021+
AC_MSG_CHECKING([for --with-suffix])
1022+
AC_ARG_WITH([suffix],
1023+
[AS_HELP_STRING([--with-suffix=SUFFIX], [set executable suffix to SUFFIX (default is empty, yes is mapped to '.exe')])],
10241024
[
1025-
case $withval in
1026-
no) EXEEXT=;;
1027-
yes) EXEEXT=.exe;;
1028-
*) EXEEXT=$withval;;
1029-
esac])
1030-
AC_MSG_RESULT($EXEEXT)
1025+
AS_CASE([$with_suffix],
1026+
[no], [EXEEXT=],
1027+
[yes], [EXEEXT=.exe],
1028+
[EXEEXT=$with_suffix]
1029+
)
1030+
], [
1031+
AS_CASE([$ac_sys_system],
1032+
[Emscripten], [EXEEXT=.wasm],
1033+
[EXEEXT=]
1034+
)
1035+
])
1036+
AC_MSG_RESULT([$EXEEXT])
10311037

10321038
# Test whether we're running on a non-case-sensitive system, in which
10331039
# case we give a warning if no ext is given

0 commit comments

Comments
 (0)
0