fix osx bootstrap for new double-conversion directory structure
[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
21 test -d double-conversion ||
22     git clone https://github.com/floitsch/double-conversion.git
23 pushd double-conversion
24 make
25 # fool libtool into using static linkage
26 # (this won't work if you've already installed libdouble-conversion into a
27 # default search path)
28 rm -f libdouble-conversion*dylib
29 DOUBLE_CONVERSION_HOME=$(pwd)
30 popd
31
32 autoreconf -i
33 ./configure CPPFLAGS=-I"$DOUBLE_CONVERSION_HOME" LDFLAGS=-L"$DOUBLE_CONVERSION_HOME"
34
35 pushd test
36 test -e gtest-1.7.0.zip || {
37     curl -O https://googletest.googlecode.com/files/gtest-1.7.0.zip
38     unzip gtest-1.7.0.zip
39 }
40 popd