Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/pkg
Path: blob/main/scripts/travis_build.sh
2065 views
1
#! /bin/sh
2
# Copyright (c) 2012 Bryan Drewery <[email protected]>
3
# All rights reserved.
4
#
5
# Redistribution and use in source and binary forms, with or without
6
# modification, are permitted provided that the following conditions
7
# are met:
8
# 1. Redistributions of source code must retain the above copyright
9
# notice, this list of conditions and the following disclaimer
10
# in this position and unchanged.
11
# 2. Redistributions in binary form must reproduce the above copyright
12
# notice, this list of conditions and the following disclaimer in the
13
# documentation and/or other materials provided with the distribution.
14
#
15
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
16
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
17
# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
18
# IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
19
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
20
# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25
26
# This script is run as the 'script' step in .travis.yml. Have a standalone
27
# script is better than listing multiple scripts in .travis.yml for several
28
# reasons:
29
# 1 - It allows for condition logic
30
# 2 - We can bail out on the first failure (set -x). Travis will always try
31
# to run all the scripts so, for example, it will try to run 'make' even
32
# if 'configure' fails.
33
# 3 - It allows developers to easily, with a single command re-produce what
34
# travis is doing.
35
36
set -x
37
set -e
38
39
if [ $(uname -s) = "Darwin" ]; then
40
export LDFLAGS="-L/usr/local/opt/libarchive/lib"
41
export CPPFLAGS="-I/usr/local/opt/libarchive/include"
42
export CFLAGS="-I/usr/local/opt/libarchive/include"
43
./configure
44
elif [ $(uname -s) = "Linux" ]; then
45
CFLAGS="-Wno-strict-aliasing -Wno-unused-result -Wno-unused-value" ./configure --with-libarchive.pc
46
else
47
./configure
48
fi
49
50
# Build quietly and in parallel first. If the build fails re-run
51
# with verbosity and in serial, both of which make build errors
52
# easier to interpret.
53
make -j4 || make V=1
54
55
make check || {
56
kyua report --verbose
57
exit 1
58
}
59
60