From 51381f01b1e1cd8ca85594f0dd5a5e3f380a1095 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Toke=20H=C3=B8iland-J=C3=B8rgensen?= Date: Mon, 11 Oct 2021 17:05:13 +0200 Subject: [PATCH] configure: avoid bashisms MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The variable substitution used to parse the clang version was a bashism, so it broke on Debian/Ubuntu. So let's just use sed instead. Signed-off-by: Toke Høiland-Jørgensen --- configure | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/configure b/configure index 06fc1fe..b65066e 100755 --- a/configure +++ b/configure @@ -28,8 +28,9 @@ check_toolchain() done clang_version=$($CLANG --version | sed -n '/clang version/ s/^.*clang version // p') - if [ "${clang_version//.*/}" -lt "11" ]; then - echo "ERROR: Need clang version >= 11, found $clang_version" + clang_major_version=$(echo "$clang_version" | sed 's/\..*$//') + if [ "$clang_major_version" -lt "11" ]; then + echo "ERROR: Need clang version >= 11, found $clang_major_version ($clang_version)" exit 1 fi echo "clang: $clang_version"