diff options
author | Christian Heimes <christian@python.org> | 2022-03-22 17:42:09 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-22 17:42:09 (GMT) |
commit | 4aea656d62860e78cd8384f2de375f0d4f1db579 (patch) | |
tree | fb22ac0872243fd981f091ebda38c646bc779305 | |
parent | 9b889b5bda32c2610f98114d94750ba5f3260b58 (diff) | |
download | cpython-4aea656d62860e78cd8384f2de375f0d4f1db579.zip cpython-4aea656d62860e78cd8384f2de375f0d4f1db579.tar.gz cpython-4aea656d62860e78cd8384f2de375f0d4f1db579.tar.bz2 |
bpo-32033: Finalize WASI configure options (GH-32053)
-rw-r--r-- | Tools/wasm/config.site-wasm32-wasi | 6 | ||||
-rwxr-xr-x | configure | 32 | ||||
-rw-r--r-- | configure.ac | 24 | ||||
-rw-r--r-- | pyconfig.h.in | 6 |
4 files changed, 64 insertions, 4 deletions
diff --git a/Tools/wasm/config.site-wasm32-wasi b/Tools/wasm/config.site-wasm32-wasi index be26c46..255e99c 100644 --- a/Tools/wasm/config.site-wasm32-wasi +++ b/Tools/wasm/config.site-wasm32-wasi @@ -1,8 +1,6 @@ # config.site override for cross compiling to wasm32-wasi platform # # Written by Christian Heimes <christian@python.org> -# Partly based on pyodide's pyconfig.undefs.h file. - # cannot be detected in cross builds ac_cv_buggy_getaddrinfo=no @@ -14,4 +12,8 @@ ac_cv_file__dev_ptc=no # dummy readelf, WASI build does not need readelf. ac_cv_prog_ac_ct_READELF=true +# get/setrlimit are not supported +ac_cv_header_sys_resource_h=no + +# undefined symbols / unsupported features ac_cv_func_eventfd=no @@ -7758,7 +7758,13 @@ case $ac_sys_system/$ac_sys_emscripten_target in #( $as_echo "#define _WASI_EMULATED_SIGNAL 1" >>confdefs.h - LIBS="$LIBS -lwasi-emulated-signal" + +$as_echo "#define _WASI_EMULATED_GETPID 1" >>confdefs.h + + +$as_echo "#define _WASI_EMULATED_PROCESS_CLOCKS 1" >>confdefs.h + + LIBS="$LIBS -lwasi-emulated-signal -lwasi-emulated-getpid -lwasi-emulated-process-clocks" echo "#define _WASI_EMULATED_SIGNAL 1" >> confdefs.h ;; #( @@ -20549,6 +20555,8 @@ else case $ac_sys_system in #( Emscripten) : with_ensurepip=no ;; #( + WASI) : + with_ensurepip=no ;; #( *) : with_ensurepip=upgrade ;; @@ -21461,6 +21469,28 @@ case $ac_sys_system/$ac_sys_emscripten_target in #( py_cv_module_=n/a ;; #( + WASI/*) : + + + + py_cv_module__ctypes=n/a + py_cv_module__ctypes_test=n/a + py_cv_module__curses=n/a + py_cv_module__curses_panel=n/a + py_cv_module__dbm=n/a + py_cv_module__gdbm=n/a + py_cv_module__scproxy=n/a + py_cv_module__tkinter=n/a + py_cv_module__xxsubinterpreters=n/a + py_cv_module_grp=n/a + py_cv_module_nis=n/a + py_cv_module_ossaudiodev=n/a + py_cv_module_pwd=n/a + py_cv_module_spwd=n/a + py_cv_module_syslog=n/a + py_cv_module_=n/a + + ;; #( *) : diff --git a/configure.ac b/configure.ac index 4afc898..6fd95f7 100644 --- a/configure.ac +++ b/configure.ac @@ -1898,7 +1898,9 @@ AS_CASE([$ac_sys_system/$ac_sys_emscripten_target], ], [WASI/*], [ AC_DEFINE([_WASI_EMULATED_SIGNAL], [1], [Define to 1 if you want to emulate signals on WASI]) - LIBS="$LIBS -lwasi-emulated-signal" + AC_DEFINE([_WASI_EMULATED_GETPID], [1], [Define to 1 if you want to emulate getpid() on WASI]) + AC_DEFINE([_WASI_EMULATED_PROCESS_CLOCKS], [1], [Define to 1 if you want to emulate process clocks on WASI]) + LIBS="$LIBS -lwasi-emulated-signal -lwasi-emulated-getpid -lwasi-emulated-process-clocks" echo "#define _WASI_EMULATED_SIGNAL 1" >> confdefs.h ] ) @@ -6078,6 +6080,7 @@ AC_ARG_WITH(ensurepip, [ AS_CASE([$ac_sys_system], [Emscripten], [with_ensurepip=no], + [WASI], [with_ensurepip=no], [with_ensurepip=upgrade] ) ]) @@ -6468,6 +6471,25 @@ AS_CASE([$ac_sys_system/$ac_sys_emscripten_target], [syslog], ) ], + [WASI/*], [ + PY_STDLIB_MOD_SET_NA( + [_ctypes], + [_ctypes_test], + [_curses], + [_curses_panel], + [_dbm], + [_gdbm], + [_scproxy], + [_tkinter], + [_xxsubinterpreters], + [grp], + [nis], + [ossaudiodev], + [pwd], + [spwd], + [syslog], + ) + ], [PY_STDLIB_MOD_SET_NA([_scproxy])] ) diff --git a/pyconfig.h.in b/pyconfig.h.in index 4095288..ccbf900 100644 --- a/pyconfig.h.in +++ b/pyconfig.h.in @@ -1728,6 +1728,12 @@ /* Define to force use of thread-safe errno, h_errno, and other functions */ #undef _REENTRANT +/* Define to 1 if you want to emulate getpid() on WASI */ +#undef _WASI_EMULATED_GETPID + +/* Define to 1 if you want to emulate process clocks on WASI */ +#undef _WASI_EMULATED_PROCESS_CLOCKS + /* Define to 1 if you want to emulate signals on WASI */ #undef _WASI_EMULATED_SIGNAL |