blob: e5f7585fa719a9fb6867315dd5b5e74a00432773 [file] [log] [blame]
Junxiao Shi439d9722015-03-20 15:08:44 -07001#!/usr/bin/env bash
Junxiao Shi439d9722015-03-20 15:08:44 -07002set -e
3
Joao Pereira4bd28fc2015-07-08 15:30:42 -04004JDIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
5source "$JDIR"/util.sh
6
Davide Pesavento956ac312016-09-20 19:11:30 +02007set -x
8
9pushd "${CACHE_DIR:-/tmp}" >/dev/null
Junxiao Shi439d9722015-03-20 15:08:44 -070010
11INSTALLED_VERSION=$((cd ndn-cxx && git rev-parse HEAD) 2>/dev/null || echo NONE)
12
13sudo rm -Rf ndn-cxx-latest
Joao Pereira4bd28fc2015-07-08 15:30:42 -040014
Junxiao Shi439d9722015-03-20 15:08:44 -070015git clone --depth 1 git://github.com/named-data/ndn-cxx ndn-cxx-latest
Joao Pereira4bd28fc2015-07-08 15:30:42 -040016
Junxiao Shi439d9722015-03-20 15:08:44 -070017LATEST_VERSION=$((cd ndn-cxx-latest && git rev-parse HEAD) 2>/dev/null || echo UNKNOWN)
18
19if [[ $INSTALLED_VERSION != $LATEST_VERSION ]]; then
20 sudo rm -Rf ndn-cxx
21 mv ndn-cxx-latest ndn-cxx
22else
23 sudo rm -Rf ndn-cxx-latest
24fi
25
26sudo rm -Rf /usr/local/include/ndn-cxx
27sudo rm -f /usr/local/lib/libndn-cxx*
28sudo rm -f /usr/local/lib/pkgconfig/libndn-cxx*
29
30pushd ndn-cxx >/dev/null
31
Davide Pesavento956ac312016-09-20 19:11:30 +020032./waf -j1 --color=yes configure --enable-shared --disable-static --without-osx-keychain
33./waf -j1 --color=yes build
34sudo ./waf -j1 --color=yes install
Junxiao Shi439d9722015-03-20 15:08:44 -070035
36popd >/dev/null
37popd >/dev/null
Joao Pereira4bd28fc2015-07-08 15:30:42 -040038
39if has Linux $NODE_LABELS; then
40 sudo ldconfig
41elif has FreeBSD $NODE_LABELS; then
42 sudo ldconfig -a
43fi