2021-04-21 02:33:16 -03:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
# script to build cygwin binaries for using in MissionPlanner
|
|
|
|
# the contents of artifacts directory is uploaded to:
|
|
|
|
# https://firmware.ardupilot.org/Tools/MissionPlanner/sitl/
|
|
|
|
|
|
|
|
# the script assumes you start in the root of the ardupilot git tree
|
|
|
|
|
|
|
|
set -x
|
|
|
|
|
2022-12-07 04:07:51 -04:00
|
|
|
# TOOLCHAIN=i686-pc-cygwin
|
|
|
|
TOOLCHAIN=x86_64-pc-cygwin
|
|
|
|
GPP_COMPILER="${TOOLCHAIN}-g++"
|
|
|
|
|
|
|
|
$GPP_COMPILER -print-sysroot
|
|
|
|
|
|
|
|
SYS_ROOT=$($GPP_COMPILER -print-sysroot)
|
|
|
|
echo "SYS_ROOT=$SYS_ROOT"
|
|
|
|
|
2022-04-13 03:31:25 -03:00
|
|
|
git config --global --add safe.directory /cygdrive/d/a/ardupilot/ardupilot
|
|
|
|
|
2021-04-21 02:33:16 -03:00
|
|
|
rm -rf artifacts
|
|
|
|
mkdir artifacts
|
|
|
|
|
|
|
|
(
|
2022-12-07 04:07:51 -04:00
|
|
|
python ./waf --color yes --toolchain $TOOLCHAIN --board sitl configure 2>&1
|
2021-11-19 06:17:20 -04:00
|
|
|
python ./waf plane 2>&1
|
|
|
|
python ./waf copter 2>&1
|
|
|
|
python ./waf heli 2>&1
|
|
|
|
python ./waf rover 2>&1
|
|
|
|
python ./waf sub 2>&1
|
2021-04-21 02:33:16 -03:00
|
|
|
) | tee artifacts/build.txt
|
|
|
|
|
2022-06-06 17:41:02 -03:00
|
|
|
# copy both with exe and without to cope with differences
|
|
|
|
# between windows versions in CI
|
|
|
|
cp -v build/sitl/bin/arduplane artifacts/ArduPlane.elf.exe
|
|
|
|
cp -v build/sitl/bin/arducopter artifacts/ArduCopter.elf.exe
|
|
|
|
cp -v build/sitl/bin/arducopter-heli artifacts/ArduHeli.elf.exe
|
|
|
|
cp -v build/sitl/bin/ardurover artifacts/ArduRover.elf.exe
|
|
|
|
cp -v build/sitl/bin/ardusub artifacts/ArduSub.elf.exe
|
|
|
|
|
2021-04-21 02:33:16 -03:00
|
|
|
cp -v build/sitl/bin/arduplane artifacts/ArduPlane.elf
|
|
|
|
cp -v build/sitl/bin/arducopter artifacts/ArduCopter.elf
|
|
|
|
cp -v build/sitl/bin/arducopter-heli artifacts/ArduHeli.elf
|
|
|
|
cp -v build/sitl/bin/ardurover artifacts/ArduRover.elf
|
|
|
|
cp -v build/sitl/bin/ardusub artifacts/ArduSub.elf
|
|
|
|
|
2022-12-07 04:07:51 -04:00
|
|
|
# Find all cyg*.dll files returned by cygcheck for each exe in artifacts
|
|
|
|
# and copy them over
|
|
|
|
for exe in artifacts/*.exe; do
|
|
|
|
echo $exe
|
|
|
|
cygcheck $exe | grep -oP 'cyg[^\s\\/]+\.dll' | while read -r line; do
|
|
|
|
cp -v /usr/bin/$line artifacts/
|
|
|
|
done
|
|
|
|
done
|
2021-04-21 02:33:16 -03:00
|
|
|
|
|
|
|
git log -1 > artifacts/git.txt
|
2022-06-06 17:41:02 -03:00
|
|
|
ls -l artifacts/
|