Alexander Afanasyev | a87e0a8 | 2014-10-21 14:09:19 -0400 | [diff] [blame] | 1 | #!/usr/bin/env bash |
Alexander Afanasyev | 33ce4c3 | 2014-10-24 11:19:45 -0700 | [diff] [blame] | 2 | set -e |
Alexander Afanasyev | a87e0a8 | 2014-10-21 14:09:19 -0400 | [diff] [blame] | 3 | |
Alexander Afanasyev | b346ddb | 2015-06-03 00:52:03 -0400 | [diff] [blame] | 4 | JDIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) |
| 5 | source "$JDIR"/util.sh |
Alexander Afanasyev | a87e0a8 | 2014-10-21 14:09:19 -0400 | [diff] [blame] | 6 | |
Davide Pesavento | 0934888 | 2016-09-17 02:39:44 +0200 | [diff] [blame] | 7 | set -x |
| 8 | |
Davide Pesavento | 7143048 | 2017-06-08 20:06:40 -0400 | [diff] [blame] | 9 | sudo rm -f /usr/local/bin/ndnsec* |
| 10 | sudo rm -fr /usr/local/include/ndn-cxx |
Md Ashiqur Rahman | 8bd3b8a | 2018-09-01 23:43:51 +0000 | [diff] [blame] | 11 | sudo rm -f /usr/local/lib{,64}/libndn-cxx* |
| 12 | sudo rm -f /usr/local/lib{,64}/pkgconfig/libndn-cxx.pc |
Alexander Afanasyev | a87e0a8 | 2014-10-21 14:09:19 -0400 | [diff] [blame] | 13 | |
Davide Pesavento | 9412d12 | 2018-01-02 21:52:09 -0500 | [diff] [blame] | 14 | if [[ $JOB_NAME == *"code-coverage" ]]; then |
| 15 | COVERAGE="--with-coverage" |
| 16 | elif [[ -z $DISABLE_ASAN ]]; then |
| 17 | ASAN="--with-sanitizer=address" |
| 18 | fi |
Davide Pesavento | 9412d12 | 2018-01-02 21:52:09 -0500 | [diff] [blame] | 19 | |
Davide Pesavento | dfe9c6b | 2014-08-25 21:17:10 +0200 | [diff] [blame] | 20 | # Cleanup |
Davide Pesavento | cdb5d8f | 2018-09-05 22:27:49 -0400 | [diff] [blame] | 21 | sudo_preserve_env PATH -- ./waf --color=yes distclean |
Alexander Afanasyev | a87e0a8 | 2014-10-21 14:09:19 -0400 | [diff] [blame] | 22 | |
Davide Pesavento | 0530b5b | 2016-11-07 03:23:58 +0100 | [diff] [blame] | 23 | if [[ $JOB_NAME != *"code-coverage" && $JOB_NAME != *"limited-build" ]]; then |
Davide Pesavento | 97242f7 | 2020-02-29 14:28:15 -0500 | [diff] [blame] | 24 | # Build static library in release mode with tests and without precompiled headers |
| 25 | ./waf --color=yes configure --enable-static --disable-shared --with-tests --without-pch |
| 26 | ./waf --color=yes build -j${WAF_JOBS:-1} |
Davide Pesavento | dfe9c6b | 2014-08-25 21:17:10 +0200 | [diff] [blame] | 27 | |
Davide Pesavento | 97242f7 | 2020-02-29 14:28:15 -0500 | [diff] [blame] | 28 | # Cleanup |
| 29 | sudo_preserve_env PATH -- ./waf --color=yes distclean |
Davide Pesavento | dfe9c6b | 2014-08-25 21:17:10 +0200 | [diff] [blame] | 30 | |
Davide Pesavento | 97242f7 | 2020-02-29 14:28:15 -0500 | [diff] [blame] | 31 | # Build static and shared library in release mode without tests |
| 32 | ./waf --color=yes configure --enable-static --enable-shared |
| 33 | ./waf --color=yes build -j${WAF_JOBS:-1} |
Davide Pesavento | dfe9c6b | 2014-08-25 21:17:10 +0200 | [diff] [blame] | 34 | |
Davide Pesavento | 97242f7 | 2020-02-29 14:28:15 -0500 | [diff] [blame] | 35 | # Cleanup |
| 36 | sudo_preserve_env PATH -- ./waf --color=yes distclean |
Davide Pesavento | 0934888 | 2016-09-17 02:39:44 +0200 | [diff] [blame] | 37 | fi |
Davide Pesavento | dfe9c6b | 2014-08-25 21:17:10 +0200 | [diff] [blame] | 38 | |
Davide Pesavento | 97242f7 | 2020-02-29 14:28:15 -0500 | [diff] [blame] | 39 | # Build shared library in debug mode with tests and examples |
| 40 | ./waf --color=yes configure --disable-static --enable-shared --debug --with-tests --with-examples $ASAN $COVERAGE |
Davide Pesavento | 3cf9078 | 2017-08-10 01:21:20 -0400 | [diff] [blame] | 41 | ./waf --color=yes build -j${WAF_JOBS:-1} |
Davide Pesavento | dfe9c6b | 2014-08-25 21:17:10 +0200 | [diff] [blame] | 42 | |
Davide Pesavento | 97242f7 | 2020-02-29 14:28:15 -0500 | [diff] [blame] | 43 | # (tests will be run against the debug version) |
Alexander Afanasyev | a87e0a8 | 2014-10-21 14:09:19 -0400 | [diff] [blame] | 44 | |
| 45 | # Install |
Davide Pesavento | cdb5d8f | 2018-09-05 22:27:49 -0400 | [diff] [blame] | 46 | sudo_preserve_env PATH -- ./waf --color=yes install |
Alexander Afanasyev | b346ddb | 2015-06-03 00:52:03 -0400 | [diff] [blame] | 47 | |
| 48 | if has Linux $NODE_LABELS; then |
| 49 | sudo ldconfig |
Alexander Afanasyev | b346ddb | 2015-06-03 00:52:03 -0400 | [diff] [blame] | 50 | fi |