finalinstall.html revision 1.10 1 1.10 mrg <html lang="en">
2 1.10 mrg <head>
3 1.10 mrg <title>Installing GCC: Final installation</title>
4 1.10 mrg <meta http-equiv="Content-Type" content="text/html">
5 1.10 mrg <meta name="description" content="Installing GCC: Final installation">
6 1.10 mrg <meta name="generator" content="makeinfo 4.13">
7 1.10 mrg <link title="Top" rel="top" href="#Top">
8 1.10 mrg <link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
9 1.10 mrg <!--
10 1.10 mrg Copyright (C) 1988-2017 Free Software Foundation, Inc.
11 1.1 mrg
12 1.10 mrg Permission is granted to copy, distribute and/or modify this document
13 1.3 mrg under the terms of the GNU Free Documentation License, Version 1.3 or
14 1.1 mrg any later version published by the Free Software Foundation; with no
15 1.1 mrg Invariant Sections, the Front-Cover texts being (a) (see below), and
16 1.1 mrg with the Back-Cover Texts being (b) (see below). A copy of the
17 1.10 mrg license is included in the section entitled "GNU Free Documentation License".
18 1.1 mrg
19 1.1 mrg (a) The FSF's Front-Cover Text is:
20 1.1 mrg
21 1.10 mrg A GNU Manual
22 1.1 mrg
23 1.1 mrg (b) The FSF's Back-Cover Text is:
24 1.1 mrg
25 1.10 mrg You have freedom to copy and modify this GNU Manual, like GNU
26 1.1 mrg software. Copies published by the Free Software Foundation raise
27 1.10 mrg funds for GNU development.-->
28 1.10 mrg <meta http-equiv="Content-Style-Type" content="text/css">
29 1.10 mrg <style type="text/css"><!--
30 1.10 mrg pre.display { font-family:inherit }
31 1.10 mrg pre.format { font-family:inherit }
32 1.10 mrg pre.smalldisplay { font-family:inherit; font-size:smaller }
33 1.10 mrg pre.smallformat { font-family:inherit; font-size:smaller }
34 1.10 mrg pre.smallexample { font-size:smaller }
35 1.10 mrg pre.smalllisp { font-size:smaller }
36 1.10 mrg span.sc { font-variant:small-caps }
37 1.10 mrg span.roman { font-family:serif; font-weight:normal; }
38 1.10 mrg span.sansserif { font-family:sans-serif; font-weight:normal; }
39 1.10 mrg --></style>
40 1.1 mrg </head>
41 1.10 mrg <body>
42 1.10 mrg <h1 class="settitle">Installing GCC: Final installation</h1>
43 1.10 mrg Now that GCC has been built (and optionally tested), you can install it with
44 1.10 mrg <pre class="smallexample"> cd <var>objdir</var> && make install
45 1.10 mrg </pre>
46 1.10 mrg <p>We strongly recommend to install into a target directory where there is
47 1.1 mrg no previous version of GCC present. Also, the GNAT runtime should not
48 1.1 mrg be stripped, as this would break certain features of the debugger that
49 1.1 mrg depend on this debugging information (catching Ada exceptions for
50 1.1 mrg instance).
51 1.10 mrg
52 1.10 mrg <p>That step completes the installation of GCC; user level binaries can
53 1.10 mrg be found in <samp><var>prefix</var><span class="file">/bin</span></samp> where <var>prefix</var> is the value
54 1.10 mrg you specified with the <samp><span class="option">--prefix</span></samp> to configure (or
55 1.10 mrg <samp><span class="file">/usr/local</span></samp> by default). (If you specified <samp><span class="option">--bindir</span></samp>,
56 1.1 mrg that directory will be used instead; otherwise, if you specified
57 1.10 mrg <samp><span class="option">--exec-prefix</span></samp>, <samp><var>exec-prefix</var><span class="file">/bin</span></samp> will be used.)
58 1.10 mrg Headers for the C++ library are installed in
59 1.10 mrg <samp><var>prefix</var><span class="file">/include</span></samp>; libraries in <samp><var>libdir</var></samp>
60 1.10 mrg (normally <samp><var>prefix</var><span class="file">/lib</span></samp>); internal parts of the compiler in
61 1.10 mrg <samp><var>libdir</var><span class="file">/gcc</span></samp> and <samp><var>libexecdir</var><span class="file">/gcc</span></samp>; documentation
62 1.1 mrg in info format in <samp><var>infodir</var></samp> (normally
63 1.10 mrg <samp><var>prefix</var><span class="file">/info</span></samp>).
64 1.10 mrg
65 1.10 mrg <p>When installing cross-compilers, GCC's executables
66 1.1 mrg are not only installed into <samp><var>bindir</var></samp>, that
67 1.10 mrg is, <samp><var>exec-prefix</var><span class="file">/bin</span></samp>, but additionally into
68 1.10 mrg <samp><var>exec-prefix</var><span class="file">/</span><var>target-alias</var><span class="file">/bin</span></samp>, if that directory
69 1.10 mrg exists. Typically, such <dfn>tooldirs</dfn> hold target-specific
70 1.1 mrg binutils, including assembler and linker.
71 1.10 mrg
72 1.10 mrg <p>Installation into a temporary staging area or into a <samp><span class="command">chroot</span></samp>
73 1.1 mrg jail can be achieved with the command
74 1.1 mrg
75 1.10 mrg <pre class="smallexample"> make DESTDIR=<var>path-to-rootdir</var> install
76 1.10 mrg </pre>
77 1.10 mrg <p class="noindent">where <var>path-to-rootdir</var> is the absolute path of
78 1.1 mrg a directory relative to which all installation paths will be
79 1.1 mrg interpreted. Note that the directory specified by <code>DESTDIR</code>
80 1.1 mrg need not exist yet; it will be created if necessary.
81 1.10 mrg
82 1.10 mrg <p>There is a subtle point with tooldirs and <code>DESTDIR</code>:
83 1.1 mrg If you relocate a cross-compiler installation with
84 1.10 mrg e.g. ‘<samp><span class="samp">DESTDIR=</span><var>rootdir</var></samp>’, then the directory
85 1.10 mrg <samp><var>rootdir</var><span class="file">/</span><var>exec-prefix</var><span class="file">/</span><var>target-alias</var><span class="file">/bin</span></samp> will
86 1.1 mrg be filled with duplicated GCC executables only if it already exists,
87 1.1 mrg it will not be created otherwise. This is regarded as a feature,
88 1.1 mrg not as a bug, because it gives slightly more control to the packagers
89 1.1 mrg using the <code>DESTDIR</code> feature.
90 1.1 mrg
91 1.10 mrg <p>You can install stripped programs and libraries with
92 1.10 mrg
93 1.10 mrg <pre class="smallexample"> make install-strip
94 1.10 mrg </pre>
95 1.10 mrg <p>If you are bootstrapping a released version of GCC then please
96 1.1 mrg quickly review the build status page for your release, available from
97 1.10 mrg <a href="http://gcc.gnu.org/buildstat.html">http://gcc.gnu.org/buildstat.html</a>.
98 1.1 mrg If your system is not listed for the version of GCC that you built,
99 1.1 mrg send a note to
100 1.1 mrg <a href="mailto:gcc (a] gcc.gnu.org">gcc (a] gcc.gnu.org</a> indicating
101 1.10 mrg that you successfully built and installed GCC.
102 1.1 mrg Include the following information:
103 1.10 mrg
104 1.10 mrg <ul>
105 1.10 mrg <li>Output from running <samp><var>srcdir</var><span class="file">/config.guess</span></samp>. Do not send
106 1.1 mrg that file itself, just the one-line output from running it.
107 1.1 mrg
108 1.10 mrg <li>The output of ‘<samp><span class="samp">gcc -v</span></samp>’ for your newly installed <samp><span class="command">gcc</span></samp>.
109 1.1 mrg This tells us which version of GCC you built and the options you passed to
110 1.1 mrg configure.
111 1.1 mrg
112 1.10 mrg <li>Whether you enabled all languages or a subset of them. If you used a
113 1.1 mrg full distribution then this information is part of the configure
114 1.10 mrg options in the output of ‘<samp><span class="samp">gcc -v</span></samp>’, but if you downloaded the
115 1.10 mrg “core” compiler plus additional front ends then it isn't apparent
116 1.1 mrg which ones you built unless you tell us about it.
117 1.1 mrg
118 1.10 mrg <li>If the build was for GNU/Linux, also include:
119 1.10 mrg <ul>
120 1.10 mrg <li>The distribution name and version (e.g., Red Hat 7.1 or Debian 2.2.3);
121 1.10 mrg this information should be available from <samp><span class="file">/etc/issue</span></samp>.
122 1.10 mrg
123 1.10 mrg <li>The version of the Linux kernel, available from ‘<samp><span class="samp">uname --version</span></samp>’
124 1.10 mrg or ‘<samp><span class="samp">uname -a</span></samp>’.
125 1.10 mrg
126 1.10 mrg <li>The version of glibc you used; for RPM-based systems like Red Hat,
127 1.10 mrg Mandrake, and SuSE type ‘<samp><span class="samp">rpm -q glibc</span></samp>’ to get the glibc version,
128 1.10 mrg and on systems like Debian and Progeny use ‘<samp><span class="samp">dpkg -l libc6</span></samp>’.
129 1.10 mrg </ul>
130 1.10 mrg For other systems, you can include similar information if you think it is
131 1.1 mrg relevant.
132 1.10 mrg
133 1.10 mrg <li>Any other information that you think would be useful to people building
134 1.1 mrg GCC on the same configuration. The new entry in the build status list
135 1.10 mrg will include a link to the archived copy of your message.
136 1.10 mrg </ul>
137 1.1 mrg
138 1.10 mrg <p>We'd also like to know if the
139 1.1 mrg <a href="specific.html">host/target specific installation notes</a>
140 1.10 mrg didn't include your host/target information or if that information is
141 1.1 mrg incomplete or out of date. Send a note to
142 1.1 mrg <a href="mailto:gcc (a] gcc.gnu.org">gcc (a] gcc.gnu.org</a> detailing how the information should be changed.
143 1.10 mrg
144 1.10 mrg <p>If you find a bug, please report it following the
145 1.1 mrg <a href="../bugs/">bug reporting guidelines</a>.
146 1.10 mrg
147 1.10 mrg <p>If you want to print the GCC manuals, do ‘<samp><span class="samp">cd </span><var>objdir</var><span class="samp">; make
148 1.10 mrg dvi</span></samp>’. You will need to have <samp><span class="command">texi2dvi</span></samp> (version at least 4.7)
149 1.10 mrg and TeX installed. This creates a number of <samp><span class="file">.dvi</span></samp> files in
150 1.1 mrg subdirectories of <samp><var>objdir</var></samp>; these may be converted for
151 1.10 mrg printing with programs such as <samp><span class="command">dvips</span></samp>. Alternately, by using
152 1.10 mrg ‘<samp><span class="samp">make pdf</span></samp>’ in place of ‘<samp><span class="samp">make dvi</span></samp>’, you can create documentation
153 1.10 mrg in the form of <samp><span class="file">.pdf</span></samp> files; this requires <samp><span class="command">texi2pdf</span></samp>, which
154 1.1 mrg is included with Texinfo version 4.8 and later. You can also
155 1.10 mrg <a href="https://shop.fsf.org/">buy printed manuals from the Free Software Foundation</a>, though such manuals may not be for the most
156 1.1 mrg recent version of GCC.
157 1.1 mrg
158 1.10 mrg <p>If you would like to generate online HTML documentation, do ‘<samp><span class="samp">cd
159 1.10 mrg </span><var>objdir</var><span class="samp">; make html</span></samp>’ and HTML will be generated for the gcc manuals in
160 1.10 mrg <samp><var>objdir</var><span class="file">/gcc/HTML</span></samp>.
161 1.1 mrg
162 1.10 mrg <p><hr />
163 1.10 mrg <p><a href="./index.html">Return to the GCC Installation page</a>
164 1.1 mrg
165 1.10 mrg <!-- ***Binaries**************************************************************** -->
166 1.10 mrg <!-- ***Specific**************************************************************** -->
167 1.10 mrg <!-- ***Old documentation****************************************************** -->
168 1.10 mrg <!-- ***GFDL******************************************************************** -->
169 1.10 mrg <!-- *************************************************************************** -->
170 1.10 mrg <!-- Part 6 The End of the Document -->
171 1.10 mrg </body></html>
172 1.1 mrg
173