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 | 0530b5b | 2016-11-07 03:23:58 +0100 | [diff] [blame] | 16 | if [[ $JOB_NAME != *"code-coverage" && $JOB_NAME != *"limited-build" ]]; then |
Davide Pesavento | 0934888 | 2016-09-17 02:39:44 +0200 | [diff] [blame] | 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 |
Davide Pesavento | 0530b5b | 2016-11-07 03:23:58 +0100 | [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" |
Davide Pesavento | 50e2002 | 2016-09-17 18:50:27 +0200 | [diff] [blame] | 35 | elif ! has OSX-10.9 $NODE_LABELS && ! has OSX-10.11 $NODE_LABELS; then |
| 36 | ASAN="--with-sanitizer=address" |
Alexander Afanasyev | b346ddb | 2015-06-03 00:52:03 -0400 | [diff] [blame] | 37 | fi |
Davide Pesavento | 50e2002 | 2016-09-17 18:50:27 +0200 | [diff] [blame] | 38 | ./waf -j1 --color=yes configure --disable-static --enable-shared --debug --with-tests --with-examples --without-pch $COVERAGE $ASAN |
Davide Pesavento | dfe9c6b | 2014-08-25 21:17:10 +0200 | [diff] [blame] | 39 | ./waf -j1 --color=yes build |
| 40 | |
Alexander Afanasyev | b346ddb | 2015-06-03 00:52:03 -0400 | [diff] [blame] | 41 | # (tests will be run against debug version) |
Alexander Afanasyev | a87e0a8 | 2014-10-21 14:09:19 -0400 | [diff] [blame] | 42 | |
| 43 | # Install |
| 44 | sudo ./waf -j1 --color=yes install |
Alexander Afanasyev | b346ddb | 2015-06-03 00:52:03 -0400 | [diff] [blame] | 45 | |
| 46 | if has Linux $NODE_LABELS; then |
| 47 | sudo ldconfig |
| 48 | elif has FreeBSD $NODE_LABELS; then |
| 49 | sudo ldconfig -a |
| 50 | fi |