From 448b4d080fa404d8f848821912c99fdc28f6dcf2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20M=C3=BCller?= Date: Tue, 28 Feb 2023 20:51:55 +0100 Subject: [PATCH] Prefer matching `llvm-config` in `find-llvm-config` (#13087) --- src/llvm/ext/find-llvm-config | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/llvm/ext/find-llvm-config b/src/llvm/ext/find-llvm-config index 9d42b7381ed4..40be636e1b23 100755 --- a/src/llvm/ext/find-llvm-config +++ b/src/llvm/ext/find-llvm-config @@ -4,13 +4,13 @@ if ! LLVM_CONFIG=$(command -v "$LLVM_CONFIG"); then llvm_config_version=$(llvm-config --version 2>/dev/null) for version in $(cat "$(dirname $0)/llvm-versions.txt"); do LLVM_CONFIG=$( + ([ "${llvm_config_version#$version}" != "$llvm_config_version" ] && command -v llvm-config) || \ command -v llvm-config-${version%.*} || \ command -v llvm-config-$version || \ command -v llvm-config${version%.*}${version#*.} || \ command -v llvm-config${version%.*} || \ command -v llvm-config$version || \ - command -v llvm${version%.*}-config || \ - [ "${llvm_config_version#$version}" = "$llvm_config_version" ] || command -v llvm-config) + command -v llvm${version%.*}-config) [ "$LLVM_CONFIG" ] && break done fi