* .travis.yml (matrix) <CHECK=coverage>: Add KHEADERS=torvalds/linux.
* travis-build.sh: Handle $KHEADERS.
* travis-install.sh: Likewise.
env:
- TARGET=x86_64
- CHECK=coverage
+ - KHEADERS=torvalds/linux
;;
esac
+case "$KHEADERS" in
+ */*)
+ CPPFLAGS='-isystem /opt/kernel/include'
+ export CPPFLAGS
+ ;;
+esac
+
case "${CHECK-}" in
coverage)
DISTCHECK_CONFIGURE_FLAGS="$DISTCHECK_CONFIGURE_FLAGS --enable-code-coverage"
install -y "$@"
}
+case "$KHEADERS" in
+ */*)
+ git clone --depth=1 https://github.com/"$KHEADERS" kernel
+ sudo make -C kernel headers_install INSTALL_HDR_PATH=/opt/kernel
+ sudo rm -rf kernel
+ KHEADERS_INC=/opt/kernel/include
+ ;;
+ *)
+ KHEADERS_INC=/usr/include
+ ;;
+esac
+
case "$CC" in
gcc)
apt_get_install gcc-multilib
cd -
rm -rf musl
sudo ln -s \
- /usr/include/linux \
- /usr/include/asm \
- /usr/include/asm-generic \
- /usr/include/mtd \
+ $KHEADERS_INC/asm* \
+ $KHEADERS_INC/linux \
+ $KHEADERS_INC/mtd \
/opt/musl/include/
;;
esac