mirror of
https://github.com/Zeckmathederg/glfs.git
synced 2025-01-31 20:42:34 +08:00
13f51bbc58
git-svn-id: svn://svn.linuxfromscratch.org/BLFS/trunk/BOOK@1202 af4574ff-66df-0310-9fd7-8a98e5e911e0
45 lines
2.0 KiB
XML
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 &&
|
|
patch -Np1 -i ../gcc-&gcc2-version;-no-fixinc.patch &&
|
|
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 &&
|
|
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 &&
|
|
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` &&
|
|
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 &&
|
|
ln -sf $IL /usr/lib/libstdc++-libc6.2-2.so.3 &&
|
|
ln -sf $IL /usr/lib/libstdc++-libc6.3-2.so.3</command></userinput></screen>
|
|
|
|
</sect2>
|