[d496aea] | 1 | <?xml version="1.0" encoding="ISO-8859-1"?>
|
---|
[6732c094] | 2 | <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
|
---|
| 3 | "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
|
---|
[d496aea] | 4 | <!ENTITY % general-entities SYSTEM "../../general.ent">
|
---|
| 5 | %general-entities;
|
---|
| 6 |
|
---|
[b94988f] | 7 | <!ENTITY gcc3-download-http "http://ftp.gnu.org/gnu/gcc/gcc-&gcc3-version;/gcc-&gcc3-version;.tar.bz2">
|
---|
[8c9ec303] | 8 | <!ENTITY gcc3-download-ftp "ftp://ftp.gnu.org/gnu/gcc/gcc-&gcc3-version;/gcc-&gcc3-version;.tar.bz2">
|
---|
[4096f25] | 9 | <!ENTITY gcc3-md5sum "6936616a967da5a0b46f1e7424a06414">
|
---|
| 10 | <!ENTITY gcc3-size "24 MB">
|
---|
| 11 | <!ENTITY gcc3-buildsize "433 MB (includes running the test suite)">
|
---|
| 12 | <!ENTITY gcc3-time "5.2 SBU (additional 11.2 SBU to run the test suite)">
|
---|
[d496aea] | 13 | ]>
|
---|
| 14 |
|
---|
| 15 | <sect1 id="gcc3" xreflabel="GCC-&gcc3-version;">
|
---|
[b1df977] | 16 | <?dbhtml filename="gcc3.html" ?>
|
---|
| 17 |
|
---|
| 18 | <sect1info>
|
---|
| 19 | <othername>$LastChangedBy$</othername>
|
---|
| 20 | <date>$Date$</date>
|
---|
| 21 | </sect1info>
|
---|
| 22 |
|
---|
| 23 | <title>GCC-&gcc3-version;</title>
|
---|
| 24 |
|
---|
| 25 | <indexterm zone="gcc3">
|
---|
| 26 | <primary sortas="a-GCC-3-3">GCC-&gcc3-version;</primary>
|
---|
| 27 | </indexterm>
|
---|
| 28 |
|
---|
| 29 | <sect2 role="package">
|
---|
| 30 | <title>Introduction to GCC-&gcc3-version;</title>
|
---|
| 31 |
|
---|
[b90045c] | 32 | <para>There are several reasons why you may wish to install
|
---|
| 33 | <application>GCC</application>-&gcc3-version;. Some packages have not been
|
---|
| 34 | updated so they can be successfully compiled by
|
---|
| 35 | <application>GCC</application>-&gcc-version; as
|
---|
| 36 | version 4.x.x of <application>GCC</application> is much stricter in
|
---|
| 37 | enforcing coding standards. Additionally, some pre-compiled packages may
|
---|
| 38 | require the <application>GCC</application>-&gcc3-version; libraries at
|
---|
| 39 | run-time. Another reason you may need to install
|
---|
| 40 | <application>GCC</application>-&gcc3-version; is to use the
|
---|
| 41 | <command>g77</command> Fortran 77 compiler provided by pre-4.x.x versions
|
---|
| 42 | of <application>GCC</application>. <application>GCC</application>-4.x.x
|
---|
| 43 | only includes <command>gfortran</command>, a Fortran 95 compatible compiler
|
---|
| 44 | that is not yet ready to be used in a production environment.</para>
|
---|
| 45 |
|
---|
| 46 | <para>If all you need is a working <command>{f,g}77</command> Fortran 77
|
---|
| 47 | compiler, you may wish to use the one provided by
|
---|
| 48 | <application>GCC</application>-3.4.x. This is what the
|
---|
| 49 | <application>GCC</application> developers recommend. Instructions for
|
---|
| 50 | building the <application>GCC</application>-3.4.x Fortran compiler can be
|
---|
| 51 | found on the
|
---|
[4e88613] | 52 | <ulink url="&blfs-wiki;/gcc3">BLFS
|
---|
[b90045c] | 53 | Wiki</ulink>.</para>
|
---|
[b1df977] | 54 |
|
---|
| 55 | <bridgehead renderas="sect3">Package Information</bridgehead>
|
---|
| 56 | <itemizedlist spacing="compact">
|
---|
| 57 | <listitem>
|
---|
| 58 | <para>Download (HTTP): <ulink url="&gcc3-download-http;"/></para>
|
---|
| 59 | </listitem>
|
---|
| 60 | <listitem>
|
---|
| 61 | <para>Download (FTP): <ulink url="&gcc3-download-ftp;"/></para>
|
---|
| 62 | </listitem>
|
---|
| 63 | <listitem>
|
---|
| 64 | <para>Download MD5 sum: &gcc3-md5sum;</para>
|
---|
| 65 | </listitem>
|
---|
| 66 | <listitem>
|
---|
| 67 | <para>Download size: &gcc3-size;</para>
|
---|
| 68 | </listitem>
|
---|
| 69 | <listitem>
|
---|
| 70 | <para>Estimated disk space required: &gcc3-buildsize;</para>
|
---|
| 71 | </listitem>
|
---|
| 72 | <listitem>
|
---|
| 73 | <para>Estimated build time: &gcc3-time;</para>
|
---|
| 74 | </listitem>
|
---|
| 75 | </itemizedlist>
|
---|
| 76 |
|
---|
| 77 | <bridgehead renderas="sect3">Additional Downloads</bridgehead>
|
---|
| 78 | <itemizedlist spacing='compact'>
|
---|
| 79 | <listitem>
|
---|
[7cd76d62] | 80 | <para>Required patch: <ulink
|
---|
[b1df977] | 81 | url="&patch-root;/gcc-&gcc3-version;-no_fixincludes-1.patch"/></para>
|
---|
| 82 | </listitem>
|
---|
| 83 | <listitem>
|
---|
[7cd76d62] | 84 | <para>Required patch: <ulink
|
---|
[b1df977] | 85 | url="&patch-root;/gcc-&gcc3-version;-linkonce-1.patch"/></para>
|
---|
| 86 | </listitem>
|
---|
| 87 | </itemizedlist>
|
---|
| 88 |
|
---|
| 89 | <bridgehead renderas="sect3">GCC-&gcc3-version; Dependencies</bridgehead>
|
---|
[256ee72c] | 90 |
|
---|
| 91 | <bridgehead renderas="sect4">Optional</bridgehead>
|
---|
| 92 | <para role="optional"><xref linkend="dejagnu"/> (required to run the full test suite)</para>
|
---|
[b1df977] | 93 |
|
---|
[1039de3] | 94 | <para condition="html" role="usernotes">User Notes:
|
---|
| 95 | <ulink url="&blfs-wiki;/gcc3"/></para>
|
---|
| 96 |
|
---|
[b1df977] | 97 | </sect2>
|
---|
| 98 |
|
---|
| 99 | <sect2 role="installation">
|
---|
| 100 | <title>Installation of GCC-&gcc3-version;</title>
|
---|
| 101 |
|
---|
[7cd76d62] | 102 | <para>Install <application>GCC</application>-&gcc3-version; by running
|
---|
[b1df977] | 103 | the following commands:</para>
|
---|
| 104 |
|
---|
| 105 | <screen><userinput>patch -Np1 -i ../gcc-&gcc3-version;-no_fixincludes-1.patch &&
|
---|
[b94988f] | 106 | patch -Np1 -i ../gcc-&gcc3-version;-linkonce-1.patch &&
|
---|
| 107 | mkdir ../gcc-build &&
|
---|
| 108 | cd ../gcc-build &&
|
---|
[4096f25] | 109 | ../gcc-&gcc3-version;/configure --prefix=/opt/gcc-&gcc3-version; \
|
---|
| 110 | --enable-shared --enable-languages=c,c++ --enable-threads=posix &&
|
---|
[b1df977] | 111 | make bootstrap</userinput></screen>
|
---|
[d260aaf4] | 112 |
|
---|
[7cd76d62] | 113 | <para>If desired, run the test suite using the following commands. The
|
---|
| 114 | <command>test_summary</command> commands create log files which can be
|
---|
| 115 | compared to known good results located at <ulink
|
---|
[0f9a8a99] | 116 | url="&files-anduin;/gcc336_test.txt"/>.</para>
|
---|
[fb9298b4] | 117 |
|
---|
[b1df977] | 118 | <screen><userinput>make -k check &&
|
---|
[4096f25] | 119 | ../gcc-&gcc3-version;/contrib/test_summary >test_summary.log 2>&1 &&
|
---|
| 120 | ../gcc-&gcc3-version;/contrib/test_summary | \
|
---|
[b1df977] | 121 | grep -A7 Summ >test_summary_short.log 2>&1</userinput></screen>
|
---|
[fb9298b4] | 122 |
|
---|
[b1df977] | 123 | <para>Now, as the <systemitem class="username">root</systemitem> user:</para>
|
---|
[d260aaf4] | 124 |
|
---|
[b1df977] | 125 | <screen role="root"><userinput>make install &&
|
---|
[f079a990] | 126 | mv -v /opt/gcc-&gcc3-version;/lib/libstdc++.so.5* /usr/lib &&
|
---|
[4096f25] | 127 | ln -v -sf /usr/lib/libstdc++.so.5.0.7 /opt/gcc-&gcc3-version;/lib &&
|
---|
| 128 | ln -v -sf libstdc++.so.5.0.7 /opt/gcc-&gcc3-version;/lib/libstdc++.so.5 &&
|
---|
[f079a990] | 129 | chown -v -R root:root \
|
---|
[b1df977] | 130 | /opt/gcc-&gcc3-version;/lib/gcc-lib/i686-pc-linux-gnu/&gcc3-version;/include</userinput></screen>
|
---|
[b94988f] | 131 |
|
---|
[b1df977] | 132 | </sect2>
|
---|
[d496aea] | 133 |
|
---|
[b1df977] | 134 | <sect2 role="commands">
|
---|
| 135 | <title>Command Explanations</title>
|
---|
[d496aea] | 136 |
|
---|
[7cd76d62] | 137 | <para><command>mkdir ../gcc-build; cd ../gcc-build</command>: The
|
---|
| 138 | <application>GCC</application> development team recommends
|
---|
[b1df977] | 139 | building in a separate directory.</para>
|
---|
[d496aea] | 140 |
|
---|
[ca4b09e] | 141 | <para id='gcc3-lang'><parameter>--enable-shared --enable-languages=c,c++
|
---|
[7cd76d62] | 142 | --enable-threads=posix</parameter>: Configures
|
---|
[ca4b09e] | 143 | <application>GCC</application> to build the <application>C</application>
|
---|
| 144 | and <application>C++</application> compilers and enable the related
|
---|
| 145 | <application>C++</application> options. In addition to c and c++, you can
|
---|
[fea3ac80] | 146 | add f77 for FORTRAN (called <application>g77</application>). Note that
|
---|
| 147 | <application>GCC-4</application> no longer provides a FORTRAN 77
|
---|
| 148 | compiler.</para>
|
---|
[ca4b09e] | 149 |
|
---|
| 150 | <indexterm zone="gcc3 gcc3-lang">
|
---|
| 151 | <primary sortas="b-g77">g77</primary>
|
---|
| 152 | </indexterm>
|
---|
| 153 | <indexterm zone="gcc3 gcc3-lang">
|
---|
| 154 | <primary sortas="b-FORTRAN">FORTRAN</primary>
|
---|
| 155 | </indexterm>
|
---|
[9f12e36] | 156 |
|
---|
[7cd76d62] | 157 | <para><command>mv -v /opt/gcc-&gcc3-version;/lib/libstdc++.so.5*
|
---|
[4096f25] | 158 | /usr/lib</command>: Moves the <application>C++</application> library to the
|
---|
[7cd76d62] | 159 | standard lib directory to avoid having to add
|
---|
| 160 | <userinput>/opt/gcc-&gcc3-version;/lib</userinput> to
|
---|
[b1df977] | 161 | <filename>/etc/ld.so.conf</filename>.</para>
|
---|
[d496aea] | 162 |
|
---|
[b1df977] | 163 | </sect2>
|
---|
[d496aea] | 164 |
|
---|
[b1df977] | 165 | <sect2 role="configuration">
|
---|
| 166 | <title>Configuring GCC-&gcc3-version;</title>
|
---|
[d496aea] | 167 |
|
---|
[b1df977] | 168 | <sect3>
|
---|
| 169 | <title>Configuration information</title>
|
---|
[d496aea] | 170 |
|
---|
[4096f25] | 171 | <para>If you only need the GCC-&gcc3-version; C++ library, you may delete
|
---|
[b1df977] | 172 | <filename>/opt/gcc-&gcc3-version;</filename>.</para>
|
---|
[d496aea] | 173 |
|
---|
[b1df977] | 174 | <para>Whenever you need to use GCC-&gcc3-version; instead of your system
|
---|
| 175 | installed compiler, add
|
---|
[7cd76d62] | 176 | <filename class="directory">/opt/gcc-&gcc3-version;/bin</filename> to the
|
---|
[b1df977] | 177 | front of your <envar>PATH</envar> or (preferably) set the <envar>CC</envar>
|
---|
| 178 | environment variable before compiling the concerned package.</para>
|
---|
[d496aea] | 179 |
|
---|
[772f15b] | 180 | <para>If you use <application>g77</application> programs, you also
|
---|
| 181 | should move the libg2c.* libraries and symbolic links to <filename
|
---|
| 182 | class='directory'>/usr/lib</filename>. Using export
|
---|
| 183 | LD_LIBRARY_PATH=/opt/gcc-&gcc3-version;/lib or updating
|
---|
[ca4b09e] | 184 | <filename>/etc/ld.so.conf</filename> to point to <filename
|
---|
[772f15b] | 185 | class='directory'>/opt/gcc-&gcc3-version;/lib</filename> is not
|
---|
| 186 | recommended as it may conflict with your normal libraries.</para>
|
---|
[ca4b09e] | 187 |
|
---|
[b1df977] | 188 | </sect3>
|
---|
[d496aea] | 189 |
|
---|
[b1df977] | 190 | </sect2>
|
---|
[d496aea] | 191 |
|
---|
[b1df977] | 192 | <sect2 role="content">
|
---|
| 193 | <title>Contents</title>
|
---|
[d496aea] | 194 |
|
---|
[b1df977] | 195 | <segmentedlist>
|
---|
| 196 | <segtitle>Installed Programs</segtitle>
|
---|
| 197 | <segtitle>Installed Libraries</segtitle>
|
---|
[40d6bab] | 198 | <segtitle>Installed Directory</segtitle>
|
---|
[b94988f] | 199 |
|
---|
[b1df977] | 200 | <seglistitem>
|
---|
[7cd76d62] | 201 | <seg>c++, cpp, g++, gcc, gccbug, gcov, and architecture specific
|
---|
[b1df977] | 202 | names of these programs.</seg>
|
---|
[1039de3] | 203 | <seg>libgcc_s.so, libiberty.a, libstdc++.{a,so}, libsupc++.a, and other
|
---|
[b1df977] | 204 | support libraries and files.</seg>
|
---|
| 205 | <seg>/opt/gcc-&gcc3-version;</seg>
|
---|
| 206 | </seglistitem>
|
---|
| 207 | </segmentedlist>
|
---|
[d496aea] | 208 |
|
---|
[b1df977] | 209 | <bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
---|
| 210 |
|
---|
| 211 | <para>The GCC-&gcc3-version; package contains the
|
---|
| 212 | <command>gcc</command>-&gcc3-version; <application>C</application> and
|
---|
[40d6bab] | 213 | <application>C++</application> compilers and the GCC-&gcc3-version;
|
---|
| 214 | <filename>libstdc++.so</filename> library that is required by some
|
---|
| 215 | commercial and pre-compiled packages.</para>
|
---|
[b1df977] | 216 |
|
---|
| 217 | </sect2>
|
---|
[d496aea] | 218 |
|
---|
| 219 | </sect1>
|
---|