Dmitry V. Levin | b227293 | 2016-01-13 12:12:33 +0000 | [diff] [blame] | 1 | #!/bin/sh -ex |
Dmitry V. Levin | 690235a | 2015-11-26 16:07:57 +0000 | [diff] [blame] | 2 | |
Dmitry V. Levin | b227293 | 2016-01-13 12:12:33 +0000 | [diff] [blame] | 3 | case "$CC" in |
| 4 | gcc) |
| 5 | ENABLE_GCC_WERROR=--enable-gcc-Werror |
| 6 | ;; |
| 7 | clang-*) |
| 8 | sudo apt-get -qq update |
| 9 | sudo apt-get -qq --no-install-suggests --no-install-recommends install -y \ |
| 10 | "$CC" |
| 11 | # clang -mx32 fails with the following error: |
| 12 | # clang: error: clang frontend command failed with exit code 70 (use -v to see invocation) |
| 13 | export st_cv_mx32_runtime=no |
| 14 | ;; |
| 15 | musl-gcc) |
| 16 | sudo add-apt-repository ppa:bortis/musl -y |
| 17 | sudo apt-get -qq update |
| 18 | sudo apt-get -qq --no-install-suggests --no-install-recommends install -y \ |
| 19 | musl-tools linux-musl-dev |
| 20 | ;; |
| 21 | esac |
| 22 | |
Dmitry V. Levin | c9d2501 | 2015-11-30 22:18:16 +0000 | [diff] [blame] | 23 | case "${TARGET-}" in |
| 24 | x32) |
| 25 | CC="$CC -mx32" |
| 26 | ;; |
| 27 | x86) |
| 28 | export DISTCHECK_CONFIGURE_FLAGS='--build=i686-pc-linux-gnu' |
| 29 | CC="$CC -m32" |
| 30 | ;; |
| 31 | esac |
| 32 | export CC_FOR_BUILD="$CC" |
Dmitry V. Levin | b227293 | 2016-01-13 12:12:33 +0000 | [diff] [blame] | 33 | |
| 34 | $CC --version |
| 35 | |
| 36 | git fetch --unshallow |
| 37 | ./git-set-file-times |
Dmitry V. Levin | 690235a | 2015-11-26 16:07:57 +0000 | [diff] [blame] | 38 | ./bootstrap |
Dmitry V. Levin | c9d2501 | 2015-11-30 22:18:16 +0000 | [diff] [blame] | 39 | ./configure --enable-maintainer-mode ${ENABLE_GCC_WERROR-} ${DISTCHECK_CONFIGURE_FLAGS-} |
Dmitry V. Levin | b227293 | 2016-01-13 12:12:33 +0000 | [diff] [blame] | 40 | j=-j`getconf _NPROCESSORS_ONLN 2> /dev/null` || j= |
Dmitry V. Levin | c9d2501 | 2015-11-30 22:18:16 +0000 | [diff] [blame] | 41 | make -k $j distcheck VERBOSE=${VERBOSE-} |
Dmitry V. Levin | 5be488c | 2016-02-04 00:16:11 +0000 | [diff] [blame] | 42 | |
| 43 | if [ "$CC:${TARGET-}" = 'gcc:x86_64' ]; then |
| 44 | set -- strace-*.tar.xz |
| 45 | tar -xf "$1" |
| 46 | dir="${1%.tar.xz}" |
| 47 | cd "$dir" |
| 48 | ./configure --enable-code-coverage ${ENABLE_GCC_WERROR-} ${DISTCHECK_CONFIGURE_FLAGS-} |
| 49 | make -k $j |
| 50 | make -k $j check VERBOSE=${VERBOSE-} |
Dmitry V. Levin | 0acd8d0 | 2016-02-07 22:47:40 +0000 | [diff] [blame] | 51 | codecov --gcov-args=-abcp ||: |
Dmitry V. Levin | 5be488c | 2016-02-04 00:16:11 +0000 | [diff] [blame] | 52 | fi |