Updating chapter 6 Binutils and Gcc installation text.

git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@2690 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689
This commit is contained in:
Alex Gronenwoud 2003-08-28 21:19:09 +00:00
parent 871df54793
commit ae581daa00
2 changed files with 35 additions and 25 deletions

View File

@ -6,7 +6,7 @@
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 binutils.</para>
or modifying them when building Binutils.</para>
<para>It is recommended by the Binutils installation documentation to build
Binutils outside of the source directory:</para>
@ -14,29 +14,34 @@ Binutils outside of the source directory:</para>
<para><screen><userinput>mkdir ../binutils-build
cd ../binutils-build</userinput></screen></para>
<para>Next, prepare Binutils to be compiled:</para>
<para>Now prepare Binutils for compilation:</para>
<para><screen><userinput>../binutils-&binutils-version;/configure \
&nbsp;&nbsp;&nbsp;&nbsp;--prefix=/usr --enable-shared</userinput></screen></para>
<para>Continue with compiling the package:</para>
<para>Compile the package:</para>
<para><screen><userinput>make tooldir=/usr</userinput></screen></para>
<para><screen><userinput>make check</userinput></screen></para>
<para>Normally, the <emphasis>tooldir</emphasis> (the directory where the
executables end up) is set to $(exec_prefix)/$(target_alias) which expands
into, for example, /usr/i686-pc-linux-gnu. Since we only build for our
own system, we don't need this target specific directory in /usr. That
setup would be used if the system was used to cross-compile (for example
compiling a package on the Intel machine that generates code that can be
executed on Apple PowerPC machines).</para>
executables end up) is set to $(exec_prefix)/$(target_alias), which expands
into, for example, <filename>/usr/i686-pc-linux-gnu</filename>. Since we only
build for our own system, we don't need this target specific directory in
<filename>/usr</filename>. That setup would be used if the system was used to
cross-compile (for example compiling a package on an Intel machine that
generates code that can be executed on PowerPC machines).</para>
<para>Check the results:</para>
<para><screen><userinput>make check</userinput></screen></para>
<para>Install the package:</para>
<para><screen><userinput>make tooldir=/usr install</userinput></screen></para>
<para>And remove a library that normally is not meant to be installed on its
own:</para>
<para><screen><userinput>rm /usr/lib/libiberty.a</userinput></screen></para>
</sect2>

View File

@ -9,29 +9,30 @@ 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>
<para>We will be building the C and C++ compilers at this time, so you'll
need to unpack both the gcc-core and gcc-g++ tarballs. Other compilers are
available in the full gcc package; instructions for building them may be
found at <ulink url="&blfs-root;view/cvs/general/gcc.html"/>.</para>
<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>
<para><screen><userinput>patch -Np1 -i ../gcc-&gcc-version;-no_fixincludes.patch
patch -Np1 -i ../gcc-&gcc-version;-mmap_test.patch</userinput></screen></para>
<para>It is recommended by the GCC installation documentation to build GCC
in a dedicated directory outside of the source tree. Create the build
directory:</para>
<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>
<para><screen><userinput>mkdir ../gcc-build
cd ../gcc-build</userinput></screen></para>
<para>Prepare GCC to be compiled:</para>
<para>Now prepare GCC for compilation:</para>
<para><screen><userinput>../gcc-&gcc-version;/configure --prefix=/usr \
&nbsp;&nbsp;&nbsp;&nbsp;--enable-shared --enable-threads=posix \
&nbsp;&nbsp;&nbsp;&nbsp;--enable-__cxa_atexit --enable-clocale=gnu \
&nbsp;&nbsp;&nbsp;&nbsp;--enable-languages=c,c++</userinput></screen></para>
<para>The meanings of the configure options are:</para>
<para>The meaning of the new configure options:</para>
<itemizedlist>
<listitem><para><userinput>--enable-threads=posix</userinput>: This enables
@ -50,13 +51,16 @@ this specific locale, then the correct locale mode (<emphasis>gnu</emphasis>)
is implemented.</para></listitem>
</itemizedlist>
<para>Continue with compiling the package:</para>
<para>Compile the package:</para>
<para><screen><userinput>make</userinput></screen></para>
<para>Check the results, but don't stop at errors (you'll remember the few
known ones):</para>
<para><screen><userinput>make -k check</userinput></screen></para>
<para>Finish installing the package:</para>
<para>And install the package:</para>
<para><screen><userinput>make install</userinput></screen></para>
@ -66,12 +70,13 @@ To honor those packages, create two symlinks:</para>
<para><screen><userinput>ln -s ../usr/bin/cpp /lib</userinput></screen></para>
<para>Many packages compile using <emphasis>cc</emphasis> as the name for
the C compiler. To satisfy those packages, create a <emphasis>cc</emphasis>
symlink:</para>
<para>Many packages use the name <userinput>cc</userinput> to call the C
compiler. To satisfy those packages, create a symlink:</para>
<para><screen><userinput>ln -s gcc /usr/bin/cc</userinput></screen></para>
<para>Remove the spurious a-out library again:</para>
<para><screen><userinput>rm /usr/lib/libiberty.a</userinput></screen></para>
</sect2>