We are used to compiling our software against x86 systems, but… what happens when we want to run our software on other architectures? Basically, with a mere change of compiler if we have followed the POSIX, directives and little else we will be able to migrate our applications to the system we want.

  For example, devices like the fonera, the Linksys WRT54GL, the ASUS WL500G, …… have this type of processor and if we want to compile against them we only have to follow the following simple steps:

Discharge:

_cd /usr/src
mkdir openwrt
cd openwrt
wget http://downloads.openwrt.org/whiterussian/newest/OpenWrt-SDK-Linux-i686-1.tar.bz2
_

Unzip it:

_bzcat OpenWrt-SDK-Linux-i686-1.tar.bz2 | tar -xvf - _

_export PATH=$PATH:/usr/src/openwrt/OpenWrt-SDK-Linux-i686-1/staging_dir_mipsel/bin/
_

mips-linux-uclibc-gcc example.c -o example 

Congratulations!!!!  You are already a MIPS programmer.

UPDATE:

   All of the above is valid to compile for the WRT54GL, Asus WL500GX, …… but not for the fonera, since the following SDKs must be used: http://download.fon.com/firmware/fonera/latest/fonera.tar.bz2 instead of http://downloads.openwrt.org/whiterussian/newest/OpenWrt-SDK-Linux-i686-1.tar.bz2, with this you can compile for the small router.