From 67c82a9ef29b4bb6e40a1c3df7f30e120229432d Mon Sep 17 00:00:00 2001 From: dcsommer Date: Wed, 12 Nov 2014 13:19:48 -0800 Subject: [PATCH] Adding support for Ubuntu 12.04 Summary: Adds support for building on Ubuntu 12.04 (for all folks who haven't upgraded yet) This also fixes a minor bug in the deps.sh script, where it doesn't exit if fbthrift/folly fail to build Closes https://github.com/facebook/proxygen/pull/15 Github Author: delow12 {sync, type="child", parent="github", parentrepo="facebook/proxygen", parentprnum="15", parentprfbid="991375867544448"} Test Plan: Imported from GitHub, without a `Test Plan:` line. Reviewed By: cgheorghe@fb.com Subscribers: doug, bmatheny FB internal diff: D1674609 Signature: t1:1674609:1415756820:a84f67d7932e7ca24c3212a8b29f7d7145addc48 --- proxygen/deps.sh | 49 ++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 47 insertions(+), 2 deletions(-) diff --git a/proxygen/deps.sh b/proxygen/deps.sh index 0740fc0877..aac0b692ff 100755 --- a/proxygen/deps.sh +++ b/proxygen/deps.sh @@ -25,9 +25,51 @@ sudo apt-get install -yq \ gperf \ autoconf-archive \ libevent-dev \ - libgoogle-glog-dev \ wget +# Adding support for Ubuntu 12.04.x +# Needs libdouble-conversion-dev, google-gflags and double-conversion +# deps.sh in fbthrift and folly builds anyways (no trap there) +if ! sudo apt-get install libgoogle-glog-dev; +then + echo "fetching glog from svn (apt-get fails)" + if [ ! -e google-glog ]; then + svn checkout http://google-glog.googlecode.com/svn/trunk/ google-glog + cd google-glog + ./configure + make + sudo make install + cd .. + fi +fi + +if ! sudo apt-get install libgflags-dev; +then + if [ ! -e google-gflags ]; then + echo "Fetching and building libgflags" + wget https://github.com/schuhschuh/gflags/archive/v2.0.tar.gz + mkdir google-gflags + tar xf v2.0.tar.gz -C google-gflags + cd google-gflags/gflags-2.0/ + ./configure + make + sudo make install + cd ../../ + fi +fi + +if ! sudo apt-get install libdouble-conversion-dev; +then + if [ ! -e double-conversion ]; then + git clone https://code.google.com/p/double-conversion double-conversion + cd double-conversion + cmake . -DBUILD_SHARED_LIBS=ON + sudo make install + cd .. + fi +fi + + git clone https://github.com/facebook/fbthrift || true cd fbthrift/thrift @@ -41,7 +83,10 @@ if [ -e folly/folly ]; then fi # Build folly and fbthrift -./deps.sh +if ! ./deps.sh; then + echo "fatal: fbthrift+folly build failed" + exit -1 +fi # Build proxygen cd ../..