blob: 9616634786d1e9d2a26d36b78a2c251ca86dd8a9 [file] [log] [blame]
Alexander Afanasyeva87e0a82014-10-21 14:09:19 -04001#!/usr/bin/env bash
Davide Pesavento73e946e2022-08-06 16:44:54 -04002set -eo pipefail
Alexander Afanasyeva87e0a82014-10-21 14:09:19 -04003
Davide Pesaventoab7300b2020-04-09 00:51:41 -04004if [[ -z $DISABLE_ASAN ]]; then
5 ASAN="--with-sanitizer=address"
6fi
7if [[ $JOB_NAME == *"code-coverage" ]]; then
8 COVERAGE="--with-coverage"
9fi
Davide Pesavento73e946e2022-08-06 16:44:54 -040010if [[ $ID == macos && ${VERSION_ID%%.*} -ge 12 ]]; then
Davide Pesaventof6625002022-07-31 17:15:02 -040011 KEYCHAIN="--without-osx-keychain"
12fi
Davide Pesavento2349e282020-03-24 14:28:03 -040013
Davide Pesavento73e946e2022-08-06 16:44:54 -040014set -x
15
Davide Pesavento0530b5b2016-11-07 03:23:58 +010016if [[ $JOB_NAME != *"code-coverage" && $JOB_NAME != *"limited-build" ]]; then
Davide Pesavento97242f72020-02-29 14:28:15 -050017 # Build static library in release mode with tests and without precompiled headers
18 ./waf --color=yes configure --enable-static --disable-shared --with-tests --without-pch
Davide Pesavento73e946e2022-08-06 16:44:54 -040019 ./waf --color=yes build
Davide Pesaventodfe9c6b2014-08-25 21:17:10 +020020
Davide Pesavento97242f72020-02-29 14:28:15 -050021 # Cleanup
Davide Pesaventod776a932020-03-20 18:42:36 -040022 ./waf --color=yes distclean
Davide Pesaventodfe9c6b2014-08-25 21:17:10 +020023
Davide Pesavento9a8e1462023-12-03 16:33:34 -050024 # Build static and shared library in release mode with examples
Davide Pesavento4dc4b3c2024-02-05 20:05:54 -050025 ./waf --color=yes configure --enable-static --enable-shared --with-examples
Davide Pesavento73e946e2022-08-06 16:44:54 -040026 ./waf --color=yes build
Davide Pesaventodfe9c6b2014-08-25 21:17:10 +020027
Davide Pesavento97242f72020-02-29 14:28:15 -050028 # Cleanup
Davide Pesaventod776a932020-03-20 18:42:36 -040029 ./waf --color=yes distclean
Davide Pesavento09348882016-09-17 02:39:44 +020030fi
Davide Pesaventodfe9c6b2014-08-25 21:17:10 +020031
Davide Pesavento9a8e1462023-12-03 16:33:34 -050032# Build shared library in debug mode with tests
Davide Pesavento4dc4b3c2024-02-05 20:05:54 -050033./waf --color=yes configure --disable-static --enable-shared --debug --with-tests $ASAN $COVERAGE $KEYCHAIN
Davide Pesavento73e946e2022-08-06 16:44:54 -040034./waf --color=yes build
Davide Pesaventodfe9c6b2014-08-25 21:17:10 +020035
Davide Pesavento97242f72020-02-29 14:28:15 -050036# (tests will be run against the debug version)
Alexander Afanasyeva87e0a82014-10-21 14:09:19 -040037
38# Install
Davide Pesavento73e946e2022-08-06 16:44:54 -040039sudo ./waf --color=yes install
Alexander Afanasyevb346ddb2015-06-03 00:52:03 -040040
Davide Pesavento73e946e2022-08-06 16:44:54 -040041if [[ $ID_LIKE == *linux* ]]; then
Davide Pesavento4dc4b3c2024-02-05 20:05:54 -050042 if [[ $(uname -m) == x86_64 && -d /usr/lib64 ]]; then
43 sudo tee /etc/ld.so.conf.d/ndn.conf >/dev/null <<< /usr/local/lib64
44 fi
Alexander Afanasyevb346ddb2015-06-03 00:52:03 -040045 sudo ldconfig
Alexander Afanasyevb346ddb2015-06-03 00:52:03 -040046fi