2003-04-01 05:48:11 +08:00
|
|
|
<sect2>
|
2003-04-06 08:30:53 +08:00
|
|
|
<title>Installation of gcc</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-21 07:03:02 +08:00
|
|
|
<para><screen><userinput>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</userinput></screen></para>
|
2003-04-01 05:48:11 +08:00
|
|
|
|
2003-04-08 05:14:53 +08:00
|
|
|
<para>The gcc development team recommends building in a separate directory.</para>
|
2003-04-01 05:48:11 +08:00
|
|
|
|
|
|
|
<para><screen><userinput>mkdir ../gcc-build &&
|
|
|
|
cd ../gcc-build</userinput></screen></para>
|
|
|
|
|
2003-04-08 22:28:08 +08:00
|
|
|
<para>Configure gcc to build the C and C++ compilers and enable the related C++
|
2003-04-01 05:48:11 +08:00
|
|
|
options.</para>
|
|
|
|
<para><screen><userinput>../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++ \
|
|
|
|
--enable-threads=posix</userinput></screen></para>
|
|
|
|
|
2003-09-21 07:03:02 +08:00
|
|
|
<para>Compile and install gcc:</para>
|
2003-04-01 05:48:11 +08:00
|
|
|
<para><screen><userinput>make bootstrap &&
|
2003-09-21 07:03:02 +08:00
|
|
|
make install</userinput></screen></para>
|
2003-04-01 05:48:11 +08:00
|
|
|
|
|
|
|
<para>Make note of the library that is installed.</para>
|
2003-09-21 07:03:02 +08:00
|
|
|
<para><screen><userinput>L=`find /opt/gcc-&gcc2-version;/lib -name "*libstdc++*.so" -type f` &&
|
2003-04-01 05:48:11 +08:00
|
|
|
IL=`basename $L`</userinput></screen></para>
|
|
|
|
|
2003-04-08 22:28:08 +08:00
|
|
|
<para>Move the C++ libraries to the standard lib directory to avoid having to
|
2003-09-21 07:03:02 +08:00
|
|
|
add <filename>/opt/gcc-&gcc2-version;/lib</filename> to
|
2003-04-10 06:30:49 +08:00
|
|
|
<filename>/etc/ld.so.conf</filename>.</para>
|
2003-04-01 05:48:11 +08:00
|
|
|
|
2003-09-21 07:03:02 +08:00
|
|
|
<para><screen><userinput>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</userinput></screen></para>
|
2003-04-01 05:48:11 +08:00
|
|
|
|
|
|
|
<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>
|