This repository was archived by the owner on Dec 15, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathbuild_release
More file actions
executable file
·124 lines (115 loc) · 2.84 KB
/
Copy pathbuild_release
File metadata and controls
executable file
·124 lines (115 loc) · 2.84 KB
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
#!/bin/bash
#
# CDDL HEADER START
#
# This file and its contents are supplied under the terms of the
# Common Development and Distribution License ("CDDL"), version 1.0.
# You may only use this file in accordance with the terms of version
# 1.0 of the CDDL.
#
# A full copy of the text of the CDDL should have accompanied this
# source. A copy of the CDDL is also available via the Internet at
# http://www.illumos.org/license/CDDL.
#
# CDDL HEADER END
#
# Copyright 2024 Saso Kiselkov. All rights reserved.
function my_realpath() {
[[ $1 = /* ]] && echo "$1" || echo "$PWD/${1#./}"
}
OUTPUT="X-TCAS"
VSI_MODE="OFF"
VSI_STYLE=""
GTS820_MODE="OFF"
SNDSET="male1"
AUDIO="ON"
OS="$(uname)"
case "$OS" in
Darwin)
REALPATH=my_realpath
;;
*)
REALPATH=realpath
;;
esac
while getopts "a:v:s:GNh" opt; do
case "$opt" in
a)
LIBACFUTILS="$(${REALPATH} "$OPTARG")"
;;
v)
VSI_MODE="ON"
VSI_STYLE="$OPTARG"
;;
s)
SNDSET="$OPTARG"
;;
G)
VSI_MODE="OFF"
VSI_STYLE=""
GTS820_MODE="ON"
SNDSET="gts820"
;;
N)
AUDIO="OFF"
;;
h)
cat << EOF
Usage: $0 -a <libacfutils> [-GN] [-v <style>] [-s <sndset>]
-a <libacfutils> : path to built libacfutils repo
-G : behave as a Garmin GTS 820
-N : disable audio generation entirely
-v <style> : create a VSI-styled TCAS, where <style> is either
"ATR" or "HONEYWELL"
-s <sndset> :
EOF
exit
;;
*)
exit 1
;;
esac
done
if [ -z "$LIBACFUTILS" ]; then
echo "Missing mandatory argument -a." \
"Try $0 -h for more information" >&2
exit 1
fi
if [[ "$OS" = "Darwin" ]]; then
NCPUS=$(( $(sysctl -n hw.ncpu) + 1 ))
rm -f CMakeCache.txt
( cd src && rm -f CMakeCache.txt && \
cmake . -DLIBACFUTILS="${LIBACFUTILS}" -DAUDIO="${AUDIO}" \
-DVSI_MODE="${VSI_MODE}" -DVSI_STYLE="${VSI_STYLE}" \
-DGTS820_MODE="${GTS820_MODE}" \
-DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" && \
make -j "$NCPUS" ) || exit 1
else
NCPUS=$(( $(grep 'processor[[:space:]]\+:' /proc/cpuinfo | wc -l) + \
1 ))
( cd src && rm -f CMakeCache.txt && \
cmake . -DLIBACFUTILS="${LIBACFUTILS}" -DAUDIO="${AUDIO}" \
-DVSI_MODE="${VSI_MODE}" -DVSI_STYLE="${VSI_STYLE}" \
-DGTS820_MODE="${GTS820_MODE}" && \
make -j "${NCPUS}" ) || exit 1
( cd src && rm -f CMakeCache.txt && \
cmake . -DLIBACFUTILS="${LIBACFUTILS}" -DAUDIO="${AUDIO}" \
-DVSI_MODE="${VSI_MODE}" -DVSI_STYLE="${VSI_STYLE}" \
-DGTS820_MODE="${GTS820_MODE}" \
-DCMAKE_TOOLCHAIN_FILE="XCompile.cmake" \
-DHOST=x86_64-w64-mingw32 && \
make -j "${NCPUS}" && \
"$LIBACFUTILS/tools/mksyms" "../win_x64/X-TCAS.xpl" > \
"../win_x64/syms.txt" ) || exit 1
fi
rm -rf "$OUTPUT"
mkdir -p "$OUTPUT/data/msgs"
if [[ $(uname) = "Darwin" ]]; then
cp -r mac_x64 "$OUTPUT"
else
cp -r {win,lin}_x64 "$OUTPUT"
fi
cp -r $SNDSET/*.wav "$OUTPUT/data/msgs"
if [[ "$VSI_STYLE" != 0 ]]; then
cp -r fonts "$OUTPUT/data/"
fi