Python(Anaconda) script to build Mingw-w64 cross-toolchain
To build 32bit and 64bit non-multilib STATIC Mingw-w64 toolchain in a bash-like environment
Download this script to somewhere. The simplest use would be:
python3 tc-builder.py
This would download and build inside a new folder named ~/MWTC
.
Downloaded TAR balls would be inside ~/MWTC/dl
(Delete the dl folder to force re-download)
Extracted archives would be inside ~/MWTC/pkgs
(If the archive's MD5 has not been changed, decompression is skipped)
Build trees inside ~MWTC/build
(Can be safely deleted. Automatically deleted on rebuild)
Actual toolchains inside ~/MWTC/mingw-w64-i686
and ~/MWTC/mingw-w64-x86_64
To change the sandbox to somewhere other than ~/MWTC
use:
python3 tc-builder.py --prefix="/your/sandbox"
To specify component versions, use:
python3 tc-builder.py --prefix="/your/sandbox" --gcc="6.4.0"
If the version string is not found on repo, the latest version would be used. (based on version string)
After the thing successfully built, you may:
cd ~/MWTC
source use64.sh
To start using the 64bit Mingw toolchain
Test compile with:
$CXX std=c++14 compiler-test.cpp -o /mnt/c/compiler-test64.exe
and run compiler-test64.exe from Windows. Check if multiple CPU cores have increased activity.
finally,
source restore.sh
to restore PATH when done
--help
print the help text--prefix="~/MWTC"
set the sandbox folder--sjlj
Force win32 to use sjlj exception handling--gcc="6.4.0"
set the preferred GCC version. Use latest if not found--binutils="99"
set the preferred Binutils version. Use latest if not found--mingw="99"
set the preferred Mingw-w64 version. Use latest if not found