blob: e627627c0ac0465665889118530cb14e88bb8fee [file] [log] [blame]
Davide Pesavento7ef57e22017-10-28 16:58:43 -04001#!/usr/bin/env bash
2set -e
3
4JDIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
5source "$JDIR"/util.sh
6
7set -x
8
9pushd "${CACHE_DIR:-/tmp}" >/dev/null
10
11INSTALLED_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
24
25sudo rm -Rf ndn-cxx-latest
26
27git clone --depth 1 git://github.com/named-data/ndn-cxx ndn-cxx-latest
28
29LATEST_VERSION=$(git -C ndn-cxx-latest rev-parse HEAD 2>/dev/null || echo UNKNOWN)
30
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 -f /usr/local/bin/ndnsec*
39sudo rm -fr /usr/local/include/ndn-cxx
Davide Pesavento5188f312019-03-18 18:38:45 -040040sudo rm -f /usr/local/lib{,64}/libndn-cxx*
41sudo rm -f /usr/local/lib{,64}/pkgconfig/libndn-cxx.pc
Davide Pesavento7ef57e22017-10-28 16:58:43 -040042
43pushd ndn-cxx >/dev/null
44
45./waf configure --color=yes --enable-shared --disable-static --without-osx-keychain
46./waf build --color=yes -j${WAF_JOBS:-1}
Davide Pesavento5188f312019-03-18 18:38:45 -040047sudo_preserve_env PATH -- ./waf install --color=yes
Davide Pesavento7ef57e22017-10-28 16:58:43 -040048
49popd >/dev/null
50popd >/dev/null
51
52if has Linux $NODE_LABELS; then
53 sudo ldconfig
54elif has FreeBSD10 $NODE_LABELS; then
55 sudo ldconfig -m
56fi