#Compiling AVR toolchain
http://distribute.atmel.no/tools/opensource/Atmel-AVR-Toolchain-3.4.1/avr/
Rebuild configure script with autoconf
in root and in bfd? May need to hack the Makefile.am if the autotools version is wrong.
(cd bfd; ./configure && make headers)
TARGET=avr
build_platform=$(shell uname -i)-pc-linux-gnu
host_platform=$(shell uname -i)-pc-linux-gnu
ATMEL_VERSION=3.4.1
mkdir build; cd build;
../configure --build=$(DEB_BUILD_GNU_TYPE) \
--host=$(DEB_HOST_GNU_TYPE) \
--target=$(TARGET) \
--host=${host_platform} \
--build=${build_platform} \
--with-pkgversion="AVR_8_bit_GNU_Toolchain_${ATMEL_VERSION}_ppa" \
--with-bugurl="http://www.atmel.com" \
--disable-nls \
--disable-werror \
--enable-install-libiberty \
--enable-install-libbfd \
--prefix=/usr/lib \
--infodir=/usr/share/info \
--mandir=/usr/share/man \
--bindir=/usr/bin \
--libexecdir=/usr/lib \
--libdir=/usr/lib \
make -j5
make install
Apply patch from http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51969 if building with GCC 4.7 host compiler.
mkdir build; cd build;
../configure --build=$(DEB_BUILD_GNU_TYPE) \
--host=$(DEB_HOST_GNU_TYPE) \
--target=$(TARGET) \
--host=${host_platform} \
--build=${build_platform} \
--with-pkgversion="AVR_8_bit_GNU_Toolchain_${ATMEL_VERSION}_ppa" \
--with-bugurl="http://www.atmel.com" \
--with-dwarf2 \
--enable-doc \
--disable-shared \
--disable-libada \
--disable-libssp \
--disable-nls \
--enable-languages=c,c++ \
--enable-fixed-point \
--prefix=/usr/lib \
--infodir=/usr/share/info \
--mandir=/usr/share/man \
--bindir=/usr/bin \
--libexecdir=/usr/lib \
--libdir=/usr/lib \
make -j5
make install
If using a build system, make sure it does not automatically try to strip all binaries, as amd64 strip will mangle the AVR libs.
Extract their separate headers tarball as avr-headers
cp avr-headers/io[0-9a-zA-Z]*.h include/avr/
./bootstrap
mkdir build; cd build;
../configure --build=$(DEB_BUILD_GNU_TYPE) \
--host=avr \
--target=$(TARGET) \
--prefix=/usr/lib \
--infodir=/usr/share/info \
--mandir=/usr/share/man \
--bindir=/usr/bin \
--libexecdir=/usr/lib \
--libdir=/usr/lib \
make -j5
make install
If using a build system, make sure it does not automatically try to strip all binaries, as amd64 strip will mangle the AVR libs.