| 1 | #!/bin/bash |
| 2 | set -x -e |
| 3 | source "$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)/functions.sh" |
| 4 | |
| 5 | cd "$(dirname "$0")" |
| 6 | |
| 7 | if [[ ! "x$(uname)" == "xLinux" ]]; |
| 8 | then |
| 9 | echo "Only Linux hosts can build windows (yes, i know)"; |
| 10 | exit 1 |
| 11 | fi |
| 12 | |
| 13 | ../prepare_moneroc.sh |
| 14 | |
| 15 | # export USE_DOCKER="ON" |
| 16 | |
| 17 | pushd ../monero_c |
| 18 | set +e |
| 19 | command -v sudo && export SUDO=sudo |
| 20 | set -e |
| 21 | if [[ ! "x$USE_DOCKER" == "x" ]]; |
| 22 | then |
| 23 | for COIN in monero wownero; |
| 24 | do |
| 25 | $SUDO docker run --platform linux/amd64 -v$HOME/.cache/ccache:/root/.ccache -v$PWD:$PWD -w $PWD --rm -it git.mrcyjanek.net/mrcyjanek/debian:buster bash -c "git config --global --add safe.directory '*'; apt update; apt install -y ccache gcc-mingw-w64-x86-64 g++-mingw-w64-x86-64 gperf libtinfo5; ./build_single.sh ${COIN} x86_64-w64-mingw32 -j$MAKE_JOB_COUNT" |
| 26 | # $SUDO docker run --platform linux/amd64 -v$HOME/.cache/ccache:/root/.ccache -v$PWD:$PWD -w $PWD --rm -it git.mrcyjanek.net/mrcyjanek/debian:buster bash -c "git config --global --add safe.directory '*'; apt update; apt install -y ccache gcc-mingw-w64-i686 g++-mingw-w64-i686 gperf libtinfo5; ./build_single.sh ${COIN} i686-w64-mingw32 -j$MAKE_JOB_COUNT" |
| 27 | done |
| 28 | else |
| 29 | for COIN in monero wownero; |
| 30 | do |
| 31 | $SUDO ./build_single.sh ${COIN} x86_64-w64-mingw32 -j$MAKE_JOB_COUNT |
| 32 | # $SUDO ./build_single.sh ${COIN} i686-w64-mingw32 -j$MAKE_JOB_COUNT |
| 33 | done |
| 34 | fi |
| 35 | popd |
| 36 | |
| 37 | $SUDO unxz -f ../monero_c/release/monero/*.dll.xz |
| 38 | $SUDO unxz -f ../monero_c/release/wownero/*.dll.xz |