blob: 58599ea25926edf5fd7c2bb805c47bbdfa0cf310 [file] [log] [blame]
Alexander Afanasyev8e60bcd2015-01-15 20:55:40 +00001#!/usr/bin/env bash
Alexander Afanasyev8e60bcd2015-01-15 20:55:40 +00002set -e
3
Yuanzhi Gaodd516fe2015-04-23 04:18:24 -07004JDIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
5source "$JDIR"/util.sh
Alexander Afanasyev8e60bcd2015-01-15 20:55:40 +00006
Alexander Afanasyev49ecab22020-05-31 00:03:17 -04007set -x
8
Alexander Afanasyevd6453cd2015-08-20 21:45:36 -07009pushd ns-3 >/dev/null
10
Yuanzhi Gaodd516fe2015-04-23 04:18:24 -070011git submodule update --init
Alexander Afanasyev8e60bcd2015-01-15 20:55:40 +000012
13# Cleanup
Alexander Afanasyevd6453cd2015-08-20 21:45:36 -070014sudo rm -Rf build/ .waf-1* .waf3-1*
15find . -name '*.pyc' | sudo xargs rm -f
Alexander Afanasyev8e60bcd2015-01-15 20:55:40 +000016
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"
Alexander Afanasyev49ecab22020-05-31 00:03:17 -040019 if [[ -n $USE_OPENSSL_1_1 ]]; then
20 OPENSSL="--with-openssl=/usr/local/opt/openssl@1.1"
21 fi
Alexander Afanasyev40b88332019-02-13 16:19:06 -050022fi
Alexander Afanasyev49ecab22020-05-31 00:03:17 -040023
24./waf -j${WAF_JOBS:-1} configure -d debug --enable-examples --enable-tests $OPENSSL
Alexander Afanasyev77f84c62018-10-08 13:37:42 -040025./waf -j${WAF_JOBS:-1} build
Alexander Afanasyev8e60bcd2015-01-15 20:55:40 +000026
Yuanzhi Gaodd516fe2015-04-23 04:18:24 -070027# Install
Alexander Afanasyev49ecab22020-05-31 00:03:17 -040028sudo_preserve_env PATH -- ./waf -j${WAF_JOBS:-1} install
Alexander Afanasyev8e60bcd2015-01-15 20:55:40 +000029
Yuanzhi Gaodd516fe2015-04-23 04:18:24 -070030if has Linux $NODE_LABELS; then
31 sudo ldconfig
32elif has FreeBSD $NODE_LABELS; then
33 sudo ldconfig -a
34fi
Alexander Afanasyevd6453cd2015-08-20 21:45:36 -070035
36popd >/dev/null