aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeroen van Rijn <Kelimion@users.noreply.github.com>2022-09-03 16:59:58 +0200
committerJeroen van Rijn <Kelimion@users.noreply.github.com>2022-09-03 16:59:58 +0200
commit4c857bf031be285e08ce64f0a89bbee5ee373d4b (patch)
tree4052dc79864869944048843276451368aa3cc49b
parentc2809c2948cecffc128472ed6a0abe9bfd0c3a26 (diff)
FreeBSD: Autodetect LLVM version.
-rwxr-xr-xbuild_odin.sh14
1 files changed, 13 insertions, 1 deletions
diff --git a/build_odin.sh b/build_odin.sh
index b8cd09c54..62d8a0f59 100755
--- a/build_odin.sh
+++ b/build_odin.sh
@@ -50,7 +50,19 @@ config_darwin() {
}
config_freebsd() {
- : ${LLVM_CONFIG=/usr/local/bin/llvm-config11}
+ : ${LLVM_CONFIG=}
+
+ if [ ! "$LLVM_CONFIG" ]; then
+ if which llvm-config11 > /dev/null 2>&1; then
+ LLVM_CONFIG=llvm-config11
+ elif which llvm-config12 > /dev/null 2>&1; then
+ LLVM_CONFIG=llvm-config12
+ elif which llvm-config13 > /dev/null 2>&1; then
+ LLVM_CONFIG=llvm-config13
+ else
+ panic "Unable to find LLVM-config"
+ fi
+ fi
CXXFLAGS="$CXXFLAGS $($LLVM_CONFIG --cxxflags --ldflags)"
LDFLAGS="$LDFLAGS $($LLVM_CONFIG --libs core native --system-libs)"