Ashlesh Gawande | 0b2897e | 2018-06-20 14:40:47 -0500 | [diff] [blame] | 1 | #!/usr/bin/env bash |
Davide Pesavento | da1a4d3 | 2022-08-19 19:03:24 -0400 | [diff] [blame] | 2 | set -eo pipefail |
Ashlesh Gawande | 0b2897e | 2018-06-20 14:40:47 -0500 | [diff] [blame] | 3 | |
Davide Pesavento | 133067f | 2020-04-02 22:08:27 -0400 | [diff] [blame] | 4 | if [[ -z $DISABLE_ASAN ]]; then |
Davide Pesavento | 1526fee | 2019-03-18 19:31:55 -0400 | [diff] [blame] | 5 | ASAN="--with-sanitizer=address" |
| 6 | fi |
Davide Pesavento | 133067f | 2020-04-02 22:08:27 -0400 | [diff] [blame] | 7 | if [[ $JOB_NAME == *"code-coverage" ]]; then |
| 8 | COVERAGE="--with-coverage" |
Ashlesh Gawande | 0b2897e | 2018-06-20 14:40:47 -0500 | [diff] [blame] | 9 | fi |
Davide Pesavento | da1a4d3 | 2022-08-19 19:03:24 -0400 | [diff] [blame] | 10 | if [[ $ID == debian && ${VERSION_ID%%.*} -eq 11 ]]; then |
| 11 | LZMA="--without-lzma" |
| 12 | fi |
| 13 | |
| 14 | set -x |
Ashlesh Gawande | 0b2897e | 2018-06-20 14:40:47 -0500 | [diff] [blame] | 15 | |
Davide Pesavento | 133067f | 2020-04-02 22:08:27 -0400 | [diff] [blame] | 16 | if [[ $JOB_NAME != *"code-coverage" && $JOB_NAME != *"limited-build" ]]; then |
| 17 | # Build in release mode with tests |
| 18 | ./waf --color=yes configure --with-tests |
Davide Pesavento | da1a4d3 | 2022-08-19 19:03:24 -0400 | [diff] [blame] | 19 | ./waf --color=yes build |
Ashlesh Gawande | 0b2897e | 2018-06-20 14:40:47 -0500 | [diff] [blame] | 20 | |
Davide Pesavento | 133067f | 2020-04-02 22:08:27 -0400 | [diff] [blame] | 21 | # Cleanup |
| 22 | ./waf --color=yes distclean |
| 23 | |
Davide Pesavento | 123d44b | 2023-12-03 16:12:43 -0500 | [diff] [blame^] | 24 | # Build in release mode with examples |
| 25 | ./waf --color=yes configure --with-examples |
Davide Pesavento | da1a4d3 | 2022-08-19 19:03:24 -0400 | [diff] [blame] | 26 | ./waf --color=yes build |
Davide Pesavento | 133067f | 2020-04-02 22:08:27 -0400 | [diff] [blame] | 27 | |
| 28 | # Cleanup |
| 29 | ./waf --color=yes distclean |
| 30 | fi |
| 31 | |
Davide Pesavento | 123d44b | 2023-12-03 16:12:43 -0500 | [diff] [blame^] | 32 | # Build in debug mode with tests |
| 33 | ./waf --color=yes configure --debug --with-tests $ASAN $COVERAGE $LZMA |
Davide Pesavento | da1a4d3 | 2022-08-19 19:03:24 -0400 | [diff] [blame] | 34 | ./waf --color=yes build |
Davide Pesavento | 133067f | 2020-04-02 22:08:27 -0400 | [diff] [blame] | 35 | |
| 36 | # (tests will be run against the debug version) |
Ashlesh Gawande | 0b2897e | 2018-06-20 14:40:47 -0500 | [diff] [blame] | 37 | |
| 38 | # Install |
Davide Pesavento | da1a4d3 | 2022-08-19 19:03:24 -0400 | [diff] [blame] | 39 | sudo ./waf --color=yes install |
Ashlesh Gawande | 0b2897e | 2018-06-20 14:40:47 -0500 | [diff] [blame] | 40 | |
Davide Pesavento | da1a4d3 | 2022-08-19 19:03:24 -0400 | [diff] [blame] | 41 | if [[ $ID_LIKE == *fedora* ]]; then |
Davide Pesavento | f278438 | 2022-07-09 19:58:53 -0400 | [diff] [blame] | 42 | sudo tee /etc/ld.so.conf.d/ndn.conf >/dev/null <<< /usr/local/lib64 |
| 43 | fi |
Davide Pesavento | da1a4d3 | 2022-08-19 19:03:24 -0400 | [diff] [blame] | 44 | if [[ $ID_LIKE == *linux* ]]; then |
Ashlesh Gawande | 0b2897e | 2018-06-20 14:40:47 -0500 | [diff] [blame] | 45 | sudo ldconfig |
Ashlesh Gawande | 0b2897e | 2018-06-20 14:40:47 -0500 | [diff] [blame] | 46 | fi |