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