blob: 4e0e1549d7dcffa258049e91dfefaf72a0518ab3 [file] [log] [blame]
Davide Pesavento7ef57e22017-10-28 16:58:43 -04001#!/usr/bin/env bash
Davide Pesaventoa0546db2020-04-01 19:18:04 -04002set -ex
Davide Pesavento7ef57e22017-10-28 16:58:43 -04003
Davide Pesaventoa0546db2020-04-01 19:18:04 -04004pushd "$CACHE_DIR" >/dev/null
Davide Pesavento7ef57e22017-10-28 16:58:43 -04005
6INSTALLED_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
19
Davide Pesaventoa0546db2020-04-01 19:18:04 -040020sudo rm -rf ndn-cxx-latest
21git clone --depth 1 https://github.com/named-data/ndn-cxx.git ndn-cxx-latest
Davide Pesavento7ef57e22017-10-28 16:58:43 -040022LATEST_VERSION=$(git -C ndn-cxx-latest rev-parse HEAD 2>/dev/null || echo UNKNOWN)
23
24if [[ $INSTALLED_VERSION != $LATEST_VERSION ]]; then
Davide Pesaventoa0546db2020-04-01 19:18:04 -040025 sudo rm -rf ndn-cxx
Davide Pesavento7ef57e22017-10-28 16:58:43 -040026 mv ndn-cxx-latest ndn-cxx
27else
Davide Pesaventoa0546db2020-04-01 19:18:04 -040028 sudo rm -rf ndn-cxx-latest
Davide Pesavento7ef57e22017-10-28 16:58:43 -040029fi
30
31sudo rm -f /usr/local/bin/ndnsec*
32sudo rm -fr /usr/local/include/ndn-cxx
Davide Pesavento5188f312019-03-18 18:38:45 -040033sudo rm -f /usr/local/lib{,64}/libndn-cxx*
34sudo rm -f /usr/local/lib{,64}/pkgconfig/libndn-cxx.pc
Davide Pesavento7ef57e22017-10-28 16:58:43 -040035
36pushd ndn-cxx >/dev/null
37
Davide Pesaventoa0546db2020-04-01 19:18:04 -040038if has CentOS-8 $NODE_LABELS; then
39 # https://bugzilla.redhat.com/show_bug.cgi?id=1721553
40 PCH="--without-pch"
41fi
42
Davide Pesavento5f408ae2020-07-15 21:17:04 -040043./waf --color=yes configure --disable-static --enable-shared --without-osx-keychain $PCH
Davide Pesaventoa0546db2020-04-01 19:18:04 -040044./waf --color=yes build -j$WAF_JOBS
45sudo_preserve_env PATH -- ./waf --color=yes install
Davide Pesavento7ef57e22017-10-28 16:58:43 -040046
47popd >/dev/null
48popd >/dev/null
49
Davide Pesaventoa0546db2020-04-01 19:18:04 -040050if has CentOS-8 $NODE_LABELS; then
51 sudo tee /etc/ld.so.conf.d/ndn.conf >/dev/null <<< /usr/local/lib64
52fi
Davide Pesavento7ef57e22017-10-28 16:58:43 -040053if has Linux $NODE_LABELS; then
54 sudo ldconfig
Davide Pesavento7ef57e22017-10-28 16:58:43 -040055fi