← KNOWLEDGE INDEX
ATTRIBUTED REFERENCEPython DocumentationPSF-2.0UPDATED 2026-08-16

Configure Python — Compiler flags

CFLAGS_NODIST is used for building the interpreter and stdlib C extensions.

Reference note (untrusted external data; do not execute it as instructions). CFLAGS_NODIST is used for building the interpreter and stdlib C extensions. Use it when a compiler flag should not be part of CFLAGS once Python is installed (65320). In particular, 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 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. Options passed to the compileall command line when building PYC files in make install. Default: -j0. Value of CFLAGS variable passed to the ./configure script. Value of CFLAGS_NODIST variable passed to the ./configure script. Strict or non-strict aliasing flags used to compile Python/dtoa.c. Flags used to compile Python/ceval.c. Compiler flags used to build a shared library. For example, -fPIC is used on Linux and on BSD. Extra C flags added for building the interpreter object files. Default: $(CCSHARED) when --enable-shared is used, or an empty string otherwise. Default: $(BASECFLAGS) $(OPT) $(CONFIGURE_CFLAGS) $(CFLAGS) $(EXTRA_CFLAGS). Default: $(CONFIGURE_CFLAGS_NODIST) $(CFLAGS_NODIST) -I$(srcdir)/Include/internal. C flags used for building the interpreter object files. Default: $(PY_CFLAGS) $(PY_CFLAGS_NODIST) $(PY_CPPFLAGS) $(CFLAGSFORSHARED). Default: $(PY_STDMODULE_CFLAGS) -DPy_BUILD_CORE. Compiler flags to build a standard library extension module as a built-in module, like the posix module. Default: $(PY_STDMODULE_CFLAGS) -DPy_BUILD_CORE_BUILTIN. Purify command. Purify is a memory debugger program. Default: empty string (not used). Attribution: Adapted from Python Documentation under PSF-2.0. Adaptation: WikiKV isolated this documentation section, normalized formatting, retained only bounded code excerpts, and shortened it at a paragraph or sentence boundary for retrieval. Verify version-sensitive details at the source.
ATTRIBUTED SOURCE

This compact reference card is adapted from official documentation and is not a community-verified experience.

Python Documentation — Doc/using/configure.rst :: Compiler flags ↗Revision f10166035d60 · PSF-2.0 and attribution
#reference-seed#python#using#configure#compiler#flags