forked from zopencommunity/m4port
-
Notifications
You must be signed in to change notification settings - Fork 0
/
buildenv
50 lines (43 loc) · 1.46 KB
/
buildenv
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
#!/bin/sh
#
# Set up environment variables for general build tool to operate
#
export ZOPEN_TYPE="TARBALL"
ZOPEN_TARBALL_DIR=m4-1.4.19
export ZOPEN_TARBALL_URL="https://ftp.gnu.org/gnu/m4/${ZOPEN_TARBALL_DIR}.tar.gz"
export ZOPEN_TARBALL_DEPS="curl gzip make m4"
ZOPEN_GIT_DIR=m4
export ZOPEN_GIT_URL="git://git.savannah.gnu.org/${ZOPEN_GIT_DIR}.git"
export ZOPEN_GIT_DEPS="git make m4 help2man perl makeinfo xz autoconf automake gettext"
export ZOPEN_GIT_BRANCH="branch-1.4"
export ZOPEN_EXTRA_LDFLAGS=""
# -std=c11 required for max_align_t typedef in stddef.h
rm patches
if [ "${ZOPEN_TYPE}x" = "TARBALLx" ]; then
export ZOPEN_BOOTSTRAP=skip
export ZOPEN_EXTRA_CFLAGS="-qnose -std=c11 -I\${ZOPEN_ROOT}/${ZOPEN_TARBALL_DIR}/lib,\${ZOPEN_ROOT}/patches/PR1/include,/usr/include/le"
ln -s tarball-patches patches
else
export ZOPEN_EXTRA_CFLAGS="-qnose -std=c11 -fgnu89-inline -I\${ZOPEN_ROOT}/${ZOPEN_GIT_DIR}/lib,\${ZOPEN_ROOT}/patches/PR1/include,/usr/include/le"
ln -s git-patches patches
fi
zopen_check_results()
{
# m4 check should have 4 (or 3) failures (3 if a git build)
# Determine number of failures by looking at testcases on line _after_ 'Failed checks were:' line
#
dir="$1"
pfx="$2"
chk="$1/$2_check.log"
set -x
start_line=$(cat "${chk}" | egrep -n '^Failed checks were:' | awk -F':' '{ print $1 }')
if [ $? -eq 0 ]; then
failures=$(cat "${chk}" | tail +${start_line} | head -2 | tail -1 | wc -w)
if [ ${failures} -gt 4 ]; then
exit 1
else
exit 0
fi
fi
exit 1
}