Skip to content

Commit

Permalink
updated build scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
rajszym committed Mar 11, 2021
1 parent a0ba7a7 commit 7d4f054
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 54 deletions.
68 changes: 16 additions & 52 deletions .build-avr-gcc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,66 +2,30 @@

set -e

OUTDIR="build"
BINVER="2.36.1"
GCCVER="10.2.0"
COMMIT_LIBC="d09c2a61764aced3274b6dde4399e11b0aee4a87"

# install dependencies
apt-get -y -qq install wget make mingw-w64 gcc g++ bzip2 git autoconf texinfo

# get the source code
wget https://ftpmirror.gnu.org/binutils/binutils-$BINVER.tar.xz
tar -xf binutils-$BINVER.tar.xz
# build and install
mkdir -p binutils-$BINVER/$OUTDIR
cd binutils-$BINVER/$OUTDIR
../configure \
--target=avr \
--disable-nls \
--disable-werror
make -s
sudo make -s install
cd ../..
rm -rf binutils-$BINVER

# get the source code
wget https://ftpmirror.gnu.org/gcc/gcc-$GCCVER/gcc-$GCCVER.tar.xz
tar -xf gcc-$GCCVER.tar.xz
# download prerequisites
cd gcc-$GCCVER
cd gcc-$GCCVER
./contrib/download_prerequisites
# build and install
mkdir -p $OUTDIR
cd $OUTDIR
../configure \
--target=avr \
--enable-languages=c,c++ \
--disable-nls \
--disable-libssp \
--disable-libada \
--with-dwarf2 \
--disable-shared \
--enable-static \
--enable-mingw-wildcard \
--enable-plugin \
--with-gnu-as
make -s
sudo make -s install
cd ../..
rm -rf gcc-$GCCVER

# get the source code
git clone https://github.com/stevenj/avr-libc3 avr-libc3
cd avr-libc3
git checkout $COMMIT_LIBC
./bootstrap
mkdir -p $OUTDIR
cd $OUTDIR
../configure \
--host=avr \
--build=`../avr-libc3/config.guess`
mkdir -p build
cd build
../configure \
--target=avr \
--enable-languages=c,c++ \
--disable-nls \
--disable-libssp \
--disable-libada \
--with-dwarf2 \
--disable-shared \
--enable-static \
--enable-mingw-wildcard \
--enable-plugin \
--with-gnu-as
make -s
sudo make -s install
cd ../..
rm -rf avr-libc3
rm -fRd gcc-$GCCVER
21 changes: 21 additions & 0 deletions .build-avr-libc.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/bash

set -e

COMMIT_LIBC="d09c2a61764aced3274b6dde4399e11b0aee4a87"

# get the source code
git clone https://github.com/stevenj/avr-libc3 avr-libc3
cd avr-libc3
git checkout $COMMIT_LIBC
./bootstrap
# build and install
mkdir -p build
cd build
../configure \
--host=avr \
--build=`../avr-libc3/config.guess`
make -s
sudo make -s install
cd ../..
rm -fRd avr-libc3
20 changes: 20 additions & 0 deletions .build-binutils.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/bash

set -e

BINVER="2.36.1"

# get the source code
wget https://ftpmirror.gnu.org/binutils/binutils-$BINVER.tar.xz
tar -xf binutils-$BINVER.tar.xz
# build and install
mkdir -p binutils-$BINVER/build
cd binutils-$BINVER/build
../configure \
--target=avr \
--disable-nls \
--disable-werror
make -s
sudo make -s install
cd ../..
rm -fRd binutils-$BINVER
8 changes: 6 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,15 @@ jobs:
- name: install dependencies
run: |
sudo apt-get -y -qq update
sudo apt-get -y -qq install cmake ninja-build
sudo apt-get -y -qq install cmake ninja-build wget make mingw-w64 gcc g++ bzip2 git autoconf texinfo
- name: build binutils
run: bash ./.build-binutils.sh
- name: build avr-gcc
run: sudo bash ./.build-avr-gcc.sh
run: bash ./.build-avr-gcc.sh
- name: check avr-gcc version
run: avr-gcc --version
- name: build avr-libc
run: bash ./.build-avr-libc.sh
- name: make test
run: |
cmake -S. -Bbuild -GNinja
Expand Down

0 comments on commit 7d4f054

Please sign in to comment.