Skip to content

Instantly share code, notes, and snippets.

@aczid
Last active Aug 29, 2015
Embed
What would you like to do?
AVR build script for bleeding edge toolchain (extended)
# - requires git, svn, hg installed
# - will just build the bleeding edge of everything
export PREFIX=`pwd`
export PATH=$PATH:$PREFIX/bin/
export SRCDIR=$PREFIX/src/
# todo test if SRCDIR exists, then get the source
mkdir -p $SRCDIR
# get binutils/gdb, gmp, mpfr, mpc
cd $SRCDIR
git clone git://sourceware.org/git/binutils-gdb.git
hg clone https://gmplib.org/repo/gmp/
git clone https://gforge.inria.fr/git/mpc/mpc.git
svn checkout svn://scm.gforge.inria.fr/svn/mpfr/trunk mpfr
svn checkout svn://gcc.gnu.org/svn/gcc/trunk gcc_trunk
# get avr-libc, avarice, simulavr, avrdude
svn checkout svn://svn.savannah.nongnu.org/avr-libc/trunk/avr-libc
svn checkout svn://svn.code.sf.net/p/avarice/code/trunk/avarice
git clone git://git.savannah.nongnu.org/simulavr.git
svn co svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude
# install gcc with all the binutils stuff + gmp/mpfr/mpc in-tree
cd $SRCDIR/gcc_trunk
#patch <apply any patches you have here>
for file in ../binutils-gdb/* ; do ln -s "${file}" ; done
ln -s $SRCDIR/gmp gmp
ln -s $SRCDIR/mpc mpc
ln -s $SRCDIR/mpfr mpfr
mkdir obj-avr
cd obj-avr
../configure --prefix=$PREFIX \
--libdir=$PREFIX/lib/ \
--host=x86_64-pc-linux-gnu \
--build=x86_64-pc-linux-gnu \
--target=avr \
--enable-languages=c,c++ \
--with-newlib \
--disable-shared \
--disable-threads \
--disable-nls \
--disable-libssp \
--disable-libada \
--with-dwarf2 \
--enable-version-specific-runtime-libs \
--enable-fixed-point \
--with-pkgversion='by Aram Verstegen' \
--with-bugurl='http://www.google.com/ :)'
make
make install
## install avr-libc
cd $SRCDIR/avr-libc
./bootstrap
mkdir obj-avr
cd obj-avr
../configure --prefix=$PREFIX --build=`../config.guess` --host=avr
make
make install
# install avarice
cd $SRCDIR/avarice
./Bootstrap
mkdir obj-avr
cd obj-avr
../configure --prefix=$PREFIX
make
make install
# install simulavr
# still sort of broken
#cd $SRCDIR/simulavr
#./bootstrap
#mkdir obj-avr
#cd obj-avr
#../configure --prefix=$PREFIX --disable-doxygen-doc --enable-dependency-tracking
#make
#make install
# install avrdude
cd $SRCDIR/avrdude
./bootstrap
mkdir obj-avr
cd obj-avr
../configure --prefix=$PREFIX
make
make install
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment