I decided to use the latest version of gcc for my avr. Thus I went on and installed the binutils for avr in /usr/local/avr/bin ... all fine. Then I installed the latest versions of gmp, mcfr and mcp (required for gcc) and then I wanted to install gcc.
So I created a folder "obj-avr" in the gcc source directory and used this for configure:
../configure --prefix=$PREFIX --target=avr --enable-languages=c,c++ --disable-nls --disable-libssp --with-dwarf2
Then I run the make command but I got this error:
checking for suffix of object files... configure: error: in `/local/scratch/osc22/dwl/gcc-4.5.1/obj-avr/avr/libgcc':
configure: error: cannot compute suffix of object files: cannot compile
See `config.log' for more details.
I've checked many posts online but I am not able to figure the exact problem, so maybe someone already knows what can it be. By looking at the config.log I can see a strange thing, in that the config is using some binutils from a different folder:
configure:13579: checking where to find the target ar
configure:13607: result: pre-installed in /usr/local/avr/avr/bin
the above paths are a bit strange, as I have the avr-as, and avr-ar on the /usr/local/avr/bin folder and that is where my PATH variable points as well. So I believe that somehow the configure script or the make process has messed up with the folders. I am not sure if this is the problem. However if you think this might be the issue let me know how to specify the correct path for the as/ar and any other necessary tools.
Also for the record, the $PREFIX is set to /usr/local/avr
Another thing to mention on the config.log is that there are a couple errors but which don't seem to affect the make process:
configure:6487: gcc -c -g -O2 -I/usr/include/libelf -I/usr/include/libelf conftest.c >&5
conftest.c:53:18: error: gelf.h: No such file or directory
configure:6475: gcc -c -g -O2 -I/usr/include/libelf -I/usr/include/libelf conftest.c >&5
conftest.c:53:20: error: libelf.h: No such file or directory