blob: d22bfb688a8667e17256695f48f89a6e6ab0a443 [file] [log] [blame]
Alexander Afanasyevbc98fcf2014-08-16 23:18:50 -07001#!/usr/bin/env bash
2set -x
Vince Lehman0a7da612014-10-29 14:39:29 -05003set -e
Alexander Afanasyevbc98fcf2014-08-16 23:18:50 -07004
Alexander Afanasyevf9f39102015-12-01 17:43:40 -08005JDIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
6source "$JDIR"/util.sh
7
Alexander Afanasyev24ed83a2015-03-30 11:06:50 -07008pushd /tmp >/dev/null
9
Muktadir R Chowdhury4c7caad2015-09-03 15:49:22 -050010INSTALLED_VERSION=$((cd ndn-cxx && git rev-parse HEAD) 2>/dev/null || echo NONE)
Alexander Afanasyev24ed83a2015-03-30 11:06:50 -070011
Muktadir R Chowdhury4c7caad2015-09-03 15:49:22 -050012sudo 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
21else
22 sudo rm -Rf ndn-cxx-latest
23fi
Alexander Afanasyevbc98fcf2014-08-16 23:18:50 -070024
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
Muktadir R Chowdhury4c7caad2015-09-03 15:49:22 -050029pushd ndn-cxx >/dev/null
Alexander Afanasyevf9f39102015-12-01 17:43:40 -080030
31./waf configure -j1 --color=yes --enable-shared --disable-static --without-osx-keychain
Alexander Afanasyevbc98fcf2014-08-16 23:18:50 -070032./waf -j1 --color=yes
Alexander Afanasyev24ed83a2015-03-30 11:06:50 -070033sudo ./waf install -j1 --color=yes
34
35popd >/dev/null
36popd >/dev/null
Alexander Afanasyevf9f39102015-12-01 17:43:40 -080037
38if has Linux $NODE_LABELS; then
39 sudo ldconfig
40elif has FreeBSD $NODE_LABELS; then
41 sudo ldconfig -a
42fi