@@ -462,7 +462,7 @@ used in ``python.sh``:
462
462
Emscripten
463
463
----------
464
464
465
- Emscripten _ is a complete open source compiler toolchain. It compiles C/C++ code
465
+ Emscripten _ is a complete open- source compiler toolchain. It compiles C/C++ code
466
466
into WebAssembly _/JavaScript executables, for use in JavaScript runtimes,
467
467
including browsers and Node.js.
468
468
@@ -474,10 +474,10 @@ including browsers and Node.js.
474
474
To build for Emscripten, you will need to cross-compile CPython. This requires a
475
475
C compiler just like building for :ref: `Unix <unix-compiling >` as well as:
476
476
477
- 1. The Emscripten compiler
478
- 2. Node.js
477
+ * The Emscripten compiler
478
+ * Node.js
479
479
480
- The simplest way to install the Emscripten compiler is as follows :
480
+ The simplest way to install the Emscripten compiler is:
481
481
482
482
.. code-block :: sh
483
483
@@ -488,7 +488,7 @@ The simplest way to install the Emscripten compiler is as follows:
488
488
source ./emsdk/emsdk_env.sh
489
489
490
490
Building for Emscripten requires doing a cross-build where you have a *build *
491
- Python to help produce a Emscripten build of CPython. This means you build
491
+ Python to help produce an Emscripten build of CPython. This means you build
492
492
CPython twice: once to have a version of Python for the build system to use and
493
493
another that's the build you ultimately care about (that is, the build Python is
494
494
not meant for use by you directly, only the build system).
@@ -499,7 +499,7 @@ version of Python you have installed on your machine):
499
499
500
500
.. code-block :: shell
501
501
502
- $ python3 Tools/wasm/emscripten build --quiet -- --config-cache --with-pydebug
502
+ python3 Tools/wasm/emscripten build --quiet -- --config-cache --with-pydebug
503
503
504
504
That single command will configure and build both the build Python and the
505
505
Emscripten build in ``cross-build/build `` and
@@ -510,35 +510,35 @@ is a convenience wrapper around the following commands:
510
510
511
511
.. code-block :: shell
512
512
513
- $ python Tools/wasm/emscripten configure-build-python --quiet -- --config-cache --with-pydebug
514
- $ python Tools/wasm/emscripten make-build-python --quiet
515
- $ python Tools/wasm/emscripten make-libffi --quiet
516
- $ python Tools/wasm/emscripten configure-host --quiet -- --config-cache
517
- $ python Tools/wasm/emscripten make-host --quiet
513
+ python Tools/wasm/emscripten configure-build-python --quiet -- --config-cache --with-pydebug
514
+ python Tools/wasm/emscripten make-build-python --quiet
515
+ python Tools/wasm/emscripten make-libffi --quiet
516
+ python Tools/wasm/emscripten configure-host --quiet -- --config-cache
517
+ python Tools/wasm/emscripten make-host --quiet
518
518
519
519
.. note ::
520
520
521
521
The ``configure-host `` command infers the use of ``--with-pydebug `` from the
522
522
build Python.
523
523
524
- Running the separate commands after ``emscripten build `` is useful if you, for example, only want to
525
- run the ``make-host `` step after making code changes.
524
+ Running the separate commands after ``emscripten build `` is useful if you, for
525
+ example, only want to run the ``make-host `` step after making code changes.
526
526
527
527
Once everything is complete, there will be a
528
528
``cross-build/wasm32-emscripten/build/python/python.sh `` helper file which you
529
529
can use to run the ``python.mjs `` file:
530
530
531
531
.. code-block :: shell
532
532
533
- $ cross-build/wasm32-emscripten/build/python/python.sh --version
533
+ cross-build/wasm32-emscripten/build/python/python.sh --version
534
534
535
535
You can also use ``Makefile `` targets and they will work as expected thanks to
536
536
the ``HOSTRUNNER `` environment variable having been set to a similar value as
537
537
used in ``python.sh ``:
538
538
539
539
.. code-block :: shell
540
540
541
- $ make -C cross-build/wasm32-emscripten/build/python/ test
541
+ make -C cross-build/wasm32-emscripten/build/python/ test
542
542
543
543
544
544
.. _Emscripten : https://emscripten.org/
0 commit comments