2003-01-15 16:06:56 +00:00
|
|
|
<sect2><title> </title><para> </para></sect2>
|
|
|
|
|
2001-01-24 00:31:17 +00:00
|
|
|
<sect2>
|
|
|
|
<title>Installation of GCC</title>
|
|
|
|
|
2002-04-19 19:27:01 +01:00
|
|
|
<para>This package is known to behave badly when you have changed its
|
2003-01-30 05:06:58 +00:00
|
|
|
default optimization flags (including the -march and -mcpu options).
|
|
|
|
Therefore, if you have defined any environment variables that override
|
|
|
|
default optimizations, such as CFLAGS and CXXFLAGS, we recommend unsetting
|
|
|
|
or modifying them when building GCC.</para>
|
2001-09-05 15:13:36 +01:00
|
|
|
|
2003-08-28 22:19:09 +01:00
|
|
|
<para>This time we will build both the C and the C++ compiler, so you'll have
|
|
|
|
to unpack the GCC-core <emphasis>and</emphasis> the GCC-g++ tarball -- they
|
|
|
|
will unfold into the same directory. The full GCC package contains even more
|
|
|
|
compilers. Instructions for building these can be found at
|
|
|
|
<ulink url="&blfs-root;view/cvs/general/gcc.html"/>.</para>
|
2003-01-15 16:06:56 +00:00
|
|
|
|
2003-05-05 23:28:14 +01:00
|
|
|
<para><screen><userinput>patch -Np1 -i ../gcc-&gcc-version;-no_fixincludes.patch
|
2003-05-02 19:20:20 +01:00
|
|
|
patch -Np1 -i ../gcc-&gcc-version;-mmap_test.patch</userinput></screen></para>
|
|
|
|
|
2003-08-28 22:19:09 +01:00
|
|
|
<para>GCC's installation documentation recommends to build the package in a
|
|
|
|
dedicated directory separate from the source tree. Create this build
|
|
|
|
directory and go there:</para>
|
2001-01-24 00:31:17 +00:00
|
|
|
|
2003-05-13 08:38:47 +01:00
|
|
|
<para><screen><userinput>mkdir ../gcc-build
|
2003-01-15 16:06:56 +00:00
|
|
|
cd ../gcc-build</userinput></screen></para>
|
|
|
|
|
2003-08-28 22:19:09 +01:00
|
|
|
<para>Now prepare GCC for compilation:</para>
|
2003-01-15 16:06:56 +00:00
|
|
|
|
2003-05-11 00:48:26 +01:00
|
|
|
<para><screen><userinput>../gcc-&gcc-version;/configure --prefix=/usr \
|
2003-05-02 19:20:20 +01:00
|
|
|
--enable-shared --enable-threads=posix \
|
|
|
|
--enable-__cxa_atexit --enable-clocale=gnu \
|
2003-05-08 00:51:03 +01:00
|
|
|
--enable-languages=c,c++</userinput></screen></para>
|
2003-01-15 16:06:56 +00:00
|
|
|
|
2003-08-28 22:19:09 +01:00
|
|
|
<para>The meaning of the new configure options:</para>
|
2003-01-15 16:06:56 +00:00
|
|
|
|
|
|
|
<itemizedlist>
|
2003-02-03 23:24:24 +00:00
|
|
|
<listitem><para><userinput>--enable-threads=posix</userinput>: This enables
|
2003-01-15 16:06:56 +00:00
|
|
|
C++ exception handling for multi-threaded code.</para></listitem>
|
|
|
|
|
2003-02-03 23:24:24 +00:00
|
|
|
<listitem><para><userinput>--enable-__cxa_atexit</userinput>: This option
|
2003-01-15 16:06:56 +00:00
|
|
|
will result in C++ shared libraries and C++ programs that are interoperable
|
|
|
|
with other Linux distributions.</para></listitem>
|
|
|
|
|
2003-02-03 23:24:24 +00:00
|
|
|
<listitem><para><userinput>--enable-clocale=gnu</userinput>: There is a risk
|
2003-01-15 16:06:56 +00:00
|
|
|
that some people will build ABI incompatible C++ libraries if they didn't
|
|
|
|
install all of the glibc localedata. Using --enable-clocale=gnu ensures that
|
|
|
|
the "right thing" is done in all cases. If you don't wish to use this option,
|
|
|
|
then at least build the <emphasis>de_DE</emphasis> locale. When GCC finds
|
|
|
|
this specific locale, then the correct locale mode (<emphasis>gnu</emphasis>)
|
|
|
|
is implemented.</para></listitem>
|
|
|
|
</itemizedlist>
|
|
|
|
|
2003-08-28 22:19:09 +01:00
|
|
|
<para>Compile the package:</para>
|
2003-01-15 16:06:56 +00:00
|
|
|
|
2003-05-11 00:48:26 +01:00
|
|
|
<para><screen><userinput>make</userinput></screen></para>
|
2003-01-15 16:06:56 +00:00
|
|
|
|
2003-08-28 22:19:09 +01:00
|
|
|
<para>Check the results, but don't stop at errors (you'll remember the few
|
|
|
|
known ones):</para>
|
|
|
|
|
2003-05-02 19:20:20 +01:00
|
|
|
<para><screen><userinput>make -k check</userinput></screen></para>
|
2003-01-15 16:06:56 +00:00
|
|
|
|
2003-08-28 22:19:09 +01:00
|
|
|
<para>And install the package:</para>
|
2003-01-15 16:06:56 +00:00
|
|
|
|
2003-05-02 19:20:20 +01:00
|
|
|
<para><screen><userinput>make install</userinput></screen></para>
|
2003-01-15 16:06:56 +00:00
|
|
|
|
2003-01-27 22:10:07 +00:00
|
|
|
<para>Some packages expect the C PreProcessor to be installed in the
|
2003-01-15 16:06:56 +00:00
|
|
|
<filename>/lib</filename> and <filename>/usr/lib</filename> directories.
|
|
|
|
To honor those packages, create two symlinks:</para>
|
|
|
|
|
2003-05-05 23:28:14 +01:00
|
|
|
<para><screen><userinput>ln -s ../usr/bin/cpp /lib</userinput></screen></para>
|
2003-01-15 16:06:56 +00:00
|
|
|
|
2003-08-28 22:19:09 +01:00
|
|
|
<para>Many packages use the name <userinput>cc</userinput> to call the C
|
|
|
|
compiler. To satisfy those packages, create a symlink:</para>
|
2003-01-15 16:06:56 +00:00
|
|
|
|
|
|
|
<para><screen><userinput>ln -s gcc /usr/bin/cc</userinput></screen></para>
|
2001-01-24 00:31:17 +00:00
|
|
|
|
2003-08-28 22:19:09 +01:00
|
|
|
<para>Remove the spurious a-out library again:</para>
|
|
|
|
|
2003-05-02 19:20:20 +01:00
|
|
|
<para><screen><userinput>rm /usr/lib/libiberty.a</userinput></screen></para>
|
|
|
|
|
2001-01-24 00:31:17 +00:00
|
|
|
</sect2>
|