forked from mullvad/mullvadvpn-app
-
Notifications
You must be signed in to change notification settings - Fork 0
/
env.sh
executable file
·55 lines (49 loc) · 1.19 KB
/
env.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# shellcheck shell=bash
#
# Sourcing this file should set up the environment to build the app
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
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
ENV_TARGET=${1:-$HOST}
case "$ENV_TARGET" in
*linux*)
export LIBMNL_LIB_DIR="$SCRIPT_DIR/dist-assets/binaries/$ENV_TARGET"
export LIBNFTNL_LIB_DIR="$SCRIPT_DIR/dist-assets/binaries/$ENV_TARGET"
;;
x86_64-*-darwin*)
export MACOSX_DEPLOYMENT_TARGET="10.7"
if [[ $HOST != "$ENV_TARGET" ]]; then
# Required for building daemon
SDKROOT=$(xcrun --show-sdk-path)
export SDKROOT
fi
;;
aarch64-*-darwin*)
export MACOSX_DEPLOYMENT_TARGET="11.0"
if [[ $HOST != "$ENV_TARGET" ]]; then
# Required for building daemon
SDKROOT=$(xcrun --show-sdk-path)
export SDKROOT
fi
;;
*windows*)
;;
*)
echo "Unknown target \"$ENV_TARGET\"" >&2
exit 1
;;
esac