Some years ago, Dan Kegel wrote a set of scripts and makefiles for generating cross development toolchains and called it crosstool (http://kegel.com/crosstool/). In 2007, Yann E. Morin used that base to create the next generation of crosstool, crosstool-NG (http://crosstool-ng.github.io/). Today it is by far the most convenient way to create a stand-alone cross toolchain from source.
Building a toolchain using crosstool-NG
Installing crosstool-NG
Before you begin, you will need a working native toolchain and build tools on your host PC. To work with crosstool-NG on an Ubuntu host, you will need to install the packages using the following command:
$ sudo apt-get install automake bison chrpath flex g++ git gperf \
gawk libexpat1...