forked from stellar/stellar-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
travis-build.sh
executable file
·68 lines (57 loc) · 1.5 KB
/
travis-build.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#!/bin/bash
# This is just a slightly more-debuggable script that does our travis build
set -ev
echo $TRAVIS_PULL_REQUEST
# Short-circuit transient 'auto-initialization' builds
git fetch origin master
MASTER=$(git describe --always FETCH_HEAD)
HEAD=$(git describe --always HEAD)
echo $MASTER
echo $HEAD
if [ $HEAD == $MASTER ]
then
echo "HEAD SHA1 equals master; probably just establishing merge, exiting build early"
exit 0
fi
# Try to ensure we're using the real g++ and clang++ versions we want
mkdir bin
ln -s `which gcc-4.9` bin/gcc
ln -s `which g++-4.9` bin/g++
ln -s `which clang-3.5` bin/clang
ln -s `which clang++-3.5` bin/clang++
export PATH=`pwd`/bin:$PATH
hash -r
clang -v
g++ -v
llvm-symbolizer --version || true
# Create postgres databases
export PGUSER=postgres
psql -c "create database test;"
for i in $(seq 0 15)
do
psql -c "create database test$i;"
done
committer_of(){
local c=$(git cat-file -p "$1" 2> /dev/null \
| sed -ne '/^committer \([^<]*[^ <]\) *<.*>.*/{s//\1/p; q;}')
test -n "$c" -a Latobarita != "$c" && echo "$c"
}
committer=$(committer_of HEAD) \
|| committer=$(committer_of HEAD^2) \
|| committer=$(committer_of HEAD^1) \
|| committer=Latobarita
case $committer in
"David Mazieres")
config_flags="--enable-asan --enable-ccache"
;;
*)
config_flags="--enable-asan --enable-ccache --enable-sdfprefs"
;;
esac
echo "committer = $committer, config_flags = $config_flags"
ccache -s
./autogen.sh
./configure $config_flags
make
ccache -s
make check