blob: 8b9441a27eb13cb065548b61a0a8a5a48200af0b [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
27if [ ! -d "ndn-cxx-hotfix" ]; then
28 ## Remove '-hotfix' off the end when #3920 and #4119 merge.
29 git clone git://github.com/named-data/ndn-cxx ndn-cxx-hotfix
Muktadir R Chowdhury4c7caad2015-09-03 15:49:22 -050030fi
Alexander Afanasyevbc98fcf2014-08-16 23:18:50 -070031
Nick Gordonb9c5cec2017-06-08 14:10:27 -050032## Uncomment when #3920 and #4119 merge.
33# LATEST_VERSION=$((cd ndn-cxx-latest && git rev-parse HEAD) 2>/dev/null || echo UNKNOWN)
34
35# if [[ $INSTALLED_VERSION != $LATEST_VERSION ]]; then
36# sudo rm -Rf ndn-cxx
37# mv ndn-cxx-latest ndn-cxx
38# cp ndn-cxx ndn-cxx-hotfix
39# else
40# sudo rm -Rf ndn-cxx-latest
41# fi
42
Alexander Afanasyevbc98fcf2014-08-16 23:18:50 -070043sudo rm -Rf /usr/local/include/ndn-cxx
44sudo rm -f /usr/local/lib/libndn-cxx*
45sudo rm -f /usr/local/lib/pkgconfig/libndn-cxx*
46
Nick Gordonb9c5cec2017-06-08 14:10:27 -050047## Change to the hotfix directory instead of the normal ndn-cxx directory
48## Restore below line when #3920 and #4119 merge.
49#pushd ndn-cxx >/dev/null
50pushd ndn-cxx-hotfix >/dev/null
51git checkout b555b00c280b9c9ed46f24a1fbebc73b720601af
Alexander Afanasyevf9f39102015-12-01 17:43:40 -080052
53./waf configure -j1 --color=yes --enable-shared --disable-static --without-osx-keychain
Alexander Afanasyevbc98fcf2014-08-16 23:18:50 -070054./waf -j1 --color=yes
Alexander Afanasyev24ed83a2015-03-30 11:06:50 -070055sudo ./waf install -j1 --color=yes
56
57popd >/dev/null
58popd >/dev/null
Alexander Afanasyevf9f39102015-12-01 17:43:40 -080059
60if has Linux $NODE_LABELS; then
61 sudo ldconfig
Ashlesh Gawande415676b2016-12-22 00:26:23 -060062elif has FreeBSD10 $NODE_LABELS; then
63 sudo ldconfig -m
Alexander Afanasyevf9f39102015-12-01 17:43:40 -080064fi