• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/bin/sh
2
3if test -f /etc/debian_version; then
4    CCACHE_PATH=/usr/lib/ccache
5else
6    CCACHE_PATH=/usr/lib64/ccache
7fi
8
9# Common setup among container builds before we get to building code.
10
11export CCACHE_COMPILERCHECK=content
12export CCACHE_COMPRESS=true
13export CCACHE_DIR=/cache/mesa/ccache
14export PATH=$CCACHE_PATH:$PATH
15
16# CMake ignores $PATH, so we have to force CC/GCC to the ccache versions.
17export CC="${CCACHE_PATH}/gcc"
18export CXX="${CCACHE_PATH}/g++"
19
20# Force linkers to gold, since it's so much faster for building.  We can't use
21# lld because we're on old debian and it's buggy.  ming fails meson builds
22# with it with "meson.build:21:0: ERROR: Unable to determine dynamic linker"
23find /usr/bin -name \*-ld -o -name ld | \
24    grep -v mingw | \
25    xargs -n 1 -I '{}' ln -sf '{}.gold' '{}'
26
27ccache --show-stats
28
29# Make a wrapper script for ninja to always include the -j flags
30echo '#!/bin/sh -x' > /usr/local/bin/ninja
31echo '/usr/bin/ninja -j${FDO_CI_CONCURRENT:-4} "$@"' >> /usr/local/bin/ninja
32chmod +x /usr/local/bin/ninja
33
34# Set MAKEFLAGS so that all make invocations in container builds include the
35# flags (doesn't apply to non-container builds, but we don't run make there)
36export MAKEFLAGS="-j${FDO_CI_CONCURRENT:-4}"
37