blob: b0ec56017e4d7bd65a0483bf5b5a49309dd6e6f4 [file] [log] [blame]
Alexander Afanasyev8e60bcd2015-01-15 20:55:40 +00001#!/usr/bin/env bash
2set -x
3set -e
4
Yuanzhi Gaodd516fe2015-04-23 04:18:24 -07005JDIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
6source "$JDIR"/util.sh
Alexander Afanasyev8e60bcd2015-01-15 20:55:40 +00007
Alexander Afanasyevd6453cd2015-08-20 21:45:36 -07008pushd ns-3 >/dev/null
9
Yuanzhi Gaodd516fe2015-04-23 04:18:24 -070010git submodule update --init
Alexander Afanasyev8e60bcd2015-01-15 20:55:40 +000011
12# Cleanup
Alexander Afanasyevd6453cd2015-08-20 21:45:36 -070013sudo rm -Rf build/ .waf-1* .waf3-1*
14find . -name '*.pyc' | sudo xargs rm -f
Alexander Afanasyev8e60bcd2015-01-15 20:55:40 +000015
Yuanzhi Gaodd516fe2015-04-23 04:18:24 -070016if has Ubuntu-12.04 $NODE_LABELS; then
17 EXTRA_FLAGS=" --boost-libs=/usr/lib/x86_64-linux-gnu"
18fi
19
Alexander Afanasyev8e60bcd2015-01-15 20:55:40 +000020# Configure/build in debug mode
Yuanzhi Gaodd516fe2015-04-23 04:18:24 -070021./waf -j1 configure -d debug --enable-modules=ndnSIM --enable-examples --enable-tests $EXTRA_FLAGS
Alexander Afanasyev8e60bcd2015-01-15 20:55:40 +000022./waf -j1 build
23
Yuanzhi Gaodd516fe2015-04-23 04:18:24 -070024# Install
25sudo ./waf -j1 install
Alexander Afanasyev8e60bcd2015-01-15 20:55:40 +000026
Yuanzhi Gaodd516fe2015-04-23 04:18:24 -070027if has Linux $NODE_LABELS; then
28 sudo ldconfig
29elif has FreeBSD $NODE_LABELS; then
30 sudo ldconfig -a
31fi
Alexander Afanasyevd6453cd2015-08-20 21:45:36 -070032
33popd >/dev/null