blob: 0d4239e65a96415774d4691522f22a10de233b63 [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
20if [[ -z $INSTALLED_VERSION ]]; then
21 INSTALLED_VERSION=$((cd ndn-cxx && git rev-parse HEAD) 2>/dev/null || echo NONE)
22fi
Alexander Afanasyev24ed83a2015-03-30 11:06:50 -070023
Muktadir R Chowdhury4c7caad2015-09-03 15:49:22 -050024sudo rm -Rf ndn-cxx-latest
25
26git clone --depth 1 git://github.com/named-data/ndn-cxx ndn-cxx-latest
27
28LATEST_VERSION=$((cd ndn-cxx-latest && git rev-parse HEAD) 2>/dev/null || echo UNKNOWN)
29
30if [[ $INSTALLED_VERSION != $LATEST_VERSION ]]; then
31 sudo rm -Rf ndn-cxx
32 mv ndn-cxx-latest ndn-cxx
33else
34 sudo rm -Rf ndn-cxx-latest
35fi
Alexander Afanasyevbc98fcf2014-08-16 23:18:50 -070036
37sudo rm -Rf /usr/local/include/ndn-cxx
38sudo rm -f /usr/local/lib/libndn-cxx*
39sudo rm -f /usr/local/lib/pkgconfig/libndn-cxx*
40
Muktadir R Chowdhury4c7caad2015-09-03 15:49:22 -050041pushd ndn-cxx >/dev/null
Alexander Afanasyevf9f39102015-12-01 17:43:40 -080042
43./waf configure -j1 --color=yes --enable-shared --disable-static --without-osx-keychain
Alexander Afanasyevbc98fcf2014-08-16 23:18:50 -070044./waf -j1 --color=yes
Alexander Afanasyev24ed83a2015-03-30 11:06:50 -070045sudo ./waf install -j1 --color=yes
46
47popd >/dev/null
48popd >/dev/null
Alexander Afanasyevf9f39102015-12-01 17:43:40 -080049
50if has Linux $NODE_LABELS; then
51 sudo ldconfig
Ashlesh Gawande415676b2016-12-22 00:26:23 -060052elif has FreeBSD10 $NODE_LABELS; then
53 sudo ldconfig -m
Alexander Afanasyevf9f39102015-12-01 17:43:40 -080054fi