<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
  "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
  <!ENTITY % general-entities SYSTEM "../../general.ent">
  <!ENTITY % patches-entities SYSTEM "../../patches.ent">
  %general-entities;
  %patches-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>

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

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

    <segmentedlist>
      <segtitle>&buildtime;</segtitle>
      <segtitle>&diskspace;</segtitle>

      <seglistitem>
        <seg>Not checked yet</seg>
        <seg>Not checked yet</seg>
      </seglistitem>
    </segmentedlist>

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

  </sect2>

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

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

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

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

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

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

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

    <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
    href="../x86/gcc.xml"
    xpointer="xpointer(//*[@os='cd'])"/>

    <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
    href="../x86/gcc.xml"
    xpointer="xpointer(//*[@os='ce'])"/>

    <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
    href="../x86/gcc.xml"
    xpointer="xpointer(//*[@os='cf'])"/>

    <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
    href="../x86/gcc.xml"
    xpointer="xpointer(//*[@os='cg'])"/>

    <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
    href="../x86/gcc.xml"
    xpointer="xpointer(//*[@os='ch'])"/>

    <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
    href="../x86/gcc.xml"
    xpointer="xpointer(//*[@os='ci'])"/>

    <para os="da">When searching for the multilibs, force the build to use the
    results of <option>--print-multi-lib</option> from our cross-compiler,
    not the native compiler <command>gcc</command> builds now.</para>

<screen os="db"><userinput>cp gcc/Makefile.in{,.orig2}
sed -e "/MULTILIBS/s@\$(GCC_FOR_TARGET)@/cross-tools/bin/${CC}@g" \
   gcc/Makefile.in.orig2 > gcc/Makefile.in</userinput></screen>

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

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

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

    <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
    href="../x86/gcc.xml"
    xpointer="xpointer(//*[@os='cj'])"/>

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

<screen><userinput>CC="${CC} ${BUILD64}" CXX="${CXX} ${BUILD64}" \
    ../gcc-&gcc-version;/configure --prefix=/tools --libdir=/tools/lib64 \
    --build=${LFS_HOST} --host=${LFS_TARGET} --target=${LFS_TARGET} \
    --libexecdir=/tools/lib64 --with-local-prefix=/tools --enable-long-long \
    --enable-c99 --enable-shared --enable-threads=posix --enable-__cxa_atexit \
    --disable-nls --enable-languages=c,c++ --disable-libstdcxx-pch</userinput></screen>

    <variablelist os="dc">
      <title>The meaning of the new configure options:</title>

      <varlistentry os="dc1">
        <term><parameter>CXX="${CXX} ${BUILD64}"</parameter></term>
        <listitem>
          <para>This do ...</para>
        </listitem>
      </varlistentry>

      <varlistentry os="dc2">
        <term><parameter>--libexecdir=/tools/lib64</parameter></term>
        <listitem>
          <para>This do ...</para>
        </listitem>
      </varlistentry>

      <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
      href="../x86/gcc.xml"
      xpointer="xpointer(//*[@os='ck2'])"/>

    </variablelist>

    <para>Compile the package:</para>

<screen><userinput>make AS_FOR_TARGET="/cross-tools/bin/${LFS_TARGET}-as" \
    LD_FOR_TARGET="/cross-tools/bin/${LFS_TARGET}-ld"</userinput></screen>

    <para>Install the package:</para>

<screen><userinput>make install</userinput></screen>

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

<screen><userinput>ln -s gcc /tools/bin/cc</userinput></screen>

  </sect2>

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

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

  </sect2>

</sect1>
