Skip to content

Instantly share code, notes, and snippets.

@erkkel
Last active August 29, 2017 22:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save erkkel/87354d3f68163e222b8ea94c6334fc55 to your computer and use it in GitHub Desktop.
Save erkkel/87354d3f68163e222b8ea94c6334fc55 to your computer and use it in GitHub Desktop.
# Taken from https://gist.github.com/xiaom/8264691. Massive kudos for coming up with 95% of the logic.
# This version has been tweaked to work with the most recent versions of mosh and protobuf as of Aug 29 2017
# Example usage: mosh --server=/home/cc/eecs151/fa17/class/eecs151-aba/local/bin/mosh-server eecs151-aba@cory.eecs.berkeley.edu
mkdir mosh
cd mosh
ROOT=`pwd`
echo "==================================="
echo "about to set up everything in $ROOT"
echo "==================================="
mkdir build
mkdir install
cd build
curl -O https://codeload.github.com/google/protobuf/tar.gz/v3.4.0
curl -O https://mosh.org/mosh-1.3.2.tar.gz
tar zxvf v3.4.0
tar zxvf mosh-1.3.2.tar.gz
echo "================="
echo "building protobuf"
echo "================="
cd $ROOT/build/protobuf-3.4.0
export CXXFLAGS="$CXXFLAGS -fPIC"
./autogen.sh
./configure --prefix=$HOME/local --disable-shared
make install
echo "============="
echo "building mosh"
echo "============="
cd $ROOT/build/mosh-1.3.2
export PROTOC=$HOME/local/bin/protoc
export protobuf_CFLAGS=-I$HOME/local/include
export protobuf_LIBS=$HOME/local/lib/libprotobuf.a
./autogen.sh
./configure --prefix=$HOME/local
make install
echo "==="
echo "if all was successful, binaries are now in $HOME/local/bin/"
echo "==="
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment