[a9e389d] | 1 | <?xml version="1.0" encoding="ISO-8859-1"?>
|
---|
[bd48e48] | 2 | <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
|
---|
| 3 | "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
|
---|
[a9e389d] | 4 | <!ENTITY % general-entities SYSTEM "../../general.ent">
|
---|
| 5 | %general-entities;
|
---|
| 6 | ]>
|
---|
| 7 |
|
---|
| 8 | <sect1 id="ch-cross-tools-variables">
|
---|
| 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.
|
---|
[a9bbc46] | 17 | You will need to set the target triplet for the target architecture. As well
|
---|
| 18 | as the CPUs type and endianess. If you do not know what triplet you want,
|
---|
| 19 | you can use the table at the bottom of this page as a reference. Set
|
---|
[a9e389d] | 20 | the command using the method listed below:</para>
|
---|
| 21 |
|
---|
[e269c28] | 22 | <screen os="b"><userinput>export CLFS_HOST=$(echo ${MACHTYPE} | sed "s/-[^-]*/-cross/")
|
---|
[a9bbc46] | 23 | export CLFS_TARGET=<replaceable>[target triplet]</replaceable></userinput></screen>
|
---|
[a9e389d] | 24 |
|
---|
[a9bbc46] | 25 | <para os="c">Now we will set the architecture and endianess of the CPU based
|
---|
| 26 | on the target triplet provided above:</para>
|
---|
[6533111] | 27 |
|
---|
[a9bbc46] | 28 | <screen os="d"><userinput>export CLFS_ARCH=$(echo ${CLFS_TARGET} | sed -e 's/-.*//' -e 's/i.86/i386/')
|
---|
| 29 | export CLFS_ENDIAN=little</userinput></screen>
|
---|
[0dad5b9] | 30 |
|
---|
| 31 | <para os="g">Now we will add this to <filename>~/.bashrc</filename>, just in
|
---|
[a9e389d] | 32 | case you have to exit and restart building later:</para>
|
---|
| 33 |
|
---|
[e269c28] | 34 | <screen os="h"><userinput>echo export CLFS_HOST=\""${CLFS_HOST}\"" >> ~/.bashrc
|
---|
| 35 | echo export CLFS_TARGET=\""${CLFS_TARGET}\"" >> ~/.bashrc
|
---|
[0dad5b9] | 36 | echo export CLFS_ARCH=\""${CLFS_ARCH}\"" >> ~/.bashrc
|
---|
[a9bbc46] | 37 | echo export CLFS_ENDIAN=\""${CLFS_ENDIAN}\"" >> ~/.bashrc</userinput></screen>
|
---|
[a9e389d] | 38 |
|
---|
[0dad5b9] | 39 | <table os="i">
|
---|
[a9e389d] | 40 | <title>Processor Type and Target Triplets</title>
|
---|
[3ca2208] | 41 | <?dbfo table-width="4.5in" ?>
|
---|
| 42 |
|
---|
| 43 | <tgroup cols="2">
|
---|
| 44 |
|
---|
| 45 | <colspec colnum="1" colwidth="2.5in" colname="Processor"/>
|
---|
| 46 | <colspec colnum="2" colwidth="2in" colname="Triplet"/>
|
---|
| 47 |
|
---|
[a9e389d] | 48 | <thead>
|
---|
| 49 | <row>
|
---|
| 50 | <entry>Processor</entry>
|
---|
| 51 | <entry>Target Triplet</entry>
|
---|
| 52 | </row>
|
---|
| 53 | </thead>
|
---|
[3ca2208] | 54 |
|
---|
[a9e389d] | 55 | <tbody>
|
---|
| 56 | <row>
|
---|
| 57 | <entry>486 Compatibles</entry>
|
---|
[246191f] | 58 | <entry>i486-pc-linux-uclibc</entry>
|
---|
[a9e389d] | 59 | </row>
|
---|
| 60 | <row>
|
---|
| 61 | <entry>Pentium, K6, 586 Compatibles</entry>
|
---|
[246191f] | 62 | <entry>i586-pc-linux-uclibc</entry>
|
---|
[a9e389d] | 63 | </row>
|
---|
| 64 | <row>
|
---|
| 65 | <entry>Pentium II, Pentium III, Pentium 4</entry>
|
---|
[246191f] | 66 | <entry>i686-pc-linux-uclibc</entry>
|
---|
[a9e389d] | 67 | </row>
|
---|
| 68 | <row>
|
---|
| 69 | <entry>Athlon, Duron</entry>
|
---|
[246191f] | 70 | <entry>i686-pc-linux-uclibc</entry>
|
---|
[a9e389d] | 71 | </row>
|
---|
[128e9a4] | 72 | <row>
|
---|
| 73 | <entry>x86_64</entry>
|
---|
| 74 | <entry>x86_64-unknown-linux-uclibc</entry>
|
---|
| 75 | </row>
|
---|
[a9e389d] | 76 | </tbody>
|
---|
[3ca2208] | 77 |
|
---|
[a9e389d] | 78 | </tgroup>
|
---|
[3ca2208] | 79 |
|
---|
[a9e389d] | 80 | </table>
|
---|
| 81 |
|
---|
| 82 | </sect1>
|
---|