Junxiao Shi | 439d972 | 2015-03-20 15:08:44 -0700 | [diff] [blame] | 1 | #!/usr/bin/env bash |
Junxiao Shi | 439d972 | 2015-03-20 15:08:44 -0700 | [diff] [blame] | 2 | set -e |
| 3 | |
Joao Pereira | 4bd28fc | 2015-07-08 15:30:42 -0400 | [diff] [blame] | 4 | JDIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) |
| 5 | source "$JDIR"/util.sh |
| 6 | |
Davide Pesavento | 956ac31 | 2016-09-20 19:11:30 +0200 | [diff] [blame] | 7 | set -x |
| 8 | |
| 9 | pushd "${CACHE_DIR:-/tmp}" >/dev/null |
Junxiao Shi | 439d972 | 2015-03-20 15:08:44 -0700 | [diff] [blame] | 10 | |
Ashlesh Gawande | 70750cf | 2017-05-27 17:10:34 +0000 | [diff] [blame] | 11 | INSTALLED_VERSION= |
| 12 | if 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 |
| 19 | fi |
| 20 | |
| 21 | if [[ -z $INSTALLED_VERSION ]]; then |
| 22 | INSTALLED_VERSION=$(git -C ndn-cxx rev-parse HEAD 2>/dev/null || echo NONE) |
| 23 | fi |
Junxiao Shi | 439d972 | 2015-03-20 15:08:44 -0700 | [diff] [blame] | 24 | |
| 25 | sudo rm -Rf ndn-cxx-latest |
Joao Pereira | 4bd28fc | 2015-07-08 15:30:42 -0400 | [diff] [blame] | 26 | |
Junxiao Shi | 439d972 | 2015-03-20 15:08:44 -0700 | [diff] [blame] | 27 | git clone --depth 1 git://github.com/named-data/ndn-cxx ndn-cxx-latest |
Joao Pereira | 4bd28fc | 2015-07-08 15:30:42 -0400 | [diff] [blame] | 28 | |
Ashlesh Gawande | 70750cf | 2017-05-27 17:10:34 +0000 | [diff] [blame] | 29 | LATEST_VERSION=$(git -C ndn-cxx-latest rev-parse HEAD 2>/dev/null || echo UNKNOWN) |
Junxiao Shi | 439d972 | 2015-03-20 15:08:44 -0700 | [diff] [blame] | 30 | |
| 31 | if [[ $INSTALLED_VERSION != $LATEST_VERSION ]]; then |
| 32 | sudo rm -Rf ndn-cxx |
| 33 | mv ndn-cxx-latest ndn-cxx |
| 34 | else |
| 35 | sudo rm -Rf ndn-cxx-latest |
| 36 | fi |
| 37 | |
Davide Pesavento | 5485ca9 | 2017-08-10 21:47:42 -0400 | [diff] [blame] | 38 | sudo rm -f /usr/local/bin/ndnsec* |
| 39 | sudo rm -fr /usr/local/include/ndn-cxx |
Md Ashiqur Rahman | 25c37f1 | 2018-10-12 17:59:20 +0000 | [diff] [blame^] | 40 | sudo rm -f /usr/local/lib{,64}/libndn-cxx* |
| 41 | sudo rm -f /usr/local/lib{,64}/pkgconfig/libndn-cxx.pc |
Junxiao Shi | 439d972 | 2015-03-20 15:08:44 -0700 | [diff] [blame] | 42 | |
| 43 | pushd ndn-cxx >/dev/null |
| 44 | |
Davide Pesavento | 44660cf | 2017-08-16 00:44:23 -0400 | [diff] [blame] | 45 | ./waf configure --color=yes --enable-shared --disable-static --without-osx-keychain |
| 46 | ./waf build --color=yes -j${WAF_JOBS:-1} |
Davide Pesavento | 3f2f486 | 2018-09-11 17:56:55 -0400 | [diff] [blame] | 47 | sudo_preserve_env PATH -- ./waf install --color=yes |
Junxiao Shi | 439d972 | 2015-03-20 15:08:44 -0700 | [diff] [blame] | 48 | |
| 49 | popd >/dev/null |
| 50 | popd >/dev/null |
Joao Pereira | 4bd28fc | 2015-07-08 15:30:42 -0400 | [diff] [blame] | 51 | |
| 52 | if has Linux $NODE_LABELS; then |
| 53 | sudo ldconfig |
Ashlesh Gawande | 70750cf | 2017-05-27 17:10:34 +0000 | [diff] [blame] | 54 | elif has FreeBSD10 $NODE_LABELS; then |
| 55 | sudo ldconfig -m |
Joao Pereira | 4bd28fc | 2015-07-08 15:30:42 -0400 | [diff] [blame] | 56 | fi |