~vcs-imports/gawk/master

731.8.52 by Arnold D. Robbins
Improvements to test-build.sh.
1
#! /bin/bash
731.8.51 by Arnold D. Robbins
New helper script: test-build.sh.
2
731.8.52 by Arnold D. Robbins
Improvements to test-build.sh.
3
MIXED_COMPILERS=${MIXED_COMPILERS:-gcc /usr/gcc/bin/gcc clang}
4
OTHER_COMPILERS=${OTHER_COMPILERS:-tcc pcc}
731.8.51 by Arnold D. Robbins
New helper script: test-build.sh.
5
6
rm -f compile-results.txt
7
8
compile () {
9
	make -k
10
	if make check
11
	then
12
		echo success: $1 $2 >> compile-results.txt
13
	else
14
		echo failure: $1 $2 >> compile-results.txt
15
	fi
16
}
17
18
configure_and_compile () {
731.8.52 by Arnold D. Robbins
Improvements to test-build.sh.
19
	if type -p $1 >> compile-results.txt 2>&1
20
	then
21
		for j in "" --disable-mpfr
22
		do
23
			./configure $j CC="$1"
24
			compile "$1" "$j"
25
			make distclean
26
		done
27
	fi
731.8.51 by Arnold D. Robbins
New helper script: test-build.sh.
28
}
29
30
(make distclean)
31
32
for i in $OTHER_COMPILERS $MIXED_COMPILERS
33
do
34
	configure_and_compile $i
35
done
36
37
for i in $MIXED_COMPILERS
38
do
39
	configure_and_compile "$i -m32"
40
done
41
42
echo
43
echo ==========================================
44
echo
45
case $(grep failure compile-results.txt | wc -l) in
46
0)	echo No failures!
47
	# rm compile-results.txt
48
	;;
49
*)	echo The following combinations failed:
50
	grep failure compile-results.txt
51
	;;
52
esac