blob: 37a7f44376e240f1672475b8d3e13e6c6b3dce60 [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
16# Configure/build in debug mode
Alexander Afanasyev77f84c62018-10-08 13:37:42 -040017export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/usr/local/opt/libxml2/lib/pkgconfig"
18./waf -j${WAF_JOBS:-1} configure -d debug --enable-examples --enable-tests $EXTRA_FLAGS
19./waf -j${WAF_JOBS:-1} build
Alexander Afanasyev8e60bcd2015-01-15 20:55:40 +000020
Yuanzhi Gaodd516fe2015-04-23 04:18:24 -070021# Install
Eric Newberry00f38392017-11-01 15:21:35 -070022sudo ./waf -j${WAF_JOBS:-1} install
Alexander Afanasyev8e60bcd2015-01-15 20:55:40 +000023
Yuanzhi Gaodd516fe2015-04-23 04:18:24 -070024if has Linux $NODE_LABELS; then
25 sudo ldconfig
26elif has FreeBSD $NODE_LABELS; then
27 sudo ldconfig -a
28fi
Alexander Afanasyevd6453cd2015-08-20 21:45:36 -070029
30popd >/dev/null