-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbuildenv
76 lines (64 loc) · 2.25 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
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
# bump: make-version /MMAKE_VERSION="(.*)"/ https://ftp.gnu.org/gnu/make/|re:/make-([\d.]+).tar.gz/$1/|semver:*
# Deliberately misspelt so that CMAKE's regex also doesn't catch this
MMAKE_VERSION="4.4.1"
export ZOPEN_CATEGORIES="development build_system"
export ZOPEN_BUILD_LINE="STABLE"
export ZOPEN_STABLE_URL="https://ftp.gnu.org/gnu/make/make-${MMAKE_VERSION}.tar.gz"
export ZOPEN_STABLE_DEPS="curl gzip tar m4 perl make zoslib"
export ZOPEN_DEV_URL="https://git.savannah.gnu.org/git/make.git"
export ZOPEN_DEV_DEPS="git make m4 perl autoconf automake help2man texinfo xz"
export ZOPEN_CHECK="check_make"
export ZOPEN_INSTALL="install_make"
export ZOPEN_COMP=CLANG
# Use a function as ./make doesn't exist at buildenv processing
install_make()
{
./make install "$@"
}
check_make()
{
(cd "${ZOPEN_ROOT}/make-$MMAKE_VERSION/tests" && perl ./run_make_tests.pl -srcdir ../ -make ../make 2>&1)
}
zopen_check_results()
{
chk="$1/$2_check.log"
if grep ".* Tests.*No Failures :-)" ${chk} >/dev/null; then
totalTests=$(grep ".* Tests.*No Failures :-)" ${chk} | cut -f1 -d' ')
cat <<ZZ
actualFailures:0
totalTests:$totalTests
expectedFailures:1
ZZ
return
fi
failures=$(grep ".* Test.*in .* Categor.*Failed" ${chk} | cut -f1 -d' ')
success=$(grep -E "[0-9]+ passed" $chk | sed -e 's#.*[(/]\([0-9]\+\) passed)#\1#g' | awk '{s+=$1} END {print s}')
totalTests=$((failures+success))
cat <<ZZ
actualFailures:$failures
totalTests:$totalTests
expectedFailures:2
ZZ
}
zopen_install_caveats()
{
cat <<ZZ
GNU make has been installed as gmake under the bin/ dir to avoid collision with z/OS /bin/make.
The conflicting manpages have been installed under the share/altman dir. You can use zotman to view
the manpages as such: zotman gmake
If you prefer to use the GNU make as make, source zopen-config with the option --override-zos-tools.
ZZ
}
zopen_post_install()
{
mv $ZOPEN_INSTALL_DIR/bin/make $ZOPEN_INSTALL_DIR/bin/gmake
mkdir $ZOPEN_INSTALL_DIR/altbin
ln -s ../bin/gmake $ZOPEN_INSTALL_DIR/altbin/make
mkdir -p $ZOPEN_INSTALL_DIR/share/altman/man1
mv $ZOPEN_INSTALL_DIR/share/man/man1/make.1 $ZOPEN_INSTALL_DIR/share/man/man1/gmake.1
ln -s ../../man/man1/gmake.1 $ZOPEN_INSTALL_DIR/share/altman/man1/make.1
}
zopen_get_version()
{
./make --version | head -1 | awk ' { print $3; }'
}