]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-101100: Documenting --prefix and --exec-prefix. (GH-102695)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Wed, 15 Mar 2023 22:14:00 +0000 (15:14 -0700)
committerGitHub <noreply@github.com>
Wed, 15 Mar 2023 22:14:00 +0000 (15:14 -0700)
(cherry picked from commit 61b9ff35cbda0cc59816951a17de073968fc25c6)

Co-authored-by: Julien Palard <julien@palard.fr>
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
Doc/c-api/init.rst
Doc/c-api/intro.rst
Doc/library/sys.rst
Doc/using/configure.rst
Doc/using/unix.rst

index e1d2328c5f3163df2eaaea2a5a933bcf417c6df7..c453f3a14a5a0f12b1a84929db9fe89aae0e51de 100644 (file)
@@ -391,7 +391,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.
 
index 80713c565bb8d6aed865d5a37d893761e22514f1..7591537fe69f7e8e7b4df07a3d846d6df7db4d7e 100644 (file)
@@ -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,
index 315e570416b60dfa48fbba719ba67c3af899abb6..cf20d33ab6e82dceb02033e2914b35fc6ff8114a 100644 (file)
@@ -1254,7 +1254,7 @@ always available.
 
    A string giving the site-specific directory prefix where the platform
    independent Python files are installed; on Unix, the default is
-   ``'/usr/local'``.  This can be set at build time with the ``--prefix``
+   :file:`/usr/local`. This can be set at build time with the :option:`--prefix`
    argument to the :program:`configure` script.  See
    :ref:`installation_paths` for derived paths.
 
index 872283615f64f572a141bec3f89c70e72d3fc474..ab33e0a06f5145cfae12e42c4b381363020a787e 100644 (file)
@@ -120,6 +120,22 @@ General Options
 Install Options
 ---------------
 
+.. cmdoption:: --prefix=PREFIX
+
+   Install architecture-independent files in PREFIX. On Unix, it
+   defaults to :file:`/usr/local`.
+
+   This value can be retrived at runtime using :data:`sys.prefix`.
+
+   As an example, one can use ``--prefix="$HOME/.local/"`` to install
+   a Python in its home directory.
+
+.. cmdoption:: --exec-prefix=EPREFIX
+
+   Install architecture-dependent files in EPREFIX, defaults to :option:`--prefix`.
+
+   This value can be retrived at runtime using :data:`sys.exec_prefix`.
+
 .. cmdoption:: --disable-test-modules
 
    Don't build nor install test modules, like the :mod:`test` package or the
index 24c02c99f871d56adee38450d64a590b9afe90b0..067ff4cce5e48d413c52cb9ba5c620efcfe8e637 100644 (file)
@@ -93,7 +93,7 @@ Python-related paths and files
 ==============================
 
 These are subject to difference depending on local installation conventions;
-:envvar:`prefix` (``${prefix}``) and :envvar:`exec_prefix` (``${exec_prefix}``)
+:option:`prefix <--prefix>` and :option:`exec_prefix <--exec-prefix>`
 are installation-dependent and should be interpreted as for GNU software; they
 may be the same.