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 | |
Alexander Afanasyev | a87e0a8 | 2014-10-21 14:09:19 -0400 | [diff] [blame] | 9 | sudo rm -Rf /usr/local/include/ndn-cxx |
| 10 | sudo rm -f /usr/local/lib/libndn-cxx* |
| 11 | sudo rm -f /usr/local/lib/pkgconfig/libndn-cxx* |
| 12 | |
Davide Pesavento | dfe9c6b | 2014-08-25 21:17:10 +0200 | [diff] [blame] | 13 | # Cleanup |
| 14 | sudo ./waf -j1 --color=yes distclean |
Alexander Afanasyev | a87e0a8 | 2014-10-21 14:09:19 -0400 | [diff] [blame] | 15 | |
Davide Pesavento | 0934888 | 2016-09-17 02:39:44 +0200 | [diff] [blame^] | 16 | if [[ "$JOB_NAME" != *"limited-build" ]]; then |
| 17 | # Configure/build static library in optimized mode with tests |
| 18 | ./waf -j1 --color=yes configure --enable-static --disable-shared --with-tests |
| 19 | ./waf -j1 --color=yes build |
Davide Pesavento | dfe9c6b | 2014-08-25 21:17:10 +0200 | [diff] [blame] | 20 | |
Davide Pesavento | 0934888 | 2016-09-17 02:39:44 +0200 | [diff] [blame^] | 21 | # Cleanup |
| 22 | sudo ./waf -j1 --color=yes distclean |
Davide Pesavento | dfe9c6b | 2014-08-25 21:17:10 +0200 | [diff] [blame] | 23 | |
Davide Pesavento | 0934888 | 2016-09-17 02:39:44 +0200 | [diff] [blame^] | 24 | # Configure/build static and shared library in optimized mode without tests |
| 25 | ./waf -j1 --color=yes configure --enable-static --enable-shared |
| 26 | ./waf -j1 --color=yes build |
Davide Pesavento | dfe9c6b | 2014-08-25 21:17:10 +0200 | [diff] [blame] | 27 | |
Davide Pesavento | 0934888 | 2016-09-17 02:39:44 +0200 | [diff] [blame^] | 28 | # Cleanup |
| 29 | sudo ./waf -j1 --color=yes distclean |
| 30 | fi |
Davide Pesavento | dfe9c6b | 2014-08-25 21:17:10 +0200 | [diff] [blame] | 31 | |
Davide Pesavento | 0934888 | 2016-09-17 02:39:44 +0200 | [diff] [blame^] | 32 | # Configure/build shared library in debug mode with tests/examples and without precompiled headers |
Alexander Afanasyev | 1884694 | 2015-08-18 23:17:15 -0700 | [diff] [blame] | 33 | if [[ "$JOB_NAME" == *"code-coverage" ]]; then |
Alexander Afanasyev | b346ddb | 2015-06-03 00:52:03 -0400 | [diff] [blame] | 34 | COVERAGE="--with-coverage" |
| 35 | fi |
Davide Pesavento | 0934888 | 2016-09-17 02:39:44 +0200 | [diff] [blame^] | 36 | ./waf -j1 --color=yes configure --disable-static --enable-shared --debug --with-tests --with-examples --without-pch $COVERAGE |
Davide Pesavento | dfe9c6b | 2014-08-25 21:17:10 +0200 | [diff] [blame] | 37 | ./waf -j1 --color=yes build |
| 38 | |
Alexander Afanasyev | b346ddb | 2015-06-03 00:52:03 -0400 | [diff] [blame] | 39 | # (tests will be run against debug version) |
Alexander Afanasyev | a87e0a8 | 2014-10-21 14:09:19 -0400 | [diff] [blame] | 40 | |
| 41 | # Install |
| 42 | sudo ./waf -j1 --color=yes install |
Alexander Afanasyev | b346ddb | 2015-06-03 00:52:03 -0400 | [diff] [blame] | 43 | |
| 44 | if has Linux $NODE_LABELS; then |
| 45 | sudo ldconfig |
| 46 | elif has FreeBSD $NODE_LABELS; then |
| 47 | sudo ldconfig -a |
| 48 | fi |