blob: d22bfb688a8667e17256695f48f89a6e6ab0a443 [file] [log] [blame]
Chengyu Fan27887552015-03-26 17:12:00 -06001#!/usr/bin/env bash
2set -x
3set -e
4
Chengyu Fan46398212015-08-11 11:23:13 -06005JDIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
6source "$JDIR"/util.sh
7
Chengyu Fan27887552015-03-26 17:12:00 -06008pushd /tmp >/dev/null
9
10INSTALLED_VERSION=$((cd ndn-cxx && git rev-parse HEAD) 2>/dev/null || echo NONE)
11
12sudo rm -Rf ndn-cxx-latest
Chengyu Fan46398212015-08-11 11:23:13 -060013
Chengyu Fan27887552015-03-26 17:12:00 -060014git clone --depth 1 git://github.com/named-data/ndn-cxx ndn-cxx-latest
Chengyu Fan46398212015-08-11 11:23:13 -060015
Chengyu Fan27887552015-03-26 17:12:00 -060016LATEST_VERSION=$((cd ndn-cxx-latest && git rev-parse HEAD) 2>/dev/null || echo UNKNOWN)
17
18if [[ $INSTALLED_VERSION != $LATEST_VERSION ]]; then
19 sudo rm -Rf ndn-cxx
20 mv ndn-cxx-latest ndn-cxx
21else
22 sudo rm -Rf ndn-cxx-latest
23fi
24
25sudo rm -Rf /usr/local/include/ndn-cxx
26sudo rm -f /usr/local/lib/libndn-cxx*
27sudo rm -f /usr/local/lib/pkgconfig/libndn-cxx*
28
29pushd ndn-cxx >/dev/null
30
Chengyu Fan46398212015-08-11 11:23:13 -060031./waf configure -j1 --color=yes --enable-shared --disable-static --without-osx-keychain
Chengyu Fan27887552015-03-26 17:12:00 -060032./waf -j1 --color=yes
33sudo ./waf install -j1 --color=yes
Chengyu Fan27887552015-03-26 17:12:00 -060034
35popd >/dev/null
36popd >/dev/null
Chengyu Fan46398212015-08-11 11:23:13 -060037
38if has Linux $NODE_LABELS; then
39 sudo ldconfig
40elif has FreeBSD $NODE_LABELS; then
41 sudo ldconfig -a
42fi