]> granicus.if.org Git - strace/blob - travis-install.sh
CREDITS.in: use UTF-8 consistently
[strace] / travis-install.sh
1 #!/bin/sh -ex
2
3 updated=
4 apt_get_install()
5 {
6         [ -n "$updated" ] || {
7                 sudo apt-get -qq update
8                 updated=1
9         }
10         sudo apt-get -qq --no-install-suggests --no-install-recommends \
11                 install -y "$@"
12 }
13
14 case "$KHEADERS" in
15         */*)
16                 git clone --depth=1 https://github.com/"$KHEADERS" kernel
17                 sudo make -C kernel headers_install INSTALL_HDR_PATH=/opt/kernel
18                 sudo rm -rf kernel
19                 KHEADERS_INC=/opt/kernel/include
20                 ;;
21         *)
22                 KHEADERS_INC=/usr/include
23                 ;;
24 esac
25
26 case "$CC" in
27         gcc)
28                 apt_get_install gcc-multilib
29                 ;;
30         gcc-*)
31                 sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
32                 apt_get_install gcc-multilib "$CC"-multilib
33                 ;;
34         clang-*)
35                 apt_get_install gcc-multilib "$CC"
36                 ;;
37         musl-gcc)
38                 apt_get_install gcc-multilib
39                 git clone --depth=1 https://github.com/strace/musl
40                 cd musl
41                         CC=gcc
42                         build=
43                         case "${TARGET-}" in
44                                 x32)
45                                         CC="$CC -mx32"
46                                         ;;
47                                 x86)
48                                         CC="$CC -m32"
49                                         build='--build=i686-pc-linux-gnu --target=i686-pc-linux-gnu'
50                                         ;;
51                         esac
52                         ./configure --prefix=/opt/musl --exec-prefix=/usr ${build}
53                         make
54                         sudo make install
55                 cd -
56                 rm -rf musl
57                 sudo ln -s \
58                         $KHEADERS_INC/asm* \
59                         $KHEADERS_INC/linux \
60                         $KHEADERS_INC/mtd \
61                         /opt/musl/include/
62                 ;;
63 esac
64
65 case "${CHECK-}" in
66         coverage)
67                 apt_get_install lcov
68                 pip install --user codecov
69                 ;;
70         valgrind)
71                 apt_get_install valgrind
72                 ;;
73 esac