diff options
Diffstat (limited to 'www')
-rw-r--r-- | www/cross-gcc.t | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/www/cross-gcc.t b/www/cross-gcc.t index 0915961ef8..030671a2ec 100644 --- a/www/cross-gcc.t +++ b/www/cross-gcc.t | |||
@@ -5,23 +5,24 @@ | |||
5 | In this example I will assume that you are running Linux with the bash shell. | 5 | In this example I will assume that you are running Linux with the bash shell. |
6 | We will only build the C compiler along with the assembler, linker and stuff. | 6 | We will only build the C compiler along with the assembler, linker and stuff. |
7 | Note that the procedure is exactly the same if you are running cygwin on Windows. | 7 | Note that the procedure is exactly the same if you are running cygwin on Windows. |
8 | |||
8 | <h2>Download the source code</h2> | 9 | <h2>Download the source code</h2> |
9 | <p> | 10 | <p> |
10 | You will need the following archives: | 11 | You will need the following archives: |
11 | <ul> | 12 | <ul> |
12 | <li>binutils-2.11.tar.gz (find it at your closest GNU FTP site) | 13 | <li>binutils-2.11.tar.gz (find it at your closest GNU FTP site) |
13 | <li>gcc-3.0.3.tar.gz (find it at your closest GNU FTP site) | 14 | <li>gcc-3.0.3.tar.gz (find it at your closest GNU FTP site) |
14 | <li>newlib-1.10.0.tar.gz (go to <a href="http://sources.redhat.com/newlib/">the newlib home page</a> for information) | ||
15 | <li>(optional) gdb-5.1.1.tar.gz (find it at your closest GNU FTP site) | 15 | <li>(optional) gdb-5.1.1.tar.gz (find it at your closest GNU FTP site) |
16 | </ul> | 16 | </ul> |
17 | |||
17 | <h2>Unpack the archives</h2> | 18 | <h2>Unpack the archives</h2> |
18 | <p> | 19 | <p> |
19 | <pre> | 20 | <pre> |
20 | /home/linus> tar zxf binutils-2.11.tar.gz | 21 | /home/linus> tar zxf binutils-2.11.tar.gz |
21 | /home/linus> tar zxf gcc-3.0.3.tar.gz | 22 | /home/linus> tar zxf gcc-3.0.3.tar.gz |
22 | /home/linus> tar zxf newlib-1.10.0.tar.gz | ||
23 | /home/linus> tar zxf gdb-5.1.1.tar.gz | 23 | /home/linus> tar zxf gdb-5.1.1.tar.gz |
24 | </pre> | 24 | </pre> |
25 | |||
25 | <h2>Create the directory tree</h2> | 26 | <h2>Create the directory tree</h2> |
26 | <p> | 27 | <p> |
27 | <pre> | 28 | <pre> |
@@ -31,14 +32,7 @@ You will need the following archives: | |||
31 | /home/linus/build> mkdir gcc | 32 | /home/linus/build> mkdir gcc |
32 | /home/linus/build> mkdir gdb | 33 | /home/linus/build> mkdir gdb |
33 | </pre> | 34 | </pre> |
34 | <h2>Create the newlib and libgloss links</h2> | 35 | |
35 | <p> | ||
36 | The GCC configuration script finds the newlib and libgloss files if they are in the GCC tree. Let's create two soft links. | ||
37 | <pre> | ||
38 | /home/linus> cd gcc-3.0.3 | ||
39 | /home/linus/gcc-3.0.3> ln -s ../newlib-1.10.0/newlib . | ||
40 | /home/linus/gcc-3.0.3> ln -s ../newlib-1.10.0/libgloss . | ||
41 | </pre> | ||
42 | <h2>Choose location</h2> | 36 | <h2>Choose location</h2> |
43 | <p> | 37 | <p> |
44 | Now is the time to decide where you want the tools to be installed. This is | 38 | Now is the time to decide where you want the tools to be installed. This is |
@@ -47,6 +41,7 @@ you do "make install". | |||
47 | <p> | 41 | <p> |
48 | In this example I have chosen "/home/linus/sh1" as my installation directory, or <i>prefix</i> as it is called. Feel free to use any prefix, like | 42 | In this example I have chosen "/home/linus/sh1" as my installation directory, or <i>prefix</i> as it is called. Feel free to use any prefix, like |
49 | /usr/local/sh1 for example. | 43 | /usr/local/sh1 for example. |
44 | |||
50 | <h2>Build binutils</h2> | 45 | <h2>Build binutils</h2> |
51 | <p> | 46 | <p> |
52 | We will start with building the binutils (the assembler, linker and stuff). | 47 | We will start with building the binutils (the assembler, linker and stuff). |
@@ -58,6 +53,7 @@ in the /home/linus/sh1 directory. | |||
58 | /home/linus/build/binutils> make | 53 | /home/linus/build/binutils> make |
59 | /home/linus/build/binutils> make install | 54 | /home/linus/build/binutils> make install |
60 | </pre> | 55 | </pre> |
56 | |||
61 | <h2>Build GCC</h2> | 57 | <h2>Build GCC</h2> |
62 | <p> | 58 | <p> |
63 | Now you are ready to build GCC. To do this, you must have the newly built | 59 | Now you are ready to build GCC. To do this, you must have the newly built |
@@ -65,10 +61,11 @@ binutils in the PATH. | |||
65 | <pre> | 61 | <pre> |
66 | /home/linus> export PATH=/home/linus/sh1/bin:$PATH | 62 | /home/linus> export PATH=/home/linus/sh1/bin:$PATH |
67 | /home/linus> cd build/gcc | 63 | /home/linus> cd build/gcc |
68 | /home/linus/gcc> ../../gcc-3.0.3/configure --target=sh-elf --prefix=/home/linus/sh1 --with-newlib --enable-languages=c | 64 | /home/linus/gcc> ../../gcc-3.0.3/configure --target=sh-elf --prefix=/home/linus/sh1 --enable-languages=c |
69 | /home/linus/build/gcc> make | 65 | /home/linus/build/gcc> make |
70 | /home/linus/build/gcc> make install | 66 | /home/linus/build/gcc> make install |
71 | </pre> | 67 | </pre> |
68 | |||
72 | <h2>Build GDB</h2> | 69 | <h2>Build GDB</h2> |
73 | <p> | 70 | <p> |
74 | If you are planning to debug your code with GDB, you have to build it as well. | 71 | If you are planning to debug your code with GDB, you have to build it as well. |
@@ -79,6 +76,7 @@ If you are planning to debug your code with GDB, you have to build it as well. | |||
79 | /home/linus/build/gdb> make | 76 | /home/linus/build/gdb> make |
80 | /home/linus/build/gdb> make install | 77 | /home/linus/build/gdb> make install |
81 | </pre> | 78 | </pre> |
79 | |||
82 | <h2>Done</h2> | 80 | <h2>Done</h2> |
83 | <p> | 81 | <p> |
84 | If someone up there likes you, you now have a working tool chain for SH1. | 82 | If someone up there likes you, you now have a working tool chain for SH1. |