Skip to content

Commit bef189b

Browse files
miss-islingtonJulienPalarderlend-aasland
authored
pythongh-101100: Documenting --prefix and --exec-prefix. (pythonGH-102695)
(cherry picked from commit 61b9ff3) Co-authored-by: Julien Palard <julien@palard.fr> Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
1 parent 087fb56 commit bef189b

File tree

5 files changed

+24
-8
lines changed

5 files changed

+24
-8
lines changed

Doc/c-api/init.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,7 @@ Process-wide parameters
391391
program name is ``'/usr/local/bin/python'``, the prefix is ``'/usr/local'``. The
392392
returned string points into static storage; the caller should not modify its
393393
value. This corresponds to the :makevar:`prefix` variable in the top-level
394-
:file:`Makefile` and the ``--prefix`` argument to the :program:`configure`
394+
:file:`Makefile` and the :option:`--prefix` argument to the :program:`configure`
395395
script at build time. The value is available to Python code as ``sys.prefix``.
396396
It is only useful on Unix. See also the next function.
397397

Doc/c-api/intro.rst

+5-5
Original file line numberDiff line numberDiff line change
@@ -78,19 +78,19 @@ used by extension writers. Structure member names do not have a reserved prefix.
7878

7979
The header files are typically installed with Python. On Unix, these are
8080
located in the directories :file:`{prefix}/include/pythonversion/` and
81-
:file:`{exec_prefix}/include/pythonversion/`, where :envvar:`prefix` and
82-
:envvar:`exec_prefix` are defined by the corresponding parameters to Python's
81+
:file:`{exec_prefix}/include/pythonversion/`, where :option:`prefix <--prefix>` and
82+
:option:`exec_prefix <--exec-prefix>` are defined by the corresponding parameters to Python's
8383
:program:`configure` script and *version* is
8484
``'%d.%d' % sys.version_info[:2]``. On Windows, the headers are installed
85-
in :file:`{prefix}/include`, where :envvar:`prefix` is the installation
85+
in :file:`{prefix}/include`, where ``prefix`` is the installation
8686
directory specified to the installer.
8787

8888
To include the headers, place both directories (if different) on your compiler's
8989
search path for includes. Do *not* place the parent directories on the search
9090
path and then use ``#include <pythonX.Y/Python.h>``; this will break on
9191
multi-platform builds since the platform independent headers under
92-
:envvar:`prefix` include the platform specific headers from
93-
:envvar:`exec_prefix`.
92+
:option:`prefix <--prefix>` include the platform specific headers from
93+
:option:`exec_prefix <--exec-prefix>`.
9494

9595
C++ users should note that although the API is defined entirely using C, the
9696
header files properly declare the entry points to be ``extern "C"``. As a result,

Doc/library/sys.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -1254,7 +1254,7 @@ always available.
12541254

12551255
A string giving the site-specific directory prefix where the platform
12561256
independent Python files are installed; on Unix, the default is
1257-
``'/usr/local'``. This can be set at build time with the ``--prefix``
1257+
:file:`/usr/local`. This can be set at build time with the :option:`--prefix`
12581258
argument to the :program:`configure` script. See
12591259
:ref:`installation_paths` for derived paths.
12601260

Doc/using/configure.rst

+16
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,22 @@ General Options
120120
Install Options
121121
---------------
122122

123+
.. cmdoption:: --prefix=PREFIX
124+
125+
Install architecture-independent files in PREFIX. On Unix, it
126+
defaults to :file:`/usr/local`.
127+
128+
This value can be retrived at runtime using :data:`sys.prefix`.
129+
130+
As an example, one can use ``--prefix="$HOME/.local/"`` to install
131+
a Python in its home directory.
132+
133+
.. cmdoption:: --exec-prefix=EPREFIX
134+
135+
Install architecture-dependent files in EPREFIX, defaults to :option:`--prefix`.
136+
137+
This value can be retrived at runtime using :data:`sys.exec_prefix`.
138+
123139
.. cmdoption:: --disable-test-modules
124140

125141
Don't build nor install test modules, like the :mod:`test` package or the

Doc/using/unix.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ Python-related paths and files
9393
==============================
9494

9595
These are subject to difference depending on local installation conventions;
96-
:envvar:`prefix` (``${prefix}``) and :envvar:`exec_prefix` (``${exec_prefix}``)
96+
:option:`prefix <--prefix>` and :option:`exec_prefix <--exec-prefix>`
9797
are installation-dependent and should be interpreted as for GNU software; they
9898
may be the same.
9999

0 commit comments

Comments
 (0)