2001-01-24 00:31:17 +00:00
|
|
|
<sect2>
|
2001-03-10 04:28:47 +00:00
|
|
|
<title>Installation of GCC</title>
|
2001-01-24 00:31:17 +00:00
|
|
|
|
2002-10-07 05:33:47 +01:00
|
|
|
<para>We won't be needing a C++ compiler until Chapter 6. So, only
|
|
|
|
the gcc-core tarball needs to be unpacked at this time.</para>
|
|
|
|
|
2002-04-19 19:27:01 +01:00
|
|
|
<para>This package is known to behave badly when you have changed its
|
|
|
|
default optimization flags (including the -march and -mcpu options). GCC is
|
2002-09-28 22:08:29 +01:00
|
|
|
best left alone. Therefore, if you have defined any environment variables
|
2002-04-19 19:27:01 +01:00
|
|
|
that override default optimizations, such as CFLAGS and CXXFLAGS, we
|
2002-09-28 22:08:29 +01:00
|
|
|
recommend unsetting or modifying them when building GCC. You have
|
2002-04-19 19:27:01 +01:00
|
|
|
been warned.</para>
|
2001-09-05 15:13:36 +01:00
|
|
|
|
2001-07-22 20:45:10 +01:00
|
|
|
<para>Install GCC by running the following commands:</para>
|
2001-01-24 00:31:17 +00:00
|
|
|
|
2002-12-31 15:45:00 +00:00
|
|
|
<para><screen><userinput>mkdir ../gcc-build &&
|
2001-10-27 23:21:44 +01:00
|
|
|
cd ../gcc-build &&
|
2002-10-07 05:33:47 +01:00
|
|
|
../gcc-&gcc-version;/configure --prefix=/static \
|
2002-12-31 15:45:00 +00:00
|
|
|
--disable-nls --disable-shared \
|
|
|
|
--with-as=$LFS/static/bin/as \
|
|
|
|
--with-ld=$LFS/static/bin/ld &&
|
2002-12-30 03:12:54 +00:00
|
|
|
make BOOT_LDFLAGS="-static" bootstrap &&
|
2002-12-31 15:45:00 +00:00
|
|
|
make prefix=$LFS/static install-no-fixedincludes &&
|
2002-05-27 04:17:49 +01:00
|
|
|
ln -s gcc $LFS/static/bin/cc</userinput></screen></para>
|
2001-01-24 00:31:17 +00:00
|
|
|
|
|
|
|
</sect2>
|
|
|
|
|