blob: e5bdda8c9c6bd484a9f801be1dd465cfd0d02f67 [file] [log] [blame]
Junxiao Shi439d9722015-03-20 15:08:44 -07001#!/usr/bin/env bash
Davide Pesaventod8398822020-03-29 18:46:19 -04002set -ex
Junxiao Shi439d9722015-03-20 15:08:44 -07003
Davide Pesaventod8398822020-03-29 18:46:19 -04004pushd "$CACHE_DIR" >/dev/null
Junxiao Shi439d9722015-03-20 15:08:44 -07005
Ashlesh Gawande70750cf2017-05-27 17:10:34 +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
Junxiao Shi439d9722015-03-20 15:08:44 -070019
Davide Pesaventod8398822020-03-29 18:46:19 -040020sudo rm -rf ndn-cxx-latest
Junxiao Shi439d9722015-03-20 15:08:44 -070021git clone --depth 1 git://github.com/named-data/ndn-cxx ndn-cxx-latest
Ashlesh Gawande70750cf2017-05-27 17:10:34 +000022LATEST_VERSION=$(git -C ndn-cxx-latest rev-parse HEAD 2>/dev/null || echo UNKNOWN)
Junxiao Shi439d9722015-03-20 15:08:44 -070023
24if [[ $INSTALLED_VERSION != $LATEST_VERSION ]]; then
Davide Pesaventod8398822020-03-29 18:46:19 -040025 sudo rm -rf ndn-cxx
Junxiao Shi439d9722015-03-20 15:08:44 -070026 mv ndn-cxx-latest ndn-cxx
27else
Davide Pesaventod8398822020-03-29 18:46:19 -040028 sudo rm -rf ndn-cxx-latest
Junxiao Shi439d9722015-03-20 15:08:44 -070029fi
30
Davide Pesavento5485ca92017-08-10 21:47:42 -040031sudo rm -f /usr/local/bin/ndnsec*
32sudo rm -fr /usr/local/include/ndn-cxx
Md Ashiqur Rahman25c37f12018-10-12 17:59:20 +000033sudo rm -f /usr/local/lib{,64}/libndn-cxx*
34sudo rm -f /usr/local/lib{,64}/pkgconfig/libndn-cxx.pc
Junxiao Shi439d9722015-03-20 15:08:44 -070035
36pushd ndn-cxx >/dev/null
37
Davide Pesaventod8398822020-03-29 18:46:19 -040038if has CentOS-8 $NODE_LABELS; then
39 PCH="--without-pch"
40fi
41
42./waf --color=yes configure --disable-static --enable-shared --without-osx-keychain $PCH
Davide Pesaventoa1a9d702020-03-29 00:58:15 -040043./waf --color=yes build -j$WAF_JOBS
Davide Pesavento9fa6a782020-03-10 19:47:06 -040044sudo_preserve_env PATH -- ./waf --color=yes install
Junxiao Shi439d9722015-03-20 15:08:44 -070045
46popd >/dev/null
47popd >/dev/null
Joao Pereira4bd28fc2015-07-08 15:30:42 -040048
Davide Pesaventod8398822020-03-29 18:46:19 -040049if has CentOS-8 $NODE_LABELS; then
50 sudo tee /etc/ld.so.conf.d/ndn.conf >/dev/null <<< /usr/local/lib64
51fi
Joao Pereira4bd28fc2015-07-08 15:30:42 -040052if has Linux $NODE_LABELS; then
53 sudo ldconfig
Joao Pereira4bd28fc2015-07-08 15:30:42 -040054fi