RP6 ROBOT SYSTEM - 3. Hardware and Software Setup
Depending on your PC's performance this will take a few minutes – this is also true for
the next two steps – especially for the GCC!
GCC for AVR
Using similar procedure as for Binutils, the GCC has to be patched, compiled and in-
stalled:
> cd ~/RP6
> bunzip2 -c gcc-4.1.1.tar.bz2 | tar xf -
> cd gcc-4.1.1
> patch -p0 < ../gcc-patch-0b-constants.diff
> patch -p0 < ../gcc-patch-attribute_alias.diff
> patch -p0 < ../gcc-patch-bug25672.diff
> patch -p0 < ../gcc-patch-dwarf.diff
> patch -p0 < ../gcc-patch-libiberty-Makefile.in.diff
> patch -p0 < ../gcc-patch-newdevices.diff
> patch -p0 < ../gcc-patch-zz-atmega256x.diff
> mkdir obj-avr
> cd obj-avr
> ../configure --prefix=$PREFIX --target=avr --enable-languages=c,c++ \
--disable-nls --disable-libssp –with-dwarf2
> make
> make install
By using a “\” you may press Enter and continue typing on the commandline – this al-
lows you to split a line up and write an extremely long command line in several lines
for better overview. Of course you may also omit this character and write the com-
mand as a single very long line.
AVR Libc
Finally the AVR libc:
> cd ~/RP6
> bunzip2 -c avr-libc-1.4.5.tar.bz2 | tar xf -
> cd avr-libc-1.4.5
> ./configure --prefix=$PREFIX --build=`./config.guess` --host=avr
> make
> make install
Attention: At –build=
`
./config.guess
`
you must pay attention to the “Accent grave”
(à <-- the tiny stroke on top of the letter a! Do not use a normal apostrophe, as this
will not work.
3.2.3.3. Setting the path
Now you have to make sure that the directory
/usr/local/avr/bin
is in your Path vari-
able! Otherwise you will not be able to start the avr-gcc from the terminal and from
makefiles. You have to add the avr-gcc path to the file
/etc/profile
or
/etc/envir-
onment
or similar files (this varies from distribution to distribution). You have to add
the new path to the excisting string, separated by a “:” character. The line in the file
may
more or less
look like this:
PATH="/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin
:/usr/local/avr/bin
"
Now you can check if the installation works by entering “avr-gcc -–version” in a
terminal as discussed in previous sections. If this gives proper response, in-
stallation was successful!
- 36 -