blob: c23a0bc0e182df8c91fb21c048c1322479a6ea6a [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
Ashlesh Gawande812af972017-04-21 09:26:37 -050010INSTALLED_VERSION=
11if has OSX $NODE_LABELS; then
12 BOOST=$(brew ls --versions boost)
13 OLD_BOOST=$(cat boost.txt || :)
14 if [[ $OLD_BOOST != $BOOST ]]; then
15 echo "$BOOST" > boost.txt
16 INSTALLED_VERSION=NONE
17 fi
18fi
19
Nick Gordonb9c5cec2017-06-08 14:10:27 -050020## Uncomment when #3920 and #4119 merge.
21# if [[ -z $INSTALLED_VERSION ]]; then
22# INSTALLED_VERSION=$((cd ndn-cxx && git rev-parse HEAD) 2>/dev/null || echo NONE)
23# fi
Alexander Afanasyev24ed83a2015-03-30 11:06:50 -070024
Muktadir R Chowdhury4c7caad2015-09-03 15:49:22 -050025sudo rm -Rf ndn-cxx-latest
Nick Gordonb9c5cec2017-06-08 14:10:27 -050026## Remove this when #3920 and #4119 merge
Nick Gordona75fdb22017-07-06 14:10:43 -050027sudo rm -Rf ndn-cxx-hotfix
28git clone git://github.com/named-data/ndn-cxx ndn-cxx-hotfix
29
Alexander Afanasyevbc98fcf2014-08-16 23:18:50 -070030
Nick Gordonb9c5cec2017-06-08 14:10:27 -050031## Uncomment when #3920 and #4119 merge.
32# LATEST_VERSION=$((cd ndn-cxx-latest && git rev-parse HEAD) 2>/dev/null || echo UNKNOWN)
33
34# if [[ $INSTALLED_VERSION != $LATEST_VERSION ]]; then
35# sudo rm -Rf ndn-cxx
36# mv ndn-cxx-latest ndn-cxx
37# cp ndn-cxx ndn-cxx-hotfix
38# else
39# sudo rm -Rf ndn-cxx-latest
40# fi
41
Alexander Afanasyevbc98fcf2014-08-16 23:18:50 -070042sudo rm -Rf /usr/local/include/ndn-cxx
43sudo rm -f /usr/local/lib/libndn-cxx*
44sudo rm -f /usr/local/lib/pkgconfig/libndn-cxx*
45
Nick Gordonb9c5cec2017-06-08 14:10:27 -050046## Change to the hotfix directory instead of the normal ndn-cxx directory
47## Restore below line when #3920 and #4119 merge.
48#pushd ndn-cxx >/dev/null
49pushd ndn-cxx-hotfix >/dev/null
50git checkout b555b00c280b9c9ed46f24a1fbebc73b720601af
Alexander Afanasyevf9f39102015-12-01 17:43:40 -080051
52./waf configure -j1 --color=yes --enable-shared --disable-static --without-osx-keychain
Alexander Afanasyevbc98fcf2014-08-16 23:18:50 -070053./waf -j1 --color=yes
Alexander Afanasyev24ed83a2015-03-30 11:06:50 -070054sudo ./waf install -j1 --color=yes
55
56popd >/dev/null
57popd >/dev/null
Alexander Afanasyevf9f39102015-12-01 17:43:40 -080058
59if has Linux $NODE_LABELS; then
60 sudo ldconfig
Ashlesh Gawande415676b2016-12-22 00:26:23 -060061elif has FreeBSD10 $NODE_LABELS; then
62 sudo ldconfig -m
Alexander Afanasyevf9f39102015-12-01 17:43:40 -080063fi