xref: /freebsd/contrib/lutok/admin/travis-build.sh (revision c697fb7f7cc9bedc5beee44d35b771c4e87b335a)
1*c697fb7fSBrooks Davis#! /bin/sh
2*c697fb7fSBrooks Davis# Copyright 2014 Google Inc.
3*c697fb7fSBrooks Davis# All rights reserved.
4*c697fb7fSBrooks Davis#
5*c697fb7fSBrooks Davis# Redistribution and use in source and binary forms, with or without
6*c697fb7fSBrooks Davis# modification, are permitted provided that the following conditions are
7*c697fb7fSBrooks Davis# met:
8*c697fb7fSBrooks Davis#
9*c697fb7fSBrooks Davis# * Redistributions of source code must retain the above copyright
10*c697fb7fSBrooks Davis#   notice, this list of conditions and the following disclaimer.
11*c697fb7fSBrooks Davis# * Redistributions in binary form must reproduce the above copyright
12*c697fb7fSBrooks Davis#   notice, this list of conditions and the following disclaimer in the
13*c697fb7fSBrooks Davis#   documentation and/or other materials provided with the distribution.
14*c697fb7fSBrooks Davis# * Neither the name of Google Inc. nor the names of its contributors
15*c697fb7fSBrooks Davis#   may be used to endorse or promote products derived from this software
16*c697fb7fSBrooks Davis#   without specific prior written permission.
17*c697fb7fSBrooks Davis#
18*c697fb7fSBrooks Davis# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19*c697fb7fSBrooks Davis# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20*c697fb7fSBrooks Davis# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21*c697fb7fSBrooks Davis# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22*c697fb7fSBrooks Davis# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23*c697fb7fSBrooks Davis# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24*c697fb7fSBrooks Davis# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25*c697fb7fSBrooks Davis# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26*c697fb7fSBrooks Davis# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27*c697fb7fSBrooks Davis# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28*c697fb7fSBrooks Davis# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29*c697fb7fSBrooks Davis
30*c697fb7fSBrooks Davisset -e -x
31*c697fb7fSBrooks Davis
32*c697fb7fSBrooks Davisif [ -d /usr/local/share/aclocal ]; then
33*c697fb7fSBrooks Davis    autoreconf -isv -I/usr/local/share/aclocal
34*c697fb7fSBrooks Daviselse
35*c697fb7fSBrooks Davis    autoreconf -isv
36*c697fb7fSBrooks Davisfi
37*c697fb7fSBrooks Davis./configure
38*c697fb7fSBrooks Davis
39*c697fb7fSBrooks Davisarchflags=
40*c697fb7fSBrooks Davis[ "${ARCH?}" != i386 ] || archflags=-m32
41*c697fb7fSBrooks Davis
42*c697fb7fSBrooks Davisf=
43*c697fb7fSBrooks Davisf="${f} CPPFLAGS='-I/usr/local/include'"
44*c697fb7fSBrooks Davisf="${f} CXX='${CXX} ${archflags}'"
45*c697fb7fSBrooks Davisf="${f} LDFLAGS='-L/usr/local/lib -Wl,-R/usr/local/lib'"
46*c697fb7fSBrooks Davisf="${f} PKG_CONFIG_PATH='/usr/local/lib/pkgconfig'"
47*c697fb7fSBrooks Davisif [ "${AS_ROOT:-no}" = yes ]; then
48*c697fb7fSBrooks Davis    sudo -H PATH="${PATH}" make distcheck DISTCHECK_CONFIGURE_FLAGS="${f}"
49*c697fb7fSBrooks Daviselse
50*c697fb7fSBrooks Davis    make distcheck DISTCHECK_CONFIGURE_FLAGS="${f}"
51*c697fb7fSBrooks Davisfi
52