2016-06-19 01:53:25 +03:00
#!/bin/sh -ex
case " $CC " in
2017-04-12 06:06:32 +03:00
gcc*)
2016-12-22 01:20:29 +03:00
DISTCHECK_CONFIGURE_FLAGS = " $DISTCHECK_CONFIGURE_FLAGS --enable-gcc-Werror "
2016-06-19 01:53:25 +03:00
; ;
clang-*)
# clang -mx32 fails with the following error:
# clang: error: clang frontend command failed with exit code 70 (use -v to see invocation)
export st_cv_mx32_runtime = no
; ;
esac
case " ${ TARGET - } " in
x32)
CC = " $CC -mx32 "
; ;
x86)
CC = " $CC -m32 "
2016-12-22 01:20:29 +03:00
DISTCHECK_CONFIGURE_FLAGS = " $DISTCHECK_CONFIGURE_FLAGS --build=i686-pc-linux-gnu --target=i686-pc-linux-gnu "
2016-12-18 03:12:48 +03:00
; ;
esac
2017-04-13 21:24:09 +03:00
case " $KHEADERS " in
*/*)
CPPFLAGS = '-isystem /opt/kernel/include'
export CPPFLAGS
; ;
esac
2016-12-18 03:12:48 +03:00
case " ${ CHECK - } " in
coverage)
2016-12-22 01:20:29 +03:00
DISTCHECK_CONFIGURE_FLAGS = " $DISTCHECK_CONFIGURE_FLAGS --enable-code-coverage "
2016-12-18 03:12:48 +03:00
CFLAGS = '-g -O0'
CFLAGS_FOR_BUILD = " $CFLAGS "
export CFLAGS CFLAGS_FOR_BUILD
2016-06-19 01:53:25 +03:00
; ;
esac
$CC --version
export CC_FOR_BUILD = " $CC "
2016-12-22 01:20:29 +03:00
[ -z " ${ DISTCHECK_CONFIGURE_FLAGS - } " ] ||
export DISTCHECK_CONFIGURE_FLAGS
2016-06-19 01:53:25 +03:00
./git-set-file-times
./bootstrap
2016-12-18 03:12:48 +03:00
./configure --enable-maintainer-mode \
${ DISTCHECK_CONFIGURE_FLAGS - } \
#
2016-06-19 01:53:25 +03:00
j = -j` getconf _NPROCESSORS_ONLN 2> /dev/null` || j =
2016-12-18 03:12:48 +03:00
case " ${ CHECK - } " in
coverage)
make -k $j all VERBOSE = ${ VERBOSE - }
make -k $j check VERBOSE = ${ VERBOSE - }
codecov --gcov-args= -abcp || :
2017-04-13 07:43:46 +03:00
echo 'BEGIN OF TEST SUITE INFORMATION'
tail -n 99999 -- tests*/test-suite.log tests*/ksysent.log
echo 'END OF TEST SUITE INFORMATION'
2016-12-18 03:12:48 +03:00
; ;
*)
make -k $j distcheck VERBOSE = ${ VERBOSE - }
; ;
esac