blob: 6eb84a5d3c84d775f3f85d820706308aa221345a [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
Davide Pesavento813df802017-08-20 20:53:54 -04009pushd "${CACHE_DIR:-/tmp}" >/dev/null
Alexander Afanasyev24ed83a2015-03-30 11:06:50 -070010
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
Davide Pesavento813df802017-08-20 20:53:54 -040023# INSTALLED_VERSION=$(git -C ndn-cxx rev-parse HEAD 2>/dev/null || echo NONE)
Nick Gordonb9c5cec2017-06-08 14:10:27 -050024# 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
Nick Gordonb9c5cec2017-06-08 14:10:27 -050031## Uncomment when #3920 and #4119 merge.
Davide Pesavento813df802017-08-20 20:53:54 -040032# LATEST_VERSION=$(git -C ndn-cxx-latest rev-parse HEAD 2>/dev/null || echo UNKNOWN)
Nick Gordonb9c5cec2017-06-08 14:10:27 -050033
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
Davide Pesavento6a81b772017-08-20 18:43:46 -040042sudo rm -f /usr/local/bin/ndnsec*
43sudo rm -fr /usr/local/include/ndn-cxx
Alexander Afanasyevbc98fcf2014-08-16 23:18:50 -070044sudo rm -f /usr/local/lib/libndn-cxx*
Davide Pesavento6a81b772017-08-20 18:43:46 -040045sudo rm -f /usr/local/lib/pkgconfig/libndn-cxx.pc
Alexander Afanasyevbc98fcf2014-08-16 23:18:50 -070046
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
Davide Pesavento813df802017-08-20 20:53:54 -040053./waf configure --color=yes --enable-shared --disable-static --without-osx-keychain
54./waf build --color=yes -j${WAF_JOBS:-1}
Davide Pesavento6a81b772017-08-20 18:43:46 -040055sudo env "PATH=$PATH" ./waf install --color=yes
Alexander Afanasyev24ed83a2015-03-30 11:06:50 -070056
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