Compile Mono SVN Head on Windows

  1. Download and install a recent Mono from http://mono-project.com/Downloads. Install it in C:\mono (instead of C:\Program Files\Mono) in order to avoid problems with whitespace in path during build). This mono will be used to compile mono from source. It will also provide a set of other native libraries required for the build.
  2. Install Cygwin (I would recommend in C:\cygwin to same problems mentioned above) with the following packages in addition to the default ones:
  3. autoconf
    automake
    bison
    gcc-mingw
    gcc-mingw-g++
    libtool
    pkg-config
    subversion
    make
    
  4. Downgrade make because version 3.81 installed by Cygwin introduces a bug which causes the mono build to fail. Replace C:\cygwin\bin\make.exe with the one from here: make 3.80
  5. Prepare the build environment by setting the paths so that all the dependancy libs and scripts will be used from the official setup.
  6. export MONO_LOCATION=/cygdrive/c/mono
    export PATH=${PATH}:${MONO_LOCATION}/bin
    export ACLOCAL_FLAGS="-I ${MONO_LOCATION}/share/aclocal"
    export PKG_CONFIG_PATH=${PKG_CONFIG_PATH}:${MONO_LOCATION}/lib/pkgconfig
    mkdir -p /mono/svn
    mkdir /mono/build
    
  7. Checkout Mono’s source from svn and compile.
  8. cd /mono/svn
    svn co svn://anonsvn.mono-project.com/source/trunk/mono
    svn co svn://anonsvn.mono-project.com/source/trunk/mcs
    cd mono
    ./autogen.sh --prefix=/mono/build
    make
    make install
  9. Copy the freshly compiled files from C:\cygwin\mono\build to C:\mono and replace all existing. DONE!
  • Twitter
  • Facebook
  • FriendFeed
  • StumbleUpon
  • Digg
  • del.icio.us
  • Google Bookmarks
  • Reddit
  • Tumblr
  • PDF
  • Print
  • email
Rating: (No Ratings Yet)
Loading ... Loading ...
View Comments
Published: Mar 14th, 2006 (Views: 312)
Categories: Coding
Tags: ,
  • Stifu
    This little article has been useful to me. Thanks to you, I could submit my first Mono patch today. :)

    However, I'm running into a problem... I closely followed your steps on 2 computers. It worked on one, but not on the other. After the autogen step (at the end of which I'm told: "Now type 'make' to compile"), the "make" command does nothing at all, it displays nothing and instantly lets you type another command. "make clean", "make --help" and so on behave the same. I even redownloaded make 3.80 just in case, and same result. Any idea?

    By the way, the link to make 3.80 above doesn't work anymore, so here's a working one for anyone interested: http://www.go-mono.com/archive/helper/make-3.80-1.tar.bz2
  • I have no idea what the problem might be. Try make --verbose or something.

    Thanks for pointing out that the link is broken. I have no uploaded the file onto my blog and linked it directly just to make sure it doesn't go 404 again.
  • Stifu
    Verbose made no difference. For the record, I checked out Cygwin 1.70 beta, and it worked the same as the stable version except it actually outputs an error:

    /usr/bin/make.exe: error while loading shared libraries: cygintl-2.dll: cannot open shared object file: No such file or directory
    I can indeed see I have cygintl-3 and 8, but not 2... I'll grab that DLL and see if it works!

    Edit: yep, looks like the libintl2 package was left out from cygwin... I might have clicked it by mistake during the install or something.

    Now for another error... 'libgthread-2.0.la' not a valid libtool archive. Great. But I'll manage.
  • _Alan_
    Woo, after 2 long hard days of trying and failing, i finally managed to compile mono for windows on windows. Only worked when i did exactly as he did, with the exact same paths. Cygwin is a monster :(
blog comments powered by Disqus