blob: f0fb72e355cb45ddc31fb000ac824406f68a5831 [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 Afanasyev40b88332019-02-13 16:19:06 -050017if has OSX $NODE_LABELS; then
18 export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/usr/local/opt/libxml2/lib/pkgconfig"
19fi
Alexander Afanasyev77f84c62018-10-08 13:37:42 -040020./waf -j${WAF_JOBS:-1} configure -d debug --enable-examples --enable-tests $EXTRA_FLAGS
21./waf -j${WAF_JOBS:-1} build
Alexander Afanasyev8e60bcd2015-01-15 20:55:40 +000022
Yuanzhi Gaodd516fe2015-04-23 04:18:24 -070023# Install
Eric Newberry00f38392017-11-01 15:21:35 -070024sudo ./waf -j${WAF_JOBS:-1} install
Alexander Afanasyev8e60bcd2015-01-15 20:55:40 +000025
Yuanzhi Gaodd516fe2015-04-23 04:18:24 -070026if has Linux $NODE_LABELS; then
27 sudo ldconfig
28elif has FreeBSD $NODE_LABELS; then
29 sudo ldconfig -a
30fi
Alexander Afanasyevd6453cd2015-08-20 21:45:36 -070031
32popd >/dev/null