From 799d6503beb06762f183f146f087882cce977f48 Mon Sep 17 00:00:00 2001 From: Hans Fugal Date: Mon, 5 Jan 2015 16:21:50 -0800 Subject: [PATCH] (folly) osx bootstrap script MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Summary: This is a bootstrap script for building folly on osx. I attempted to make it Just Work™ for anyone who uses Homebrew (http://brew.sh/) but even if it doesn't work out of the box it should be instructive for the motivated developer on OSX. Facebook: In #5134151 Wangle used to not build, because something was using a futex. But that seems to have been rectified (or the build problems are hiding in headers that aren't used in the libfolly build). I'll also update https://our.intern.facebook.com/intern/wiki/Folly/BuildingOnMac to point people to this script instead. Test Plan: Tested on my laptop which is running Yosemite (10.10.1) Build, then inspect `otool -L .libs/*dylib` Reviewed By: davejwatson@fb.com Subscribers: folly-diffs@, exa FB internal diff: D1765248 Tasks: 5134151 Signature: t1:1765248:1420500905:bc5da97a0446f502cb2badc85c9004ff0a62027a --- folly/bootstrap-osx-homebrew.sh | 37 +++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100755 folly/bootstrap-osx-homebrew.sh diff --git a/folly/bootstrap-osx-homebrew.sh b/folly/bootstrap-osx-homebrew.sh new file mode 100755 index 00000000..6565f4b6 --- /dev/null +++ b/folly/bootstrap-osx-homebrew.sh @@ -0,0 +1,37 @@ +#!/bin/bash -x +# The only prerequisite should be homebrew. If something doesn't work out of +# the box with just homebrew, let's fix it. + +# fail fast +set -e + +brewget() { + brew install $@ || brew upgrade $@ +} + +# tool dependencies: autotools, scons (for double-conversion), and gcc 4.9 +brewget autoconf automake libtool scons gcc + +# dependencies +brewget glog gflags boost libevent + +# Install the double-conversion library. +# NB their install target installs the libs but not the headers, hence the +# CPPFLAGS and link shenanigans. +DOUBLE_CONVERSION_CPPFLAGS="-I./double-conversion/src" +test -d double-conversion || { + git clone https://github.com/floitsch/double-conversion.git + pushd double-conversion/src + ln -s . double-conversion + popd +} +pushd double-conversion +scons +# fool libtool into using static linkage +# (this won't work if you've already installed libdouble-conversion into a +# default search path) +rm -f libdouble-conversion*dylib +popd + +autoreconf -i +./configure CPPFLAGS="-I./double-conversion/src" LDFLAGS="-L./double-conversion" CXX=g++-4.9 -- 2.34.1