[3b03fa57] | 1 | <sect2>
|
---|
[f22f96e9] | 2 | <title>Installation of gcc</title>
|
---|
[3b03fa57] | 3 |
|
---|
| 4 | <para>Apply the two patches, one to fix compilation and the other to stop the
|
---|
| 5 | fixincludes script from executing.</para>
|
---|
| 6 |
|
---|
| 7 | <para><screen><userinput>patch -Np1 -i ../gcc-&gcc2-version;-1.patch &&
|
---|
| 8 | patch -Np1 -i ../gcc-&gcc2-version;-no-fixinc.patch</userinput></screen></para>
|
---|
| 9 |
|
---|
[5628618e] | 10 | <para>The gcc development team recommends building in a separate directory.</para>
|
---|
[3b03fa57] | 11 |
|
---|
| 12 | <para><screen><userinput>mkdir ../gcc-build &&
|
---|
| 13 | cd ../gcc-build</userinput></screen></para>
|
---|
| 14 |
|
---|
[3e248486] | 15 | <para>Configure gcc to build the C and C++ compilers and enable the related C++
|
---|
[3b03fa57] | 16 | options.</para>
|
---|
| 17 | <para><screen><userinput>../gcc-&gcc2-version;/configure \
|
---|
| 18 | --prefix=/opt/gcc2 \
|
---|
| 19 | --enable-shared --enable-languages=c,c++ \
|
---|
| 20 | --enable-threads=posix</userinput></screen></para>
|
---|
| 21 |
|
---|
| 22 | <para>Compile and install gcc and remove unneeded directories (adjust the
|
---|
| 23 | machine triplet to match your architecture).</para>
|
---|
| 24 | <para><screen><userinput>make bootstrap &&
|
---|
| 25 | make install &&
|
---|
| 26 | ln -sf gcc /opt/gcc2/bin/cc &&
|
---|
| 27 | rm -rf /opt/gcc2/{i686-pc-linux-gnu,info,man}</userinput></screen></para>
|
---|
| 28 |
|
---|
| 29 | <para>Make note of the library that is installed.</para>
|
---|
| 30 | <para><screen><userinput>L=`find /opt/gcc2/lib -name "*libstdc++*.so" -type f` &&
|
---|
| 31 | IL=`basename $L`</userinput></screen></para>
|
---|
| 32 |
|
---|
[3e248486] | 33 | <para>Move the C++ libraries to the standard lib directory to avoid having to
|
---|
[8a0cee4] | 34 | add <filename>/opt/gcc2/lib</filename> to
|
---|
| 35 | <filename>/etc/ld.so.conf</filename>.</para>
|
---|
[3b03fa57] | 36 |
|
---|
| 37 | <para><screen><userinput>for i in /opt/gcc2/lib/*.so*; do mv -f $i /usr/lib;
|
---|
| 38 | ln -sf /usr/lib/`basename $i` /opt/gcc2/lib; done</userinput></screen></para>
|
---|
| 39 |
|
---|
| 40 | <para>Create symlinks required by commercial and precompiled packages.</para>
|
---|
| 41 | <para><screen><userinput>ln -sf $IL /usr/lib/libstdc++-libc6.1-1.so.2 &&
|
---|
| 42 | ln -sf $IL /usr/lib/libstdc++-libc6.2-2.so.3 &&
|
---|
| 43 | ln -sf $IL /usr/lib/libstdc++-libc6.3-2.so.3</userinput></screen></para>
|
---|
| 44 |
|
---|
| 45 | </sect2>
|
---|