blob: bcd536404c87f774dba3ee1345b04122bdd4aec7 [file] [log] [blame]
Alexander Afanasyev8e60bcd2015-01-15 20:55:40 +00001#!/usr/bin/env bash
2set -x
3set -e
4
Yuanzhi Gaodd516fe2015-04-23 04:18:24 -07005JDIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
6source "$JDIR"/util.sh
Alexander Afanasyev15db7722015-01-19 17:27:26 -08007
Yuanzhi Gaodd516fe2015-04-23 04:18:24 -07008pushd /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
13git clone --depth 1 git://github.com/named-data/ndn-cxx ndn-cxx-latest
14LATEST_VERSION=$((cd ndn-cxx-latest && git rev-parse HEAD) 2>/dev/null || echo UNKNOWN)
15
16if [[ $INSTALLED_VERSION != $LATEST_VERSION ]]; then
17 sudo rm -Rf ndn-cxx
18 mv ndn-cxx-latest ndn-cxx
Alexander Afanasyev8e60bcd2015-01-15 20:55:40 +000019else
Yuanzhi Gaodd516fe2015-04-23 04:18:24 -070020 sudo rm -Rf ndn-cxx-latest
Alexander Afanasyev8e60bcd2015-01-15 20:55:40 +000021fi
22
23sudo rm -Rf /usr/local/include/ndn-cxx
24sudo rm -f /usr/local/lib/libndn-cxx*
25sudo rm -f /usr/local/lib/pkgconfig/libndn-cxx*
26
Yuanzhi Gaodd516fe2015-04-23 04:18:24 -070027pushd ndn-cxx >/dev/null
Alexander Afanasyev8e60bcd2015-01-15 20:55:40 +000028
Yuanzhi Gaodd516fe2015-04-23 04:18:24 -070029if has Ubuntu-12.04 $NODE_LABELS; then
Alexander Afanasyevdf26b5a2015-01-15 23:30:56 -080030 EXTRA_FLAGS=" --boost-libs=/usr/lib/x86_64-linux-gnu"
31fi
32
Alexander Afanasyevdc63d4a2015-06-08 12:26:12 -070033./waf configure -j1 --color=yes --enable-shared --disable-static --without-osx-keychain $EXTRA_FLAGS
Alexander Afanasyev8e60bcd2015-01-15 20:55:40 +000034./waf -j1 --color=yes
35sudo ./waf install -j1 --color=yes
Yuanzhi Gaodd516fe2015-04-23 04:18:24 -070036
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