blob: e86ced8bb6343a1af435b17a826c7f0c620ef39c [file] [log] [blame]
Alexander Afanasyeva87e0a82014-10-21 14:09:19 -04001#!/usr/bin/env bash
Alexander Afanasyev33ce4c32014-10-24 11:19:45 -07002set -e
Alexander Afanasyeva87e0a82014-10-21 14:09:19 -04003
Alexander Afanasyevb346ddb2015-06-03 00:52:03 -04004JDIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
5source "$JDIR"/util.sh
Alexander Afanasyeva87e0a82014-10-21 14:09:19 -04006
Davide Pesavento09348882016-09-17 02:39:44 +02007set -x
8
Alexander Afanasyeva87e0a82014-10-21 14:09:19 -04009sudo rm -Rf /usr/local/include/ndn-cxx
10sudo rm -f /usr/local/lib/libndn-cxx*
11sudo rm -f /usr/local/lib/pkgconfig/libndn-cxx*
12
Davide Pesaventodfe9c6b2014-08-25 21:17:10 +020013# Cleanup
14sudo ./waf -j1 --color=yes distclean
Alexander Afanasyeva87e0a82014-10-21 14:09:19 -040015
Davide Pesavento09348882016-09-17 02:39:44 +020016if [[ "$JOB_NAME" != *"limited-build" ]]; then
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 Pesaventodfe9c6b2014-08-25 21:17:10 +020020
Davide Pesavento09348882016-09-17 02:39:44 +020021 # Cleanup
22 sudo ./waf -j1 --color=yes distclean
Davide Pesaventodfe9c6b2014-08-25 21:17:10 +020023
Davide Pesavento09348882016-09-17 02:39:44 +020024 # 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 Pesaventodfe9c6b2014-08-25 21:17:10 +020027
Davide Pesavento09348882016-09-17 02:39:44 +020028 # Cleanup
29 sudo ./waf -j1 --color=yes distclean
30fi
Davide Pesaventodfe9c6b2014-08-25 21:17:10 +020031
Davide Pesavento09348882016-09-17 02:39:44 +020032# Configure/build shared library in debug mode with tests/examples and without precompiled headers
Alexander Afanasyev18846942015-08-18 23:17:15 -070033if [[ "$JOB_NAME" == *"code-coverage" ]]; then
Alexander Afanasyevb346ddb2015-06-03 00:52:03 -040034 COVERAGE="--with-coverage"
35fi
Davide Pesavento09348882016-09-17 02:39:44 +020036./waf -j1 --color=yes configure --disable-static --enable-shared --debug --with-tests --with-examples --without-pch $COVERAGE
Davide Pesaventodfe9c6b2014-08-25 21:17:10 +020037./waf -j1 --color=yes build
38
Alexander Afanasyevb346ddb2015-06-03 00:52:03 -040039# (tests will be run against debug version)
Alexander Afanasyeva87e0a82014-10-21 14:09:19 -040040
41# Install
42sudo ./waf -j1 --color=yes install
Alexander Afanasyevb346ddb2015-06-03 00:52:03 -040043
44if has Linux $NODE_LABELS; then
45 sudo ldconfig
46elif has FreeBSD $NODE_LABELS; then
47 sudo ldconfig -a
48fi