From 11b667eeda7f8fa06644ef6359ca6cc753184ac6 Mon Sep 17 00:00:00 2001 From: Raphael Bahuau Date: Fri, 29 Nov 2019 11:35:06 +0100 Subject: [PATCH] Update Dockerfile with new compiler sh-elf-gcc + improve fxsdk install --- Dockerfile | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/Dockerfile b/Dockerfile index 788c9f2..20f036a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,10 +1,10 @@ # linux base image FROM alpine -# set up environment variables +# set up environment variables for the compiler ENV TARGET="sh3eb-elf" \ - PREFIX="$HOME/opt/sh3eb-elf-2.31.1-8.2.0" \ - PATH="$PATH:/opt/sh3eb-elf-2.31.1-8.2.0/bin:/opt/sh3eb-elf-2.31.1-8.2.0/fxsdk/bin" + COMPILER="/opt/sh-elf-2.31.1-8.2.0" \ + PATH="$PATH:/opt/sh-elf-2.31.1-8.2.0/bin" # dependencies RUN apk update && apk add --update --no-cache \ @@ -21,35 +21,36 @@ RUN apk update && apk add --update --no-cache \ flex # extract archives (binutils & gcc) -ADD binutils-2.31.1.tar.xz gcc-8.2.0.tar.xz $PREFIX/ +ADD binutils-2.31.1.tar.xz gcc-8.2.0.tar.xz $COMPILER/ # binutils -RUN cd $PREFIX && mkdir build-binutils && cd build-binutils && \ - ../binutils-2.31.1/configure --prefix=$PREFIX --target=$TARGET --disable-nls && \ +RUN cd $COMPILER && mkdir build-binutils && cd build-binutils && \ + ../binutils-2.31.1/configure --prefix=$COMPILER --target=$TARGET --with-multilib-list=m3,m4-nofpu --disable-nls --program-prefix=sh-elf- && \ make && make install # gcc -RUN cd $PREFIX && mkdir build-gcc && cd build-gcc && \ - ../gcc-8.2.0/configure --prefix=$PREFIX --target=$TARGET --enable-languages=c,c++ --without-headers --with-newlib --disable-nls && \ +RUN cd $COMPILER && mkdir build-gcc && cd build-gcc && \ + ../gcc-8.2.0/configure --prefix=$COMPILER --target=$TARGET --with-multilib-list=m3,m4-nofpu --enable-languages=c,c++ --without-headers --with-newlib --disable-nls --program-prefix=sh-elf- && \ make all-gcc && make install-gcc -# link gcc with libgcc +# link gcc with libgcc # need to fix the contrib/dl script : https://www.mail-archive.com/gcc-bugs@gcc.gnu.org/msg549371.html -RUN cd $PREFIX/gcc-8.2.0 && \ +RUN cd $COMPILER/gcc-8.2.0 && \ sed -i 's/sha512sum --check/sha512sum -c/g' ./contrib/download_prerequisites && \ ./contrib/download_prerequisites && \ - cd $PREFIX/build-gcc && \ + cd $COMPILER/build-gcc && \ make all-target-libgcc && make install-target-libgcc -# TODO git clone with commit number (or find a better way to rebuild from this) +# set up environment variables for casio tools +ENV CASIO="/usr/local" # fxsdk -ADD fxsdk $PREFIX/fxsdk -RUN cd $PREFIX/fxsdk && bash configure --prefix=$PREFIX && make && make install +ADD fxsdk $CASIO/fxsdk +RUN cd $CASIO/fxsdk && bash configure --prefix=$CASIO && make && make install # gint -ADD gint $PREFIX/gint -RUN cd $PREFIX/gint && mkdir build.fx && cd build.fx && \ +ADD gint $CASIO/gint +RUN cd $CASIO/gint && mkdir build.fx && cd build.fx && \ ../configure --target=fx9860g && make && make install WORKDIR /casio