Alexander Afanasyev | 4d4e725 | 2014-10-25 12:21:53 -0700 | [diff] [blame] | 1 | #!/usr/bin/env bash |
Alexander Afanasyev | 4d4e725 | 2014-10-25 12:21:53 -0700 | [diff] [blame] | 2 | set -e |
| 3 | |
Joao Pereira | 08f0701 | 2015-07-06 18:13:29 -0400 | [diff] [blame] | 4 | JDIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) |
| 5 | source "$JDIR"/util.sh |
| 6 | |
Davide Pesavento | e0edc4c | 2016-09-13 18:29:52 +0000 | [diff] [blame] | 7 | set -x |
| 8 | |
| 9 | pushd "${CACHE_DIR:-/tmp}" >/dev/null |
Joao Pereira | 08f0701 | 2015-07-06 18:13:29 -0400 | [diff] [blame] | 10 | |
Ashlesh Gawande | 6f6ef01 | 2017-05-11 16:05:40 +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 |
Joao Pereira | 08f0701 | 2015-07-06 18:13:29 -0400 | [diff] [blame] | 24 | |
| 25 | sudo rm -Rf ndn-cxx-latest |
| 26 | |
| 27 | git clone --depth 1 git://github.com/named-data/ndn-cxx ndn-cxx-latest |
| 28 | |
Ashlesh Gawande | 6f6ef01 | 2017-05-11 16:05:40 +0000 | [diff] [blame] | 29 | LATEST_VERSION=$(git -C ndn-cxx rev-parse HEAD 2>/dev/null || echo UNKNOWN) |
Joao Pereira | 08f0701 | 2015-07-06 18:13:29 -0400 | [diff] [blame] | 30 | |
| 31 | if [[ $INSTALLED_VERSION != $LATEST_VERSION ]]; then |
| 32 | sudo rm -Rf ndn-cxx |
| 33 | mv ndn-cxx-latest ndn-cxx |
Alexander Afanasyev | 4d4e725 | 2014-10-25 12:21:53 -0700 | [diff] [blame] | 34 | else |
Joao Pereira | 08f0701 | 2015-07-06 18:13:29 -0400 | [diff] [blame] | 35 | sudo rm -Rf ndn-cxx-latest |
Alexander Afanasyev | 4d4e725 | 2014-10-25 12:21:53 -0700 | [diff] [blame] | 36 | fi |
| 37 | |
| 38 | sudo rm -Rf /usr/local/include/ndn-cxx |
| 39 | sudo rm -f /usr/local/lib/libndn-cxx* |
| 40 | sudo rm -f /usr/local/lib/pkgconfig/libndn-cxx* |
| 41 | |
Joao Pereira | 08f0701 | 2015-07-06 18:13:29 -0400 | [diff] [blame] | 42 | pushd ndn-cxx >/dev/null |
Alexander Afanasyev | 4d4e725 | 2014-10-25 12:21:53 -0700 | [diff] [blame] | 43 | |
Ashlesh Gawande | 6f6ef01 | 2017-05-11 16:05:40 +0000 | [diff] [blame] | 44 | ./waf configure -j1 --color=yes --enable-shared --disable-static --without-osx-keychain |
| 45 | ./waf -j1 --color=yes |
| 46 | sudo ./waf install -j1 --color=yes |
Joao Pereira | 08f0701 | 2015-07-06 18:13:29 -0400 | [diff] [blame] | 47 | |
| 48 | popd >/dev/null |
| 49 | popd >/dev/null |
| 50 | |
| 51 | if has Linux $NODE_LABELS; then |
| 52 | sudo ldconfig |
Ashlesh Gawande | 6f6ef01 | 2017-05-11 16:05:40 +0000 | [diff] [blame] | 53 | elif has FreeBSD10 $NODE_LABELS; then |
| 54 | sudo ldconfig -m |
Joao Pereira | 08f0701 | 2015-07-06 18:13:29 -0400 | [diff] [blame] | 55 | fi |