2017-12-21 16:42:29 +00:00
|
|
|
# This package gets installed in the native chroot only. When cross-
|
|
|
|
# compiling packages in the native chroot (e.g. kernel packages), the
|
|
|
|
# cross-compiler does not get called directly, but wrapped through
|
|
|
|
# ccache, which can then cache the results.
|
2017-05-26 20:26:25 +00:00
|
|
|
|
|
|
|
pkgname=ccache-cross-symlinks
|
2020-11-04 12:50:40 +00:00
|
|
|
pkgver=3
|
|
|
|
pkgrel=0
|
2017-05-26 20:26:25 +00:00
|
|
|
pkgdesc="Enable ccache for cross-compilers with symlinks"
|
|
|
|
url="https://ccache.samba.org/"
|
|
|
|
arch="noarch"
|
2017-05-31 17:10:29 +00:00
|
|
|
license="MIT"
|
2017-05-26 20:26:25 +00:00
|
|
|
depends="ccache"
|
|
|
|
options="!check"
|
|
|
|
|
|
|
|
package() {
|
2019-04-03 18:40:31 +00:00
|
|
|
# Keep in sync with pmb.config.build_device_architectures
|
|
|
|
local _archs="armhf armv7 aarch64 x86_64 x86"
|
|
|
|
|
|
|
|
local _bins="c++ cc cpp g++ gcc clang clang++"
|
2017-05-26 20:26:25 +00:00
|
|
|
mkdir -p "$pkgdir/usr/lib/ccache/bin"
|
|
|
|
cd "$pkgdir/usr/lib/ccache/bin"
|
|
|
|
for _arch in $_archs; do
|
2019-04-03 18:40:31 +00:00
|
|
|
if [ "$_arch" = "$CARCH" ]; then
|
|
|
|
continue
|
|
|
|
fi
|
2017-05-26 20:26:25 +00:00
|
|
|
_hostspec="$(arch_to_hostspec $_arch)"
|
|
|
|
for _bin in $_bins; do
|
2019-04-03 18:40:31 +00:00
|
|
|
# Relative symlink, so it works with crossdirect (pointing to
|
|
|
|
# /native/usr/bin/ccache)
|
|
|
|
ln -v -s ../../../bin/ccache ${_hostspec}-${_bin}
|
2017-05-26 20:26:25 +00:00
|
|
|
done
|
2020-11-04 12:50:40 +00:00
|
|
|
|
|
|
|
ln -v -s ../../../bin/ccache gcc4-${_hostspec}-gcc
|
|
|
|
ln -v -s ../../../bin/ccache gcc6-${_hostspec}-gcc
|
2017-05-26 20:26:25 +00:00
|
|
|
done
|
2020-11-04 12:50:40 +00:00
|
|
|
|
|
|
|
ln -v -s ../../../bin/ccache gcc4-gcc
|
|
|
|
ln -v -s ../../../bin/ccache gcc6-gcc
|
2017-05-26 20:26:25 +00:00
|
|
|
}
|