blob: c1e2ded0cacb1f7fcba0960425814f8bf0d4901c [file] [log] [blame]
Ashlesh Gawande0b2897e2018-06-20 14:40:47 -05001#!/usr/bin/env bash
Davide Pesaventoda1a4d32022-08-19 19:03:24 -04002set -eo pipefail
Ashlesh Gawande0b2897e2018-06-20 14:40:47 -05003
Davide Pesavento133067f2020-04-02 22:08:27 -04004if [[ -z $DISABLE_ASAN ]]; then
Davide Pesavento1526fee2019-03-18 19:31:55 -04005 ASAN="--with-sanitizer=address"
6fi
Davide Pesavento133067f2020-04-02 22:08:27 -04007if [[ $JOB_NAME == *"code-coverage" ]]; then
8 COVERAGE="--with-coverage"
Ashlesh Gawande0b2897e2018-06-20 14:40:47 -05009fi
Davide Pesaventoda1a4d32022-08-19 19:03:24 -040010if [[ $ID == debian && ${VERSION_ID%%.*} -eq 11 ]]; then
11 LZMA="--without-lzma"
12fi
13
14set -x
Ashlesh Gawande0b2897e2018-06-20 14:40:47 -050015
Davide Pesavento133067f2020-04-02 22:08:27 -040016if [[ $JOB_NAME != *"code-coverage" && $JOB_NAME != *"limited-build" ]]; then
17 # Build in release mode with tests
18 ./waf --color=yes configure --with-tests
Davide Pesaventoda1a4d32022-08-19 19:03:24 -040019 ./waf --color=yes build
Ashlesh Gawande0b2897e2018-06-20 14:40:47 -050020
Davide Pesavento133067f2020-04-02 22:08:27 -040021 # Cleanup
22 ./waf --color=yes distclean
23
Davide Pesavento123d44b2023-12-03 16:12:43 -050024 # Build in release mode with examples
25 ./waf --color=yes configure --with-examples
Davide Pesaventoda1a4d32022-08-19 19:03:24 -040026 ./waf --color=yes build
Davide Pesavento133067f2020-04-02 22:08:27 -040027
28 # Cleanup
29 ./waf --color=yes distclean
30fi
31
Davide Pesavento123d44b2023-12-03 16:12:43 -050032# Build in debug mode with tests
33./waf --color=yes configure --debug --with-tests $ASAN $COVERAGE $LZMA
Davide Pesaventoda1a4d32022-08-19 19:03:24 -040034./waf --color=yes build
Davide Pesavento133067f2020-04-02 22:08:27 -040035
36# (tests will be run against the debug version)
Ashlesh Gawande0b2897e2018-06-20 14:40:47 -050037
38# Install
Davide Pesaventoda1a4d32022-08-19 19:03:24 -040039sudo ./waf --color=yes install
Ashlesh Gawande0b2897e2018-06-20 14:40:47 -050040
Davide Pesaventoda1a4d32022-08-19 19:03:24 -040041if [[ $ID_LIKE == *fedora* ]]; then
Davide Pesaventof2784382022-07-09 19:58:53 -040042 sudo tee /etc/ld.so.conf.d/ndn.conf >/dev/null <<< /usr/local/lib64
43fi
Davide Pesaventoda1a4d32022-08-19 19:03:24 -040044if [[ $ID_LIKE == *linux* ]]; then
Ashlesh Gawande0b2897e2018-06-20 14:40:47 -050045 sudo ldconfig
Ashlesh Gawande0b2897e2018-06-20 14:40:47 -050046fi