Compile Mono SVN Head on Windows

  1. Download and install a recent Mono from http://mono-project.com/Downloads. Install it in C:\mono to avoid problems with spaces and other chars in the build path. The official install will feed the cygwin environment with the compiler as well as all the native dependancy libs.
  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
    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 fromhere: 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 ...
Comments
Published: Mar 14th, 2006 (Views: 196)
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...
  • 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