Decide on a work directory. I used ~/work/BUILD. In there I put all the downloaded tar files in ./dist.
If you are repeating the build procedure, you need to re-instate the libiconv and libintl libraries for the benefit of the build tools (Mac OSX only). If you're doing this for the first time, then ignore this for now.
1. cd ~/work/BUILD 2. edit setnative.sh
We'll use this script to set up our native search PATH:
I'm using my /opt/gcc-4.7.0 Ada compiler in this build.
PATH="/opt/gcc-4.7.0/bin:/opt/local/bin:/opt/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin"
Modify the setnative.sh shell script to use your chosen compiler. It is probably best to choose a compiler release that is near the one being built. Here I am using 4.7.0 to build 4.7.2.
3. Set your PATH . ./setnative.sh 4. hash -r
(this clears the bash cache of known executables)
5. Check: type gcc (/opt/gcc-4.7.0/bin/gcc) gcc --version 6. tar xjvf dist/binutils-2.20.1.tar.bz2 7. cd ./binutils-2.20.1 8. . ../binutils_patch.sh
This applies the AVR-Ada patches for binutils to binutils.
9. cd .. (~/work/BUILD) edit ../binutils.myconf ../binutils-2.20.1/configure --target=avr --program-prefix=avr- \ --disable-shared --disable-nls --enable-commonbfdlib=no \ --disable-werror --prefix=/opt/avrada-1.2.2
Change --prefix=/opt/avrada-1.2.2 if installing your toolchain somewhere else.
10. mkdir ./binutils-obj cd ./binutils-obj 11. . ../binutils.myconf 12. make 13. sudo make install