finalinstall.html 8.8 KB

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