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 |
Alexander Afanasyev | a87e0a8 | 2014-10-21 14:09:19 -0400 | [diff] [blame] | 11 | sudo rm -f /usr/local/lib/libndn-cxx* |
Davide Pesavento | 7143048 | 2017-06-08 20:06:40 -0400 | [diff] [blame] | 12 | sudo rm -f /usr/local/lib/pkgconfig/libndn-cxx.pc |
Alexander Afanasyev | a87e0a8 | 2014-10-21 14:09:19 -0400 | [diff] [blame] | 13 | |
Davide Pesavento | dfe9c6b | 2014-08-25 21:17:10 +0200 | [diff] [blame] | 14 | # Cleanup |
Davide Pesavento | 3cf9078 | 2017-08-10 01:21:20 -0400 | [diff] [blame^] | 15 | sudo env "PATH=$PATH" ./waf --color=yes distclean |
Alexander Afanasyev | a87e0a8 | 2014-10-21 14:09:19 -0400 | [diff] [blame] | 16 | |
Davide Pesavento | 0530b5b | 2016-11-07 03:23:58 +0100 | [diff] [blame] | 17 | if [[ $JOB_NAME != *"code-coverage" && $JOB_NAME != *"limited-build" ]]; then |
Davide Pesavento | 0934888 | 2016-09-17 02:39:44 +0200 | [diff] [blame] | 18 | # Configure/build static library in optimized mode with tests |
Davide Pesavento | 3cf9078 | 2017-08-10 01:21:20 -0400 | [diff] [blame^] | 19 | ./waf --color=yes configure --enable-static --disable-shared --with-tests |
| 20 | ./waf --color=yes build -j${WAF_JOBS:-1} |
Davide Pesavento | dfe9c6b | 2014-08-25 21:17:10 +0200 | [diff] [blame] | 21 | |
Davide Pesavento | 0934888 | 2016-09-17 02:39:44 +0200 | [diff] [blame] | 22 | # Cleanup |
Davide Pesavento | 3cf9078 | 2017-08-10 01:21:20 -0400 | [diff] [blame^] | 23 | sudo env "PATH=$PATH" ./waf --color=yes distclean |
Davide Pesavento | dfe9c6b | 2014-08-25 21:17:10 +0200 | [diff] [blame] | 24 | |
Davide Pesavento | 0934888 | 2016-09-17 02:39:44 +0200 | [diff] [blame] | 25 | # Configure/build static and shared library in optimized mode without tests |
Davide Pesavento | 3cf9078 | 2017-08-10 01:21:20 -0400 | [diff] [blame^] | 26 | ./waf --color=yes configure --enable-static --enable-shared |
| 27 | ./waf --color=yes build -j${WAF_JOBS:-1} |
Davide Pesavento | dfe9c6b | 2014-08-25 21:17:10 +0200 | [diff] [blame] | 28 | |
Davide Pesavento | 0934888 | 2016-09-17 02:39:44 +0200 | [diff] [blame] | 29 | # Cleanup |
Davide Pesavento | 3cf9078 | 2017-08-10 01:21:20 -0400 | [diff] [blame^] | 30 | sudo env "PATH=$PATH" ./waf --color=yes distclean |
Davide Pesavento | 0934888 | 2016-09-17 02:39:44 +0200 | [diff] [blame] | 31 | fi |
Davide Pesavento | dfe9c6b | 2014-08-25 21:17:10 +0200 | [diff] [blame] | 32 | |
Davide Pesavento | 0934888 | 2016-09-17 02:39:44 +0200 | [diff] [blame] | 33 | # Configure/build shared library in debug mode with tests/examples and without precompiled headers |
Davide Pesavento | 0530b5b | 2016-11-07 03:23:58 +0100 | [diff] [blame] | 34 | if [[ $JOB_NAME == *"code-coverage" ]]; then |
Alexander Afanasyev | b346ddb | 2015-06-03 00:52:03 -0400 | [diff] [blame] | 35 | COVERAGE="--with-coverage" |
Davide Pesavento | 7143048 | 2017-06-08 20:06:40 -0400 | [diff] [blame] | 36 | elif [[ -n $BUILD_WITH_ASAN || -z $TRAVIS ]]; then |
Davide Pesavento | 50e2002 | 2016-09-17 18:50:27 +0200 | [diff] [blame] | 37 | ASAN="--with-sanitizer=address" |
Alexander Afanasyev | b346ddb | 2015-06-03 00:52:03 -0400 | [diff] [blame] | 38 | fi |
Davide Pesavento | 3cf9078 | 2017-08-10 01:21:20 -0400 | [diff] [blame^] | 39 | ./waf --color=yes configure --disable-static --enable-shared --debug --with-tests --with-examples --without-pch $COVERAGE $ASAN |
| 40 | ./waf --color=yes build -j${WAF_JOBS:-1} |
Davide Pesavento | dfe9c6b | 2014-08-25 21:17:10 +0200 | [diff] [blame] | 41 | |
Alexander Afanasyev | b346ddb | 2015-06-03 00:52:03 -0400 | [diff] [blame] | 42 | # (tests will be run against debug version) |
Alexander Afanasyev | a87e0a8 | 2014-10-21 14:09:19 -0400 | [diff] [blame] | 43 | |
| 44 | # Install |
Davide Pesavento | 3cf9078 | 2017-08-10 01:21:20 -0400 | [diff] [blame^] | 45 | sudo env "PATH=$PATH" ./waf --color=yes install |
Alexander Afanasyev | b346ddb | 2015-06-03 00:52:03 -0400 | [diff] [blame] | 46 | |
| 47 | if has Linux $NODE_LABELS; then |
| 48 | sudo ldconfig |
| 49 | elif has FreeBSD $NODE_LABELS; then |
| 50 | sudo ldconfig -a |
| 51 | fi |