generated from gnu-ci-templates/ci-check
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build-on.sh
executable file
·69 lines (52 loc) · 1.91 KB
/
build-on.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#!/bin/sh
# Copyright (C) 2024 Free Software Foundation, Inc.
#
# This file is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published
# by the Free Software Foundation, either version 3 of the License,
# or (at your option) any later version.
#
# This file is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# This script builds a tarball of the package on a single platform.
# Usage: build-on.sh PACKAGE CONFIGURE_OPTIONS MAKE
package="$1"
configure_options="$2"
make="$3"
install_optional_dependencies_command="$4"
set -x
# Unpack the tarball.
tarfile=`echo "$package"-*.tar.gz`
packagedir=`echo "$tarfile" | sed -e 's/\.tar\.gz$//'`
tar xfz "$tarfile"
cd "$packagedir" || exit 1
# First, without the optional dependencies.
mkdir build
cd build
# Configure.
../configure --config-cache $configure_options > log1 2>&1; rc=$?; cat log1; test $rc = 0 || exit 1
# Build.
$make > log2 2>&1; rc=$?; cat log2; test $rc = 0 || exit 1
# Run the tests.
$make check > log3 2>&1; rc=$?; cat log3; test $rc = 0 || exit 1
cd ..
if test -n "$install_optional_dependencies_command"; then
# Install the optional dependencies.
sh -c "$install_optional_dependencies_command"
# Build again, this time with optional packages installed.
mkdir build-full
cd build-full
# Configure.
../configure --config-cache $configure_options > log1 2>&1; rc=$?; cat log1; test $rc = 0 || exit 1
# Build.
$make > log2 2>&1; rc=$?; cat log2; test $rc = 0 || exit 1
# Run the tests.
$make check > log3 2>&1; rc=$?; cat log3; test $rc = 0 || exit 1
cd ..
fi
exit 0