glfs/general/prog/gcc2/gcc2-inst.xml
Tushar Teredesai 3b03fa57d1 added gcc2, removed gcc2libs
git-svn-id: svn://svn.linuxfromscratch.org/BLFS/trunk/BOOK@790 af4574ff-66df-0310-9fd7-8a98e5e911e0
2003-03-31 21:48:11 +00:00

45 lines
1.8 KiB
XML

<sect2>
<title>Installation of gcc2</title>
<para>Apply the two patches, one to fix compilation and the other to stop the
fixincludes script from executing.</para>
<para><screen><userinput>patch -Np1 -i ../gcc-&gcc2-version;-1.patch &amp;&amp;
patch -Np1 -i ../gcc-&gcc2-version;-no-fixinc.patch</userinput></screen></para>
<para>The gcc development team recommends building in a seperate directory.</para>
<para><screen><userinput>mkdir ../gcc-build &amp;&amp;
cd ../gcc-build</userinput></screen></para>
<para>Configure gcc to build the c and c++ compilers and enable the related c++
options.</para>
<para><screen><userinput>../gcc-&gcc2-version;/configure \
--prefix=/opt/gcc2 \
--enable-shared --enable-languages=c,c++ \
--enable-threads=posix</userinput></screen></para>
<para>Compile and install gcc and remove unneeded directories (adjust the
machine triplet to match your architecture).</para>
<para><screen><userinput>make bootstrap &amp;&amp;
make install &amp;&amp;
ln -sf gcc /opt/gcc2/bin/cc &amp;&amp;
rm -rf /opt/gcc2/{i686-pc-linux-gnu,info,man}</userinput></screen></para>
<para>Make note of the library that is installed.</para>
<para><screen><userinput>L=`find /opt/gcc2/lib -name "*libstdc++*.so" -type f` &amp;&amp;
IL=`basename $L`</userinput></screen></para>
<para>Move the c++ libraries to the standard lib directory to avoid having to
add /opt/gcc2/lib to <userinput>/etc/ld.so.conf</userinput>.</para>
<para><screen><userinput>for i in /opt/gcc2/lib/*.so*; do mv -f $i /usr/lib;
ln -sf /usr/lib/`basename $i` /opt/gcc2/lib; done</userinput></screen></para>
<para>Create symlinks required by commercial and precompiled packages.</para>
<para><screen><userinput>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</userinput></screen></para>
</sect2>