Installation of gcc
Apply the patches:
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
The gcc development team recommends building in a separate directory.
mkdir ../gcc-build &&
cd ../gcc-build
Configure gcc to build the C and C++ compilers and enable the related C++
options.
../gcc-&gcc2-version;/configure \
--prefix=/opt/gcc-&gcc2-version; \
--enable-shared --enable-languages=c,c++ \
--enable-threads=posix
Compile and install gcc:
make bootstrap &&
make install
Make note of the library that is installed.
L=`find /opt/gcc-&gcc2-version;/lib -name "*libstdc++*.so" -type f` &&
IL=`basename $L`
Move the C++ libraries to the standard lib directory to avoid having to
add /opt/gcc-&gcc2-version;/lib to
/etc/ld.so.conf.
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
Create symlinks required by commercial and precompiled packages.
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