mirror of
https://github.com/Zeckmathederg/glfs.git
synced 2025-01-31 12:32:13 +08:00
3b03fa57d1
git-svn-id: svn://svn.linuxfromscratch.org/BLFS/trunk/BOOK@790 af4574ff-66df-0310-9fd7-8a98e5e911e0
45 lines
1.8 KiB
XML
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 &&
|
|
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 &&
|
|
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 &&
|
|
make install &&
|
|
ln -sf gcc /opt/gcc2/bin/cc &&
|
|
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` &&
|
|
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 &&
|
|
ln -sf $IL /usr/lib/libstdc++-libc6.2-2.so.3 &&
|
|
ln -sf $IL /usr/lib/libstdc++-libc6.3-2.so.3</userinput></screen></para>
|
|
|
|
</sect2>
|