2 # Test building with different compilers.
3 # Copyright (c) 2013 Emil Mikulic <emikulic@gmail.com>
9 RULER
=${GRAY}$
(for i
in $
(seq $
(tput cols
)); do echo -n -; done)${NORMAL}
10 notice
() { echo "${BOLD}==> $*${NORMAL}"; }
11 fatal() { echo "${RED}==> FATAL: $*${NORMAL}" >&2; exit 1; }
14 echo -n "${BOLD}==> $*: "
15 if [[ $RET = 0 ]]; then
24 MY_CLANG
=$HOME/llvm
/install
/bin
/clang
25 if [[ -z $CLANG ]]; then
26 # No CLANG env var set, try to guess.
27 if [[ -e $MY_CLANG ]]; then
33 if ! which $CLANG >/dev
/null
; then
34 fatal
"can't find clang as [$CLANG]"
36 notice
"clang is [$CLANG]"
39 notice
"[$0] run from [$RUNDIR]"
41 SRCDIR
=$
(cd $
(dirname $0)/..
; pwd)
42 notice
"src dir is [$SRCDIR]"
45 notice build
: standard
48 report build
: standard
50 notice build
: gcc with all the warnings
52 CFLAGS
="-fdiagnostics-show-option --all-warnings --extra-warnings -O"
53 env CC
=gcc
"CFLAGS=$CFLAGS" make
54 report build
: gcc with all the warnings
56 notice build
: clang with all the warnings
58 env CC
=$CLANG "CFLAGS=-Weverything" make