[8672967] | 1 | <?xml version="1.0" encoding="ISO-8859-1"?>
|
---|
[aa18ac0] | 2 | <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
|
---|
| 3 | "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
|
---|
[8672967] | 4 | <!ENTITY % general-entities SYSTEM "../../general.ent">
|
---|
| 5 | %general-entities;
|
---|
| 6 | ]>
|
---|
| 7 |
|
---|
[0666dec] | 8 | <sect1 id="ch-final-preps-variables">
|
---|
[8672967] | 9 | <?dbhtml filename="variables.html"?>
|
---|
| 10 |
|
---|
| 11 | <title>Build Variables</title>
|
---|
| 12 |
|
---|
| 13 | <bridgehead renderas="sect4">Setting Host and Target</bridgehead>
|
---|
| 14 |
|
---|
| 15 | <para os="a">During the building of the cross-compile tools you will need to
|
---|
| 16 | set a few variables that will be dependent on your particular needs.
|
---|
[7030b60] | 17 | The first variable will be the triplet of the host machine, which will be
|
---|
| 18 | put into the <envar>CLFS_HOST</envar> variable. To account for the
|
---|
| 19 | possibility that the host and target are the same arch, as cross-compiling
|
---|
| 20 | won't work when host and target are the same, part of the triplet needs to
|
---|
[ee30dac] | 21 | be changed slightly - in our case, we will change part of the triplet
|
---|
| 22 | to "cross". Set <envar>CLFS_HOST</envar> using the following command:</para>
|
---|
[8672967] | 23 |
|
---|
[48dab198] | 24 | <screen os="b"><userinput>export CLFS_HOST=$(echo ${MACHTYPE} | sed -e 's/-[^-]*/-cross/')</userinput></screen>
|
---|
[8672967] | 25 |
|
---|
[7030b60] | 26 | <para os="c">Now you will need to set the triplet for the target
|
---|
| 27 | architecture. Set the target variable using the following command:</para>
|
---|
[8672967] | 28 |
|
---|
[48dab198] | 29 | <screen os="d"><userinput>export CLFS_TARGET="<replaceable>[target triplet]</replaceable>"</userinput></screen>
|
---|
[8672967] | 30 |
|
---|
[7030b60] | 31 | <para os="t1">Replace [target triplet] with the appropriate machine triplet
|
---|
| 32 | using the table at the bottom of the page.</para>
|
---|
[8672967] | 33 |
|
---|
[7030b60] | 34 | <bridgehead renderas="sect4">Copy settings to the Environment</bridgehead>
|
---|
| 35 |
|
---|
| 36 | <para os="e">Now add these to <filename>~/.bashrc</filename>, just in
|
---|
[8672967] | 37 | case you have to exit and restart building later:</para>
|
---|
| 38 |
|
---|
[c63dde1] | 39 | <screen os="f"><userinput>cat >> ~/.bashrc << EOF
|
---|
| 40 | export CLFS_HOST="${CLFS_HOST}"
|
---|
| 41 | export CLFS_TARGET="${CLFS_TARGET}"
|
---|
| 42 | EOF</userinput></screen>
|
---|
[8672967] | 43 |
|
---|
| 44 | <table os="g">
|
---|
| 45 | <title>Processor Type and Target Triplets</title>
|
---|
[d018b81] | 46 | <?dbfo table-width="5in" ?>
|
---|
| 47 |
|
---|
| 48 | <tgroup cols="2">
|
---|
| 49 |
|
---|
| 50 | <colspec colnum="1" colwidth="2.5in" colname="Processor"/>
|
---|
| 51 | <colspec colnum="2" colwidth="2.5in" colname="Triplet"/>
|
---|
| 52 |
|
---|
[8672967] | 53 | <thead>
|
---|
| 54 | <row>
|
---|
| 55 | <entry>Processor</entry>
|
---|
| 56 | <entry>Target Triplet</entry>
|
---|
| 57 | </row>
|
---|
| 58 | </thead>
|
---|
[d018b81] | 59 |
|
---|
[8672967] | 60 | <tbody>
|
---|
[44426cf] | 61 | <row>
|
---|
| 62 | <entry>386 Compatibles</entry>
|
---|
| 63 | <entry>Not Supported By Glibc</entry>
|
---|
| 64 | </row>
|
---|
[8672967] | 65 | <row>
|
---|
| 66 | <entry>486 Compatibles</entry>
|
---|
[9c8852d] | 67 | <entry>i486-pc-linux-gnu</entry>
|
---|
[8672967] | 68 | </row>
|
---|
| 69 | <row>
|
---|
| 70 | <entry>Pentium, K6, 586 Compatibles</entry>
|
---|
[9c8852d] | 71 | <entry>i586-pc-linux-gnu</entry>
|
---|
[8672967] | 72 | </row>
|
---|
| 73 | <row>
|
---|
| 74 | <entry>Pentium II, Pentium III, Pentium 4</entry>
|
---|
[9c8852d] | 75 | <entry>i686-pc-linux-gnu</entry>
|
---|
[8672967] | 76 | </row>
|
---|
| 77 | <row>
|
---|
| 78 | <entry>Athlon, Duron</entry>
|
---|
[9c8852d] | 79 | <entry>i686-pc-linux-gnu</entry>
|
---|
[8672967] | 80 | </row>
|
---|
| 81 | </tbody>
|
---|
[d018b81] | 82 |
|
---|
[8672967] | 83 | </tgroup>
|
---|
[d018b81] | 84 |
|
---|
[8672967] | 85 | </table>
|
---|
| 86 |
|
---|
| 87 | </sect1>
|
---|