From a62ffbf3ac7fcadbfb0dc71206f674419b1a44e0 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Thu, 28 Nov 2024 14:52:14 -0800 Subject: [PATCH] prereq-build: add clang support The Apple g++ check is really clang in disguise. Furthermore, testing on Linux hosts reveals that clang can sufficiently replace gcc. Minimum version of clang is 12 because of ccache. Signed-off-by: Rosen Penev Link: https://github.com/openwrt/openwrt/pull/17259 Signed-off-by: Jonas Jelonek --- include/prereq-build.mk | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/include/prereq-build.mk b/include/prereq-build.mk index 9a83d6b4c3a..f37ea3bd086 100644 --- a/include/prereq-build.mk +++ b/include/prereq-build.mk @@ -35,7 +35,8 @@ $(eval $(call SetupHostCommand,gcc, \ Please install the GNU C Compiler (gcc) 10 or later, \ $(CC) -dumpversion | grep -E '^(1[0-9]|[2-9][0-9])\.?', \ gcc -dumpversion | grep -E '^(1[0-9]|[2-9][0-9])\.?', \ - gcc --version | grep -E 'Apple.(LLVM|clang)' )) + clang -dumpversion | grep -E '^(1[2-9]|[2-9][0-9])\.', \ + clang-12 -dumpversion | grep -E '^(1[2-9]|[2-9][0-9])\.' )) $(eval $(call TestHostCommand,working-gcc, \ Please reinstall the GNU C Compiler (10 or later) - \ @@ -47,7 +48,8 @@ $(eval $(call SetupHostCommand,g++, \ Please install the GNU C++ Compiler (g++) 10 or later, \ $(CXX) -dumpversion | grep -E '^(1[0-9]|[2-9][0-9])\.?', \ g++ -dumpversion | grep -E '^(1[0-9]|[2-9][0-9])\.?', \ - g++ --version | grep -E 'Apple.(LLVM|clang)' )) + clang++ -dumpversion | grep -E '^(1[2-9]|[2-9][0-9])\.', \ + clang++-12 -dumpversion | grep -E '^(1[2-9]|[2-9][0-9])\.' )) $(eval $(call TestHostCommand,working-g++, \ Please reinstall the GNU C++ Compiler (10 or later) - \ -- 2.47.3