refactor(mk): move build rules into separate scripts (#855)

See https://github.com/ooni/probe/issues/2218
This commit is contained in:
Simone Basso 2022-08-17 13:16:53 +02:00 committed by GitHub
commit 5c0368c862
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
19 changed files with 539 additions and 273 deletions

37
CLI/check-mingw-w64-version Executable file
View file

@ -0,0 +1,37 @@
#!/bin/bash
set -euo pipefail
EXPECTED_MINGW_W64_VERSION=${EXPECTED_MINGW_W64_VERSION:-12.1.0} # Allow overriding
printf "checking for x86_64-w64-mingw32-gcc... "
command -v x86_64-w64-mingw32-gcc || {
echo "not found"
exit 1
}
printf "checking for i686-w64-mingw32-gcc... "
command -v i686-w64-mingw32-gcc || {
echo "not found"
exit 1
}
exitcode=0
printf "checking for x86_64-w64-mingw32-gcc version... "
__version_amd64=$(x86_64-w64-mingw32-gcc --version | sed -n 1p | awk '{print $3}')
echo $__version_amd64
[[ "$EXPECTED_MINGW_W64_VERSION" == "$__version_amd64" ]] || {
echo "fatal: x86_64-w64-mingw32-gcc version must be $EXPECTED_MINGW_W64_VERSION instead of $__version_amd64"
exitcode=1
}
printf "checking for i686-w64-mingw32-gcc version... "
__version_386=$(i686-w64-mingw32-gcc --version | sed -n 1p | awk '{print $3}')
echo $__version_386
[[ "$EXPECTED_MINGW_W64_VERSION" == "$__version_386" ]] || {
echo "fatal: i686-w64-mingw32-gcc version must be $EXPECTED_MINGW_W64_VERSION instead of $__version_386"
exitcode=1
}
exit $exitcode