blob: 6dd2326f0d4d780d2b08b6b2dc7c5e5acde47186 [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
Davide Pesavento71430482017-06-08 20:06:40 -04009sudo rm -f /usr/local/bin/ndnsec*
10sudo rm -fr /usr/local/include/ndn-cxx
Alexander Afanasyeva87e0a82014-10-21 14:09:19 -040011sudo rm -f /usr/local/lib/libndn-cxx*
Davide Pesavento71430482017-06-08 20:06:40 -040012sudo rm -f /usr/local/lib/pkgconfig/libndn-cxx.pc
Alexander Afanasyeva87e0a82014-10-21 14:09:19 -040013
Davide Pesaventodfe9c6b2014-08-25 21:17:10 +020014# Cleanup
15sudo ./waf -j1 --color=yes distclean
Alexander Afanasyeva87e0a82014-10-21 14:09:19 -040016
Davide Pesavento0530b5b2016-11-07 03:23:58 +010017if [[ $JOB_NAME != *"code-coverage" && $JOB_NAME != *"limited-build" ]]; then
Davide Pesavento09348882016-09-17 02:39:44 +020018 # Configure/build static library in optimized mode with tests
19 ./waf -j1 --color=yes configure --enable-static --disable-shared --with-tests
20 ./waf -j1 --color=yes build
Davide Pesaventodfe9c6b2014-08-25 21:17:10 +020021
Davide Pesavento09348882016-09-17 02:39:44 +020022 # Cleanup
23 sudo ./waf -j1 --color=yes distclean
Davide Pesaventodfe9c6b2014-08-25 21:17:10 +020024
Davide Pesavento09348882016-09-17 02:39:44 +020025 # Configure/build static and shared library in optimized mode without tests
26 ./waf -j1 --color=yes configure --enable-static --enable-shared
27 ./waf -j1 --color=yes build
Davide Pesaventodfe9c6b2014-08-25 21:17:10 +020028
Davide Pesavento09348882016-09-17 02:39:44 +020029 # Cleanup
30 sudo ./waf -j1 --color=yes distclean
31fi
Davide Pesaventodfe9c6b2014-08-25 21:17:10 +020032
Davide Pesavento09348882016-09-17 02:39:44 +020033# Configure/build shared library in debug mode with tests/examples and without precompiled headers
Davide Pesavento0530b5b2016-11-07 03:23:58 +010034if [[ $JOB_NAME == *"code-coverage" ]]; then
Alexander Afanasyevb346ddb2015-06-03 00:52:03 -040035 COVERAGE="--with-coverage"
Davide Pesavento71430482017-06-08 20:06:40 -040036elif [[ -n $BUILD_WITH_ASAN || -z $TRAVIS ]]; then
Davide Pesavento50e20022016-09-17 18:50:27 +020037 ASAN="--with-sanitizer=address"
Alexander Afanasyevb346ddb2015-06-03 00:52:03 -040038fi
Davide Pesavento50e20022016-09-17 18:50:27 +020039./waf -j1 --color=yes configure --disable-static --enable-shared --debug --with-tests --with-examples --without-pch $COVERAGE $ASAN
Davide Pesaventodfe9c6b2014-08-25 21:17:10 +020040./waf -j1 --color=yes build
41
Alexander Afanasyevb346ddb2015-06-03 00:52:03 -040042# (tests will be run against debug version)
Alexander Afanasyeva87e0a82014-10-21 14:09:19 -040043
44# Install
45sudo ./waf -j1 --color=yes install
Alexander Afanasyevb346ddb2015-06-03 00:52:03 -040046
47if has Linux $NODE_LABELS; then
48 sudo ldconfig
49elif has FreeBSD $NODE_LABELS; then
50 sudo ldconfig -a
51fi