blob: c38011c19f8679ea5d3660039cb7257cbe77bc10 [file] [log] [blame]
Alexander Afanasyevbc98fcf2014-08-16 23:18:50 -07001#!/usr/bin/env bash
2set -x
Vince Lehman0a7da612014-10-29 14:39:29 -05003set -e
Alexander Afanasyevbc98fcf2014-08-16 23:18:50 -07004
5cd /tmp
6BUILD="no"
7if [ ! -d ndn-cxx ]; then
8 git clone --depth 1 git://github.com/named-data/ndn-cxx
9 cd ndn-cxx
10 BUILD="yes"
11else
12 cd ndn-cxx
13 INSTALLED_VERSION=`git rev-parse HEAD || echo NONE`
14 sudo rm -Rf latest-version
15 git clone --depth 1 git://github.com/named-data/ndn-cxx latest-version
16 cd latest-version
17 LATEST_VERSION=`git rev-parse HEAD || echo UNKNOWN`
18 cd ..
19 rm -Rf latest-version
20 if [ "$INSTALLED_VERSION" != "$LATEST_VERSION" ]; then
21 cd ..
22 sudo rm -Rf ndn-cxx
23 git clone --depth 1 git://github.com/named-data/ndn-cxx
24 cd ndn-cxx
25 BUILD="yes"
26 fi
27fi
28
29sudo rm -Rf /usr/local/include/ndn-cxx
30sudo rm -f /usr/local/lib/libndn-cxx*
31sudo rm -f /usr/local/lib/pkgconfig/libndn-cxx*
32
33if [ "$BUILD" = "yes" ]; then
Vince Lehman0a7da612014-10-29 14:39:29 -050034 sudo ./waf distclean --color=yes
Alexander Afanasyevbc98fcf2014-08-16 23:18:50 -070035fi
36
37./waf configure --color=yes --without-osx-keychain
38./waf -j1 --color=yes
39sudo ./waf install --color=yes