<?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-final-preps-variables">
  <?dbhtml filename="variables.html"?>

  <title>Build Variables</title>

  <bridgehead renderas="sect4">Setting Host and Target</bridgehead>

  <para os="a">During the building of the cross-compile tools you will need to
  set a few variables that will be dependent on your particular needs.
  The first variable will be the triplet of the host machine, which will be
  put into the <envar>CLFS_HOST</envar> variable. To account for the
  possibility that the host and target are the same arch, as cross-compiling
  won't work when host and target are the same, part of the triplet needs to
  be changed slightly - in our case, we will change part of the triplet
  to "cross". Set <envar>CLFS_HOST</envar> using the following command:</para>

<screen os="b"><userinput>export CLFS_HOST=$(echo ${MACHTYPE} | sed -e 's/-[^-]*/-cross/')</userinput></screen>

  <para os="c">Now you will need to set the triplet for the target
  architecture. Set the target variable using the following command:</para>

<screen os="d"><userinput>export CLFS_TARGET="<replaceable>[target triplet]</replaceable>"</userinput></screen>

  <para os="t1">Replace [target triplet] with the appropriate machine triplet
  using the table at the bottom of the page.</para>

  <bridgehead renderas="sect4">Copy settings to the Environment</bridgehead>

  <para os="e">Now add these to <filename>~/.bashrc</filename>, just in
  case you have to exit and restart building later:</para>

<screen os="f"><userinput>cat &gt;&gt; ~/.bashrc &lt;&lt; EOF
export CLFS_HOST="${CLFS_HOST}"
export CLFS_TARGET="${CLFS_TARGET}"
EOF</userinput></screen>

  <table os="g">
    <title>Processor Type and  Target Triplets</title>
    <?dbfo table-width="5in" ?>

    <tgroup cols="2">

      <colspec colnum="1" colwidth="2.5in" colname="Processor"/>
      <colspec colnum="2" colwidth="2.5in" colname="Triplet"/>

      <thead>
        <row>
          <entry>Processor</entry>
          <entry>Target Triplet</entry>
        </row>
      </thead>

      <tbody>
        <row>
          <entry>386 Compatibles</entry>
          <entry>Not Supported By Glibc</entry>
        </row>
        <row>
          <entry>486 Compatibles</entry>
          <entry>i486-pc-linux-gnu</entry>
        </row>
        <row>
          <entry>Pentium, K6, 586 Compatibles</entry>
          <entry>i586-pc-linux-gnu</entry>
        </row>
        <row>
          <entry>Pentium II, Pentium III, Pentium 4</entry>
          <entry>i686-pc-linux-gnu</entry>
        </row>
        <row>
          <entry>Athlon, Duron</entry>
          <entry>i686-pc-linux-gnu</entry>
        </row>
      </tbody>

    </tgroup>

  </table>

</sect1>
