Skip to content

Commit 4636e43

Browse files
committed
Install avr-gcc and binutils in same directory
1 parent 2ec1ec1 commit 4636e43

File tree

3 files changed

+20
-26
lines changed

3 files changed

+20
-26
lines changed

.github/workflows/build-avr-gcc.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,14 @@ jobs:
2525
2626
- name: Compiling test files
2727
run: |
28-
/opt/avr-gcc/avr-gcc/bin/avr-g++ --version
29-
/opt/avr-gcc/avr-gcc/bin/avr-g++ -mmcu=atmega328p test/main1.cpp
30-
/opt/avr-gcc/avr-gcc/bin/avr-g++ -mmcu=atmega328p test/main2.cpp
28+
/opt/avr-gcc/bin/avr-g++ --version
29+
/opt/avr-gcc/bin/avr-g++ -mmcu=atmega328p test/main1.cpp
30+
/opt/avr-gcc/bin/avr-g++ -mmcu=atmega328p test/main2.cpp
3131
3232
#- name: Fake toolchain
3333
# run: |
3434
# mkdir -p /opt/avr-gcc/bin
35-
# cp $(which true) /opt/avr-gcc/avr-gcc/bin/avr-g++
35+
# cp $(which true) /opt/avr-gcc/bin/avr-g++
3636

3737
- name: Create tarball
3838
run: |

README.md

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,30 +2,24 @@
22

33
## Installation
44

5-
Download the latest `avr-gcc.tar.bz2` from [Releases](https://github.com/modm-ext/docker-avr-gcc/releases)
5+
Download the latest `modm-avr-gcc.tar.bz2` from [Releases](https://github.com/modm-ext/docker-avr-gcc/releases)
66
and unpack it to `/opt`:
77

88
```sh
9-
tar xf avr-gcc.tar.bz2 --directory /opt
9+
tar xf modm-avr-gcc.tar.bz2 --directory /opt
1010
```
1111

12-
Add the `bin/` directories of avr-gcc and avr-binutils to your `$PATH`,
12+
Add the `bin/` directory to your `$PATH`,
1313
e.g. by adding the following line to your `~/.bashrc` file:
1414

1515
```sh
16-
export PATH="/opt/avr-gcc/avr-gcc/bin:/opt/avr-gcc/avr-binutils/bin:$PATH"
16+
export PATH="/opt/avr-gcc/bin:$PATH"
1717
```
1818

1919
## Building locally with Docker
2020

2121
There is a Docker image with all prerequisites for building, created from the `Dockerfile` in this repository.
22-
Pull and start the image from Dockerhub with:
23-
24-
```sh
25-
docker run -it modm/avr-gcc-prerequisites
26-
```
27-
28-
Or build the image from the local `Dockerfile` and start it:
22+
Build the image from the local `Dockerfile` and start it:
2923

3024
```sh
3125
docker build --tag avr-gcc-prerequisites:local .
@@ -35,14 +29,14 @@ docker run -it avr-gcc-prerequisites:local
3529
Inside the Docker container get this repository
3630

3731
```sh
38-
git clone https://github.com/modm-ext/docker-avr-gcc.git
32+
git clone https://github.com/modm-io/avr-gcc.git
3933
```
4034

4135
Run the build.sh script
4236

4337
```sh
44-
cd docker-avr-gcc
45-
time ./build.sh
38+
cd avr-gcc
39+
./build.sh
4640
```
4741

4842
The toolchain will be in `/opt/avr-gcc`.

build.sh

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,25 +29,25 @@ patch -g 0 -f -p0 -i ../../avr-size.patch
2929
mkdir build && cd build
3030
# configure and make
3131
../configure \
32-
--prefix=${INSTALL}/avr-binutils/ \
3332
--target=avr \
33+
--prefix=${INSTALL}/ \
3434
--disable-nls \
3535
--disable-werror
3636
make -j${cores}
3737
make install
3838

3939
# prepend path of newly compiled avr-binutils
40-
export PATH=${INSTALL}/avr-binutils/bin:$PATH
40+
export PATH=${INSTALL}/bin:$PATH
4141

4242
cd ${root}
4343
cd ${SRC}/gcc-${VERSION_GCC}
4444
mkdir build && cd build
4545
../configure \
4646
--target=avr \
47-
--prefix=${INSTALL}/avr-gcc/ \
48-
--with-ld=${INSTALL}/avr-binutils/bin/avr-ld \
49-
--with-as=${INSTALL}/avr-binutils/bin/avr-as \
50-
--libdir=${INSTALL}/avr-gcc/avr/lib \
47+
--prefix=${INSTALL}/ \
48+
--with-ld=${INSTALL}/bin/avr-ld \
49+
--with-as=${INSTALL}/bin/avr-as \
50+
--libdir=${INSTALL}/avr/lib \
5151
--enable-languages=c,c++ \
5252
--disable-nls \
5353
--disable-libssp \
@@ -62,15 +62,15 @@ make -j${cores}
6262
make install
6363

6464
# prepend path of newly compiled avr-gcc
65-
export PATH=${INSTALL}/avr-gcc/bin:$PATH
65+
#export PATH=${INSTALL}/bin:$PATH
6666

6767
cd ${root}
6868
cd ${SRC}/avr-libc-${VERSION_LIBC}
6969
patch -g 0 -f -p0 -i ../../avr-libc-add-mcu-atmega168pb.patch
7070
build=`./config.guess`
7171
./configure \
7272
--build=${build} \
73-
--prefix=${INSTALL}/avr-gcc \
73+
--prefix=${INSTALL} \
7474
--host=avr
7575
make install -j${cores}
7676

0 commit comments

Comments
 (0)