glfs/general/prog/gcc2/gcc2-inst.xml
Larry Lawrence 13f51bbc58 ruby, tcl, tk tagging
git-svn-id: svn://svn.linuxfromscratch.org/BLFS/trunk/BOOK@1202 af4574ff-66df-0310-9fd7-8a98e5e911e0
2003-09-26 13:54:02 +00:00

45 lines
2.0 KiB
XML

<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.patch &amp;&amp;
patch -Np1 -i ../gcc-&gcc2-version;-returntype-fix.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>