blob: 31bb9e4a5cb24dd572a3aa52c8d0d04e7b4ba037 [file] [log] [blame]
Zhiyi Zhang8617a792017-01-17 16:45:56 -08001#!/usr/bin/env bash
2set -e
3
4JDIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
5source "$JDIR"/util.sh
6
7set -x
8
9pushd "${CACHE_DIR:-/tmp}" >/dev/null
10
11INSTALLED_VERSION=$((cd ndn-cxx && git rev-parse HEAD) 2>/dev/null || echo NONE)
12
13sudo rm -Rf ndn-cxx-latest
14
15git clone --depth 1 git://github.com/named-data/ndn-cxx ndn-cxx-latest
16
17LATEST_VERSION=$((cd ndn-cxx-latest && git rev-parse HEAD) 2>/dev/null || echo UNKNOWN)
18
Zhiyi Zhangdefa9592017-02-21 10:56:22 -080019if has OSX $NODE_LABELS; then
20 LATEST_VERSION=""
21fi
22
Zhiyi Zhang8617a792017-01-17 16:45:56 -080023if [[ $INSTALLED_VERSION != $LATEST_VERSION ]]; then
24 sudo rm -Rf ndn-cxx
25 mv ndn-cxx-latest ndn-cxx
26 sudo rm -Rf NFD NFD-latest
27else
28 sudo rm -Rf ndn-cxx-latest
29fi
30
31sudo rm -Rf /usr/local/include/ndn-cxx
32sudo rm -f /usr/local/lib/libndn-cxx*
33sudo rm -f /usr/local/lib/pkgconfig/libndn-cxx*
34
35pushd ndn-cxx >/dev/null
36
37./waf -j1 --color=yes configure --enable-shared --disable-static --without-osx-keychain
38./waf -j1 --color=yes build
39sudo ./waf -j1 --color=yes install
40
41popd >/dev/null
42popd >/dev/null
43
44if has Linux $NODE_LABELS; then
45 sudo ldconfig
46elif has FreeBSD $NODE_LABELS; then
47 sudo ldconfig -a
48fi