blob: 3ca093276c458c2f25dc6c476e475e7e41d1b12f [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 Fanb25835b2015-04-28 17:09:35 -060026./waf configure -j1 --color=yes --without-osx-keychain --disable-static --enable-shared
Chengyu Fan27887552015-03-26 17:12:00 -060027./waf -j1 --color=yes
28sudo ./waf install -j1 --color=yes
29
30popd >/dev/null
31popd >/dev/null