blob: 2bc46fdded932feaae068ce0705b6693ca860499 [file] [log] [blame]
Alexander Afanasyev4d4e7252014-10-25 12:21:53 -07001#!/usr/bin/env bash
2set -x
3set -e
4
Joao Pereira08f07012015-07-06 18:13:29 -04005JDIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
6source "$JDIR"/util.sh
7
Alexander Afanasyevf22ebaf2015-12-17 21:23:05 -08008pushd ${CACHE_DIR:-/tmp} >/dev/null
Joao Pereira08f07012015-07-06 18:13:29 -04009
10INSTALLED_VERSION=$((cd ndn-cxx && git rev-parse HEAD) 2>/dev/null || echo NONE)
11
12sudo rm -Rf ndn-cxx-latest
13
14git clone --depth 1 git://github.com/named-data/ndn-cxx ndn-cxx-latest
15
16LATEST_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
Alexander Afanasyev4d4e7252014-10-25 12:21:53 -070021else
Joao Pereira08f07012015-07-06 18:13:29 -040022 sudo rm -Rf ndn-cxx-latest
Alexander Afanasyev4d4e7252014-10-25 12:21:53 -070023fi
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
Joao Pereira08f07012015-07-06 18:13:29 -040029pushd ndn-cxx >/dev/null
Alexander Afanasyev4d4e7252014-10-25 12:21:53 -070030
Joao Pereira08f07012015-07-06 18:13:29 -040031./waf configure -j1 --color=yes --enable-shared --disable-static --without-osx-keychain
Alexander Afanasyev4d4e7252014-10-25 12:21:53 -070032./waf -j1 --color=yes
33sudo ./waf install -j1 --color=yes
Joao Pereira08f07012015-07-06 18:13:29 -040034
35popd >/dev/null
36popd >/dev/null
37
38if has Linux $NODE_LABELS; then
39 sudo ldconfig
40elif has FreeBSD $NODE_LABELS; then
41 sudo ldconfig -a
42fi