Setting up a development environment quickly and easily using MSYS2/MinGW-w64
Start out by heading over to the
MSYS2 one click installer page.
Disclaimer - this is going to take more than one click before you can compile ML.
I've only got an old 32-bit Windows system so if you try this on a 64-bit system please leave some feedback.
I recommend the default install location on the main (C:\msys32) drive. In fact just use all the defaults that the easy installer recommends and don't try to overthink it. After the install wizard finishes it will open up a terminal window. Don't feel intimidated if you aren't familiar with using the terminal. Eventually you should learn some basic commands but for now you and simply copy and paste what you need. The first thing to do as noted in the easy installer webpage is to update the system packages.
pacman --needed -Sy bash pacman pacman-mirrors msys2-runtime
Go ahead and highlight what is in that code box and copy to the clipboard. To paste in the terminal you will quickly learn that good ol' Ctrl-V doesn't work. Right click in the terminal window and select Paste from the pop up menu. You can learn the keyboard shortcuts if you like, I never did.
This will run the command to update the packages. Of course your answer should be y or Y, Windows is case insensitive so it doesn't matter. I ran the installation many time to make sure that this tutorial really does work and sometimes if the network connection wasn't solid it wouldn't download all the packages. In that case simply run the command again. Fortunately the terminal keeps a history so use the up arrow key to bring up the last command you entered in the terminal.
After this process is finished close the terminal. Don't try to get fancy and type "exit" in the terminal because it won't work and you'll have to force quit the "bash" process. Simply click the "X" on the upper right hand corner to close window.
Bring up your start menu and you will see a folder named "MSYS 32bit" or I guess "MSYS 64bit" if you installed the 64-bit version. In that folder are three "shells" -- I can hear the laughs from anyone who has seen "Demolition Man." In any case, I'll be using the "MinGW-w64 Win32 Shell." Do not use the MSYS2 Shell, it won't work with the way this setup is configured. Note that it is possible to configure MSYS2 Shell to compile ML but the command line tools will need the msys-1.0.dll to run so let's not go there.
Then copy/past this next command and run it:
pacman -Su
Guess what? You now have MSYS2 setup and it only took a few left and right clicks. Now it is time to get the packages needed to compile Magic Lantern. There aren't that many in my list because some packages will install several other packages that it depends on. You will need to make a decision if you want any of the command line tools like cr2hdr or mlv_dump to compile as 32-bit or 64-bit native. If you have a 32-bit computer like me you have no choice but on a 64-bit system you can actually install both versions and compile for either 32-bit or 64-bit targets. For now keep it simple and just select one.
32-bit compilerpacman -S make diffutils wget zip unzip tar perl mingw-w64-i686-gcc mingw-w64-i686-python2-docutils
64-bit compilerpacman -S make diffutils wget zip unzip tar perl mingw-w64-x86_64-gcc mingw-w64-x86_64-python2-docutils
Hang on, we're almost there. Canon cameras are obviously not Windows computers so we will need one more compiler to build something that will run on the ARM Architecture used in the camera. To figure out which
ARM compiler to get refer to the ML code, specifically: Makefile.user.default --
ARM_PATH=~/gcc-arm-none-eabi-4_8-2013q4 notice that little squiggly mark after the equal sign? That means that the path starts in your home directory and surprise, you're already there. Let's make it easy, just copy/paste the following in your terminal:
wget https://launchpad.net/gcc-arm-embedded/4.8/4.8-2013-q4-major/+download/gcc-arm-none-eabi-4_8-2013q4-20131204-win32.zip && mkdir gcc-arm-none-eabi-4_8-2013q4 && unzip -n gcc-arm-none-eabi-4_8-2013q4-20131204-win32.zip -d gcc-arm-none-eabi-4_8-2013q4 && rm gcc-arm-none-eabi-4_8-2013q4-20131204-win32.zip
Now you have a system that can compile ML. The only thing that is missing is the ML source code itself. The code is stored on a Mercurial repository and since the Mercurial software is a free download from the developers it makes sense to get it directly from the
Mercurial website.
Just make sure you leave the option checked to add Mercurial to the search path. It would also be a good idea to restart your system at this point.
Note that you can also install Mercurial via pacman but I had issues with that way of installing it. One of the advantages of msys is that it doesn't lock you in to only what is available in that world. For more information I recommend reading dmilligan's excellent
Mercurial Tips but if you're only interested in grabbing the code and rolling your own--read on.
Ok--let's get the code and start compiling. If you grab the unified branch as instructed in a1ex's
Getting started with development tutorial:
hg clone https://bitbucket.org/hudson/magic-lantern
cd magic-lantern
hg update unified
At this point you can jump over to any other tutorial on how to compile ML and the command line tools. Here's the way I do it for the EOSM:
cd magic-lantern/platform/EOSM.202/
make zip
This will create a zip file just like the nightly builds.
If you are interested in the command line tools you should be able to go into the appropriate directory in magic-lantern/modules/ and compile the tools. There are still some quirks getting all the command line tools to compile but I found that to be the case for all of the development setups that I have tested out. The binary files that this MSYS/MinGW setup creates should be portable to other Windows computers. What I mean by that is that it isn't dependent on cygwin1.dll or msys-1.0.dll files that may not be installed on the target computer.
So you want to start hacking away on the code? There's lots of choices when it comes to text editors, I would recommend using Notepad++. It is designed to work with source code and you can check if the source has Linux, Mac or Windows line endings--don't mix them up! Here is a screenshot of the interface, notice that posix.c has Windows (CR+LF) line endings.

Also consider using the excellent
SourceTree app to keep track of your changes and easily switch between branches.
One more tip. If you are going to do lots of coding with this system I'd recommend making shortcuts of your msys home directory and shell batch file in easy to find places.
Finally, consider this (and all ML code for that matter) as a work in progress. Have fun experimenting. My next project is checking out how to compile native Windows versions of the command line tools using Cygwin as recommended by Marsu42.
Happy Hacking!