3 if [ -e ~/.building_swift ]; then
7 touch ~/.building_swift
9 if ! which git || ! which g++ || ! which scons || ! which make ; then
10 sudo apt-get -y install make g++ scons git-core || exit 1
13 if [ ! -e ~/include/event.h ]; then
14 echo installing libevent
17 wget -c http://monkey.org/~provos/libevent-2.0.7-rc.tar.gz || exit 3
18 rm -rf libevent-2.0.7-rc
19 tar -xzf libevent-2.0.7-rc.tar.gz || exit 4
20 cd libevent-2.0.7-rc/ || exit 5
21 ./configure --prefix=$HOME || exit 6
23 make install || exit 8
28 if [ ! -e ~/include/gtest/gtest.h ]; then
32 wget -c http://googletest.googlecode.com/files/gtest-1.4.0.tar.bz2 || exit 10
34 tar -xjf gtest-1.4.0.tar.bz2 || exit 11
35 cd gtest-1.4.0 || exit 12
36 ./configure --prefix=$HOME || exit 13
38 make install || exit 15
43 #if ! which pcregrep ; then
44 # echo installing pcregrep
47 # wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.01.tar.gz || exit 5
48 # tar -xzf pcre-8.01.tar.gz
50 # ./configure --prefix=$HOME || exit 6
52 # make install || exit 8
56 if [ ! -e swift ]; then
58 git clone $ORIGIN || exit 16
61 echo switching the branch
62 git checkout $BRANCH || exit 17
64 git pull origin $BRANCH:$BRANCH || exit 18
67 INCL=~/include LIB=~/lib
68 CPPPATH=$INCL LIBPATH=$LIB scons -j4 || exit 19
70 LD_LIBRARY_PATH=$LIB tests/connecttest || exit 20
74 if [ ! -e bin ]; then mkdir bin; fi
75 g++ -I. -I$INCL *.cpp ext/seq_picker.cpp -pg -o bin/swift-pg -L$LIB -levent &
76 g++ -I. -I$INCL *.cpp ext/seq_picker.cpp -g -o bin/swift-dbg -L$LIB -levent &
77 g++ -I. -I$INCL *.cpp ext/seq_picker.cpp -O2 -o bin/swift-o2 -L$LIB -levent &