Don't implicitly try 'llvm-config-14', try fallback or set LLVM_CONFIG; Restore FreeBSD llvm-config discovery

This commit is contained in:
jcmdln
2023-10-14 18:07:20 -04:00
parent 8eff75a484
commit afcdbf1ba6
+13 -13
View File
@@ -25,20 +25,20 @@ error() {
} }
if [ -z "$LLVM_CONFIG" ]; then if [ -z "$LLVM_CONFIG" ]; then
if [ -n "$(command -v llvm-config-17)" ]; then # darwin, linux, openbsd
LLVM_CONFIG="llvm-config-17" if [ -n "$(command -v llvm-config-17)" ]; then LLVM_CONFIG="llvm-config-17"
elif [ -n "$(command -v llvm-config-14)" ]; then elif [ -n "$(command -v llvm-config-13)" ]; then LLVM_CONFIG="llvm-config-13"
LLVM_CONFIG="llvm-config-14" elif [ -n "$(command -v llvm-config-12)" ]; then LLVM_CONFIG="llvm-config-12"
elif [ -n "$(command -v llvm-config-13)" ]; then elif [ -n "$(command -v llvm-config-11)" ]; then LLVM_CONFIG="llvm-config-11"
LLVM_CONFIG="llvm-config-13" # freebsd
elif [ -n "$(command -v llvm-config-12)" ]; then elif [ -n "$(command -v llvm-config17)" ]; then LLVM_CONFIG="llvm-config-17"
LLVM_CONFIG="llvm-config-12" elif [ -n "$(command -v llvm-config13)" ]; then LLVM_CONFIG="llvm-config-13"
elif [ -n "$(command -v llvm-config-11)" ]; then elif [ -n "$(command -v llvm-config12)" ]; then LLVM_CONFIG="llvm-config-12"
LLVM_CONFIG="llvm-config-11" elif [ -n "$(command -v llvm-config11)" ]; then LLVM_CONFIG="llvm-config-11"
elif [ -n "$(command -v llvm-config)" ]; then # fallback
LLVM_CONFIG="llvm-config" elif [ -n "$(command -v llvm-config)" ]; then LLVM_CONFIG="llvm-config"
else else
error "No supported llvm-config version found. Set LLVM_CONFIG to proceed." error "No llvm-config command found. Set LLVM_CONFIG to proceed."
fi fi
fi fi