| 1 | = Get the sources = |
| 2 | |
| 3 | You will need gnu binutils and gcc. They are available on ftp.gnu.org or any gnu mirror. |
| 4 | Let's unpack sources: |
| 5 | |
| 6 | {{{ |
| 7 | $ mkdir src |
| 8 | $ cd src |
| 9 | $ tar xjf ..../binutils-2.xx.tar.bz2 |
| 10 | $ tar xjf ..../gcc-x.x.x.tar.bz2 |
| 11 | $ |
| 12 | }}} |
| 13 | |
| 14 | == Compilation == |
| 15 | |
| 16 | Now lets compile. I assume we'll need to compile more toolchains later, so let's share the sources and compile in a separate directory: |
| 17 | |
| 18 | {{{ |
| 19 | $ cd .. |
| 20 | $ mkdir build build/mipsel build/mipsel/binutils build/mipsel/gcc |
| 21 | }}} |
| 22 | First, binutils |
| 23 | {{{ |
| 24 | $ cd build/mipsel/binutils |
| 25 | $ ../../../src/binutils-2.x/configure --prefix=/where/to/put/it --target=mipsel-unknown-elf \ |
| 26 | --program-prefix=mipsel-unknown-elf- |
| 27 | $ make |
| 28 | $ make install |
| 29 | $ |
| 30 | }}} |
| 31 | Export the `bin` directory of your installation path, if not already in it. |
| 32 | You should make this permanent by setting the PATH variable in a shell's startup script. |
| 33 | {{{ |
| 34 | $ export PATH=$PATH:/where/to/put/it/bin |
| 35 | $ |
| 36 | }}} |
| 37 | Now gcc |
| 38 | {{{ |
| 39 | $ cd ../gcc |
| 40 | $ ../../../src/gcc-x.x.x/configure --program-prefix=mipsel-unknown-elf- --prefix=/where/to/put/it \ |
| 41 | --enable-languages=c --target=mipsel-unknown-elf --host=i686-pc-linux-gnu |
| 42 | $ make |
| 43 | $ make install |
| 44 | $ |
| 45 | }}} |
| 46 | |
| 47 | We're done ! |