Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
82 changes: 69 additions & 13 deletions Doc/using/configure.rst
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ Dependencies to build optional modules are:
* - Dependency
- Minimum version
- Python module
* - `libbz2 <https://sourceware.org/bzip2/>`_
* - `libbz2 <https://sourceware.org/bzip2/>`_ or
`libbzip2-rs <https://github.com/trifectatechfoundation/libbzip2-rs>`_ [1]_
-
- :mod:`bz2`
* - `libffi <https://sourceware.org/libffi/>`_
Expand All @@ -82,47 +83,54 @@ Dependencies to build optional modules are:
- :mod:`lzma`
* - `libmpdec <https://www.bytereef.org/mpdecimal/doc/libmpdec/>`_
- 2.5.0
- :mod:`decimal` [1]_
- :mod:`decimal` [2]_
* - `libreadline <https://tiswww.case.edu/php/chet/readline/rltop.html>`_ or
`libedit <https://www.thrysoee.dk/editline/>`_ [2]_
`libedit <https://www.thrysoee.dk/editline/>`_ [3]_
-
- :mod:`readline`
* - `libuuid <https://linux.die.net/man/3/libuuid>`_
-
- ``_uuid`` [3]_
* - `ncurses <https://gnu.org/software/ncurses/ncurses.html>`_ [4]_
- ``_uuid`` [4]_
* - `ncurses <https://gnu.org/software/ncurses/ncurses.html>`_ [5]_
-
- :mod:`curses`
* - `OpenSSL <https://openssl-library.org/>`_
- | 3.0.18 recommended
| (1.1.1 minimum)
- :mod:`ssl`, :mod:`hashlib` [5]_
- :mod:`ssl`, :mod:`hashlib` [6]_
* - `SQLite <https://sqlite.org/>`_
- 3.15.2
- :mod:`sqlite3`
* - `Tcl/Tk <https://www.tcl-lang.org/>`_
- 8.5.12
- :mod:`tkinter`, :ref:`IDLE <idle>`, :mod:`turtle`
* - `zlib <https://www.zlib.net>`_
- 1.2.2.1
* - `zlib <https://www.zlib.net>`_,
`zlib-ng <https://github.com/zlib-ng/zlib-ng>`_, or
`zlib-rs <https://github.com/trifectatechfoundation/zlib-rs/>`_ [7]_
- | 1.2.2.1 (zlib, zlib-ng)
| 0.6.0 (zlib-rs)
- :mod:`zlib`, :mod:`gzip`, :mod:`ensurepip`
* - `zstd <https://facebook.github.io/zstd/>`_
- 1.4.5
- :mod:`compression.zstd`

.. [1] If *libmpdec* is not available, the :mod:`decimal` module will use
.. [1] See :option:`--with-bzip2` for choosing the backend for the
:mod:`bz2` module.
.. [2] If *libmpdec* is not available, the :mod:`decimal` module will use
a pure-Python implementation.
.. [2] See :option:`--with-readline` for choosing the backend for the
.. [3] See :option:`--with-readline` for choosing the backend for the
:mod:`readline` module.
.. [3] The :mod:`uuid` module uses ``_uuid`` to generate "safe" UUIDs.
.. [4] The :mod:`uuid` module uses ``_uuid`` to generate "safe" UUIDs.
See the module documentation for details.
.. [4] The :mod:`curses` module requires the ``libncurses`` or ``libncursesw``
.. [5] The :mod:`curses` module requires the ``libncurses`` or ``libncursesw``
library.
The :mod:`curses.panel` module additionally requires the ``libpanel`` or
``libpanelw`` library.
.. [5] If OpenSSL is not available, the :mod:`hashlib` module will use
.. [6] If OpenSSL is not available, the :mod:`hashlib` module will use
bundled implementations of several hash functions.
See :option:`--with-builtin-hashlib-hashes` for *forcing* usage of OpenSSL.
.. [7] See :option:`--with-zlib` for choosing the backend for the
:mod:`zlib` module.

Note that the table does not include all optional modules; in particular,
platform-specific modules like :mod:`winreg` are not listed here.
Expand Down Expand Up @@ -1113,6 +1121,54 @@ Libraries options

.. versionadded:: next

.. option:: --with-zlib=zlib|zlib-ng|zlib-rs

Designate the zlib implementation to build the :mod:`zlib` module against.

* ``zlib``: Use the system zlib library, found via ``pkg-config`` or as
``libz``.
* ``zlib-ng``: Same detection as ``zlib``, but fail unless the detected
library is `zlib-ng <https://github.com/zlib-ng/zlib-ng>`__.
* ``zlib-rs``: Use `zlib-rs
<https://github.com/trifectatechfoundation/zlib-rs/>`__, found via
``pkg-config`` as ``libz_rs``.

Without this option (or with ``--with-zlib=auto``, the default), the system
zlib is used when found; configure only fails when an implementation was
requested explicitly but cannot be found.

.. versionadded:: next

.. option:: --without-zlib

Don't build the :mod:`zlib` module, even when a zlib library is present
(built by default when one is found).

.. versionadded:: next

.. option:: --with-bzip2=bzip2|bzip2-rs

Designate the bzip2 implementation to build the :mod:`bz2` module against.

* ``bzip2``: Use the system bzip2 library, found via ``pkg-config`` or as
``libbz2``.
* ``bzip2-rs``: Use `libbzip2-rs
<https://github.com/trifectatechfoundation/libbzip2-rs>`__, found via
``pkg-config`` as ``libbz2_rs``.

Without this option (or with ``--with-bzip2=auto``, the default), the
system bzip2 is used when found; configure only fails when an
implementation was requested explicitly but cannot be found.

.. versionadded:: next

.. option:: --without-bzip2

Don't build the :mod:`bz2` module, even when a bzip2 library is present
(built by default when one is found).

.. versionadded:: next

.. option:: --with-libm=STRING

Override ``libm`` math library to *STRING* (default is system-dependent).
Expand Down
12 changes: 12 additions & 0 deletions Doc/whatsnew/3.16.rst
Original file line number Diff line number Diff line change
Expand Up @@ -823,6 +823,18 @@ Build changes

(Contributed by Serhiy Storchaka in :gh:`136687`.)

* Add the :option:`--with-zlib` and :option:`--with-bzip2` :program:`configure`
options to select the zlib and bzip2 implementations used to build the
:mod:`zlib` and :mod:`bz2` modules. In addition to the default system
libraries, they can build against `zlib-rs
<https://github.com/trifectatechfoundation/zlib-rs/>`__ and `libbzip2-rs
<https://github.com/trifectatechfoundation/libbzip2-rs>`__, and
``--with-zlib=zlib-ng`` verifies that the detected zlib is `zlib-ng
<https://github.com/zlib-ng/zlib-ng>`__. :option:`--without-zlib` and
:option:`--without-bzip2` exclude the modules from the build.

(Contributed by Stan Ulbrych in :gh:`139314`.)


C API changes
=============
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Add the :option:`--with-zlib` and :option:`--with-bzip2` :program:`configure`
options to select the zlib and bzip2 implementations used to build the
:mod:`zlib` and :mod:`bz2` modules. In addition to the default system
libraries, they can build against `zlib-rs
<https://github.com/trifectatechfoundation/zlib-rs/>`__ and `libbzip2-rs
<https://github.com/trifectatechfoundation/libbzip2-rs>`__, and
``--with-zlib=zlib-ng`` verifies that the detected zlib is `zlib-ng
<https://github.com/zlib-ng/zlib-ng>`__. :option:`--without-zlib` and
:option:`--without-bzip2` exclude the modules from the build.
Loading
Loading