blob: 089ef149fe493a8093c74c489fdcdaa518316638 [file] [log] [blame]
Chengyu Fan27887552015-03-26 17:12:00 -06001#!/usr/bin/env bash
2set -x
3set -e
4
5pushd /tmp >/dev/null
6
7INSTALLED_VERSION=$((cd ndn-cxx && git rev-parse HEAD) 2>/dev/null || echo NONE)
8
9sudo rm -Rf ndn-cxx-latest
10git clone --depth 1 git://github.com/named-data/ndn-cxx ndn-cxx-latest
11LATEST_VERSION=$((cd ndn-cxx-latest && git rev-parse HEAD) 2>/dev/null || echo UNKNOWN)
12
13if [[ $INSTALLED_VERSION != $LATEST_VERSION ]]; then
14 sudo rm -Rf ndn-cxx
15 mv ndn-cxx-latest ndn-cxx
16else
17 sudo rm -Rf ndn-cxx-latest
18fi
19
20sudo rm -Rf /usr/local/include/ndn-cxx
21sudo rm -f /usr/local/lib/libndn-cxx*
22sudo rm -f /usr/local/lib/pkgconfig/libndn-cxx*
23
24pushd ndn-cxx >/dev/null
25
Chengyu Fanc7b87ad2015-07-09 16:44:37 -060026./waf configure -j1 --color=yes --without-osx-keychain
Chengyu Fan27887552015-03-26 17:12:00 -060027./waf -j1 --color=yes
28sudo ./waf install -j1 --color=yes
Chengyu Fanc7b87ad2015-07-09 16:44:37 -060029(echo -e '/usr/local/lib\n/usr/local/lib64' | sudo tee /etc/ld.so.conf.d/ndn-cxx.conf) || true
30sudo ldconfig || true
Chengyu Fan27887552015-03-26 17:12:00 -060031
32popd >/dev/null
33popd >/dev/null