CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
Ardupilot

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.

GitHub Repository: Ardupilot/ardupilot
Path: blob/master/Tools/scripts/cygwin_build.sh
Views: 1798
1
#!/usr/bin/env bash
2
3
# script to build cygwin binaries for using in MissionPlanner
4
# the contents of artifacts directory is uploaded to:
5
# https://firmware.ardupilot.org/Tools/MissionPlanner/sitl/
6
7
# the script assumes you start in the root of the ardupilot git tree
8
9
set -x
10
set -e
11
12
# TOOLCHAIN=i686-pc-cygwin
13
TOOLCHAIN=x86_64-pc-cygwin
14
GPP_COMPILER="${TOOLCHAIN}-g++"
15
16
$GPP_COMPILER -print-sysroot
17
18
SYS_ROOT=$($GPP_COMPILER -print-sysroot)
19
echo "SYS_ROOT=$SYS_ROOT"
20
21
rm -rf artifacts
22
mkdir artifacts
23
24
# cygwin doesn't work out the parallelism properly
25
WAF_OPTIONS="-j8"
26
27
(
28
python ./waf --color yes --toolchain $TOOLCHAIN --board sitl configure 2>&1
29
python ./waf plane $WAF_OPTIONS 2>&1
30
python ./waf copter $WAF_OPTIONS 2>&1
31
python ./waf heli $WAF_OPTIONS 2>&1
32
python ./waf rover $WAF_OPTIONS 2>&1
33
python ./waf sub $WAF_OPTIONS 2>&1
34
) | tee artifacts/build.txt
35
36
# artifacts are expected to have .exe as they are executable
37
cp -v build/sitl/bin/arduplane artifacts/ArduPlane.elf.exe
38
cp -v build/sitl/bin/arducopter artifacts/ArduCopter.elf.exe
39
cp -v build/sitl/bin/arducopter-heli artifacts/ArduHeli.elf.exe
40
cp -v build/sitl/bin/ardurover artifacts/ArduRover.elf.exe
41
cp -v build/sitl/bin/ardusub artifacts/ArduSub.elf.exe
42
43
# Find all cyg*.dll files returned by cygcheck for each exe in artifacts
44
# and copy them over
45
for exe in artifacts/*.exe; do
46
echo $exe
47
cygcheck $exe | grep -oP 'cyg[^\s\\/]+\.dll' | while read -r line; do
48
cp -v /usr/bin/$line artifacts/
49
done
50
done
51
52
git log -1 > artifacts/git.txt
53
ls -l artifacts/
54
55