-
Notifications
You must be signed in to change notification settings - Fork 336
/
env.sh
executable file
·40 lines (34 loc) · 953 Bytes
/
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
# shellcheck shell=bash
#
# Sourcing this file should set up the environment to build the app
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
source "$SCRIPT_DIR/scripts/utils/host"
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