Cleanup and documentation

This commit is contained in:
George Sokianos 2022-02-01 19:33:48 +00:00
parent aa38dff95b
commit 7b0469fefc
4 changed files with 46 additions and 26 deletions

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
native-gcc
repos

View File

@ -1,5 +1,5 @@
# The ubuntu:latest tag points to the "latest LTS", since that's the version recommended for general use. # The ubuntu:latest tag points to the "latest LTS", since that's the version recommended for general use.
FROM ubuntu:bionic FROM ubuntu:latest
LABEL maintainer="Georgios Sokianos <walkero@gmail.com>" LABEL maintainer="Georgios Sokianos <walkero@gmail.com>"
@ -19,9 +19,6 @@ RUN ln -s /usr/bin/python2.7 /usr/bin/python; \
pip2 install --no-cache-dir argcomplete==1.12.3 mako; \ pip2 install --no-cache-dir argcomplete==1.12.3 mako; \
rm -rf /tmp/* /var/tmp/*; rm -rf /tmp/* /var/tmp/*;
# libc6:i386 libncurses5:i386 libstdc++6:i386
# multiarch-support binutils-multiarch \
RUN apt-get -y --no-install-recommends install \ RUN apt-get -y --no-install-recommends install \
autoconf \ autoconf \
automake \ automake \
@ -51,7 +48,6 @@ RUN apt-get -y --no-install-recommends install \
git config --global user.email "walkero@gmail.com"; \ git config --global user.email "walkero@gmail.com"; \
git config --global user.name "Georgios Sokianos"; git config --global user.name "Georgios Sokianos";
# libfl2 \
# Install latest lha from git repo # Install latest lha from git repo
RUN git clone https://github.com/jca02266/lha.git && \ RUN git clone https://github.com/jca02266/lha.git && \
mkdir build && \ mkdir build && \
@ -67,8 +63,6 @@ RUN git clone https://github.com/jca02266/lha.git && \
ADD ${REPOS_PATH}/adtools /opt/adtools ADD ${REPOS_PATH}/adtools /opt/adtools
ADD ${REPOS_PATH}/binutils-gdb /opt/adtools/binutils/repo ADD ${REPOS_PATH}/binutils-gdb /opt/adtools/binutils/repo
ADD ${REPOS_PATH}/coreutils /opt/adtools/coreutils/repo ADD ${REPOS_PATH}/coreutils /opt/adtools/coreutils/repo
# ADD ${REPOS_PATH}/gcc-releases-gcc-8.4.0.tar.gz /opt/adtools/gcc/repo
# ADD ${REPOS_PATH}/gcc /opt/adtools/gcc/repo
ADD ${REPOS_PATH}/gnulib /opt/adtools/gnulib/repo ADD ${REPOS_PATH}/gnulib /opt/adtools/gnulib/repo
ADD build-gcc.sh /opt/adtools ADD build-gcc.sh /opt/adtools
@ -79,20 +73,3 @@ WORKDIR /opt/adtools
RUN git submodule init && \ RUN git submodule init && \
git submodule update && \ git submodule update && \
chmod +x build-gcc.sh chmod +x build-gcc.sh
# && \
# gild/bin/gild checkout binutils ${BINUTILS_VER} && \
# gild/bin/gild checkout gcc ${GCC_VER} && \
# make -C native-build -j4;
# RUN cd /opt/adtools/native-build && \
# make native-install && \
# make native-dist && \
# make clib2-dist;

View File

@ -36,7 +36,6 @@ help:
@echo "repos/execsg_private_sdk/SDK/..." @echo "repos/execsg_private_sdk/SDK/..."
@echo "" @echo ""
# TODO: Add a check for the execsg_private_sdk folder
build: build:
docker build -t $(REPO):$(TAG) \ docker build -t $(REPO):$(TAG) \
--build-arg REPOS_PATH=$(REPOSPATH) . --build-arg REPOS_PATH=$(REPOSPATH) .

View File

@ -1,3 +1,45 @@
# adtoolsBuilder # adtoolsBuilder
This is docker images that can be used to build adtools for AmigaOS 4 This is docker images that can be used to build native adtools for AmigaOS 4 on every operating system that supports Docker.
## Setup
To prepare the environment you need to do the following:
1. Clone the necessary repos under the `repos` folder
```bash
make clonerepos
```
1. Copy the latest ExecSG private SDK under `repos` folder. So the path should be `repos/execsg_private_sdk/SDK/...`
If this folder does not exist the following step will fail with an error like below.
```bash
Step 15/17 : ADD ${REPOS_PATH}/execsg_private_sdk /tmp/execsg_private_sdk
ADD failed: file not found in build context or excluded by .dockerignore: stat repos/execsg_private_sdk: file does not exist
make: *** [Makefile:41: build] Error 1
```
1. Build the docker image
```bash
make build
```
This will create the walkero/adtoolsbuilder:adtools-build Docker image, with size around 1.88GB. So make sure you have this available space at your hard disk.
After this steps you are ready to compile the adtools on your machine.
## Compile adtools
To compile adtools you first need to create a Docker container based on which GCC version you want to build. Available versions are 6, 8, 10, 11. To do that you just need to run the following:
```bash
make gcc8
```
Change the number based on which version you would like to compile.
Then you can execute the `build-gcc.sh` script to run all the steps, or do them by hand.
**CAUTION:** Because of a bug, the `make native-install` command might fail the first time you run it, but it will succeed if you run it a second time. That's why it is recommended to execute the commands by hand, until this bug is fixed.
## Useful information
1. When you start a container to compile adtools in there, a new folder will be created named `native-gcc`. In there new folders will be created with the gcc files and the distribution lha packages for adtools and clib. This way you can get those files from the host machine.
2. By default, the adtools is compiled using the latest AmigaOS 4 SDK v53.34. If you would like to compile them using the previous v53.30, then open the `Makefile` and change the `makefile-SDK53.34` to `makefile-SDK53.30`. By doing that the latest ExecSG private SDK is not used, and you can have an empty folder under `repos` directory.
3. If you don't have the latest ExecSG private SDK, then check the above line on what to do.
4. If you want to update the cloned repos and rebuild the Docker image, just run `make buildnc`. This will pull the latest code for the necessary repos and will re-create the Docker image. The files `native-build/Makefile`, `gcc-build/features.mk` and `gcc-build/Makefile` are not updated though, because custom ones are used. If there are updates at the adtools repo, these need to be applied manually, with caution. The custom files can be found under `files/` folder.