2003-04-01 05:48:11 +08:00
|
|
|
<sect2>
|
2003-09-26 11:06:17 +08:00
|
|
|
<title>Installation of <application><acronym>GCC</acronym></application></title>
|
2003-04-01 05:48:11 +08:00
|
|
|
|
2003-09-21 07:03:02 +08:00
|
|
|
<para>Apply the patches:</para>
|
2003-04-01 05:48:11 +08:00
|
|
|
|
2003-09-26 11:06:17 +08:00
|
|
|
<screen><userinput><command>patch -Np1 -i ../gcc-&gcc2-version;-2.patch &&
|
2003-09-21 07:03:02 +08:00
|
|
|
patch -Np1 -i ../gcc-&gcc2-version;-no-fixinc.patch &&
|
2003-09-26 11:06:17 +08:00
|
|
|
patch -Np1 -i ../gcc-&gcc2-version;-returntype-fix.patch</command></userinput></screen>
|
2003-04-01 05:48:11 +08:00
|
|
|
|
2003-09-26 11:06:17 +08:00
|
|
|
<para>The <acronym>GCC</acronym> development team recommends building in a
|
|
|
|
separate directory.</para>
|
2003-04-01 05:48:11 +08:00
|
|
|
|
2003-09-26 11:06:17 +08:00
|
|
|
<screen><userinput><command>mkdir ../gcc-build &&
|
|
|
|
cd ../gcc-build</command></userinput></screen>
|
2003-04-01 05:48:11 +08:00
|
|
|
|
2003-09-26 11:06:17 +08:00
|
|
|
<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 \
|
2003-09-21 07:03:02 +08:00
|
|
|
--prefix=/opt/gcc-&gcc2-version; \
|
2003-04-01 05:48:11 +08:00
|
|
|
--enable-shared --enable-languages=c,c++ \
|
2003-09-26 11:06:17 +08:00
|
|
|
--enable-threads=posix</command></userinput></screen>
|
2003-04-01 05:48:11 +08:00
|
|
|
|
2003-09-26 11:06:17 +08:00
|
|
|
<para>Compile and install <acronym>GCC</acronym>:</para>
|
|
|
|
<screen><userinput><command>make bootstrap &&
|
|
|
|
make install</command></userinput></screen>
|
2003-04-01 05:48:11 +08:00
|
|
|
|
|
|
|
<para>Make note of the library that is installed.</para>
|
2003-09-26 11:06:17 +08:00
|
|
|
<screen><userinput><command>L=`find /opt/gcc-&gcc2-version;/lib -name "*libstdc++*.so" -type f` &&
|
|
|
|
IL=`basename $L`</command></userinput></screen>
|
2003-04-01 05:48:11 +08:00
|
|
|
|
2003-09-26 11:06:17 +08:00
|
|
|
<para>Move the <application>C++</application> libraries to the standard lib
|
2003-09-26 21:54:02 +08:00
|
|
|
directory to avoid having to add <userinput>/opt/gcc-&gcc2-version;/lib
|
|
|
|
</userinput> to <filename>/etc/ld.so.conf</filename>.</para>
|
2003-04-01 05:48:11 +08:00
|
|
|
|
2003-09-26 11:06:17 +08:00
|
|
|
<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>
|
2003-04-01 05:48:11 +08:00
|
|
|
|
|
|
|
<para>Create symlinks required by commercial and precompiled packages.</para>
|
2003-09-26 11:06:17 +08:00
|
|
|
<screen><userinput><command>ln -sf $IL /usr/lib/libstdc++-libc6.1-1.so.2 &&
|
2003-04-01 05:48:11 +08:00
|
|
|
ln -sf $IL /usr/lib/libstdc++-libc6.2-2.so.3 &&
|
2003-09-26 11:06:17 +08:00
|
|
|
ln -sf $IL /usr/lib/libstdc++-libc6.3-2.so.3</command></userinput></screen>
|
2003-04-01 05:48:11 +08:00
|
|
|
|
|
|
|
</sect2>
|