From: Jerin Jacob <jer...@marvell.com>

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 <jer...@marvell.com>
---

v2:
- Rebased with master, therefore added update riscv64 cross files
- Fixed DPDK_TARGET detection with devtools/test-meson-builds.sh 
due to cross file synatx update.

 config/arm/arm32_armv8_linux_gcc           | 4 ++--
 config/arm/arm64_armada_linux_gcc          | 4 ++--
 config/arm/arm64_armv8_linux_clang_ubuntu  | 4 ++--
 config/arm/arm64_armv8_linux_gcc           | 4 ++--
 config/arm/arm64_bluefield_linux_gcc       | 4 ++--
 config/arm/arm64_centriq2400_linux_gcc     | 4 ++--
 config/arm/arm64_cn10k_linux_gcc           | 4 ++--
 config/arm/arm64_cn9k_linux_gcc            | 4 ++--
 config/arm/arm64_dpaa_linux_gcc            | 4 ++--
 config/arm/arm64_emag_linux_gcc            | 4 ++--
 config/arm/arm64_graviton2_linux_gcc       | 4 ++--
 config/arm/arm64_kunpeng920_linux_gcc      | 4 ++--
 config/arm/arm64_kunpeng930_linux_gcc      | 4 ++--
 config/arm/arm64_n1sdp_linux_gcc           | 4 ++--
 config/arm/arm64_n2_linux_gcc              | 4 ++--
 config/arm/arm64_stingray_linux_gcc        | 4 ++--
 config/arm/arm64_thunderx2_linux_gcc       | 4 ++--
 config/arm/arm64_thunderxt83_linux_gcc     | 4 ++--
 config/arm/arm64_thunderxt88_linux_gcc     | 4 ++--
 config/ppc/ppc64le-power8-linux-gcc        | 4 ++--
 config/ppc/ppc64le-power8-linux-gcc-ubuntu | 4 ++--
 config/riscv/riscv64_linux_gcc             | 4 ++--
 config/riscv/riscv64_sifive_u740_linux_gcc | 4 ++--
 config/x86/cross-mingw                     | 4 ++--
 devtools/test-meson-builds.sh              | 3 ++-
 25 files changed, 50 insertions(+), 49 deletions(-)

diff --git a/config/arm/arm32_armv8_linux_gcc b/config/arm/arm32_armv8_linux_gcc
index 89f8a12881..7f2977e49d 100644
--- a/config/arm/arm32_armv8_linux_gcc
+++ b/config/arm/arm32_armv8_linux_gcc
@@ -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'
diff --git a/config/arm/arm64_armada_linux_gcc 
b/config/arm/arm64_armada_linux_gcc
index 301418949b..1566999101 100644
--- a/config/arm/arm64_armada_linux_gcc
+++ b/config/arm/arm64_armada_linux_gcc
@@ -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'
diff --git a/config/arm/arm64_armv8_linux_clang_ubuntu 
b/config/arm/arm64_armv8_linux_clang_ubuntu
index db488d75f4..86ae43937b 100644
--- a/config/arm/arm64_armv8_linux_clang_ubuntu
+++ b/config/arm/arm64_armv8_linux_clang_ubuntu
@@ -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'
diff --git a/config/arm/arm64_armv8_linux_gcc b/config/arm/arm64_armv8_linux_gcc
index 5391d35389..048c2d9f29 100644
--- a/config/arm/arm64_armv8_linux_gcc
+++ b/config/arm/arm64_armv8_linux_gcc
@@ -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'
diff --git a/config/arm/arm64_bluefield_linux_gcc 
b/config/arm/arm64_bluefield_linux_gcc
index 248a9f031a..38df3c198b 100644
--- a/config/arm/arm64_bluefield_linux_gcc
+++ b/config/arm/arm64_bluefield_linux_gcc
@@ -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'
diff --git a/config/arm/arm64_centriq2400_linux_gcc 
b/config/arm/arm64_centriq2400_linux_gcc
index dfe9110331..0966eef2c5 100644
--- a/config/arm/arm64_centriq2400_linux_gcc
+++ b/config/arm/arm64_centriq2400_linux_gcc
@@ -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'
diff --git a/config/arm/arm64_cn10k_linux_gcc b/config/arm/arm64_cn10k_linux_gcc
index a3578c03a1..201e0ccd59 100644
--- a/config/arm/arm64_cn10k_linux_gcc
+++ b/config/arm/arm64_cn10k_linux_gcc
@@ -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'
diff --git a/config/arm/arm64_cn9k_linux_gcc b/config/arm/arm64_cn9k_linux_gcc
index a94b44a551..a9b4d51958 100644
--- a/config/arm/arm64_cn9k_linux_gcc
+++ b/config/arm/arm64_cn9k_linux_gcc
@@ -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'
diff --git a/config/arm/arm64_dpaa_linux_gcc b/config/arm/arm64_dpaa_linux_gcc
index e9d5fd31fc..0d5761bd72 100644
--- a/config/arm/arm64_dpaa_linux_gcc
+++ b/config/arm/arm64_dpaa_linux_gcc
@@ -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'
diff --git a/config/arm/arm64_emag_linux_gcc b/config/arm/arm64_emag_linux_gcc
index 9cdd931180..16ec49fc32 100644
--- a/config/arm/arm64_emag_linux_gcc
+++ b/config/arm/arm64_emag_linux_gcc
@@ -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'
diff --git a/config/arm/arm64_graviton2_linux_gcc 
b/config/arm/arm64_graviton2_linux_gcc
index 8016fd236c..094c540f50 100644
--- a/config/arm/arm64_graviton2_linux_gcc
+++ b/config/arm/arm64_graviton2_linux_gcc
@@ -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'
diff --git a/config/arm/arm64_kunpeng920_linux_gcc 
b/config/arm/arm64_kunpeng920_linux_gcc
index c4685b2458..fc057c9063 100644
--- a/config/arm/arm64_kunpeng920_linux_gcc
+++ b/config/arm/arm64_kunpeng920_linux_gcc
@@ -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'
diff --git a/config/arm/arm64_kunpeng930_linux_gcc 
b/config/arm/arm64_kunpeng930_linux_gcc
index fb85d2d710..5f43941fae 100644
--- a/config/arm/arm64_kunpeng930_linux_gcc
+++ b/config/arm/arm64_kunpeng930_linux_gcc
@@ -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'
diff --git a/config/arm/arm64_n1sdp_linux_gcc b/config/arm/arm64_n1sdp_linux_gcc
index 0df283e2f4..fc123ab53f 100644
--- a/config/arm/arm64_n1sdp_linux_gcc
+++ b/config/arm/arm64_n1sdp_linux_gcc
@@ -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'
diff --git a/config/arm/arm64_n2_linux_gcc b/config/arm/arm64_n2_linux_gcc
index 036aee2b0a..930bd5c236 100644
--- a/config/arm/arm64_n2_linux_gcc
+++ b/config/arm/arm64_n2_linux_gcc
@@ -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'
diff --git a/config/arm/arm64_stingray_linux_gcc 
b/config/arm/arm64_stingray_linux_gcc
index 319a4a151d..5dfcd974fd 100644
--- a/config/arm/arm64_stingray_linux_gcc
+++ b/config/arm/arm64_stingray_linux_gcc
@@ -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'
diff --git a/config/arm/arm64_thunderx2_linux_gcc 
b/config/arm/arm64_thunderx2_linux_gcc
index 69c71cbc82..c1f5995d93 100644
--- a/config/arm/arm64_thunderx2_linux_gcc
+++ b/config/arm/arm64_thunderx2_linux_gcc
@@ -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'
diff --git a/config/arm/arm64_thunderxt83_linux_gcc 
b/config/arm/arm64_thunderxt83_linux_gcc
index 47102c900b..52746e2e59 100644
--- a/config/arm/arm64_thunderxt83_linux_gcc
+++ b/config/arm/arm64_thunderxt83_linux_gcc
@@ -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'
diff --git a/config/arm/arm64_thunderxt88_linux_gcc 
b/config/arm/arm64_thunderxt88_linux_gcc
index 372097ba01..fed7eb791e 100644
--- a/config/arm/arm64_thunderxt88_linux_gcc
+++ b/config/arm/arm64_thunderxt88_linux_gcc
@@ -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'
diff --git a/config/ppc/ppc64le-power8-linux-gcc 
b/config/ppc/ppc64le-power8-linux-gcc
index 51f7ceebf3..465044e427 100644
--- a/config/ppc/ppc64le-power8-linux-gcc
+++ b/config/ppc/ppc64le-power8-linux-gcc
@@ -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'
 
diff --git a/config/ppc/ppc64le-power8-linux-gcc-ubuntu 
b/config/ppc/ppc64le-power8-linux-gcc-ubuntu
index 803c612cbc..44d7e0100a 100644
--- a/config/ppc/ppc64le-power8-linux-gcc-ubuntu
+++ b/config/ppc/ppc64le-power8-linux-gcc-ubuntu
@@ -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'
 
diff --git a/config/riscv/riscv64_linux_gcc b/config/riscv/riscv64_linux_gcc
index ed4d3ce7fb..5e58781193 100644
--- a/config/riscv/riscv64_linux_gcc
+++ b/config/riscv/riscv64_linux_gcc
@@ -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 = ''
diff --git a/config/riscv/riscv64_sifive_u740_linux_gcc 
b/config/riscv/riscv64_sifive_u740_linux_gcc
index 3d1905c434..58d2c92f8c 100644
--- a/config/riscv/riscv64_sifive_u740_linux_gcc
+++ b/config/riscv/riscv64_sifive_u740_linux_gcc
@@ -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 = ''
diff --git a/config/x86/cross-mingw b/config/x86/cross-mingw
index 09f7af0928..cddebda5b5 100644
--- a/config/x86/cross-mingw
+++ b/config/x86/cross-mingw
@@ -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'
diff --git a/devtools/test-meson-builds.sh b/devtools/test-meson-builds.sh
index f732dccf6c..e44a2b1995 100755
--- a/devtools/test-meson-builds.sh
+++ b/devtools/test-meson-builds.sh
@@ -160,7 +160,8 @@ 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 "'" | tr -d '"' | tr -d ']' | tr -d ' ')
        else
                cross=
        fi
-- 
2.36.1

Reply via email to