Alexander Afanasyev | bc98fcf | 2014-08-16 23:18:50 -0700 | [diff] [blame] | 1 | #!/usr/bin/env bash |
| 2 | set -x |
Vince Lehman | 0a7da61 | 2014-10-29 14:39:29 -0500 | [diff] [blame] | 3 | set -e |
Alexander Afanasyev | bc98fcf | 2014-08-16 23:18:50 -0700 | [diff] [blame] | 4 | |
Alexander Afanasyev | f9f3910 | 2015-12-01 17:43:40 -0800 | [diff] [blame] | 5 | JDIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) |
| 6 | source "$JDIR"/util.sh |
| 7 | |
Alexander Afanasyev | 24ed83a | 2015-03-30 11:06:50 -0700 | [diff] [blame] | 8 | pushd /tmp >/dev/null |
| 9 | |
Muktadir R Chowdhury | 4c7caad | 2015-09-03 15:49:22 -0500 | [diff] [blame^] | 10 | INSTALLED_VERSION=$((cd ndn-cxx && git rev-parse HEAD) 2>/dev/null || echo NONE) |
Alexander Afanasyev | 24ed83a | 2015-03-30 11:06:50 -0700 | [diff] [blame] | 11 | |
Muktadir R Chowdhury | 4c7caad | 2015-09-03 15:49:22 -0500 | [diff] [blame^] | 12 | sudo rm -Rf ndn-cxx-latest |
| 13 | |
| 14 | git clone --depth 1 git://github.com/named-data/ndn-cxx ndn-cxx-latest |
| 15 | |
| 16 | LATEST_VERSION=$((cd ndn-cxx-latest && git rev-parse HEAD) 2>/dev/null || echo UNKNOWN) |
| 17 | |
| 18 | if [[ $INSTALLED_VERSION != $LATEST_VERSION ]]; then |
| 19 | sudo rm -Rf ndn-cxx |
| 20 | mv ndn-cxx-latest ndn-cxx |
| 21 | else |
| 22 | sudo rm -Rf ndn-cxx-latest |
| 23 | fi |
Alexander Afanasyev | bc98fcf | 2014-08-16 23:18:50 -0700 | [diff] [blame] | 24 | |
| 25 | sudo rm -Rf /usr/local/include/ndn-cxx |
| 26 | sudo rm -f /usr/local/lib/libndn-cxx* |
| 27 | sudo rm -f /usr/local/lib/pkgconfig/libndn-cxx* |
| 28 | |
Muktadir R Chowdhury | 4c7caad | 2015-09-03 15:49:22 -0500 | [diff] [blame^] | 29 | pushd ndn-cxx >/dev/null |
Alexander Afanasyev | f9f3910 | 2015-12-01 17:43:40 -0800 | [diff] [blame] | 30 | |
| 31 | ./waf configure -j1 --color=yes --enable-shared --disable-static --without-osx-keychain |
Alexander Afanasyev | bc98fcf | 2014-08-16 23:18:50 -0700 | [diff] [blame] | 32 | ./waf -j1 --color=yes |
Alexander Afanasyev | 24ed83a | 2015-03-30 11:06:50 -0700 | [diff] [blame] | 33 | sudo ./waf install -j1 --color=yes |
| 34 | |
| 35 | popd >/dev/null |
| 36 | popd >/dev/null |
Alexander Afanasyev | f9f3910 | 2015-12-01 17:43:40 -0800 | [diff] [blame] | 37 | |
| 38 | if has Linux $NODE_LABELS; then |
| 39 | sudo ldconfig |
| 40 | elif has FreeBSD $NODE_LABELS; then |
| 41 | sudo ldconfig -a |
| 42 | fi |