Skip to content

Instantly share code, notes, and snippets.

@jarkko-hautakorpi
Forked from aczid/build.sh
Last active July 13, 2018 18:42
Show Gist options
  • Save jarkko-hautakorpi/581d4a6e443d9c04bd3ddbce51887d41 to your computer and use it in GitHub Desktop.
Save jarkko-hautakorpi/581d4a6e443d9c04bd3ddbce51887d41 to your computer and use it in GitHub Desktop.
AVR build script for bleeding edge toolchain
# - 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
for file in ../binutils-gdb/* ; do ln -s "${file}" ; done
./contrib/download_prerequisites
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
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