blob: 4e0e1549d7dcffa258049e91dfefaf72a0518ab3 [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 Pesavento8f290fc2020-04-12 13:20:07 -040038if has CentOS-8 $NODE_LABELS; then
39 # https://bugzilla.redhat.com/show_bug.cgi?id=1721553
40 PCH="--without-pch"
41fi
42
43./waf --color=yes configure --disable-static --enable-shared --without-osx-keychain $PCH
Davide Pesavento56c68a32020-03-12 19:26:21 -040044./waf --color=yes build -j$WAF_JOBS
45sudo_preserve_env PATH -- ./waf --color=yes install
Joao Pereira08f07012015-07-06 18:13:29 -040046
47popd >/dev/null
48popd >/dev/null
49
Davide Pesavento8f290fc2020-04-12 13:20:07 -040050if has CentOS-8 $NODE_LABELS; then
51 sudo tee /etc/ld.so.conf.d/ndn.conf >/dev/null <<< /usr/local/lib64
52fi
Joao Pereira08f07012015-07-06 18:13:29 -040053if has Linux $NODE_LABELS; then
54 sudo ldconfig
Joao Pereira08f07012015-07-06 18:13:29 -040055fi