(folly) make check on OSX Yosemite (10.10)
[folly.git] / folly / bootstrap-osx-homebrew.sh
1 #!/bin/bash -x
2 # The only prerequisite should be homebrew. If something doesn't work out of
3 # the box with just homebrew, let's fix it.
4
5 # fail fast
6 set -e
7
8 brewget() {
9     brew install $@ || brew upgrade $@
10 }
11
12 # tool dependencies: autotools and scons (for double-conversion)
13 brewget autoconf automake libtool scons
14
15 # dependencies
16 brewget glog gflags boost libevent
17
18 # Install the double-conversion library.
19 # NB their install target installs the libs but not the headers, hence the
20 # CPPFLAGS and link shenanigans.
21 test -d double-conversion || {
22     git clone https://github.com/floitsch/double-conversion.git
23     pushd double-conversion/src
24     ln -s . double-conversion
25     popd
26 }
27 pushd double-conversion
28 scons
29 # fool libtool into using static linkage
30 # (this won't work if you've already installed libdouble-conversion into a
31 # default search path)
32 rm -f libdouble-conversion*dylib
33 DOUBLE_CONVERSION_HOME=$(pwd)
34 popd
35
36 autoreconf -i
37 ./configure CPPFLAGS=-I"$DOUBLE_CONVERSION_HOME/src" LDFLAGS=-L"$DOUBLE_CONVERSION_HOME"
38
39 pushd test
40 test -d gtest-1.7.0 || {
41     curl -O https://googletest.googlecode.com/files/gtest-1.7.0.zip
42     unzip gtest-1.7.0.zip
43 }
44 popd