<?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">
  %general-entities;
]>

<sect1 id="ch-cross-tools-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 <envar>HOST</envar> machine.
  You will need to set the <envar>CHOST</envar> triplet to match your
  particular needs. To set this information you can issue the following
  command:</para>

<screen os="b"><userinput>export CLFS_HOST="$(echo $MACHTYPE | sed "s/$(echo $MACHTYPE | cut -d- -f2)/cross/")"</userinput></screen>

  <para os="c">Now you will need to set the target triplet for the target
  architecture. You can do this by running the same command as above, just
  running it on the target machine. If you can't run the command on the
  target machine, you can use the table at the bottom of this page. Set
  the command using the method listed below:</para>

<screen os="d"><userinput>export CLFS_TARGET="{target triplet}"</userinput></screen>

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

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

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

  <table os="g">
    <title>Processor Type and  Target Triplets</title>
    <tgroup cols="2" align="center">
      <colspec colname="Processor"/>
      <colspec colname="Triplet"/>
      <thead>
        <row>
          <entry>Processor</entry>
          <entry>Target Triplet</entry>
        </row>
      </thead>
      <tbody>
        <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>
