blob: e25dd2aeff6e307788b9bed6af1859768f86dd0e [file] [log] [blame]
Junxiao Shi439d9722015-03-20 15:08:44 -07001#!/usr/bin/env bash
Junxiao Shi439d9722015-03-20 15:08:44 -07002set -e
3
Joao Pereira4bd28fc2015-07-08 15:30:42 -04004JDIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
5source "$JDIR"/util.sh
6
Davide Pesavento956ac312016-09-20 19:11:30 +02007set -x
8
9pushd "${CACHE_DIR:-/tmp}" >/dev/null
Junxiao Shi439d9722015-03-20 15:08:44 -070010
Ashlesh Gawande70750cf2017-05-27 17:10:34 +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
Junxiao Shi439d9722015-03-20 15:08:44 -070024
25sudo rm -Rf ndn-cxx-latest
Joao Pereira4bd28fc2015-07-08 15:30:42 -040026
Junxiao Shi439d9722015-03-20 15:08:44 -070027git clone --depth 1 git://github.com/named-data/ndn-cxx ndn-cxx-latest
Joao Pereira4bd28fc2015-07-08 15:30:42 -040028
Ashlesh Gawande70750cf2017-05-27 17:10:34 +000029LATEST_VERSION=$(git -C ndn-cxx-latest rev-parse HEAD 2>/dev/null || echo UNKNOWN)
Junxiao Shi439d9722015-03-20 15:08:44 -070030
31if [[ $INSTALLED_VERSION != $LATEST_VERSION ]]; then
32 sudo rm -Rf ndn-cxx
33 mv ndn-cxx-latest ndn-cxx
34else
35 sudo rm -Rf ndn-cxx-latest
36fi
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
42pushd ndn-cxx >/dev/null
43
Ashlesh Gawande70750cf2017-05-27 17:10:34 +000044./waf configure -j1 --color=yes --enable-shared --disable-static --without-osx-keychain
45./waf -j1 --color=yes
46sudo ./waf install -j1 --color=yes
Junxiao Shi439d9722015-03-20 15:08:44 -070047
48popd >/dev/null
49popd >/dev/null
Joao Pereira4bd28fc2015-07-08 15:30:42 -040050
51if has Linux $NODE_LABELS; then
52 sudo ldconfig
Ashlesh Gawande70750cf2017-05-27 17:10:34 +000053elif has FreeBSD10 $NODE_LABELS; then
54 sudo ldconfig -m
Joao Pereira4bd28fc2015-07-08 15:30:42 -040055fi