<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
  "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
  <!ENTITY % general-entities SYSTEM "../../general.ent">
  %general-entities;
]>

<sect1 id="ch-temp-system-gcc" role="wrap">
  <?dbhtml filename="gcc.html"?>

  <title>GCC-&gcc-version;</title>

  <indexterm zone="ch-temp-system-gcc">
    <primary sortas="a-GCC">GCC</primary>
    <secondary>temporary system</secondary>
  </indexterm>

  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
  href="../../final-system/common/gcc.xml"
  xpointer="xpointer(//*[@role='package'])"/>

  <sect2 role="installation">
    <title>Installation of GCC</title>

    <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
    href="../../final-system/common/gcc.xml"
    xpointer="xpointer(//*[@os='p1'])"/>

    <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
    href="../../final-system/common/gcc.xml"
    xpointer="xpointer(//*[@os='p2'])"/>

    <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
    href="../../cross-tools/common/gcc-static.xml"
    xpointer="xpointer(//*[@os='aa'])"/>

    <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
    href="../../cross-tools/common/gcc-static.xml"
    xpointer="xpointer(//*[@os='ab'])"/>

    <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
    href="../../cross-tools/common/gcc-static.xml"
    xpointer="xpointer(//*[@os='ag'])"/>

    <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
    href="../../cross-tools/common/gcc-static.xml"
    xpointer="xpointer(//*[@os='ah'])"/>

    <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
    href="../../final-system/common/gcc.xml"
    xpointer="xpointer(//*[@os='fix1'])"/>

<screen os="fix2"><userinput>cp -v gcc/Makefile.in{,.orig}
sed 's@\./fixinc\.sh@-c true@' gcc/Makefile.in.orig &gt; gcc/Makefile.in</userinput></screen>

    <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
    href="../../final-system/common/gcc.xml"
    xpointer="xpointer(//*[@os='f'])"/>

    <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
    href="../../final-system/common/gcc.xml"
    xpointer="xpointer(//*[@os='g'])"/>

    <para os="cj">Before starting to build GCC, remember to unset any environment
    variables that override the default optimization flags.</para>

    <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
    href="../../final-system/common/gcc.xml"
    xpointer="xpointer(//*[@os='h'])"/>

<screen os="ck"><userinput>../gcc-&gcc-version;/configure --prefix=/tools \
    --build=${CLFS_HOST} --host=${CLFS_TARGET} --target=${CLFS_TARGET} \
    --with-local-prefix=/tools --disable-multilib --disable-nls \
    --enable-languages=c,c++ --disable-libstdcxx-pch \
    --with-system-zlib --with-native-system-header-dir=/tools/include \
    --disable-libssp --enable-checking=release --enable-libstdcxx-time</userinput></screen>

    <variablelist os="cl">
      <title>The meaning of the new configure option:</title>

      <varlistentry os="cl1">
        <term><parameter>--disable-libstdcxx-pch</parameter></term>
        <listitem>
          <para>Do not build the pre-compiled header (PCH) for
          <filename class="libraryfile">libstdc++</filename>. It takes
          up a lot of space, and we have no use for it.</para>
        </listitem>
      </varlistentry>

    </variablelist>

    <para os="s1">The following will prevent GCC from looking in the wrong
    directories for headers and libraries:</para>

<screen os="s2"><userinput>cp -v Makefile{,.orig}
sed "/^HOST_\(GMP\|ISL\|CLOOG\)\(LIBS\|INC\)/s:/tools:/cross-tools:g" \
    Makefile.orig &gt; Makefile</userinput></screen>

    <para os="cm">Compile the package:</para>

<screen os="cn"><userinput>make AS_FOR_TARGET="${AS}" \
    LD_FOR_TARGET="${LD}"</userinput></screen>

    <para os="co">Install the package:</para>

<screen os="cp"><userinput>make install</userinput></screen>

    <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
    href="../../final-system/common/gcc.xml"
    xpointer="xpointer(//*[@os='u'])"/>

<screen os="cr"><userinput>cp -v ../gcc-&gcc-version;/include/libiberty.h /tools/include</userinput></screen>

  </sect2>

  <sect2 role="content">
    <title/>

    <para>Details on this package are located in <xref
    linkend="contents-gcc" role="."/></para>

  </sect2>

</sect1>
