mirror of
https://github.com/python/cpython.git
synced 2025-09-26 10:19:53 +00:00
gh-101100: Documenting --prefix and --exec-prefix. (GH-102695)
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
This commit is contained in:
parent
afa6092ee4
commit
61b9ff35cb
5 changed files with 24 additions and 8 deletions
|
@ -513,7 +513,7 @@ Process-wide parameters
|
|||
program name is ``'/usr/local/bin/python'``, the prefix is ``'/usr/local'``. The
|
||||
returned string points into static storage; the caller should not modify its
|
||||
value. This corresponds to the :makevar:`prefix` variable in the top-level
|
||||
:file:`Makefile` and the ``--prefix`` argument to the :program:`configure`
|
||||
:file:`Makefile` and the :option:`--prefix` argument to the :program:`configure`
|
||||
script at build time. The value is available to Python code as ``sys.prefix``.
|
||||
It is only useful on Unix. See also the next function.
|
||||
|
||||
|
|
|
@ -78,19 +78,19 @@ used by extension writers. Structure member names do not have a reserved prefix.
|
|||
|
||||
The header files are typically installed with Python. On Unix, these are
|
||||
located in the directories :file:`{prefix}/include/pythonversion/` and
|
||||
:file:`{exec_prefix}/include/pythonversion/`, where :envvar:`prefix` and
|
||||
:envvar:`exec_prefix` are defined by the corresponding parameters to Python's
|
||||
:file:`{exec_prefix}/include/pythonversion/`, where :option:`prefix <--prefix>` and
|
||||
:option:`exec_prefix <--exec-prefix>` are defined by the corresponding parameters to Python's
|
||||
:program:`configure` script and *version* is
|
||||
``'%d.%d' % sys.version_info[:2]``. On Windows, the headers are installed
|
||||
in :file:`{prefix}/include`, where :envvar:`prefix` is the installation
|
||||
in :file:`{prefix}/include`, where ``prefix`` is the installation
|
||||
directory specified to the installer.
|
||||
|
||||
To include the headers, place both directories (if different) on your compiler's
|
||||
search path for includes. Do *not* place the parent directories on the search
|
||||
path and then use ``#include <pythonX.Y/Python.h>``; this will break on
|
||||
multi-platform builds since the platform independent headers under
|
||||
:envvar:`prefix` include the platform specific headers from
|
||||
:envvar:`exec_prefix`.
|
||||
:option:`prefix <--prefix>` include the platform specific headers from
|
||||
:option:`exec_prefix <--exec-prefix>`.
|
||||
|
||||
C++ users should note that although the API is defined entirely using C, the
|
||||
header files properly declare the entry points to be ``extern "C"``. As a result,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue