build: add ccache for cross compilation
By default, ccache is not used for cross build[1]. Update all cross files to use ccache if it is available in build machine. Also, updated devtools/test-meson-builds.sh script to find the correct DPDK_TARGET due to change in cross file syntax. [1] https://mesonbuild.com/Machine-files.html Signed-off-by: Jerin Jacob <jerinj@marvell.com> Acked-by: Stanislaw Kardach <kda@semihalf.com> Acked-by: Chengwen Feng <fengchengwen@huawei.com> Acked-by: Ruifeng Wang <ruifeng.wang@arm.com>
This commit is contained in:
parent
f940a2e333
commit
e3fd286ec4
@ -1,6 +1,6 @@
|
||||
[binaries]
|
||||
c = 'arm-linux-gnueabihf-gcc'
|
||||
cpp = 'arm-linux-gnueabihf-cpp'
|
||||
c = ['ccache', 'arm-linux-gnueabihf-gcc']
|
||||
cpp = ['ccache', 'arm-linux-gnueabihf-cpp']
|
||||
ar = 'arm-linux-gnueabihf-gcc-ar'
|
||||
strip = 'arm-linux-gnueabihf-strip'
|
||||
pkgconfig = 'arm-linux-gnueabihf-pkg-config'
|
||||
|
@ -1,6 +1,6 @@
|
||||
[binaries]
|
||||
c = 'aarch64-linux-gnu-gcc'
|
||||
cpp = 'aarch64-linux-gnu-cpp'
|
||||
c = ['ccache', 'aarch64-linux-gnu-gcc']
|
||||
cpp = ['ccache', 'aarch64-linux-gnu-cpp']
|
||||
ar = 'aarch64-linux-gnu-ar'
|
||||
as = 'aarch64-linux-gnu-as'
|
||||
strip = 'aarch64-linux-gnu-strip'
|
||||
|
@ -1,6 +1,6 @@
|
||||
[binaries]
|
||||
c = 'clang'
|
||||
cpp = 'clang++'
|
||||
c = ['ccache', 'clang']
|
||||
cpp = ['ccache', 'clang++']
|
||||
ar = 'llvm-ar'
|
||||
strip = 'llvm-strip'
|
||||
llvm-config = 'llvm-config'
|
||||
|
@ -1,6 +1,6 @@
|
||||
[binaries]
|
||||
c = 'aarch64-linux-gnu-gcc'
|
||||
cpp = 'aarch64-linux-gnu-cpp'
|
||||
c = ['ccache', 'aarch64-linux-gnu-gcc']
|
||||
cpp = ['ccache', 'aarch64-linux-gnu-cpp']
|
||||
ar = 'aarch64-linux-gnu-gcc-ar'
|
||||
strip = 'aarch64-linux-gnu-strip'
|
||||
pkgconfig = 'aarch64-linux-gnu-pkg-config'
|
||||
|
@ -1,6 +1,6 @@
|
||||
[binaries]
|
||||
c = 'aarch64-linux-gnu-gcc'
|
||||
cpp = 'aarch64-linux-gnu-cpp'
|
||||
c = ['ccache', 'aarch64-linux-gnu-gcc']
|
||||
cpp = ['ccache', 'aarch64-linux-gnu-cpp']
|
||||
ar = 'aarch64-linux-gnu-gcc-ar'
|
||||
strip = 'aarch64-linux-gnu-strip'
|
||||
pkgconfig = 'aarch64-linux-gnu-pkg-config'
|
||||
|
@ -1,6 +1,6 @@
|
||||
[binaries]
|
||||
c = 'aarch64-linux-gnu-gcc'
|
||||
cpp = 'aarch64-linux-gnu-cpp'
|
||||
c = ['ccache', 'aarch64-linux-gnu-gcc']
|
||||
cpp = ['ccache', 'aarch64-linux-gnu-cpp']
|
||||
ar = 'aarch64-linux-gnu-gcc-ar'
|
||||
strip = 'aarch64-linux-gnu-strip'
|
||||
pkgconfig = 'aarch64-linux-gnu-pkg-config'
|
||||
|
@ -1,6 +1,6 @@
|
||||
[binaries]
|
||||
c = 'aarch64-linux-gnu-gcc'
|
||||
cpp = 'aarch64-linux-gnu-cpp'
|
||||
c = ['ccache', 'aarch64-linux-gnu-gcc']
|
||||
cpp = ['ccache', 'aarch64-linux-gnu-cpp']
|
||||
ar = 'aarch64-linux-gnu-gcc-ar'
|
||||
strip = 'aarch64-linux-gnu-strip'
|
||||
pkgconfig = 'aarch64-linux-gnu-pkg-config'
|
||||
|
@ -1,6 +1,6 @@
|
||||
[binaries]
|
||||
c = 'aarch64-linux-gnu-gcc'
|
||||
cpp = 'aarch64-linux-gnu-cpp'
|
||||
c = ['ccache', 'aarch64-linux-gnu-gcc']
|
||||
cpp = ['ccache', 'aarch64-linux-gnu-cpp']
|
||||
ar = 'aarch64-linux-gnu-gcc-ar'
|
||||
strip = 'aarch64-linux-gnu-strip'
|
||||
pkgconfig = 'aarch64-linux-gnu-pkg-config'
|
||||
|
@ -1,6 +1,6 @@
|
||||
[binaries]
|
||||
c = 'aarch64-linux-gnu-gcc'
|
||||
cpp = 'aarch64-linux-gnu-cpp'
|
||||
c = ['ccache', 'aarch64-linux-gnu-gcc']
|
||||
cpp = ['ccache', 'aarch64-linux-gnu-cpp']
|
||||
ar = 'aarch64-linux-gnu-ar'
|
||||
as = 'aarch64-linux-gnu-as'
|
||||
strip = 'aarch64-linux-gnu-strip'
|
||||
|
@ -1,6 +1,6 @@
|
||||
[binaries]
|
||||
c = 'aarch64-linux-gnu-gcc'
|
||||
cpp = 'aarch64-linux-gnu-cpp'
|
||||
c = ['ccache', 'aarch64-linux-gnu-gcc']
|
||||
cpp = ['ccache', 'aarch64-linux-gnu-cpp']
|
||||
ar = 'aarch64-linux-gnu-gcc-ar'
|
||||
strip = 'aarch64-linux-gnu-strip'
|
||||
pkgconfig = 'aarch64-linux-gnu-pkg-config'
|
||||
|
@ -1,6 +1,6 @@
|
||||
[binaries]
|
||||
c = 'aarch64-linux-gnu-gcc'
|
||||
cpp = 'aarch64-linux-gnu-cpp'
|
||||
c = ['ccache', 'aarch64-linux-gnu-gcc']
|
||||
cpp = ['ccache', 'aarch64-linux-gnu-cpp']
|
||||
ar = 'aarch64-linux-gnu-gcc-ar'
|
||||
strip = 'aarch64-linux-gnu-strip'
|
||||
pkgconfig = 'aarch64-linux-gnu-pkg-config'
|
||||
|
@ -1,6 +1,6 @@
|
||||
[binaries]
|
||||
c = 'aarch64-linux-gnu-gcc'
|
||||
cpp = 'aarch64-linux-gnu-cpp'
|
||||
c = ['ccache', 'aarch64-linux-gnu-gcc']
|
||||
cpp = ['ccache', 'aarch64-linux-gnu-cpp']
|
||||
ar = 'aarch64-linux-gnu-gcc-ar'
|
||||
strip = 'aarch64-linux-gnu-strip'
|
||||
pkgconfig = 'aarch64-linux-gnu-pkg-config'
|
||||
|
@ -1,6 +1,6 @@
|
||||
[binaries]
|
||||
c = 'aarch64-linux-gnu-gcc'
|
||||
cpp = 'aarch64-linux-gnu-cpp'
|
||||
c = ['ccache', 'aarch64-linux-gnu-gcc']
|
||||
cpp = ['ccache', 'aarch64-linux-gnu-cpp']
|
||||
ar = 'aarch64-linux-gnu-gcc-ar'
|
||||
strip = 'aarch64-linux-gnu-strip'
|
||||
pkgconfig = 'aarch64-linux-gnu-pkg-config'
|
||||
|
@ -1,6 +1,6 @@
|
||||
[binaries]
|
||||
c = 'aarch64-linux-gnu-gcc'
|
||||
cpp = 'aarch64-linux-gnu-cpp'
|
||||
c = ['ccache', 'aarch64-linux-gnu-gcc']
|
||||
cpp = ['ccache', 'aarch64-linux-gnu-cpp']
|
||||
ar = 'aarch64-linux-gnu-gcc-ar'
|
||||
strip = 'aarch64-linux-gnu-strip'
|
||||
pkgconfig = 'aarch64-linux-gnu-pkg-config'
|
||||
|
@ -1,6 +1,6 @@
|
||||
[binaries]
|
||||
c = 'aarch64-linux-gnu-gcc'
|
||||
cpp = 'aarch64-linux-gnu-cpp'
|
||||
c = ['ccache', 'aarch64-linux-gnu-gcc']
|
||||
cpp = ['ccache', 'aarch64-linux-gnu-cpp']
|
||||
ar = 'aarch64-linux-gnu-gcc-ar'
|
||||
strip = 'aarch64-linux-gnu-strip'
|
||||
pkgconfig = 'aarch64-linux-gnu-pkg-config'
|
||||
|
@ -1,6 +1,6 @@
|
||||
[binaries]
|
||||
c = 'aarch64-linux-gnu-gcc'
|
||||
cpp = 'aarch64-linux-gnu-cpp'
|
||||
c = ['ccache', 'aarch64-linux-gnu-gcc']
|
||||
cpp = ['ccache', 'aarch64-linux-gnu-cpp']
|
||||
ar = 'aarch64-linux-gnu-gcc-ar'
|
||||
strip = 'aarch64-linux-gnu-strip'
|
||||
pkgconfig = 'aarch64-linux-gnu-pkg-config'
|
||||
|
@ -1,6 +1,6 @@
|
||||
[binaries]
|
||||
c = 'aarch64-linux-gnu-gcc'
|
||||
cpp = 'aarch64-linux-gnu-cpp'
|
||||
c = ['ccache', 'aarch64-linux-gnu-gcc']
|
||||
cpp = ['ccache', 'aarch64-linux-gnu-cpp']
|
||||
ar = 'aarch64-linux-gnu-gcc-ar'
|
||||
strip = 'aarch64-linux-gnu-strip'
|
||||
pkgconfig = 'aarch64-linux-gnu-pkg-config'
|
||||
|
@ -1,6 +1,6 @@
|
||||
[binaries]
|
||||
c = 'aarch64-linux-gnu-gcc'
|
||||
cpp = 'aarch64-linux-gnu-cpp'
|
||||
c = ['ccache', 'aarch64-linux-gnu-gcc']
|
||||
cpp = ['ccache', 'aarch64-linux-gnu-cpp']
|
||||
ar = 'aarch64-linux-gnu-gcc-ar'
|
||||
strip = 'aarch64-linux-gnu-strip'
|
||||
pkgconfig = 'aarch64-linux-gnu-pkg-config'
|
||||
|
@ -1,6 +1,6 @@
|
||||
[binaries]
|
||||
c = 'aarch64-linux-gnu-gcc'
|
||||
cpp = 'aarch64-linux-gnu-cpp'
|
||||
c = ['ccache', 'aarch64-linux-gnu-gcc']
|
||||
cpp = ['ccache', 'aarch64-linux-gnu-cpp']
|
||||
ar = 'aarch64-linux-gnu-gcc-ar'
|
||||
strip = 'aarch64-linux-gnu-strip'
|
||||
pkgconfig = 'aarch64-linux-gnu-pkg-config'
|
||||
|
@ -1,6 +1,6 @@
|
||||
[binaries]
|
||||
c = 'powerpc64le-linux-gcc'
|
||||
cpp = 'powerpc64le-linux-cpp'
|
||||
c = ['ccache', 'powerpc64le-linux-gcc']
|
||||
cpp = ['ccache', 'powerpc64le-linux-cpp']
|
||||
ar = 'powerpc64le-linux-gcc-ar'
|
||||
strip = 'powerpc64le-linux-strip'
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
[binaries]
|
||||
c = 'powerpc64le-linux-gnu-gcc'
|
||||
cpp = 'powerpc64le-linux-gnu-cpp'
|
||||
c = ['ccache', 'powerpc64le-linux-gnu-gcc']
|
||||
cpp = ['ccache', 'powerpc64le-linux-gnu-cpp']
|
||||
ar = 'powerpc64le-linux-gnu-ar'
|
||||
strip = 'powerpc64le-linux-gnu-strip'
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
[binaries]
|
||||
c = 'riscv64-linux-gnu-gcc'
|
||||
cpp = 'riscv64-linux-gnu-g++'
|
||||
c = ['ccache', 'riscv64-linux-gnu-gcc']
|
||||
cpp = ['ccache', 'riscv64-linux-gnu-g++']
|
||||
ar = 'riscv64-linux-gnu-ar'
|
||||
strip = 'riscv64-linux-gnu-strip'
|
||||
pcap-config = ''
|
||||
|
@ -1,6 +1,6 @@
|
||||
[binaries]
|
||||
c = 'riscv64-unknown-linux-gnu-gcc'
|
||||
cpp = 'riscv64-unknown-linux-gnu-g++'
|
||||
c = ['ccache', 'riscv64-unknown-linux-gnu-gcc']
|
||||
cpp = ['ccache', 'riscv64-unknown-linux-gnu-g++']
|
||||
ar = 'riscv64-unknown-linux-gnu-ar'
|
||||
strip = 'riscv64-unknown-linux-gnu-strip'
|
||||
pcap-config = ''
|
||||
|
@ -1,6 +1,6 @@
|
||||
[binaries]
|
||||
c = 'x86_64-w64-mingw32-gcc'
|
||||
cpp = 'x86_64-w64-mingw32-g++'
|
||||
c = ['ccache', 'x86_64-w64-mingw32-gcc']
|
||||
cpp = ['ccache', 'x86_64-w64-mingw32-g++']
|
||||
ld = 'x86_64-w64-mingw32-ld'
|
||||
ar = 'x86_64-w64-mingw32-ar'
|
||||
strip = 'x86_64-w64-mingw32-strip'
|
||||
|
@ -160,7 +160,7 @@ build () # <directory> <target cc | cross file> <ABI check> [meson options]
|
||||
if [ -n "$crossfile" ] ; then
|
||||
cross="--cross-file $crossfile"
|
||||
targetcc=$(sed -n 's,^c[[:space:]]*=[[:space:]]*,,p' \
|
||||
$crossfile | tr -d "'" | tr -d '"')
|
||||
$crossfile | cut -d ',' -f 2 | tr -d "'"'"] ')
|
||||
else
|
||||
cross=
|
||||
fi
|
||||
|
Loading…
Reference in New Issue
Block a user