]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/doc/install/final-installation.rst
6870209262127b894ee2d27f2f67f09a949a27cc
[thirdparty/gcc.git] / gcc / doc / install / final-installation.rst
1 ..
2 Copyright 1988-2022 Free Software Foundation, Inc.
3 This is part of the GCC manual.
4 For copying conditions, see the copyright.rst file.
5
6 .. _final-install:
7
8 Final installation
9 ------------------
10
11 Now that GCC has been built (and optionally tested), you can install it with
12
13 .. code-block:: bash
14
15 cd objdir && make install
16
17 We strongly recommend to install into a target directory where there is
18 no previous version of GCC present. Also, the GNAT runtime should not
19 be stripped, as this would break certain features of the debugger that
20 depend on this debugging information (catching Ada exceptions for
21 instance).
22
23 That step completes the installation of GCC; user level binaries can
24 be found in :samp:`{prefix}/bin` where :samp:`{prefix}` is the value
25 you specified with the :option:`--prefix` to configure (or
26 :samp:`/usr/local` by default). (If you specified :option:`--bindir`,
27 that directory will be used instead; otherwise, if you specified
28 :option:`--exec-prefix`, :samp:`{exec-prefix}/bin` will be used.)
29 Headers for the C++ library are installed in
30 :samp:`{prefix}/include`; libraries in :samp:`{libdir}`
31 (normally :samp:`{prefix}/lib`); internal parts of the compiler in
32 :samp:`{libdir}/gcc` and :samp:`{libexecdir}/gcc`; documentation
33 in info format in :samp:`{infodir}` (normally
34 :samp:`{prefix}/info`).
35
36 When installing cross-compilers, GCC's executables
37 are not only installed into :samp:`{bindir}`, that
38 is, :samp:`{exec-prefix}/bin`, but additionally into
39 :samp:`{exec-prefix}/{target-alias}/bin`, if that directory
40 exists. Typically, such :dfn:`tooldirs` hold target-specific
41 binutils, including assembler and linker.
42
43 Installation into a temporary staging area or into a :command:`chroot`
44 jail can be achieved with the command
45
46 .. code-block:: bash
47
48 make DESTDIR=path-to-rootdir install
49
50 where :samp:`{path-to-rootdir}` is the absolute path of
51 a directory relative to which all installation paths will be
52 interpreted. Note that the directory specified by ``DESTDIR``
53 need not exist yet; it will be created if necessary.
54
55 There is a subtle point with tooldirs and ``DESTDIR`` :
56 If you relocate a cross-compiler installation with
57 e.g. :samp:`DESTDIR={rootdir}`, then the directory
58 :samp:`{rootdir}/{exec-prefix}/{target-alias}/bin` will
59 be filled with duplicated GCC executables only if it already exists,
60 it will not be created otherwise. This is regarded as a feature,
61 not as a bug, because it gives slightly more control to the packagers
62 using the ``DESTDIR`` feature.
63
64 You can install stripped programs and libraries with
65
66 .. code-block:: bash
67
68 make install-strip
69
70 If you are bootstrapping a released version of GCC then please
71 quickly review the build status page for your release, available from
72 https://gcc.gnu.org/buildstat.html.
73 If your system is not listed for the version of GCC that you built,
74 send a note to
75 gcc@gcc.gnu.org indicating
76 that you successfully built and installed GCC.
77 Include the following information:
78
79 * Output from running :samp:`{srcdir}/config.guess`. Do not send
80 that file itself, just the one-line output from running it.
81
82 * The output of :samp:`gcc -v` for your newly installed :command:`gcc`.
83 This tells us which version of GCC you built and the options you passed to
84 configure.
85
86 * Whether you enabled all languages or a subset of them. If you used a
87 full distribution then this information is part of the configure
88 options in the output of :samp:`gcc -v`, but if you downloaded the
89 'core' compiler plus additional front ends then it isn't apparent
90 which ones you built unless you tell us about it.
91
92 * If the build was for GNU/Linux, also include:
93
94 * The distribution name and version (e.g., Red Hat 7.1 or Debian 2.2.3);
95 this information should be available from :samp:`/etc/issue`.
96
97 * The version of the Linux kernel, available from :samp:`uname --version`
98 or :samp:`uname -a`.
99
100 * The version of glibc you used; for RPM-based systems like Red Hat,
101 Mandrake, and SuSE type :samp:`rpm -q glibc` to get the glibc version,
102 and on systems like Debian and Progeny use :samp:`dpkg -l libc6`.
103
104 For other systems, you can include similar information if you think it is
105 relevant.
106
107 * Any other information that you think would be useful to people building
108 GCC on the same configuration. The new entry in the build status list
109 will include a link to the archived copy of your message.
110
111 We'd also like to know if the
112 :ref:`specific`
113 didn't include your host/target information or if that information is
114 incomplete or out of date. Send a note to
115 gcc@gcc.gnu.org detailing how the information should be changed.
116
117 If you find a bug, please report it following the
118 `bug reporting guidelines <https://gcc.gnu.org/bugs/>`_.
119
120 If you want to print the GCC manuals, do :samp:`cd {objdir}; make pdf`
121 You will need to have Sphinx (version at least |needs_sphinx|)
122 and XeLaTex installed.
123 You can also `buy printed manuals from the
124 Free Software Foundation <https://shop.fsf.org/>`_, though such manuals may not be for the most
125 recent version of GCC.
126
127 If you would like to generate online HTML documentation, do :samp:`cd
128 {objdir}; make html`.