blob: 4f19833c850531c8905c657726df2052f136491b [file] [log] [blame]
Alexander Afanasyev4d4e7252014-10-25 12:21:53 -07001#!/usr/bin/env bash
Davide Pesavento69857c32020-04-05 16:36:26 -04002set -ex
Alexander Afanasyev4d4e7252014-10-25 12:21:53 -07003
Davide Pesavento69857c32020-04-05 16:36:26 -04004pushd "$CACHE_DIR" >/dev/null
Joao Pereira08f07012015-07-06 18:13:29 -04005
Ashlesh Gawande6f6ef012017-05-11 16:05:40 +00006INSTALLED_VERSION=
7if has OSX $NODE_LABELS; then
8 BOOST=$(brew ls --versions boost)
9 OLD_BOOST=$(cat boost.txt || :)
10 if [[ $OLD_BOOST != $BOOST ]]; then
11 echo "$BOOST" > boost.txt
12 INSTALLED_VERSION=NONE
13 fi
14fi
15
16if [[ -z $INSTALLED_VERSION ]]; then
17 INSTALLED_VERSION=$(git -C ndn-cxx rev-parse HEAD 2>/dev/null || echo NONE)
18fi
Joao Pereira08f07012015-07-06 18:13:29 -040019
Davide Pesavento69857c32020-04-05 16:36:26 -040020sudo rm -rf ndn-cxx-latest
21git clone --depth 1 https://github.com/named-data/ndn-cxx.git ndn-cxx-latest
Junxiao Shi33a24e82017-05-27 17:09:31 +000022LATEST_VERSION=$(git -C ndn-cxx-latest rev-parse HEAD 2>/dev/null || echo UNKNOWN)
Joao Pereira08f07012015-07-06 18:13:29 -040023
24if [[ $INSTALLED_VERSION != $LATEST_VERSION ]]; then
Davide Pesavento69857c32020-04-05 16:36:26 -040025 sudo rm -rf ndn-cxx
Joao Pereira08f07012015-07-06 18:13:29 -040026 mv ndn-cxx-latest ndn-cxx
Alexander Afanasyev4d4e7252014-10-25 12:21:53 -070027else
Davide Pesavento69857c32020-04-05 16:36:26 -040028 sudo rm -rf ndn-cxx-latest
Alexander Afanasyev4d4e7252014-10-25 12:21:53 -070029fi
30
Davide Pesavento9ac95d32017-07-01 01:51:37 -040031sudo rm -f /usr/local/bin/ndnsec*
32sudo rm -fr /usr/local/include/ndn-cxx
Md Ashiqur Rahman922330b2018-09-04 17:55:18 +000033sudo rm -f /usr/local/lib{,64}/libndn-cxx*
34sudo rm -f /usr/local/lib{,64}/pkgconfig/libndn-cxx.pc
Alexander Afanasyev4d4e7252014-10-25 12:21:53 -070035
Joao Pereira08f07012015-07-06 18:13:29 -040036pushd ndn-cxx >/dev/null
Alexander Afanasyev4d4e7252014-10-25 12:21:53 -070037
Davide Pesavento56c68a32020-03-12 19:26:21 -040038./waf --color=yes configure --disable-static --enable-shared --without-osx-keychain
39./waf --color=yes build -j$WAF_JOBS
40sudo_preserve_env PATH -- ./waf --color=yes install
Joao Pereira08f07012015-07-06 18:13:29 -040041
42popd >/dev/null
43popd >/dev/null
44
45if has Linux $NODE_LABELS; then
46 sudo ldconfig
Joao Pereira08f07012015-07-06 18:13:29 -040047fi