blob: 482c1550e3fce277748e9b2805d4ff00e6ccf198 [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
19if [[ $INSTALLED_VERSION != $LATEST_VERSION ]]; then
20 sudo rm -Rf ndn-cxx
21 mv ndn-cxx-latest ndn-cxx
22 sudo rm -Rf NFD NFD-latest
23else
24 sudo rm -Rf ndn-cxx-latest
25fi
26
27sudo rm -Rf /usr/local/include/ndn-cxx
28sudo rm -f /usr/local/lib/libndn-cxx*
29sudo rm -f /usr/local/lib/pkgconfig/libndn-cxx*
30
31pushd ndn-cxx >/dev/null
32
33./waf -j1 --color=yes configure --enable-shared --disable-static --without-osx-keychain
34./waf -j1 --color=yes build
35sudo ./waf -j1 --color=yes install
36
37popd >/dev/null
38popd >/dev/null
39
40if has Linux $NODE_LABELS; then
41 sudo ldconfig
42elif has FreeBSD $NODE_LABELS; then
43 sudo ldconfig -a
44fi