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