blob: 0ae5022968295cde8a9fd20d966ce10e814d0ce3 [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
Junxiao Shi33a24e82017-05-27 17:09:31 +000029LATEST_VERSION=$(git -C ndn-cxx-latest 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
Davide Pesavento9ac95d32017-07-01 01:51:37 -040038sudo rm -f /usr/local/bin/ndnsec*
39sudo rm -fr /usr/local/include/ndn-cxx
Md Ashiqur Rahman922330b2018-09-04 17:55:18 +000040sudo rm -f /usr/local/lib{,64}/libndn-cxx*
41sudo rm -f /usr/local/lib{,64}/pkgconfig/libndn-cxx.pc
Alexander Afanasyev4d4e7252014-10-25 12:21:53 -070042
Joao Pereira08f07012015-07-06 18:13:29 -040043pushd ndn-cxx >/dev/null
Alexander Afanasyev4d4e7252014-10-25 12:21:53 -070044
Davide Pesavento56c68a32020-03-12 19:26:21 -040045./waf --color=yes configure --disable-static --enable-shared --without-osx-keychain
46./waf --color=yes build -j$WAF_JOBS
47sudo_preserve_env PATH -- ./waf --color=yes install
Joao Pereira08f07012015-07-06 18:13:29 -040048
49popd >/dev/null
50popd >/dev/null
51
52if has Linux $NODE_LABELS; then
53 sudo ldconfig
Joao Pereira08f07012015-07-06 18:13:29 -040054fi