2016-10-06 15:35:33 +00:00
|
|
|
#!/bin/sh
|
|
|
|
# test various compilation options
|
|
|
|
# - 32bit, 64bit
|
|
|
|
# - dynamic, static
|
|
|
|
# - various configure options
|
|
|
|
#
|
|
|
|
# Arguments: anything will be passed to 'make', eg. define CC, D, V
|
|
|
|
#
|
|
|
|
# Requirements for full coverage:
|
|
|
|
# - static version of all libs
|
|
|
|
# - 32bit/64bit libraries, also the static variants
|
|
|
|
|
|
|
|
make=make
|
|
|
|
opts="-j16 $@"
|
|
|
|
|
|
|
|
conf=
|
|
|
|
target=
|
|
|
|
|
2019-07-03 20:35:22 +00:00
|
|
|
die() {
|
2016-10-06 15:35:33 +00:00
|
|
|
echo "ERROR: $@"
|
|
|
|
exit 1
|
|
|
|
}
|
|
|
|
|
2019-07-03 20:35:22 +00:00
|
|
|
check_result() {
|
2016-10-06 15:35:33 +00:00
|
|
|
local ret
|
|
|
|
local str
|
|
|
|
|
|
|
|
ret=$1
|
|
|
|
|
|
|
|
str="RESULT of target($target) conf($conf): "
|
|
|
|
case $ret in
|
|
|
|
0) str="$str OK";;
|
|
|
|
*) str="$str FAIL";;
|
|
|
|
esac
|
|
|
|
echo "$str"
|
|
|
|
verdict="$verdict
|
|
|
|
$str"
|
|
|
|
}
|
|
|
|
|
2019-07-03 20:35:22 +00:00
|
|
|
buildme() {
|
2016-10-06 15:35:33 +00:00
|
|
|
make clean-all
|
|
|
|
|
|
|
|
./autogen.sh && configure "$conf" || die "configure not working with: $@"
|
|
|
|
$make clean
|
|
|
|
$make $opts $target
|
|
|
|
check_result "$?"
|
|
|
|
echo "VERDICT: $verdict"
|
|
|
|
}
|
|
|
|
|
2019-07-03 20:35:22 +00:00
|
|
|
build_make_targets() {
|
2016-10-06 15:35:33 +00:00
|
|
|
# defaults
|
|
|
|
target=
|
|
|
|
buildme
|
|
|
|
# defaults, static
|
|
|
|
target=static
|
|
|
|
buildme
|
2015-06-21 16:23:19 +00:00
|
|
|
# defaults, busybox
|
|
|
|
target='btrfs.box btrfs.box.static'
|
|
|
|
buildme
|
2016-10-06 15:35:33 +00:00
|
|
|
# defaults, 32bit
|
|
|
|
target="EXTRA_CFLAGS=-m32"
|
|
|
|
buildme
|
|
|
|
# defaults, 64bit
|
|
|
|
target="EXTRA_CFLAGS=-m64"
|
|
|
|
buildme
|
|
|
|
# defaults, library
|
|
|
|
target="library-test"
|
|
|
|
buildme
|
2017-03-13 16:15:24 +00:00
|
|
|
# defaults, static library
|
|
|
|
target="library-test.static"
|
|
|
|
buildme
|
2016-10-06 15:35:33 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
# main()
|
|
|
|
if ! [ -f configure.ac ]; then
|
|
|
|
echo "Please run me from the top directory"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
verdict=
|
|
|
|
conf=
|
|
|
|
build_make_targets
|
|
|
|
|
|
|
|
conf='--disable-documentation'
|
|
|
|
build_make_targets
|
|
|
|
|
|
|
|
conf='--disable-backtrace'
|
|
|
|
build_make_targets
|
|
|
|
|
|
|
|
conf='--disable-convert'
|
|
|
|
build_make_targets
|
|
|
|
|
2017-10-12 12:29:27 +00:00
|
|
|
conf='--with-convert=ext2'
|
|
|
|
build_make_targets
|
|
|
|
|
|
|
|
conf='--with-convert=ext2,reiserfs'
|
|
|
|
build_make_targets
|
|
|
|
|
|
|
|
conf='--enable-zstd'
|
|
|
|
build_make_targets
|
|
|
|
|
2017-08-28 11:54:02 +00:00
|
|
|
# debugging builds, just the default targets
|
|
|
|
target='D=1'
|
|
|
|
buildme
|
|
|
|
|
|
|
|
target='D=asan'
|
|
|
|
buildme
|
|
|
|
|
|
|
|
target='D=tsan'
|
|
|
|
buildme
|
|
|
|
|
|
|
|
target='D=ubsan'
|
|
|
|
buildme
|
|
|
|
|
2016-10-06 15:35:33 +00:00
|
|
|
echo "---------------------------------------------------"
|
|
|
|
echo "$verdict"
|