Alexander Afanasyev | 8e60bcd | 2015-01-15 20:55:40 +0000 | [diff] [blame] | 1 | #!/usr/bin/env bash |
| 2 | set -x |
| 3 | set -e |
| 4 | |
Yuanzhi Gao | dd516fe | 2015-04-23 04:18:24 -0700 | [diff] [blame] | 5 | JDIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) |
| 6 | source "$JDIR"/util.sh |
Alexander Afanasyev | 8e60bcd | 2015-01-15 20:55:40 +0000 | [diff] [blame] | 7 | |
Alexander Afanasyev | d6453cd | 2015-08-20 21:45:36 -0700 | [diff] [blame] | 8 | pushd ns-3 >/dev/null |
| 9 | |
Yuanzhi Gao | dd516fe | 2015-04-23 04:18:24 -0700 | [diff] [blame] | 10 | git submodule update --init |
Alexander Afanasyev | 8e60bcd | 2015-01-15 20:55:40 +0000 | [diff] [blame] | 11 | |
| 12 | # Cleanup |
Alexander Afanasyev | d6453cd | 2015-08-20 21:45:36 -0700 | [diff] [blame] | 13 | sudo rm -Rf build/ .waf-1* .waf3-1* |
| 14 | find . -name '*.pyc' | sudo xargs rm -f |
Alexander Afanasyev | 8e60bcd | 2015-01-15 20:55:40 +0000 | [diff] [blame] | 15 | |
| 16 | # Configure/build in debug mode |
Alexander Afanasyev | 40b8833 | 2019-02-13 16:19:06 -0500 | [diff] [blame] | 17 | if has OSX $NODE_LABELS; then |
| 18 | export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/usr/local/opt/libxml2/lib/pkgconfig" |
| 19 | fi |
Alexander Afanasyev | 77f84c6 | 2018-10-08 13:37:42 -0400 | [diff] [blame] | 20 | ./waf -j${WAF_JOBS:-1} configure -d debug --enable-examples --enable-tests $EXTRA_FLAGS |
| 21 | ./waf -j${WAF_JOBS:-1} build |
Alexander Afanasyev | 8e60bcd | 2015-01-15 20:55:40 +0000 | [diff] [blame] | 22 | |
Yuanzhi Gao | dd516fe | 2015-04-23 04:18:24 -0700 | [diff] [blame] | 23 | # Install |
Eric Newberry | 00f3839 | 2017-11-01 15:21:35 -0700 | [diff] [blame] | 24 | sudo ./waf -j${WAF_JOBS:-1} install |
Alexander Afanasyev | 8e60bcd | 2015-01-15 20:55:40 +0000 | [diff] [blame] | 25 | |
Yuanzhi Gao | dd516fe | 2015-04-23 04:18:24 -0700 | [diff] [blame] | 26 | if has Linux $NODE_LABELS; then |
| 27 | sudo ldconfig |
| 28 | elif has FreeBSD $NODE_LABELS; then |
| 29 | sudo ldconfig -a |
| 30 | fi |
Alexander Afanasyev | d6453cd | 2015-08-20 21:45:36 -0700 | [diff] [blame] | 31 | |
| 32 | popd >/dev/null |