Skip to content

Commit 939f5a6

Browse files
JulienPalarderlend-aasland
authored andcommitted
pythongh-101100: Documenting --prefix and --exec-prefix. (pythonGH-102695)
Co-authored-by: Erlend E. Aasland <[email protected]>
1 parent 06915ed commit 939f5a6

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
@@ -513,7 +513,7 @@ Process-wide parameters
513513
program name is ``'/usr/local/bin/python'``, the prefix is ``'/usr/local'``. The
514514
returned string points into static storage; the caller should not modify its
515515
value. This corresponds to the :makevar:`prefix` variable in the top-level
516-
:file:`Makefile` and the ``--prefix`` argument to the :program:`configure`
516+
:file:`Makefile` and the :option:`--prefix` argument to the :program:`configure`
517517
script at build time. The value is available to Python code as ``sys.prefix``.
518518
It is only useful on Unix. See also the next function.
519519

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
@@ -1323,7 +1323,7 @@ always available.
13231323

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

Doc/using/configure.rst

+16
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,22 @@ WebAssembly Options
216216
Install Options
217217
---------------
218218

219+
.. cmdoption:: --prefix=PREFIX
220+
221+
Install architecture-independent files in PREFIX. On Unix, it
222+
defaults to :file:`/usr/local`.
223+
224+
This value can be retrived at runtime using :data:`sys.prefix`.
225+
226+
As an example, one can use ``--prefix="$HOME/.local/"`` to install
227+
a Python in its home directory.
228+
229+
.. cmdoption:: --exec-prefix=EPREFIX
230+
231+
Install architecture-dependent files in EPREFIX, defaults to :option:`--prefix`.
232+
233+
This value can be retrived at runtime using :data:`sys.exec_prefix`.
234+
219235
.. cmdoption:: --disable-test-modules
220236

221237
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)