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
22 changes: 18 additions & 4 deletions getting-started/setup-building.rst
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you click macOS from the front page:

See also more detailed instructions, how to install and build dependencies, and the platform-specific pages for Unix, macOS, and Windows.

That takes you to this tab:

https://cpython-devguide--1794.org.readthedocs.build/getting-started/setup-building/#macos

Which includes this (and a 3.10 version):

$ GDBM_CFLAGS="-I$(brew --prefix gdbm)/include" \
   GDBM_LIBS="-L$(brew --prefix gdbm)/lib -lgdbm" \
   ./configure --with-pydebug \
               --with-openssl="$(brew --prefix openssl@3)"

Let's include --config-cache in those:

$ GDBM_CFLAGS="-I$(brew --prefix gdbm)/include" \
   GDBM_LIBS="-L$(brew --prefix gdbm)/lib -lgdbm" \
   ./configure --config-cache \
               --with-pydebug \
               --with-openssl="$(brew --prefix openssl@3)"

Copy link
Copy Markdown
Member Author

@johnslavik johnslavik Apr 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh I just reverted that in 69463e6. If you want me to add these back, I'll add.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's add it back, it's good to have useful snippets because people will copy and paste them (at least I do :)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added back to all 4 (brew, macports).

Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,16 @@ Configuration is typically::
More flags are available to ``configure``, but this is the minimum you should
do to get a pydebug build of CPython.

.. tip::
To speed up repeated ``configure`` runs, use ``--config-cache`` (short:
``-C``, equivalent: ``--cache-file=config.cache``)::
Comment on lines +201 to +202
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this saying -C is short for --cache-file=config.cache?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. What I meant to say precisely is that -C = --config-cache = --config-file=config.cache.


$ ./configure --config-cache --with-pydebug

This caches results in a ``config.cache`` file. If you switch compilers or
significantly change your build environment, delete ``config.cache`` before
re-running ``configure``.

.. note::
You might need to run ``make clean`` before or after re-running ``configure``
in a particular build directory.
Expand Down Expand Up @@ -864,7 +874,8 @@ some of CPython's modules (for example, ``zlib``).

$ GDBM_CFLAGS="-I$(brew --prefix gdbm)/include" \
GDBM_LIBS="-L$(brew --prefix gdbm)/lib -lgdbm" \
./configure --with-pydebug \
./configure --config-cache \
--with-pydebug \
--with-openssl="$(brew --prefix openssl@3)"

.. tab:: Python 3.10
Expand All @@ -873,7 +884,8 @@ some of CPython's modules (for example, ``zlib``).

$ CPPFLAGS="-I$(brew --prefix gdbm)/include -I$(brew --prefix xz)/include" \
LDFLAGS="-L$(brew --prefix gdbm)/lib -L$(brew --prefix xz)/lib" \
./configure --with-pydebug \
./configure --config-cache \
--with-pydebug \
--with-openssl="$(brew --prefix openssl@3)" \
--with-tcltk-libs="$(pkg-config --libs tcl tk)" \
--with-tcltk-includes="$(pkg-config --cflags tcl tk)" \
Expand All @@ -895,7 +907,8 @@ some of CPython's modules (for example, ``zlib``).

$ GDBM_CFLAGS="-I$(dirname $(dirname $(which port)))/include" \
GDBM_LIBS="-L$(dirname $(dirname $(which port)))/lib -lgdbm" \
./configure --with-pydebug \
./configure --config-cache \
--with-pydebug \
--with-system-libmpdec

.. tab:: Python 3.11-3.12
Expand All @@ -904,7 +917,8 @@ some of CPython's modules (for example, ``zlib``).

$ GDBM_CFLAGS="-I$(dirname $(dirname $(which port)))/include" \
GDBM_LIBS="-L$(dirname $(dirname $(which port)))/lib -lgdbm" \
./configure --with-pydebug
./configure --config-cache \
--with-pydebug

And finally, run ``make``::

Expand Down
4 changes: 2 additions & 2 deletions index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,13 @@ instructions please see the :ref:`setup guide <setup>`.

.. code-block:: shell

./configure --with-pydebug && make -j $(nproc)
./configure --config-cache --with-pydebug && make -j $(nproc)

.. tab:: macOS

.. code-block:: shell

./configure --with-pydebug && make -j8
./configure --config-cache --with-pydebug && make -j8

.. tab:: Windows

Expand Down
Loading