Skip to content

Commit ee1e2c6

Browse files
authored
bpo-40280: Use Setup.stdlib static for wasm builds (GH-29784)
``Modules/Setup.stdlib`` contains ``Setup`` lines for all stdlib extension modules for which ``configure`` has detected their dependencies. The file is not used yet and still under development. To use the file, do ``ln -sfr Modules/Setup.stdlib Modules/Setup.local``.
1 parent cd876c8 commit ee1e2c6

File tree

3 files changed

+19
-2
lines changed

3 files changed

+19
-2
lines changed

Modules/Setup.stdlib.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222

2323

2424
# Build modules statically or as shared extensions
25-
*shared*
26-
# *static*
25+
# *shared* / *static*
26+
*@MODULE_BUILDTYPE@*
2727

2828

2929
############################################################################

configure

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -770,6 +770,7 @@ MODULE_TIME_FALSE
770770
MODULE_TIME_TRUE
771771
MODULE__IO_FALSE
772772
MODULE__IO_TRUE
773+
MODULE_BUILDTYPE
773774
TEST_MODULES
774775
LIBRARY_DEPS
775776
STATIC_LIBPYTHON
@@ -21012,6 +21013,15 @@ case $ac_sys_system in #(
2101221013
;;
2101321014
esac
2101421015

21016+
case $host_cpu in #(
21017+
wasm32|wasm64) :
21018+
MODULE_BUILDTYPE=static ;; #(
21019+
*) :
21020+
MODULE_BUILDTYPE=${MODULE_BUILDTYPE:-shared}
21021+
;;
21022+
esac
21023+
21024+
2101521025

2101621026
MODULE_BLOCK=
2101721027

configure.ac

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6185,6 +6185,13 @@ AS_CASE([$ac_sys_system],
61856185
[py_stdlib_not_available="_scproxy"]
61866186
)
61876187

6188+
dnl Default value for Modules/Setup.stdlib build type
6189+
AS_CASE([$host_cpu],
6190+
[wasm32|wasm64], [MODULE_BUILDTYPE=static],
6191+
[MODULE_BUILDTYPE=${MODULE_BUILDTYPE:-shared}]
6192+
)
6193+
AC_SUBST([MODULE_BUILDTYPE])
6194+
61886195
dnl _MODULE_BLOCK_ADD([VAR], [VALUE])
61896196
dnl internal: adds $1=quote($2) to MODULE_BLOCK
61906197
AC_DEFUN([_MODULE_BLOCK_ADD], [AS_VAR_APPEND([MODULE_BLOCK], ["$1=_AS_QUOTE([$2])$as_nl"])])

0 commit comments

Comments
 (0)