[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. |
---|
[6b723ad] | 17 | You will need to set the target triplet for the target architecture, the CPU |
---|
| 18 | type, and CPU endianess. If you do not know what triplet or CPU type you want, |
---|
[a9bbc46] | 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/") |
---|
[6b723ad] | 23 | export CLFS_TARGET=<replaceable>[target triplet]</replaceable> |
---|
| 24 | export CLFS_CPU=<replaceable>[cpu type]</replaceable></userinput></screen> |
---|
[a9e389d] | 25 | |
---|
[a9bbc46] | 26 | <para os="c">Now we will set the architecture and endianess of the CPU based |
---|
| 27 | on the target triplet provided above:</para> |
---|
[6533111] | 28 | |
---|
[a9bbc46] | 29 | <screen os="d"><userinput>export CLFS_ARCH=$(echo ${CLFS_TARGET} | sed -e 's/-.*//' -e 's/i.86/i386/') |
---|
| 30 | export CLFS_ENDIAN=little</userinput></screen> |
---|
[0dad5b9] | 31 | |
---|
| 32 | <para os="g">Now we will add this to <filename>~/.bashrc</filename>, just in |
---|
[a9e389d] | 33 | case you have to exit and restart building later:</para> |
---|
| 34 | |
---|
[e269c28] | 35 | <screen os="h"><userinput>echo export CLFS_HOST=\""${CLFS_HOST}\"" >> ~/.bashrc |
---|
| 36 | echo export CLFS_TARGET=\""${CLFS_TARGET}\"" >> ~/.bashrc |
---|
[0dad5b9] | 37 | echo export CLFS_ARCH=\""${CLFS_ARCH}\"" >> ~/.bashrc |
---|
[a9bbc46] | 38 | echo export CLFS_ENDIAN=\""${CLFS_ENDIAN}\"" >> ~/.bashrc</userinput></screen> |
---|
[a9e389d] | 39 | |
---|
[0dad5b9] | 40 | <table os="i"> |
---|
[a9e389d] | 41 | <title>Processor Type and Target Triplets</title> |
---|
[6b723ad] | 42 | <?dbfo table-width="7.5in" ?> |
---|
[3ca2208] | 43 | |
---|
| 44 | <tgroup cols="2"> |
---|
| 45 | |
---|
| 46 | <colspec colnum="1" colwidth="2.5in" colname="Processor"/> |
---|
| 47 | <colspec colnum="2" colwidth="2in" colname="Triplet"/> |
---|
[6b723ad] | 48 | <colspec colnum="3" colwidth="0.5in" colname="CPU Type"/> |
---|
| 49 | <colspec colnum="4" colwidth="2.5in" colname="Note"/> |
---|
[3ca2208] | 50 | |
---|
[a9e389d] | 51 | <thead> |
---|
| 52 | <row> |
---|
| 53 | <entry>Processor</entry> |
---|
| 54 | <entry>Target Triplet</entry> |
---|
[6b723ad] | 55 | <entry>CPU Type</entry> |
---|
| 56 | <entry>Note</entry> |
---|
[a9e389d] | 57 | </row> |
---|
| 58 | </thead> |
---|
[3ca2208] | 59 | |
---|
[a9e389d] | 60 | <tbody> |
---|
| 61 | <row> |
---|
| 62 | <entry>486 Compatibles</entry> |
---|
[246191f] | 63 | <entry>i486-pc-linux-uclibc</entry> |
---|
[6b723ad] | 64 | <entry>i486</entry> |
---|
| 65 | <entry>Intel's i486</entry> |
---|
[a9e389d] | 66 | </row> |
---|
| 67 | <row> |
---|
| 68 | <entry>Pentium, K6, 586 Compatibles</entry> |
---|
[246191f] | 69 | <entry>i586-pc-linux-uclibc</entry> |
---|
[6b723ad] | 70 | <entry>i586</entry> |
---|
| 71 | <entry>Intel Pentium without MMX</entry> |
---|
[a9e389d] | 72 | </row> |
---|
| 73 | <row> |
---|
| 74 | <entry>Pentium II, Pentium III, Pentium 4</entry> |
---|
[246191f] | 75 | <entry>i686-pc-linux-uclibc</entry> |
---|
[6b723ad] | 76 | <entry>i686</entry> |
---|
| 77 | <entry>PentiumPro instruction set</entry> |
---|
[a9e389d] | 78 | </row> |
---|
| 79 | <row> |
---|
[6b723ad] | 80 | <entry>Athlon</entry> |
---|
[246191f] | 81 | <entry>i686-pc-linux-uclibc</entry> |
---|
[6b723ad] | 82 | <entry>athlon</entry> |
---|
| 83 | <entry>AMD 32 bit Athlon</entry> |
---|
[a9e389d] | 84 | </row> |
---|
[128e9a4] | 85 | <row> |
---|
[6b723ad] | 86 | <entry>Opteron</entry> |
---|
[128e9a4] | 87 | <entry>x86_64-unknown-linux-uclibc</entry> |
---|
[6b723ad] | 88 | <entry>k8</entry> |
---|
| 89 | <entry>AMD K8 processors with x86-64</entry> |
---|
[128e9a4] | 90 | </row> |
---|
[a9e389d] | 91 | </tbody> |
---|
[3ca2208] | 92 | |
---|
[a9e389d] | 93 | </tgroup> |
---|
[3ca2208] | 94 | |
---|
[a9e389d] | 95 | </table> |
---|
| 96 | |
---|
| 97 | </sect1> |
---|