-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild-on.sh
More file actions
executable file
·112 lines (99 loc) · 3.67 KB
/
build-on.sh
File metadata and controls
executable file
·112 lines (99 loc) · 3.67 KB
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
#!/bin/sh
# Copyright (C) 2024-2026 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 PREFIX PREREQUISITES
package="$1"
configure_options="$2"
make="$3"
prefix="$4"
prerequisites="$5"
set -x
case "$configure_options" in
--host=riscv*) cross_compiling=true ;;
*) cross_compiling=false ;;
esac
# Build and install the prerequisites.
for prereq in $prerequisites; do
tar xfz $prereq.tar.gz
cd $prereq
# --disable-shared avoids problem 1) with rpath on ELF systems, 2) with DLLs on Windows.
./configure $configure_options --disable-shared --prefix="$prefix" > log1 2>&1; rc=$?; cat log1; test $rc = 0 || exit 1
$make > log2 2>&1; rc=$?; cat log2; test $rc = 0 || exit 1
$make install > log4 2>&1; rc=$?; cat log4; test $rc = 0 || exit 1
cd ..
done
# We expect to find the sources in the repository.
# testdir1: iconv problem on macOS 14.
# iconv-capabilities: investigate iconv capabilities on macOS 14.
# testdir2: testing poll.
# testdir3: supersede, canonicalize, readlink problem on Cygwin 3.3.6.
# testdir4: testing the workaround to that problem.
# testdir5: nstrftime problem on MSVC.
# testdir6: GB18030 locale problem on Solaris 11 OmniOS.
# testdir7: an experiment with perl.
# testdir8: access, euidaccess, sigaction problem on Cygwin 3.5.5.
# testdir9: sys_select-h.
# testdir10: sys_socket-h.
# testdir11: sys_un-h.
# testdir12: sys_types-h.
# testdir13: sys_stat-h.
# testdir14: isalnum_l.
# testdir15: getlocalename_l.
# testdir16: c32isalnum c32isalpha c32isgraph c32islower c32isprint c32ispunct c32isspace c32isupper c32tolower c32toupper.
# testdir17: trim.
# testdir18: vc-mtime.
# testdir19: gettext-runtime
# testdir20: stddef-h
# testdir21: open openat
# testdir22: stat-time
# testdir23: stdcountof-h
# testdir24: kwset
# testdir25: assert-h
# testdir26: all
# testdir27: nstrftime
# testdir28: issymlink, issymlinkat
# testdir29: dirent-h stdlib-h ...
# testdir30: uchar-h
# testdir31: all
# testdir32: pagealign_alloc
# testdir33: nl_langinfo
# testdir34: chown chownat fchownat lchown
# testdir35: coreutils-9.8
# testdir36: posix_spawn_file_actions_addclose
# testdir37: boot-time, readutmp
# testdir38: 200 modules
# testdir39: 20 modules
# testdir40: all
# testdir41: git-merge-changelog
# testdir42: libiconv-1.19
cd testdir42 || exit 1
# Bring the time stamps into an order that will not require autoconf, automake, etc. to run again.
sleep 1; touch `find . -name aclocal.m4 -type f`
sleep 1; touch `find . -name configure -type f`
sleep 1; touch `find . -name config.h.in -type f`
sleep 1; touch `find . -name Makefile.in -type f`
mkdir build
cd build
# Configure.
CPPFLAGS="$CPPFLAGS -DCONTINUE_AFTER_ASSERT" \
FORCE_UNSAFE_CONFIGURE=1 ../configure --config-cache --with-included-libunistring $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
if ! $cross_compiling; then
# Run the tests.
$make check > log3 2>&1; rc=$?; cat log3; test $rc = 0 || exit 1
fi
cd ..