1. build binutils-2.22
cd build-binutils
../binutils-2.22/configure --target=mips-elf --prefix=/opt/mips-gnu-tools --enable-multilib
make all
make install
2. build gcc-4.6.3 first
ln -s /opt/mips-gnu-tools/bin/* /usr/local/bin
cd ../build-gcc
../gcc-4.6.3/configure --target=mips-elf --prefix=/opt/mips-gnu-tools --enable-multilib --enable-languages="c,c++" --without-headers --with-gnu-as --with-gnu-ld
make all-gcc
make install-gcc
ln -s /opt/mips-gnu-tools/bin/* /usr/local/bin
3. build newlib-1.2.0
cd ../build-newlib
../newlib-1.20.0/configure --target=mips-elf --prefix=/opt/mips-gnu-tools --enable-multilib
make all
make install
4. build gcc-4.6.3 again
cd ../build-gcc
../gcc-4.6.3/configure --target=mips-elf --prefix=/opt/mips-gnu-tools --enable-multilib --enable-languages="c,c++" --with-newlib --with-gnu-as --with-gnu-ld --disable-shared --disable-libssp
make all
make install
5. build gdb-7.4.1
cd ../build-gdb
../gdb-7.4.1/configure --target=mips-elf --prefix=/opt/mips-gnu-tools --enable-multilib
make all
make install
ln -s /opt/mips-gnu-tools/bin/* /usr/local/bin