<?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-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.
  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="b"><userinput>export CLFS_HOST="${MACHTYPE}"
export CLFS_TARGET="{target triplet}"</userinput></screen>

  <para os="c">Now we will setup out default architecture needed we need to build:</para>

<screen os="d"><userinput>export CLFS_ARCH=$(echo ${CLFS_TARGET} | sed -e 's/-.*//' -e 's/i.86/i386/')</userinput></screen>

  <para os="e">Now we will setup out default endian needed we need to build and set the one we don't need:</para>

<screen os="f"><userinput>export CLFS_ENDIAN=LITTLE
export CLFS_NOT_ENDIAN=BIG</userinput></screen>

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

<screen os="h"><userinput>echo export CLFS_TARGET=\""${CLFS_TARGET}\"" &gt;&gt; ~/.bashrc
echo export CLFS_ARCH=\""${CLFS_ARCH}\"" &gt;&gt; ~/.bashrc
echo export CLFS_ENDIAN=\""${CLFS_ENDIAN}\"" &gt;&gt; ~/.bashrc
echo export CLFS_NOT_ENDIAN=\""${CLFS_NOT_ENDIAN}\"" &gt;&gt; ~/.bashrc</userinput></screen>

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

    <tgroup cols="2">

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

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

      <tbody>
        <row>
          <entry>486 Compatibles</entry>
          <entry>i486-pc-linux-uclibc</entry>
        </row>
        <row>
          <entry>Pentium, K6, 586 Compatibles</entry>
          <entry>i586-pc-linux-uclibc</entry>
        </row>
        <row>
          <entry>Pentium II, Pentium III, Pentium 4</entry>
          <entry>i686-pc-linux-uclibc</entry>
        </row>
        <row>
          <entry>Athlon, Duron</entry>
          <entry>i686-pc-linux-uclibc</entry>
        </row>
        <row>
          <entry>x86_64</entry>
          <entry>x86_64-unknown-linux-uclibc</entry>
        </row>
      </tbody>

    </tgroup>

  </table>

</sect1>
