finalinstall.html revision 1.17 1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2 <html>
3 <!-- Copyright (C) 1988-2024 Free Software Foundation, Inc.
4
5 Permission is granted to copy, distribute and/or modify this document
6 under the terms of the GNU Free Documentation License, Version 1.3 or
7 any later version published by the Free Software Foundation; with no
8 Invariant Sections, the Front-Cover texts being (a) (see below), and
9 with the Back-Cover Texts being (b) (see below). A copy of the
10 license is included in the section entitled "GNU
11 Free Documentation License".
12
13 (a) The FSF's Front-Cover Text is:
14
15 A GNU Manual
16
17 (b) The FSF's Back-Cover Text is:
18
19 You have freedom to copy and modify this GNU Manual, like GNU
20 software. Copies published by the Free Software Foundation raise
21 funds for GNU development. -->
22 <!-- Created by GNU Texinfo 6.5, http://www.gnu.org/software/texinfo/ -->
23 <head>
24 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
25 <title>Installing GCC: Final installation</title>
26
27 <meta name="description" content="Installing GCC: Final installation">
28 <meta name="keywords" content="Installing GCC: Final installation">
29 <meta name="resource-type" content="document">
30 <meta name="distribution" content="global">
31 <meta name="Generator" content="makeinfo">
32 <style type="text/css">
33 <!--
34 a.summary-letter {text-decoration: none}
35 blockquote.indentedblock {margin-right: 0em}
36 blockquote.smallindentedblock {margin-right: 0em; font-size: smaller}
37 blockquote.smallquotation {font-size: smaller}
38 div.display {margin-left: 3.2em}
39 div.example {margin-left: 3.2em}
40 div.lisp {margin-left: 3.2em}
41 div.smalldisplay {margin-left: 3.2em}
42 div.smallexample {margin-left: 3.2em}
43 div.smalllisp {margin-left: 3.2em}
44 kbd {font-style: oblique}
45 pre.display {font-family: inherit}
46 pre.format {font-family: inherit}
47 pre.menu-comment {font-family: serif}
48 pre.menu-preformatted {font-family: serif}
49 pre.smalldisplay {font-family: inherit; font-size: smaller}
50 pre.smallexample {font-size: smaller}
51 pre.smallformat {font-family: inherit; font-size: smaller}
52 pre.smalllisp {font-size: smaller}
53 span.nolinebreak {white-space: nowrap}
54 span.roman {font-family: initial; font-weight: normal}
55 span.sansserif {font-family: sans-serif; font-weight: normal}
56 ul.no-bullet {list-style: none}
57 -->
58 </style>
59
60
61 </head>
62
63 <body lang="en">
64 <h1 class="settitle" align="center">Installing GCC: Final installation</h1>
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91 <p>Now that GCC has been built (and optionally tested), you can install it with
92 </p><div class="smallexample">
93 <pre class="smallexample">cd <var>objdir</var> && make install
94 </pre></div>
95
96 <p>We strongly recommend to install into a target directory where there is
97 no previous version of GCC present. Also, the GNAT runtime should not
98 be stripped, as this would break certain features of the debugger that
99 depend on this debugging information (catching Ada exceptions for
100 instance).
101 </p>
102 <p>That step completes the installation of GCC; user level binaries can
103 be found in <samp><var>prefix</var>/bin</samp> where <var>prefix</var> is the value
104 you specified with the <samp>--prefix</samp> to configure (or
105 <samp>/usr/local</samp> by default). (If you specified <samp>--bindir</samp>,
106 that directory will be used instead; otherwise, if you specified
107 <samp>--exec-prefix</samp>, <samp><var>exec-prefix</var>/bin</samp> will be used.)
108 Headers for the C++ library are installed in
109 <samp><var>prefix</var>/include</samp>; libraries in <samp><var>libdir</var></samp>
110 (normally <samp><var>prefix</var>/lib</samp>); internal parts of the compiler in
111 <samp><var>libdir</var>/gcc</samp> and <samp><var>libexecdir</var>/gcc</samp>; documentation
112 in info format in <samp><var>infodir</var></samp> (normally
113 <samp><var>prefix</var>/info</samp>).
114 </p>
115 <p>When installing cross-compilers, GCC’s executables
116 are not only installed into <samp><var>bindir</var></samp>, that
117 is, <samp><var>exec-prefix</var>/bin</samp>, but additionally into
118 <samp><var>exec-prefix</var>/<var>target-alias</var>/bin</samp>, if that directory
119 exists. Typically, such <em>tooldirs</em> hold target-specific
120 binutils, including assembler and linker.
121 </p>
122 <p>Installation into a temporary staging area or into a <code>chroot</code>
123 jail can be achieved with the command
124 </p>
125 <div class="smallexample">
126 <pre class="smallexample">make DESTDIR=<var>path-to-rootdir</var> install
127 </pre></div>
128
129 <p>where <var>path-to-rootdir</var> is the absolute path of
130 a directory relative to which all installation paths will be
131 interpreted. Note that the directory specified by <code>DESTDIR</code>
132 need not exist yet; it will be created if necessary.
133 </p>
134 <p>There is a subtle point with tooldirs and <code>DESTDIR</code>:
135 If you relocate a cross-compiler installation with
136 e.g. ‘<samp>DESTDIR=<var>rootdir</var></samp>’, then the directory
137 <samp><var>rootdir</var>/<var>exec-prefix</var>/<var>target-alias</var>/bin</samp> will
138 be filled with duplicated GCC executables only if it already exists,
139 it will not be created otherwise. This is regarded as a feature,
140 not as a bug, because it gives slightly more control to the packagers
141 using the <code>DESTDIR</code> feature.
142 </p>
143 <p>You can install stripped programs and libraries with
144 </p>
145 <div class="smallexample">
146 <pre class="smallexample">make install-strip
147 </pre></div>
148
149 <p>By default, only the man pages and info-format GCC documentation
150 are built and installed. If you want to generate the GCC manuals in
151 other formats, use commands like
152 </p>
153 <div class="smallexample">
154 <pre class="smallexample">make dvi
155 make pdf
156 make html
157 </pre></div>
158
159 <p>to build the manuals in the corresponding formats, and
160 </p>
161 <div class="smallexample">
162 <pre class="smallexample">make install-dvi
163 make install-pdf
164 make install-html
165 </pre></div>
166
167 <p>to install them.
168 Alternatively, there are prebuilt online versions of the manuals for
169 released versions of GCC on
170 <a href="https://gcc.gnu.org/onlinedocs/">the GCC web site</a>.
171 </p>
172 <p>If you built GCC yourself we would like to know if the
173 <a href="specific.html">host/target specific installation notes</a>
174 didn’t include your host/target information or if that information is
175 incomplete or out of date. Send a note to
176 <a href="mailto:gcc (a] gcc.gnu.org">gcc (a] gcc.gnu.org</a> detailing how the information should be changed.
177 </p>
178 <p>If you find a bug, please report it following the
179 <a href="../bugs/">bug reporting guidelines</a>.
180 </p>
181 <hr />
182 <p>
183 <p><a href="./index.html">Return to the GCC Installation page</a>
184 </p>
185
186
187
188
189
190
191
192 </body>
193 </html>
194