Building AVR-GCC
http://www.pololu.com/docs/0J31/2
Generally, the avr-gcc that is included with most distros is either outdated or broken. Let’s build a current set of tools.
Compiling binutils
- Download the source code.
Grab the latest binutils from here.
- Unpack the archive.
tar xzf ~/Desktop/binutils-2.19.1.tar.gz
cd binutils-2.19.1
- Configuring and compiling binutils
The options give here just specify that the AVR version of binutils should be compiled:
./configure --prefix=/usr/local --target=avr
make
sudo make install
Compiling avr-gcc
- Install prerequisites
Recent versions of GCC depend on GMP and MPFR, which can be installed from their web pages. Under Ubuntu, you can get these packages by running the following command.
sudo apt-get install libgmp3-dev libmpfr-dev
- Downloading the source code
Get the latest version of gcc from the GCC FTP site. Make sure and get the whole thing and not just gcc-core.
- Unpack the archive
tar xjf ~/Desktop/gcc-4.4.0.tar.bz2
cd gcc-4.4.0
- Configure, compile, and install GCC
Note that you need to compile GCC from a separate directory, and that we are specifying that only C and C++ be included.
mkdir obj
cd obj
../configure --prefix=/usr/local --target=avr --enable-languages=c,c++ --disable-nls --disable-libssp
make
sudo make install
Compiling avr-libc
- Downloading the source code
Get the latest version from the avr-libc website. You should get version 1.6.6 or higher.
- Unpack the archive
tar xjf ~/Desktop/avr-libc-1.6.6.tar.bz2
cd avr-libc-1.6.6
- Configuring and compiling avr-libc
./configure --host=avr --prefix=/usr/local
make
sudo make install
Compiling AVRDUDE
- Downloading the source code
Get the latest version from the AVRDUDE web site.
- Unpack the archive
tar xzf ~/Desktop/avrdude-5.6.tar.gz
cd avrdude-5.6
- Compiling and installing AVRDUDE
./configure
make
sudo make install
Finished
That’s it, you’re done.
