summaryrefslogtreecommitdiff
path: root/docker/build.sh
diff options
context:
space:
mode:
Diffstat (limited to 'docker/build.sh')
-rwxr-xr-xdocker/build.sh27
1 files changed, 27 insertions, 0 deletions
diff --git a/docker/build.sh b/docker/build.sh
new file mode 100755
index 0000000..f38740c
--- /dev/null
+++ b/docker/build.sh
@@ -0,0 +1,27 @@
+#!/bin/bash
+
+set -e # exit immediately if a command returns with a nonzero exit code
+
+echo "*** Building distcc/base image"
+docker build -t distcc/base -f base/Dockerfile base
+
+if [ $# -eq 0 ]; then
+ compilers=("gcc-4.8" "gcc-5" "clang-3.8")
+else
+ compilers=("$1")
+fi
+
+for compiler in "${compilers[@]}"
+do
+ echo "*** Building distcc/$compiler image"
+ docker build -t distcc/$compiler -f compilers/Dockerfile.$compiler .
+done
+
+echo "*** Building distcc"
+for compiler in "${compilers[@]}"
+do
+ echo "*** Building distcc with distcc/$compiler image"
+ set -x
+ docker run --rm -it -v /tmp:/tmp -v `pwd`/..:/src:rw -w /src distcc/$compiler bash -c "./autogen.sh && ./configure && make clean && make && make install && make check" &> distcc-$compiler.log
+ set +x
+done