blob: 9f8a9b27702c787f52b5cb67955a771501755b38 [file] [log] [blame]
Alexander Afanasyevbc98fcf2014-08-16 23:18:50 -07001#!/usr/bin/env bash
Vince Lehman0a7da612014-10-29 14:39:29 -05002set -e
Alexander Afanasyevbc98fcf2014-08-16 23:18:50 -07003
Alexander Afanasyevf9f39102015-12-01 17:43:40 -08004JDIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
5source "$JDIR"/util.sh
6
Davide Pesavento6a81b772017-08-20 18:43:46 -04007set -x
8
Alexander Afanasyev24ed83a2015-03-30 11:06:50 -07009pushd /tmp >/dev/null
10
Ashlesh Gawande812af972017-04-21 09:26:37 -050011INSTALLED_VERSION=
12if has OSX $NODE_LABELS; then
13 BOOST=$(brew ls --versions boost)
14 OLD_BOOST=$(cat boost.txt || :)
15 if [[ $OLD_BOOST != $BOOST ]]; then
16 echo "$BOOST" > boost.txt
17 INSTALLED_VERSION=NONE
18 fi
19fi
20
Nick Gordonb9c5cec2017-06-08 14:10:27 -050021## Uncomment when #3920 and #4119 merge.
22# if [[ -z $INSTALLED_VERSION ]]; then
23# INSTALLED_VERSION=$((cd ndn-cxx && git rev-parse HEAD) 2>/dev/null || echo NONE)
24# fi
Alexander Afanasyev24ed83a2015-03-30 11:06:50 -070025
Muktadir R Chowdhury4c7caad2015-09-03 15:49:22 -050026sudo rm -Rf ndn-cxx-latest
Nick Gordonb9c5cec2017-06-08 14:10:27 -050027## Remove this when #3920 and #4119 merge
Nick Gordona75fdb22017-07-06 14:10:43 -050028sudo rm -Rf ndn-cxx-hotfix
29git clone git://github.com/named-data/ndn-cxx ndn-cxx-hotfix
30
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
Davide Pesavento6a81b772017-08-20 18:43:46 -040043sudo rm -f /usr/local/bin/ndnsec*
44sudo rm -fr /usr/local/include/ndn-cxx
Alexander Afanasyevbc98fcf2014-08-16 23:18:50 -070045sudo rm -f /usr/local/lib/libndn-cxx*
Davide Pesavento6a81b772017-08-20 18:43:46 -040046sudo rm -f /usr/local/lib/pkgconfig/libndn-cxx.pc
Alexander Afanasyevbc98fcf2014-08-16 23:18:50 -070047
Nick Gordonb9c5cec2017-06-08 14:10:27 -050048## Change to the hotfix directory instead of the normal ndn-cxx directory
49## Restore below line when #3920 and #4119 merge.
50#pushd ndn-cxx >/dev/null
51pushd ndn-cxx-hotfix >/dev/null
52git checkout b555b00c280b9c9ed46f24a1fbebc73b720601af
Alexander Afanasyevf9f39102015-12-01 17:43:40 -080053
54./waf configure -j1 --color=yes --enable-shared --disable-static --without-osx-keychain
Alexander Afanasyevbc98fcf2014-08-16 23:18:50 -070055./waf -j1 --color=yes
Davide Pesavento6a81b772017-08-20 18:43:46 -040056sudo env "PATH=$PATH" ./waf install --color=yes
Alexander Afanasyev24ed83a2015-03-30 11:06:50 -070057
58popd >/dev/null
59popd >/dev/null
Alexander Afanasyevf9f39102015-12-01 17:43:40 -080060
61if has Linux $NODE_LABELS; then
62 sudo ldconfig
Ashlesh Gawande415676b2016-12-22 00:26:23 -060063elif has FreeBSD10 $NODE_LABELS; then
64 sudo ldconfig -m
Alexander Afanasyevf9f39102015-12-01 17:43:40 -080065fi