]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-32033: Finalize WASI configure options (GH-32053)
authorChristian Heimes <christian@python.org>
Tue, 22 Mar 2022 17:42:09 +0000 (19:42 +0200)
committerGitHub <noreply@github.com>
Tue, 22 Mar 2022 17:42:09 +0000 (18:42 +0100)
Tools/wasm/config.site-wasm32-wasi
configure
configure.ac
pyconfig.h.in

index be26c46a148fe73e2b87d2f3f33adcf896624d69..255e99c279a0a31e609478ab7d3965b472c34305 100644 (file)
@@ -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
index 5ebcadd64239d9eac4b99b562a09a77b9ab6671a..128e36a80062a2741d5507a6821c54a87dd3d4a4 100755 (executable)
--- a/configure
+++ b/configure
@@ -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
        ;;
@@ -21460,6 +21468,28 @@ case $ac_sys_system/$ac_sys_emscripten_target in #(
     py_cv_module_syslog=n/a
     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
+
    ;; #(
   *) :
 
index 4afc898e81d503942fe3aa82de0a8885ed3265f5..6fd95f7704aced285f766ed94e42ac4f680b21a4 100644 (file)
@@ -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])]
 )
 
index 40952883853e322eb86af986941bafa049881ab2..ccbf90041d1c466bac77aeaf9138d8993292603a 100644 (file)
 /* 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