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