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