Merge pull request #247 from joshuawarner32/docker

Add dockerfiles for cross-compiling to windows and linux-arm
This commit is contained in:
Joel Dice 2014-04-30 07:59:10 -06:00
commit 6de967af24
5 changed files with 127 additions and 10 deletions

View File

@ -1,10 +0,0 @@
#!/bin/sh
if test $# -eq 0; then
echo "Usage: $0 <command_to_run_in_docker>"
echo "Ex: $0 make test"
echo "Ex: $0 ./test/ci.sh"
exit 1
fi
docker run --rm -i -t -v $(cd $(dirname "$0") && pwd):/var/avian -u $(id -u "${USER}") joshuawarner32/avian-build "${@}"

69
docker/arm/Dockerfile Normal file
View File

@ -0,0 +1,69 @@
FROM joshuawarner32/avian-build
MAINTAINER Joshua Warner, joshuawarner32@gmail.com
RUN dpkg --add-architecture armel && \
apt-get update && \
mkdir -p /opt/arm && \
apt-get download libc6-dev:armel \
linux-headers-3.13-1-all-armel:armel \
linux-libc-dev:armel \
libc6:armel \
zlib1g-dev:armel \
zlib1g:armel && \
for x in *.deb; do \
dpkg -x $x /opt/arm; \
done && \
rm *.deb && \
apt-get install -y \
wget \
libgmp-dev \
libmpfr-dev \
libmpc-dev \
libisl-dev && \
apt-get clean all && \
for x in $(find /opt/arm -type l); do \
r=$(readlink "$x" | sed 's,^/,/opt/arm/,g'); \
rm "$x"; \
ln -s "$r" "$x"; \
done
RUN mkdir -p /var/src
# Build & install binutils
RUN wget ftp://sourceware.org/pub/binutils/snapshots/binutils-2.23.91.tar.bz2 -O /var/src/binutils.tar.bz2 && \
cd /var/src/ && tar -xjf binutils.tar.bz2 && rm binutils.tar.bz2 && \
cd /var/src/binutils* && \
mkdir build && \
cd build && \
../configure \
--target=arm-linux-gnueabi \
--prefix=/opt/arm \
--disable-multilib \
--program-prefix=arm-linux-gnueabi- \
--with-sysroot=/opt/arm \
--with-headers=/opt/arm/usr/include && \
make && \
make install && \
cd /var/src && \
rm -rf *
# build & install gcc
RUN wget http://www.netgull.com/gcc/releases/gcc-4.8.2/gcc-4.8.2.tar.bz2 -O /var/src/gcc.tar.bz2 && \
cd /var/src/ && tar -xjf gcc.tar.bz2 && rm gcc.tar.bz2 && \
cd /var/src/gcc* && \
mkdir build && \
cd build && \
../configure \
--target=arm-linux-gnueabi \
--enable-languages=c,c++ \
--prefix=/opt/arm \
--disable-multilib \
--program-prefix=arm-linux-gnueabi- \
--with-sysroot=/opt/arm \
--with-headers=/opt/arm/usr/include && \
make && \
make install && \
cd /var/src && \
rm -rf *
ENV PATH $PATH:/opt/arm/bin

35
docker/build.sh Executable file
View File

@ -0,0 +1,35 @@
#!/bin/sh
if test $# -eq 0; then
echo "Usage: $0 [--container <container_name>] -- <command_to_run_in_docker>"
echo "Ex: $0 make test"
echo "Ex: $0 ./test/ci.sh"
echo "Ex: $0 --container joshuawarner32/avian-build-windows -- make platform=windows"
exit 1
fi
while test $# > 1 ; do
key="$1"
case $key in
-c|--container)
shift
CONTAINER="$1"
shift
;;
--)
shift
break
;;
*)
break
;;
esac
done
if test -z $CONTAINER; then
CONTAINER=joshuawarner32/avian-build
fi
DIR=$(cd $(dirname "$0") && cd .. && pwd)
docker run --rm -i -t -v "${DIR}":/var/avian -u $(id -u "${USER}") "${CONTAINER}" "${@}"

23
docker/windows/Dockerfile Normal file
View File

@ -0,0 +1,23 @@
FROM joshuawarner32/avian-build
MAINTAINER Joshua Warner, joshuawarner32@gmail.com
# Install cross-compile toolchain and emulator for testing
RUN apt-get update && \
apt-get install -y \
mingw-w64 \
wget \
unzip \
--no-install-recommends && \
apt-get clean all
# Download win32 and win64 adjacent to avian
RUN cd .. && \
wget https://github.com/ReadyTalk/win32/archive/master.zip -O win32.zip && \
unzip win32.zip && \
rm win32.zip && \
mv win32-* win32 && \
wget https://github.com/ReadyTalk/win64/archive/master.zip -O win64.zip && \
unzip win64.zip && \
rm win64.zip && \
mv win64-* win64