summaryrefslogtreecommitdiffhomepage
path: root/scripts/utils
diff options
context:
space:
mode:
authorOskar Nyberg <oskar@mullvad.net>2024-01-09 16:32:28 +0100
committerOskar Nyberg <oskar@mullvad.net>2024-01-15 16:30:01 +0100
commit441466e650d541c88ae246cf5cb110a90cee9898 (patch)
tree47daf5aea4f1474a8c2aa7bf69666a1f281fc089 /scripts/utils
parent6bc4b86b278ec0b4187b35294ab7e889b638504d (diff)
downloadmullvadvpn-441466e650d541c88ae246cf5cb110a90cee9898.tar.xz
mullvadvpn-441466e650d541c88ae246cf5cb110a90cee9898.zip
Fix binaries paths in mac build
Diffstat (limited to 'scripts/utils')
-rw-r--r--scripts/utils/host21
1 files changed, 21 insertions, 0 deletions
diff --git a/scripts/utils/host b/scripts/utils/host
new file mode 100644
index 0000000000..28301e636d
--- /dev/null
+++ b/scripts/utils/host
@@ -0,0 +1,21 @@
+#!/usr/bin/env bash
+# shellcheck shell=bash
+
+# This function returns the target triple of the machine running this script
+
+case "$(uname -s)" in
+ Linux*)
+ arch="$(uname -m)"
+ HOST="${arch}-unknown-linux-gnu"
+ ;;
+ Darwin*)
+ arch="$(uname -m)"
+ if [[ ("${arch}" == "arm64") ]]; then
+ arch="aarch64"
+ fi
+ HOST="${arch}-apple-darwin"
+ ;;
+ MINGW*|MSYS_NT*)
+ HOST="x86_64-pc-windows-msvc"
+ ;;
+esac