glfs/general/prog/gcc2.xml
Randy McMurchy e05cd03f9c Replaced deprecated w3.org XInclude throughout the book
git-svn-id: svn://svn.linuxfromscratch.org/BLFS/trunk/BOOK@8411 af4574ff-66df-0310-9fd7-8a98e5e911e0
2010-04-21 18:48:34 +00:00

145 lines
5.4 KiB
XML

<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
<!ENTITY % general-entities SYSTEM "../../general.ent">
%general-entities;
<!ENTITY gcc2-download-http "http://ftp.gnu.org/gnu/gcc/gcc-&gcc2-version;.tar.gz">
<!ENTITY gcc2-download-ftp "ftp://ftp.gnu.org/gnu/gcc/gcc-&gcc2-version;.tar.gz">
<!ENTITY gcc2-size "9.4 MB">
<!ENTITY gcc2-buildsize "150 MB">
<!ENTITY gcc2-time "2.60 SBU">
]>
<sect1 id="gcc2" xreflabel="GCC-&gcc2-version;">
<sect1info>
<othername>$LastChangedBy$</othername>
<date>$Date$</date>
</sect1info>
<?dbhtml filename="gcc2.html" ?>
<title>GCC-&gcc2-version;</title>
<sect2>
<title>Introduction to <application><acronym>GCC</acronym></application>-&gcc2-version;</title>
<para>There are two reasons for installing
<acronym>GCC</acronym>-&gcc2-version;. The first is that the kernel
developers have certified <acronym>GCC</acronym>-&gcc2-version; as the
preferred compiler for compiling the kernel. The other (and more compelling
reason) is that some commercial closed-source packages (such as Netscape
Navigator, Yahoo Pager) and precompiled packages (such as Mozilla)
are linked against <acronym>GCC</acronym>-&gcc2-version; libs.</para>
<sect3><title>Package information</title>
<itemizedlist spacing='compact'>
<listitem><para>Download (HTTP): <ulink
url="&gcc2-download-http;"/></para></listitem>
<listitem><para>Download (FTP): <ulink
url="&gcc2-download-ftp;"/></para></listitem>
<listitem><para>Download size: &gcc2-size;</para></listitem>
<listitem><para>Estimated disk space required:
&gcc2-buildsize;</para></listitem>
<listitem><para>Estimated build time:
&gcc2-time;</para></listitem></itemizedlist>
</sect3>
<sect3><title>Additional downloads</title>
<itemizedlist spacing='compact'>
<listitem><para>Required Patch: <ulink
url="&patch-root;/gcc-&gcc2-version;-2.patch"/></para></listitem>
<listitem><para>Required Patch: <ulink
url="&patch-root;/gcc-&gcc2-version;-no_fixinc-1.patch"/></para></listitem>
<listitem><para>Required Patch: <ulink
url="&patch-root;/gcc-&gcc2-version;-returntype_fix-1.patch"/></para></listitem>
</itemizedlist>
</sect3>
</sect2>
<sect2>
<title>Installation of <application><acronym>GCC</acronym></application></title>
<para>Apply the patches:</para>
<screen><userinput><command>patch -Np1 -i ../gcc-&gcc2-version;-2.patch &amp;&amp;
patch -Np1 -i ../gcc-&gcc2-version;-no_fixinc-1.patch &amp;&amp;
patch -Np1 -i ../gcc-&gcc2-version;-returntype_fix-1.patch</command></userinput></screen>
<para>The <acronym>GCC</acronym> development team recommends building in a
separate directory.</para>
<screen><userinput><command>mkdir ../gcc-build &amp;&amp;
cd ../gcc-build</command></userinput></screen>
<para>Configure <acronym>GCC</acronym> to build the
<application>C</application> and <application>C++</application> compilers and
enable the related <application>C++</application> options.</para>
<screen><userinput><command>../gcc-&gcc2-version;/configure \
--prefix=/opt/gcc-&gcc2-version; \
--enable-shared --enable-languages=c,c++ \
--enable-threads=posix</command></userinput></screen>
<para>Compile and install <acronym>GCC</acronym>:</para>
<screen><userinput><command>make bootstrap &amp;&amp;
make install</command></userinput></screen>
<para>Make note of the library that is installed.</para>
<screen><userinput><command>L=`find /opt/gcc-&gcc2-version;/lib -name "*libstdc++*.so" -type f` &amp;&amp;
IL=`basename $L`</command></userinput></screen>
<para>Move the <application>C++</application> libraries to the standard lib
directory to avoid having to add <userinput>/opt/gcc-&gcc2-version;/lib
</userinput> to <filename>/etc/ld.so.conf</filename>.</para>
<screen><userinput><command>for i in /opt/gcc-&gcc2-version;/lib/*.so*; do mv -f $i /usr/lib;
ln -sf /usr/lib/`basename $i` /opt/gcc-&gcc2-version;/lib; done</command></userinput></screen>
<para>Create symlinks required by commercial and precompiled packages.</para>
<screen><userinput><command>ln -sf $IL /usr/lib/libstdc++-libc6.1-1.so.2 &amp;&amp;
ln -sf $IL /usr/lib/libstdc++-libc6.2-2.so.3 &amp;&amp;
ln -sf $IL /usr/lib/libstdc++-libc6.3-2.so.3</command></userinput></screen>
</sect2>
<sect2>
<title>Configuring <application><acronym>GCC</acronym></application></title>
<sect3><title>Configuration Information</title>
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="../../lib-config.xml"/>
<para>The instructions given above make compatibility symlinks that pre-compiled
packages in <acronym>BLFS</acronym> require. You may create additional
compatibility links based on your requirements.</para>
<para>If you only need the GCC-&gcc2-version; libraries, you may delete
<filename>/opt/gcc-&gcc2-version;</filename>.</para>
<para>Whenever you need to use GCC-&gcc2-version; instead of your system
installed compiler, add
<filename class="directory">/opt/gcc-&gcc2-version;/bin</filename> to the
front of your <envar>PATH</envar> or (preferably) set the <envar>CC</envar>
environment variable before compiling the concerned package.</para>
</sect3>
</sect2>
<sect2>
<title>Contents</title>
<para>The GCC-&gcc2-version; package contains the
<command>gcc</command>-&gcc2-version; <application>C</application> and
<application>C++</application> compilers and GCC-&gcc2-version;
<filename>libstdc++.so</filename> that is required by some commercial and
pre-compiled packages.</para>
</sect2>
</sect1>