blob: e5f7585fa719a9fb6867315dd5b5e74a00432773 [file] [log] [blame]
Alexander Afanasyev21034bf2014-09-02 18:31:53 -07001#!/usr/bin/env bash
Shock Jiang2d8483c2014-10-30 10:15:37 -07002set -e
Alexander Afanasyev21034bf2014-09-02 18:31:53 -07003
Alexander Afanasyevc7c99002015-10-09 17:27:30 -07004JDIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
5source "$JDIR"/util.sh
6
Alexander Afanasyev984ca9d2016-12-19 13:09:14 -08007set -x
8
9pushd "${CACHE_DIR:-/tmp}" >/dev/null
Alexander Afanasyevc7c99002015-10-09 17:27:30 -070010
11INSTALLED_VERSION=$((cd ndn-cxx && git rev-parse HEAD) 2>/dev/null || echo NONE)
12
13sudo rm -Rf ndn-cxx-latest
14
15git clone --depth 1 git://github.com/named-data/ndn-cxx ndn-cxx-latest
16
17LATEST_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
Alexander Afanasyev21034bf2014-09-02 18:31:53 -070022else
Alexander Afanasyevc7c99002015-10-09 17:27:30 -070023 sudo rm -Rf ndn-cxx-latest
Alexander Afanasyev21034bf2014-09-02 18:31:53 -070024fi
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
Alexander Afanasyevc7c99002015-10-09 17:27:30 -070030pushd ndn-cxx >/dev/null
Alexander Afanasyev21034bf2014-09-02 18:31:53 -070031
Alexander Afanasyev984ca9d2016-12-19 13:09:14 -080032./waf -j1 --color=yes configure --enable-shared --disable-static --without-osx-keychain
33./waf -j1 --color=yes build
34sudo ./waf -j1 --color=yes install
Alexander Afanasyevc7c99002015-10-09 17:27:30 -070035
36popd >/dev/null
37popd >/dev/null
38
39if has Linux $NODE_LABELS; then
40 sudo ldconfig
41elif has FreeBSD $NODE_LABELS; then
42 sudo ldconfig -a
43fi