14 Feb, 2009
Want to build Mono on Windows?
This is my “Things not to forget when building mono on windows” list. Hopefully it will be of use to somebody else too.
- Remember that this always takes a lot longer than you like.
- Read this first http://www.mono-project.com/Compiling_Mono_on_Windows.
-
use this:
cd mono
make get-monolite-latestto get a mcs compiler installed that you will need to compile some mono components.
- Do not forget to use the make linked to in the mono compiling on windows guide.
-
When the guide says “. /tmp/build_deps/env.sh” that first dot is _not_ to be forgotten.
You can also use “source /tmp/build_deps/env.sh”. do a sanitycheck with echo $PKG_CONFIG_PATH to see if your paths are really properly set. - Remember that pkg-config is a program that gets run by autogen.sh. Autogen.sh basically asks pkg-config “where is library ‘glib’, and what compiler and linkerflags should I add to use it”. try to see if your pkg-config works first. just write “pkg-config –libs glib-2.0″. If that doesn’t work, fix that first.
- If your pkg-config first worked, but later didn’t work anymore, it is likely that you modified your $PATH environment variable to contain a path to a working mono setup, to get a working mcs for your mono build. If you placed this new path in your $PATH before the rest, it means you’ll now accidentlally use /your/mono/bin/pkg-config, instead of /usr/bin/pkg-config. That is likely a too old version, and actually fails.
- Do not forget that the relocate-dependencies script linked to in the guideline actually hardcodes a C:\cygwin path. Mine is at H:\cygwin.
- If you get freezes or errors on something that says [MDOC] blabla.. try appending –with-moonlight=no to your autogen.sh command.
- If that doesn’t work (as it didn’t for me), manually edit mcs/Makefile, and remove all references to “docs”.
-
Since we patch mono with monoco, don’t forget to apply the monoco patch. If the monoco patch
doesn’t cleanly apply, it’s usually because of conflicts in mono/mono/mini/Makefile.am, which can easily be resolved manually. - Remember to remind linux users that most opensource windows software you can just download, doubleclick the .sln, and have it work. No rocket science needed.
- Remember to run around like crazy, arms waving, asking yourself why linux projects don’t just ship with their dependencies. (Except for MythTV that just embeds a forked copy of ffmpeg that they update from time to time. Hurray for common sense)
- Remember to find a copy of the autoconf manual, and burn it.
- Remember to tune into http://linuxhaters.blogspot.com/
edit:typo