Skip to content

Commit

Permalink
pythongh-90539: doc: Expand on what should not go into CFLAGS, LDFLAGS (
Browse files Browse the repository at this point in the history
pythonGH-92754)

(cherry picked from commit 61f24e7)

Co-authored-by: Matthias Köppe <[email protected]>
  • Loading branch information
mkoeppe authored and miss-islington committed Jun 20, 2022
1 parent 96254a9 commit 066dae9
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions Doc/using/configure.rst
Original file line number Diff line number Diff line change
Expand Up @@ -748,6 +748,17 @@ Compiler flags
extensions. Use it when a compiler flag should *not* be part of the
distutils :envvar:`CFLAGS` once Python is installed (:issue:`21121`).

In particular, :envvar:`CFLAGS` should not contain:

* the compiler flag `-I` (for setting the search path for include files).
The `-I` flags are processed from left to right, and any flags in
:envvar:`CFLAGS` would take precedence over user- and package-supplied `-I`
flags.

* hardening flags such as `-Werror` because distributions cannot control
whether packages installed by users conform to such heightened
standards.

.. versionadded:: 3.5

.. envvar:: EXTRA_CFLAGS
Expand Down Expand Up @@ -860,6 +871,13 @@ Linker flags
:envvar:`CFLAGS_NODIST`. Use it when a linker flag should *not* be part of
the distutils :envvar:`LDFLAGS` once Python is installed (:issue:`35257`).

In particular, :envvar:`LDFLAGS` should not contain:

* the compiler flag `-L` (for setting the search path for libraries).
The `-L` flags are processed from left to right, and any flags in
:envvar:`LDFLAGS` would take precedence over user- and package-supplied `-L`
flags.

.. envvar:: CONFIGURE_LDFLAGS_NODIST

Value of :envvar:`LDFLAGS_NODIST` variable passed to the ``./configure``
Expand Down

0 comments on commit 066dae9

Please sign in to comment.