blob: e49e4889210c882a7e6b2ee9a7b1a95dc742a4f3 [file] [log] [blame]
Alexander Afanasyev4d4e7252014-10-25 12:21:53 -07001#!/usr/bin/env bash
Alexander Afanasyev4d4e7252014-10-25 12:21:53 -07002set -e
3
Joao Pereira08f07012015-07-06 18:13:29 -04004JDIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
5source "$JDIR"/util.sh
6
Davide Pesaventoe0edc4c2016-09-13 18:29:52 +00007set -x
8
9pushd "${CACHE_DIR:-/tmp}" >/dev/null
Joao Pereira08f07012015-07-06 18:13:29 -040010
Ashlesh Gawande6f6ef012017-05-11 16:05:40 +000011INSTALLED_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
21if [[ -z $INSTALLED_VERSION ]]; then
22 INSTALLED_VERSION=$(git -C ndn-cxx rev-parse HEAD 2>/dev/null || echo NONE)
23fi
Joao Pereira08f07012015-07-06 18:13:29 -040024
25sudo rm -Rf ndn-cxx-latest
26
27git clone --depth 1 git://github.com/named-data/ndn-cxx ndn-cxx-latest
28
Ashlesh Gawande6f6ef012017-05-11 16:05:40 +000029LATEST_VERSION=$(git -C ndn-cxx rev-parse HEAD 2>/dev/null || echo UNKNOWN)
Joao Pereira08f07012015-07-06 18:13:29 -040030
31if [[ $INSTALLED_VERSION != $LATEST_VERSION ]]; then
32 sudo rm -Rf ndn-cxx
33 mv ndn-cxx-latest ndn-cxx
Alexander Afanasyev4d4e7252014-10-25 12:21:53 -070034else
Joao Pereira08f07012015-07-06 18:13:29 -040035 sudo rm -Rf ndn-cxx-latest
Alexander Afanasyev4d4e7252014-10-25 12:21:53 -070036fi
37
38sudo rm -Rf /usr/local/include/ndn-cxx
39sudo rm -f /usr/local/lib/libndn-cxx*
40sudo rm -f /usr/local/lib/pkgconfig/libndn-cxx*
41
Joao Pereira08f07012015-07-06 18:13:29 -040042pushd ndn-cxx >/dev/null
Alexander Afanasyev4d4e7252014-10-25 12:21:53 -070043
Ashlesh Gawande6f6ef012017-05-11 16:05:40 +000044./waf configure -j1 --color=yes --enable-shared --disable-static --without-osx-keychain
45./waf -j1 --color=yes
46sudo ./waf install -j1 --color=yes
Joao Pereira08f07012015-07-06 18:13:29 -040047
48popd >/dev/null
49popd >/dev/null
50
51if has Linux $NODE_LABELS; then
52 sudo ldconfig
Ashlesh Gawande6f6ef012017-05-11 16:05:40 +000053elif has FreeBSD10 $NODE_LABELS; then
54 sudo ldconfig -m
Joao Pereira08f07012015-07-06 18:13:29 -040055fi