#!/bin/sh -ex
-
+make clean
make travis CC=clang
make travis CC=gcc
make travis CC=i686-w64-mingw32-gcc HOST="--host=i686-w64-mingw32" TEST="unittest/run.exe"
make travis CC=clang CFLAGS="-fsanitize=undefined" ASAN_OPTIONS="detect_leaks=0"
make travis CC=clang CFLAGS="-fsanitize=address -g" ASAN_OPTIONS="detect_leaks=0"
-make travis CC=clang TEST=analyze
+make travis CC=/usr/bin/clang TEST=analyze
autoconf \
&& rm -rf /var/lib/apt/lists/*
+# Travis has upgraded clang, from clang-3.4 to clang-5.0
+# https://github.com/travis-ci/travis-cookbooks/pull/890
+RUN printf "deb http://apt.llvm.org/trusty/ llvm-toolchain-trusty-5.0 main\ndeb-src http://apt.llvm.org/trusty/ llvm-toolchain-trusty-5.0 main\n# Also add the following for the appropriate libstdc++\ndeb http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu trusty main\n" > /etc/apt/sources.list.d/llvm-toolchain.list && apt-key adv --fetch-keys http://apt.llvm.org/llvm-snapshot.gpg.key && apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 1E9377A2BA9EF27F
+RUN apt-get -qq update && apt-get install -y --no-install-recommends \
+ clang-5.0 \
+ && rm -rf /var/lib/apt/lists/* \
+ && ln -s /usr/bin/clang-5.0 /usr/local/bin/clang
+
# ccache specific
RUN apt-get -qq update && apt-get install -y --no-install-recommends \
gperf \