Alexander Afanasyev | 8e60bcd | 2015-01-15 20:55:40 +0000 | [diff] [blame] | 1 | #!/usr/bin/env bash |
| 2 | set -x |
| 3 | set -e |
| 4 | |
Yuanzhi Gao | dd516fe | 2015-04-23 04:18:24 -0700 | [diff] [blame] | 5 | JDIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) |
| 6 | source "$JDIR"/util.sh |
Alexander Afanasyev | 15db772 | 2015-01-19 17:27:26 -0800 | [diff] [blame] | 7 | |
Yuanzhi Gao | dd516fe | 2015-04-23 04:18:24 -0700 | [diff] [blame] | 8 | pushd /tmp >/dev/null |
| 9 | |
| 10 | INSTALLED_VERSION=$((cd ndn-cxx && git rev-parse HEAD) 2>/dev/null || echo NONE) |
| 11 | |
| 12 | sudo rm -Rf ndn-cxx-latest |
| 13 | git clone --depth 1 git://github.com/named-data/ndn-cxx ndn-cxx-latest |
| 14 | LATEST_VERSION=$((cd ndn-cxx-latest && git rev-parse HEAD) 2>/dev/null || echo UNKNOWN) |
| 15 | |
| 16 | if [[ $INSTALLED_VERSION != $LATEST_VERSION ]]; then |
| 17 | sudo rm -Rf ndn-cxx |
| 18 | mv ndn-cxx-latest ndn-cxx |
Alexander Afanasyev | 8e60bcd | 2015-01-15 20:55:40 +0000 | [diff] [blame] | 19 | else |
Yuanzhi Gao | dd516fe | 2015-04-23 04:18:24 -0700 | [diff] [blame] | 20 | sudo rm -Rf ndn-cxx-latest |
Alexander Afanasyev | 8e60bcd | 2015-01-15 20:55:40 +0000 | [diff] [blame] | 21 | fi |
| 22 | |
| 23 | sudo rm -Rf /usr/local/include/ndn-cxx |
| 24 | sudo rm -f /usr/local/lib/libndn-cxx* |
| 25 | sudo rm -f /usr/local/lib/pkgconfig/libndn-cxx* |
| 26 | |
Yuanzhi Gao | dd516fe | 2015-04-23 04:18:24 -0700 | [diff] [blame] | 27 | pushd ndn-cxx >/dev/null |
Alexander Afanasyev | 8e60bcd | 2015-01-15 20:55:40 +0000 | [diff] [blame] | 28 | |
Yuanzhi Gao | dd516fe | 2015-04-23 04:18:24 -0700 | [diff] [blame] | 29 | if has Ubuntu-12.04 $NODE_LABELS; then |
Alexander Afanasyev | df26b5a | 2015-01-15 23:30:56 -0800 | [diff] [blame] | 30 | EXTRA_FLAGS=" --boost-libs=/usr/lib/x86_64-linux-gnu" |
| 31 | fi |
| 32 | |
Alexander Afanasyev | dc63d4a | 2015-06-08 12:26:12 -0700 | [diff] [blame] | 33 | ./waf configure -j1 --color=yes --enable-shared --disable-static --without-osx-keychain $EXTRA_FLAGS |
Alexander Afanasyev | 8e60bcd | 2015-01-15 20:55:40 +0000 | [diff] [blame] | 34 | ./waf -j1 --color=yes |
| 35 | sudo ./waf install -j1 --color=yes |
Yuanzhi Gao | dd516fe | 2015-04-23 04:18:24 -0700 | [diff] [blame] | 36 | |
| 37 | popd >/dev/null |
| 38 | popd >/dev/null |
| 39 | |
| 40 | if has Linux $NODE_LABELS; then |
| 41 | sudo ldconfig |
| 42 | elif has FreeBSD $NODE_LABELS; then |
| 43 | sudo ldconfig -a |
| 44 | fi |