Created
December 20, 2015 17:44
-
-
Save phonyphonecall/457992ec8c233f301c3e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM ubuntu:14.04 | |
RUN mkdir /usr/microblaze | |
RUN mkdir /usr/microblaze/src | |
RUN mkdir /usr/microblaze/tmp | |
RUN mkdir /usr/microblaze/tmp/binutils-build | |
RUN mkdir /usr/microblaze/tmp/gcc-build | |
RUN apt-get update -y | |
RUN apt-get install -y wget | |
# dowload and extract first, so when we fail later, we always have these layers cached (no redownloads!) | |
# download the fun | |
RUN wget http://ftp.gnu.org/gnu/binutils/binutils-2.22.tar.bz2 | |
RUN wget ftp://ftp.gmplib.org/pub/gmp-5.1.3/gmp-5.1.3.tar.bz2 | |
RUN wget http://www.mpfr.org/mpfr-current/mpfr-3.1.3.tar.bz2 | |
RUN wget http://www.multiprecision.org/mpc/download/mpc-0.9.tar.gz | |
RUN wget http://mirrors.concertpass.com/gcc/releases/gcc-4.6.4/gcc-4.6.4.tar.bz2 | |
RUN wget ftp://sources.redhat.com/pub/newlib/newlib-1.20.0.tar.gz | |
# extract the fun | |
RUN tar xjvf binutils-2.22.tar.bz2 -C /usr/microblaze/src | |
RUN tar xjvf gmp-5.1.3.tar.bz2 -C /usr/microblaze/src | |
RUN tar xjvf mpfr-3.1.3.tar.bz2 -C /usr/microblaze/src | |
RUN tar xzvf mpc-0.9.tar.gz -C /usr/microblaze/src | |
RUN tar xjvf gcc-4.6.4.tar.bz2 -C /usr/microblaze/src | |
RUN tar xzvf newlib-1.20.0.tar.gz -C /usr/microblaze/src | |
RUN apt-get install -y make gcc | |
# binutils | |
RUN cd /usr/microblaze/tmp/binutils-build && /usr/microblaze/src/binutils-2.22/configure --prefix=/usr/microblaze --target=microblaze && make && make install | |
ENV LD_LIBRARY_PATH /usr/microblaze/lib:$LD_LIBRARY_PATH | |
ENV PATH /usr/microblaze/bin/:$PATH | |
RUN apt-get install -y m4 | |
# gmp, mpfr & mpc | |
RUN cd /usr/microblaze/src/gmp-5.1.3 && ./configure --prefix=/usr/microblaze && make && make check && make install | |
RUN cd /usr/microblaze/src/mpfr-3.1.3 && ./configure --prefix=/usr/microblaze --with-gmp=/usr/microblaze && make && make check && make install | |
RUN cd /usr/microblaze/src/mpc-0.9 && ./configure --prefix=/usr/microblaze --with-gmp=/usr/microblaze && make && make check && make install | |
# gcc | |
RUN cd /usr/microblaze/src/gcc-4.6.4 && ln -s /usr/microblaze/src/newlib-1.20.0/newlib . && ln -s /usr/microblaze/src/newlib-1.20.0/libgloss . && cd /usr/microblaze/tmp/gcc-build && /usr/microblaze/src/gcc-4.6.4/configure --prefix=/usr/microblaze --target=microblaze --disable-nls --with-gnu-as --with-gnu-ld --enable-languages="c,c++" --with-headers=/usr/microblaze/src/newlib-1.20.0/newlib/libc/include --with-newlib --with-libgloss --with-gmp=/usr/microblaze --with-mpfr=/usr/microblaze --with-mpc=/usr/microblaze && make all && make install | |
RUN ln -s /usr/microblaze/microblaze/lib/libnosys.a /usr/microblaze/microblaze/lib/libxil.a | |
# cleanup | |
RUN rm binutils-2.22.tar.bz2 | |
RUN rm gmp-5.1.3.tar.bz2 | |
RUN rm mpfr-3.1.3.tar.bz2 | |
RUN rm mpc-0.9.tar.gz | |
RUN rm gcc-4.6.4.tar.bz2 | |
RUN rm newlib-1.20.0.tar.gz |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
A dockerfile for the microblaze toolchain!