Subversion Repositories svn LFS-FR


Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
 "" [
 <!ENTITY % general-entities SYSTEM "../../general.ent">

<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 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 to add "cross". Set <envar>CLFS_HOST</envar> using 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 triplet for the target
  architecture. Set the target variable using the following command:</para>

<screen os="d"><userinput>export CLFS_TARGET="arm-unknown-linux-gnu"</userinput></screen>

  <bridgehead renderas="sect4">Copy settings to 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