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