@@ -9,18 +9,22 @@ mkdir ${BUILD}
9
9
mkdir ${INSTALL}
10
10
root=$( pwd)
11
11
cores=4
12
+ VERSION_BINUTILS=" 2.32"
13
+ VERSION_GCC=" 9.1.0"
14
+ VERSION_LIBC=" 2.0.0"
12
15
13
16
# Get sources
14
- wget -q " https://raw.githubusercontent.com/osx-cross/homebrew-avr/master/avr-binutils-size.patch" &
15
- wget -qO- " https://ftp.gnu.org/gnu/binutils/binutils-2.31.1.tar.bz2" | tar xj --directory ${SRC} &
16
- wget -qO- " https://ftp.gnu.org/gnu/gcc/gcc-8.2.0/gcc-8.2.0.tar.xz" | tar xJ --directory ${SRC} &
17
- wget -qO- " https://download.savannah.gnu.org/releases/avr-libc/avr-libc-2.0.0.tar.bz2" | tar xj --directory ${SRC} &
17
+ wget -q " https://dl.bintray.com/osx-cross/avr-patches/avr-binutils-${VERSION_BINUTILS} -size.patch" &
18
+ wget -q " https://dl.bintray.com/osx-cross/avr-patches/avr-libc-${VERSION_LIBC} -atmega168pb.patch" &
19
+ wget -qO- " https://ftp.gnu.org/gnu/binutils/binutils-${VERSION_BINUTILS} .tar.bz2" | tar xj --directory ${SRC} &
20
+ wget -qO- " https://ftp.gnu.org/gnu/gcc/gcc-${VERSION_GCC} /gcc-${VERSION_GCC} .tar.xz" | tar xJ --directory ${SRC} &
21
+ wget -qO- " https://download.savannah.gnu.org/releases/avr-libc/avr-libc-${VERSION_LIBC} .tar.bz2" | tar xj --directory ${SRC} &
18
22
wait
19
23
20
24
# Build binutils first
21
- cd ${SRC} /binutils-2.31.1
25
+ cd ${SRC} /binutils-${VERSION_BINUTILS}
22
26
# patch size file
23
- patch -g 0 -f -p0 -i ../../avr-binutils-size.patch
27
+ patch -g 0 -f -p0 -i ../../avr-binutils-${VERSION_BINUTILS} - size.patch
24
28
mkdir build && cd build
25
29
# configure and make
26
30
../configure --prefix=${root} /${INSTALL} /avr-binutils/ --target=avr --disable-nls --disable-werror
@@ -31,7 +35,7 @@ make install
31
35
export PATH=${root} /${INSTALL} /avr-binutils/bin:$PATH
32
36
33
37
cd ${root}
34
- cd ${SRC} /gcc-8.2.0
38
+ cd ${SRC} /gcc-${VERSION_GCC}
35
39
mkdir build && cd build
36
40
../configure --target=avr --prefix=${root} /${INSTALL} /avr-gcc/ \
37
41
--with-ld=${root} /${INSTALL} /avr-binutils/bin/avr-ld \
@@ -46,10 +50,13 @@ make install
46
50
export PATH=${root} /${INSTALL} /avr-gcc/bin:$PATH
47
51
48
52
cd ${root}
49
- cd ${SRC} /avr-libc-2.0.0
53
+ cd ${SRC} /avr-libc-${VERSION_LIBC}
54
+ patch -g 0 -f -p0 -i ../../avr-libc-${VERSION_LIBC} -atmega168pb.patch
50
55
build=` ./config.guess`
51
56
./configure --build=${build} --prefix=${root} /${INSTALL} /avr-gcc --host=avr
52
57
make install -j${cores}
53
58
54
59
cd ${root}
55
- rm -r build src avr-binutils-size.patch
60
+ rm -r build src
61
+ rm avr-binutils-${VERSION_BINUTILS} -size.patch
62
+ rm avr-libc-${VERSION_LIBC} -atmega168pb.patch
0 commit comments