(Free) Software Building and Packaging For Windows
The win-builds-switch script takes care of everything; source it in your shell:
# To switch to the i686 toolchain source /opt/windows_32/bin/win-builds-switch # To switch to the x86_64 toolchain source /opt/windows_64/bin/win-builds-switch
The currently-released version of this script has a small error that will output a message about an emulate command not being found. You can safely ignore this message. An update in a few days will fix it.
The easiest way to set a toolchain by default is to add its selection to the user’s profile. The command will be executed each time an interactive shell is started and will be valid for everything started from them.
echo 'source /opt/windows_32/bin/win-builds-switch >/dev/null' >> ~/.profile
This will silently the toolchain for all the new shells. Don't forget you've enabled this by default.